using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BrutalCompanyMinus; using BrutalCompanyMinus.Minus; using BrutalCompanyMinus.Minus.CustomEvents; using BrutalCompanyMinus.Minus.Events; using BrutalCompanyMinus.Minus.Handlers; using BrutalCompanyMinus.Minus.Handlers.CustomEvents; using BrutalCompanyMinus.Minus.Handlers.Modded; using BrutalCompanyMinus.Minus.MonoBehaviours; using BrutalCompanyMinus.NetcodePatcher; using Dawn; using DigitalRuby.ThunderAndLightning; using FacilityMeltdown.API; using GameNetcodeStuff; using HarmonyLib; using HotbarPlus.Networking; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using Scoops.misc; using SelfSortingStorage.Cupboard; using ShipInventoryUpdated.Objects; using ShipInventoryUpdated.Scripts; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.UI; using WeatherRegistry; using com.github.zehsteam.TakeyGokuBracken; using com.github.zehsteam.ToilHead; [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("SoftDiamond")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ec60fd22fbd3724b8f9f9dab66efc9a5937da16d")] [assembly: AssemblyProduct("BrutalCompanyMinusExtraReborn")] [assembly: AssemblyTitle("BrutalCompanyMinus")] [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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class BloodMoonWeather : MonoBehaviour { private float randomThunderTime; private float timeAtLastStrike; private Vector3 lastRandomStrikePosition; private Random seed; public AudioClip[] strikeSFX; public AudioClip[] distantThunderSFX; public LightningBoltPrefabScript randomThunder; public LightningBoltPrefabScript targetedThunder; public AudioSource randomStrikeAudio; public AudioSource randomStrikeAudioB; private bool lastStrikeAudioUsed; public AudioSource targetedStrikeAudio; private RaycastHit rayHit; private GameObject[] outsideNodes; private NavMeshHit navHit; public ParticleSystem explosionEffectParticle; private List metalObjects = new List(); private GrabbableObject targetingMetalObject; private float getObjectToTargetInterval; private float strikeMetalObjectTimer; private bool hasShownStrikeWarning; public ParticleSystem staticElectricityParticle; private GameObject setStaticToObject; private GrabbableObject setStaticGrabbableObject; public AudioClip staticElectricityAudio; private float lastGlobalTimeUsed; private float globalTimeAtLastStrike; private Random targetedThunderRandom; private void OnEnable() { //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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) lastRandomStrikePosition = Vector3.zero; targetedThunderRandom = new Random(StartOfRound.Instance.randomMapSeed); TimeOfDay.Instance.onTimeSync.AddListener(new UnityAction(OnGlobalTimeSync)); globalTimeAtLastStrike = TimeOfDay.Instance.globalTime; lastGlobalTimeUsed = 0f; randomThunderTime = TimeOfDay.Instance.globalTime + 7f; timeAtLastStrike = TimeOfDay.Instance.globalTime; navHit = default(NavMeshHit); outsideNodes = (from x in GameObject.FindGameObjectsWithTag("OutsideAINode") orderby x.transform.position.x + x.transform.position.z select x).ToArray(); if (((Behaviour)StartOfRound.Instance.spectateCamera).enabled) { SwitchCamera(StartOfRound.Instance.spectateCamera); } else { SwitchCamera(GameNetworkManager.Instance.localPlayerController.gameplayCamera); } seed = new Random(StartOfRound.Instance.randomMapSeed); DetermineNextStrikeInterval(); ((MonoBehaviour)this).StartCoroutine(GetMetalObjectsAfterDelay()); } private void OnDisable() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown TimeOfDay.Instance.onTimeSync.RemoveListener(new UnityAction(OnGlobalTimeSync)); } private void OnGlobalTimeSync() { float num = RoundUpToNearestTen(TimeOfDay.Instance.globalTime); if (num != lastGlobalTimeUsed) { lastGlobalTimeUsed = num; seed = new Random((int)num + StartOfRound.Instance.randomMapSeed); timeAtLastStrike = TimeOfDay.Instance.globalTime; } } private IEnumerator GetMetalObjectsAfterDelay() { yield return (object)new WaitForSeconds(15f); GrabbableObject[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { if (array[i].itemProperties.isConductiveMetal) { metalObjects.Add(array[i]); } } } public void SwitchCamera(Camera newCamera) { ((LightningBoltScript)randomThunder).Camera = newCamera; ((LightningBoltScript)targetedThunder).Camera = newCamera; } private void DetermineNextStrikeInterval() { timeAtLastStrike = randomThunderTime; float num = seed.Next(-5, 110); randomThunderTime += Mathf.Clamp(num * 0.25f, 0.6f, 110f) / Mathf.Clamp(TimeOfDay.Instance.currentWeatherVariable, 1f, 100f); } private int RoundUpToNearestTen(float x) { return (int)(x / 10f) * 10; } private void Update() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) if (!((Component)this).gameObject.activeInHierarchy) { return; } if (TimeOfDay.Instance.globalTime > randomThunderTime) { LightningStrikeRandom(); DetermineNextStrikeInterval(); } if ((Object)(object)setStaticToObject != (Object)null && (Object)(object)setStaticGrabbableObject != (Object)null) { if (setStaticGrabbableObject.isInFactory) { staticElectricityParticle.Stop(); } ((Component)staticElectricityParticle).transform.position = setStaticToObject.transform.position; } if (!((NetworkBehaviour)RoundManager.Instance).IsOwner) { return; } if ((Object)(object)targetingMetalObject == (Object)null) { if (metalObjects.Count <= 0) { return; } if (getObjectToTargetInterval <= 4f) { getObjectToTargetInterval += Time.deltaTime; return; } hasShownStrikeWarning = false; strikeMetalObjectTimer = Mathf.Clamp(Random.Range(1f, 28f), 0f, 20f); getObjectToTargetInterval = 0f; float num = 1000f; for (int i = 0; i < metalObjects.Count; i++) { if (metalObjects[i].isInFactory || metalObjects[i].isInShipRoom) { continue; } for (int j = 0; j < StartOfRound.Instance.allPlayerScripts.Length; j++) { if (StartOfRound.Instance.allPlayerScripts[j].isPlayerControlled) { float num2 = Vector3.Distance(((Component)metalObjects[i]).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[j]).transform.position); if (num2 < num) { targetingMetalObject = metalObjects[i]; num = num2; break; } } } if (Random.Range(0, 100) < 20) { break; } } if ((Object)(object)targetingMetalObject != (Object)null && targetingMetalObject.isHeld) { strikeMetalObjectTimer = Mathf.Clamp(strikeMetalObjectTimer + Time.deltaTime, 4f, 20f); } return; } strikeMetalObjectTimer -= Time.deltaTime; if (strikeMetalObjectTimer <= 0f) { if (!targetingMetalObject.isInFactory) { RoundManager.Instance.LightningStrikeServerRpc(((Component)targetingMetalObject).transform.position); } getObjectToTargetInterval = 5f; targetingMetalObject = null; } else if (strikeMetalObjectTimer < 10f && !hasShownStrikeWarning) { hasShownStrikeWarning = true; float num3 = Mathf.Abs(strikeMetalObjectTimer - 10f); RoundManager.Instance.ShowStaticElectricityWarningServerRpc(NetworkObjectReference.op_Implicit(((Component)targetingMetalObject).gameObject.GetComponent()), num3); } } public void SetStaticElectricityWarning(NetworkObject warningObject, float particleTime) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) setStaticToObject = ((Component)warningObject).gameObject; GrabbableObject component = ((Component)warningObject).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { setStaticGrabbableObject = ((Component)warningObject).gameObject.GetComponent(); for (int i = 0; i < GameNetworkManager.Instance.localPlayerController.ItemSlots.Length; i++) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController.ItemSlots[i] == (Object)(object)component) { HUDManager.Instance.DisplayTip("ALERT!", "Drop your metallic items now! A static charge has been detected. You have seconds left to live.", true, true, "LC_LightningTip"); } } } ShapeModule shape = staticElectricityParticle.shape; ((ShapeModule)(ref shape)).meshRenderer = setStaticToObject.GetComponentInChildren(); staticElectricityParticle.time = particleTime; staticElectricityParticle.Play(); staticElectricityParticle.time = particleTime; ((Component)staticElectricityParticle).gameObject.GetComponent().clip = staticElectricityAudio; ((Component)staticElectricityParticle).gameObject.GetComponent().Play(); ((Component)staticElectricityParticle).gameObject.GetComponent().time = particleTime; } private void LightningStrikeRandom() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) Vector3 randomNavMeshPositionInBoxPredictable; if (seed.Next(0, 100) < 60 && (randomThunderTime - timeAtLastStrike) * TimeOfDay.Instance.currentWeatherVariable < 3f) { randomNavMeshPositionInBoxPredictable = lastRandomStrikePosition; } else { int num = seed.Next(0, outsideNodes.Length); if (outsideNodes == null || (Object)(object)outsideNodes[num] == (Object)null) { outsideNodes = (from x in GameObject.FindGameObjectsWithTag("OutsideAINode") orderby x.transform.position.x + x.transform.position.z select x).ToArray(); num = seed.Next(0, outsideNodes.Length); } randomNavMeshPositionInBoxPredictable = outsideNodes[num].transform.position; randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(randomNavMeshPositionInBoxPredictable, 15f, navHit, seed, -1, 1f); } lastRandomStrikePosition = randomNavMeshPositionInBoxPredictable; LightningStrike(randomNavMeshPositionInBoxPredictable, useTargetedObject: false); } public void LightningStrike(Vector3 strikePosition, bool useTargetedObject) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) Random random; AudioSource val; LightningBoltPrefabScript val2; if (useTargetedObject) { random = targetedThunderRandom; staticElectricityParticle.Stop(); ((Component)staticElectricityParticle).GetComponent().Stop(); setStaticToObject = null; val = targetedStrikeAudio; val2 = targetedThunder; } else { random = new Random(seed.Next(0, 10000)); val = ((!lastStrikeAudioUsed) ? randomStrikeAudio : randomStrikeAudioB); lastStrikeAudioUsed = !lastStrikeAudioUsed; val2 = randomThunder; } bool flag = false; Vector3 val3 = Vector3.zero; for (int i = 0; i < 7; i++) { if (i == 6) { val3 = strikePosition + Vector3.up * 80f; } else { float num = random.Next(-32, 32); float num2 = random.Next(-32, 32); val3 = strikePosition + Vector3.up * 80f + new Vector3(num, 0f, num2); } if (!Physics.Linecast(val3, strikePosition + Vector3.up * 0.5f, ref rayHit, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { flag = true; break; } } if (!flag) { if (!Physics.Raycast(val3, strikePosition - val3, ref rayHit, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } strikePosition = ((RaycastHit)(ref rayHit)).point; } Debug.DrawLine(val3, strikePosition, Color.red, 10f); val2.Source.transform.position = val3; val2.Destination.transform.position = strikePosition; ((LightningBoltPrefabScriptBase)val2).AutomaticModeSeconds = 0.2f; ((Component)val).transform.position = strikePosition + Vector3.up * 0.5f; Landmine.SpawnExplosion(strikePosition + Vector3.up * 0.25f, false, 2.4f, 5f, 50, 0f, (GameObject)null, false); ((Component)explosionEffectParticle).transform.position = strikePosition + Vector3.up * 0.25f; explosionEffectParticle.Play(); PlayThunderEffects(strikePosition, val); } private void PlayThunderEffects(Vector3 strikePosition, AudioSource audio) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = GameNetworkManager.Instance.localPlayerController; if (val.isPlayerDead && (Object)(object)val.spectatedPlayerScript != (Object)null) { val = val.spectatedPlayerScript; } float num = Vector3.Distance(((Component)val.gameplayCamera).transform.position, strikePosition); bool flag = false; if (num < 40f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 110f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } else { flag = true; } AudioClip[] array = ((!flag) ? strikeSFX : distantThunderSFX); if (!val.isInsideFactory) { RoundManager.PlayRandomClip(audio, array, true, 1f, 0, 1000); } WalkieTalkie.TransmitOneShotAudio(audio, array[Random.Range(0, array.Length)], 1f); Bounds bounds = StartOfRound.Instance.shipBounds.bounds; if (((Bounds)(ref bounds)).Contains(strikePosition)) { ((Component)StartOfRound.Instance.shipAnimatorObject).GetComponent().SetTrigger("shipShake"); RoundManager.PlayRandomClip(StartOfRound.Instance.ship3DAudio, StartOfRound.Instance.shipCreakSFX, false, 1f, 0, 1000); StartOfRound.Instance.PowerSurgeShip(); } } } namespace BrutalCompanyMinus { [HarmonyPatch] public class Assets { public enum EnemyName { Bracken, HoardingBug, CoilHead, Thumper, BunkerSpider, Jester, SnareFlea, Hygrodere, GhostGirl, SporeLizard, NutCracker, Masked, EyelessDog, ForestKeeper, EarthLeviathan, BaboonHawk, RoamingLocust, Manticoil, CircuitBee, Lasso, Butler, OldBird, FlowerSnake, Maneater, Barber, GiantKiwi, CadaverGrowths, BushWolf, CadaverBloom, Puma, Stingray } public enum ItemName { LargeAxle, V_TypeEngine, PlasticFish, MetalSheet, LaserPointer, BigBolt, Bottles, Ring, SteeringWheel, CookieMoldPan, EggBeater, JarOfPickles, DustPan, AirHorn, ClownHorn, CashRegister, Candy, GoldBar, YieldSign, HomemadeFlashbang, Gift, Flask, ToyCube, Remote, ToyRobot, MagnifyingGlass, StopSign, TeaKettle, Mug, RedSoda, OldPhone, HairDryer, Brush, Bell, WhoopieCushion, Comedy, Tragedy, RubberDucky, ChemicalJug, FancyLamp, GoldenCup, Painting, Toothpaste, PillBottle, PerfumeBottle, Teeth, Magic7Ball, EasterEgg, ToyTrain, ToiletPaper, SoccerBall, PlasticCup, GarbageLid, ControlPad, Clock, ZedDog, BabyKiwiEgg, SeveredThigh, SeveredHand, SeveredEar, SeveredBone, SeveredTongue, SeveredHeart, SeveredFoot, SeveredBoneRib } public enum ObjectName { LargeRock1, LargeRock2, LargeRock3, LargeRock4, TreeLeaflessBrown1, GiantPumkin, GreyRockGrouping2, GreyRockGrouping4, Tree, TreeLeafless2, TreeLeafless3, Landmine, Turret, SpikeRoofTrap } public enum AtmosphereName { RollingGroundFog, Rainy, Stormy, Foggy, Flooded, Eclipsed } internal static AssetBundle bundle; internal static AssetBundle customAssetBundle; public static Dictionary EnemyNameList = new Dictionary { { EnemyName.SnareFlea, "Centipede" }, { EnemyName.BunkerSpider, "SandSpider" }, { EnemyName.HoardingBug, "HoarderBug" }, { EnemyName.Bracken, "Flowerman" }, { EnemyName.Thumper, "Crawler" }, { EnemyName.Hygrodere, "Blob" }, { EnemyName.GhostGirl, "DressGirl" }, { EnemyName.SporeLizard, "Puffer" }, { EnemyName.NutCracker, "Nutcracker" }, { EnemyName.EyelessDog, "MouthDog" }, { EnemyName.ForestKeeper, "ForestGiant" }, { EnemyName.EarthLeviathan, "SandWorm" }, { EnemyName.CircuitBee, "RedLocustBees" }, { EnemyName.BaboonHawk, "BaboonHawk" }, { EnemyName.CoilHead, "SpringMan" }, { EnemyName.Jester, "Jester" }, { EnemyName.Lasso, "LassoMan" }, { EnemyName.Masked, "MaskedPlayerEnemy" }, { EnemyName.Manticoil, "Doublewing" }, { EnemyName.RoamingLocust, "DocileLocustBees" }, { EnemyName.Butler, "Butler" }, { EnemyName.OldBird, "RadMech" }, { EnemyName.FlowerSnake, "FlowerSnake" }, { EnemyName.Maneater, "CaveDweller" }, { EnemyName.Barber, "ClaySurgeon" }, { EnemyName.GiantKiwi, "GiantKiwi" }, { EnemyName.CadaverGrowths, "CadaverGrowths" }, { EnemyName.BushWolf, "BushWolf" }, { EnemyName.CadaverBloom, "CadaverBloom" }, { EnemyName.Puma, "Puma" }, { EnemyName.Stingray, "Stingray" } }; public static Dictionary ItemNameList = new Dictionary { { ItemName.LargeAxle, "Cog1" }, { ItemName.V_TypeEngine, "EnginePart1" }, { ItemName.PlasticFish, "FishTestProp" }, { ItemName.MetalSheet, "MetalSheet" }, { ItemName.LaserPointer, "FlashLaserPointer" }, { ItemName.BigBolt, "BigBolt" }, { ItemName.Bottles, "BottleBin" }, { ItemName.Ring, "Ring" }, { ItemName.SteeringWheel, "SteeringWheel" }, { ItemName.CookieMoldPan, "MoldPan" }, { ItemName.EggBeater, "EggBeater" }, { ItemName.JarOfPickles, "PickleJar" }, { ItemName.DustPan, "DustPan" }, { ItemName.AirHorn, "Airhorn" }, { ItemName.ClownHorn, "ClownHorn" }, { ItemName.CashRegister, "CashRegister" }, { ItemName.Candy, "Candy" }, { ItemName.GoldBar, "GoldBar" }, { ItemName.YieldSign, "YieldSign" }, { ItemName.HomemadeFlashbang, "DiyFlashbang" }, { ItemName.Gift, "GiftBox" }, { ItemName.Flask, "Flask" }, { ItemName.ToyCube, "ToyCube" }, { ItemName.Remote, "Remote" }, { ItemName.ToyRobot, "RobotToy" }, { ItemName.MagnifyingGlass, "MagnifyingGlass" }, { ItemName.StopSign, "StopSign" }, { ItemName.TeaKettle, "TeaKettle" }, { ItemName.Mug, "Mug" }, { ItemName.RedSoda, "SodaCanRed" }, { ItemName.OldPhone, "Phone" }, { ItemName.HairDryer, "Hairdryer" }, { ItemName.Brush, "Brush" }, { ItemName.Bell, "Bell" }, { ItemName.WhoopieCushion, "WhoopieCushion" }, { ItemName.Comedy, "ComedyMask" }, { ItemName.Tragedy, "TragedyMask" }, { ItemName.RubberDucky, "RubberDuck" }, { ItemName.ChemicalJug, "ChemicalJug" }, { ItemName.FancyLamp, "FancyLamp" }, { ItemName.Painting, "FancyPainting" }, { ItemName.GoldenCup, "FancyCup" }, { ItemName.Toothpaste, "Toothpaste" }, { ItemName.PillBottle, "PillBottle" }, { ItemName.PerfumeBottle, "PerfumeBottle" }, { ItemName.Teeth, "Dentures" }, { ItemName.Magic7Ball, "7Ball" }, { ItemName.EasterEgg, "EasterEgg" }, { ItemName.ToyTrain, "ToyTrain" }, { ItemName.ToiletPaper, "ToiletPaperRolls" }, { ItemName.SoccerBall, "SoccerBall" }, { ItemName.PlasticCup, "PlasticCup" }, { ItemName.GarbageLid, "GarbageLid" }, { ItemName.ControlPad, "ControlPad" }, { ItemName.Clock, "Clock" }, { ItemName.ZedDog, "ZedDog" }, { ItemName.BabyKiwiEgg, "BabyKiwiEgg" }, { ItemName.SeveredThigh, "SeveredThigh" }, { ItemName.SeveredHand, "SeveredHand" }, { ItemName.SeveredEar, "SeveredEar" }, { ItemName.SeveredBone, "SeveredBone" }, { ItemName.SeveredTongue, "SeveredTongue" }, { ItemName.SeveredHeart, "SeveredHeart" }, { ItemName.SeveredFoot, "SeveredFoot" }, { ItemName.SeveredBoneRib, "SeveredBoneRib" } }; public static Dictionary ObjectNameList = new Dictionary { { ObjectName.LargeRock1, "LargeRock1" }, { ObjectName.LargeRock2, "LargeRock2" }, { ObjectName.LargeRock3, "LargeRock3" }, { ObjectName.LargeRock4, "LargeRock4" }, { ObjectName.GreyRockGrouping2, "GreyRockGrouping2" }, { ObjectName.GreyRockGrouping4, "GreyRockGrouping4" }, { ObjectName.GiantPumkin, "GiantPumpkin" }, { ObjectName.Tree, "tree" }, { ObjectName.TreeLeaflessBrown1, "treeLeaflessBrown.001 Variant" }, { ObjectName.TreeLeafless2, "treeLeafless.002_LOD0" }, { ObjectName.TreeLeafless3, "treeLeafless.003_LOD0" }, { ObjectName.Landmine, "Landmine" }, { ObjectName.Turret, "TurretContainer" }, { ObjectName.SpikeRoofTrap, "SpikeRoofTrapHazard" } }; public static Dictionary AtmosphereNameList = new Dictionary { { AtmosphereName.RollingGroundFog, "rolling ground fog" }, { AtmosphereName.Rainy, "rainy" }, { AtmosphereName.Stormy, "stormy" }, { AtmosphereName.Foggy, "foggy" }, { AtmosphereName.Flooded, "flooded" }, { AtmosphereName.Eclipsed, "eclipsed" } }; public static Dictionary EnemyList = new Dictionary(); public static Dictionary ItemList = new Dictionary(); public static Dictionary ObjectList = new Dictionary(); internal static List factorySizeMultiplierList = new List(); internal static List spawnableMapObjects = new List(); internal static List averageScrapValueList = new List(); internal static List insideSpawnChanceCurves = new List(); internal static List outsideSpawnChanceCurves = new List(); internal static List daytimeSpawnChanceCurves = new List(); internal static List insideMaxPowerCounts = new List(); internal static List outsideMaxPowerCounts = new List(); internal static List daytimeMaxPowerCounts = new List(); internal static StormyWeather stormy; internal static FloodWeather flooded; public static EnemyType antiCoilHead; public static EnemyType nutSlayer; public static EnemyType kamikazieBug; public static Item slayerShotgun; public static Item grabbableTurret; public static Item grabbableLandmine; public static GameObject artilleryShell; public static GameObject artillerySirens; public static GameObject bunkerEntrance; public static GameObject bunkerEscape; public static GameObject teleportAudio; public static GameObject bloodRain; private static bool generatedList = false; private static bool generatedOrignalValuesList = false; internal static GameObject hangarShip => GameObject.Find("/Environment/HangarShip"); internal static GameObject cruiser => GameObject.Find("CompanyCruiser(Clone)"); internal static GameObject Microwave => GameObject.Find("MicrowaveContainer(Clone)"); public static bool ReadSettingEarly(string filePath, string settingName) { try { if (!File.Exists(filePath)) { return false; } string input = File.ReadAllText(filePath); string pattern = Regex.Escape(settingName) + "\\s*=\\s*(true|false)"; Match match = Regex.Match(input, pattern, RegexOptions.IgnoreCase); if (match.Success) { string value = match.Groups[1].Value; return bool.Parse(value); } return false; } catch (Exception ex) { Log.LogWarning("An error occurred: " + ex.Message); return false; } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void GenerateCustom() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown antiCoilHead = (EnemyType)customAssetBundle.LoadAsset("AntiCoilHead"); antiCoilHead.enemyName = "Anti Coil-Head"; nutSlayer = (EnemyType)customAssetBundle.LoadAsset("NutSlayer"); nutSlayer.enemyName = "NutSlayer"; kamikazieBug = (EnemyType)customAssetBundle.LoadAsset("KamikazieBug"); kamikazieBug.enemyName = "kamikazieBugs"; slayerShotgun = (Item)customAssetBundle.LoadAsset("SlayerShotgun"); grabbableTurret = (Item)customAssetBundle.LoadAsset("GrabbableTurret"); grabbableLandmine = (Item)customAssetBundle.LoadAsset("GrabbableLandmine"); artilleryShell = (GameObject)customAssetBundle.LoadAsset("ArtilleryShell"); artillerySirens = (GameObject)customAssetBundle.LoadAsset("DDay"); bunkerEntrance = (GameObject)customAssetBundle.LoadAsset("BunkerEntrance"); bunkerEscape = (GameObject)customAssetBundle.LoadAsset("BunkerEscape"); teleportAudio = (GameObject)customAssetBundle.LoadAsset("TeleportAudioSource"); bloodRain = (GameObject)customAssetBundle.LoadAsset("BloodRainParticleContainer"); RegisterNetworkPrefabs(antiCoilHead.enemyPrefab, nutSlayer.enemyPrefab, kamikazieBug.enemyPrefab, slayerShotgun.spawnPrefab, grabbableTurret.spawnPrefab, grabbableLandmine.spawnPrefab, artillerySirens, bunkerEntrance, bunkerEscape); } private static void RegisterNetworkPrefabs(params GameObject[] objects) { foreach (GameObject val in objects) { NetworkManager.Singleton.AddNetworkPrefab(val); } } [HarmonyPostfix] [HarmonyPatch(typeof(TimeOfDay), "Start")] private static void OnTimeOfODayStart(ref TimeOfDay __instance) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0092: 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_00a5: Expected O, but got Unknown GameObject val = Object.Instantiate(bloodRain); LocalVolumetricFog component = ((Component)val.transform.Find("Foggy")).GetComponent(); component.parameters.albedo = new Color(0.25f, 0.35f, 0.55f, 1f); component.parameters.meanFreePath = 80f; component.parameters.size.y = 255f; __instance.effects = __instance.effects.Add(new WeatherEffect { name = "bloodyrain", effectObject = val, effectPermanentObject = null, lerpPosition = false, effectEnabled = false }); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void OnStartOfRoundStart() { StartOfRound.Instance.allItemsList.itemsList.AddRange(new List { slayerShotgun, grabbableTurret, grabbableLandmine }); } internal static void Load() { bundle = LoadAssetBundle("bcm_assets"); customAssetBundle = LoadAssetBundle("bcm_customassets"); SceneManager.sceneLoaded += OnSceneLoaded; } private static AssetBundle LoadAssetBundle(string fileName) { try { string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location); string text = Path.Combine(directoryName, fileName); return AssetBundle.LoadFromFile(text); } catch (Exception arg) { Log.LogError($"Failed to load AssetBundle \"{fileName}\". {arg}"); } return null; } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } StormyWeather[] array = Resources.FindObjectsOfTypeAll().Concat(Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); FloodWeather[] array2 = Resources.FindObjectsOfTypeAll().Concat(Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); if (array.Length != 0) { stormy = array[0]; } if (array2.Length != 0) { flooded = array2[0]; } if (generatedList) { return; } Log.LogInfo("Generating 'EnemyList'"); EnemyType[] array3 = Resources.FindObjectsOfTypeAll().Concat(Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); Array.Reverse(array3); array3 = (from x in array3 group x by ((Object)x).name into x select x.FirstOrDefault()).ToArray(); for (int num = 0; num < array3.Length; num++) { if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Prefab Warnings?") && (Object)(object)array3[num].enemyPrefab == (Object)null) { Log.LogWarning($"Enemy:{((Object)array3[num]).name}, prefab is null, this may cause issues..."); } EnemyList.Add(((Object)array3[num]).name, array3[num]); } EnemyList.Remove("RedPillEnemyType"); foreach (KeyValuePair enemy in EnemyList) { bool flag = false; foreach (KeyValuePair enemyName in EnemyNameList) { if (enemy.Key == enemyName.Value) { flag = true; break; } } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Enum Warnings?") && !flag) { Log.LogWarning($"Enemy:'{enemy.Key}', isn't matched with enum, this may cause issues..."); } } Log.LogInfo($"Finished generating 'EnemyList', Count:{EnemyList.Count}"); Log.LogInfo("Generating 'ItemList'"); Item[] array4 = Resources.FindObjectsOfTypeAll().Concat(Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)1)).ToArray(); Array.Reverse(array4); array4 = (from x in array4 group x by ((Object)x).name into x select x.FirstOrDefault()).ToArray(); for (int num2 = 0; num2 < array4.Length; num2++) { if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Prefab Warnings?") && (Object)(object)array4[num2].spawnPrefab == (Object)null) { Log.LogWarning($"Item:{((Object)array4[num2]).name}, prefab is null, this may cause issues..."); } ItemList.Add(((Object)array4[num2]).name, array4[num2]); } foreach (KeyValuePair item in ItemList) { bool flag2 = false; foreach (KeyValuePair itemName in ItemNameList) { if (item.Key == itemName.Value) { flag2 = true; break; } } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Enum Warnings?") && !flag2) { Log.LogWarning($"Item:'{item.Key}', isn't matched with enum, this may cause issues..."); } } Log.LogInfo($"Finished generating 'ItemList', Count:{ItemList.Count}"); Log.LogInfo("Generating 'ObjectList'"); List list = new List(); List list2 = new List(); SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { if ((Object)(object)val == (Object)null || val.spawnableMapObjects == null) { continue; } SpawnableMapObject[] array5 = val.spawnableMapObjects; foreach (SpawnableMapObject obj in array5) { if (obj != null && !((Object)(object)obj.prefabToSpawn == (Object)null) && list.FindIndex((SpawnableMapObject o) => ((Object)o.prefabToSpawn).name == ((Object)obj.prefabToSpawn).name) < 0) { list.Add(obj); } } SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val.spawnableOutsideObjects; foreach (SpawnableOutsideObjectWithRarity obj2 in spawnableOutsideObjects) { if (obj2 != null && !((Object)(object)obj2.spawnableObject == (Object)null) && !((Object)(object)obj2.spawnableObject.prefabToSpawn == (Object)null) && list2.FindIndex((SpawnableOutsideObjectWithRarity o) => ((Object)o.spawnableObject.prefabToSpawn).name == ((Object)obj2.spawnableObject.prefabToSpawn).name) < 0) { list2.Add(obj2); } } } foreach (SpawnableMapObject item2 in list) { ObjectList.Add(((Object)item2.prefabToSpawn).name, item2.prefabToSpawn); } foreach (SpawnableOutsideObjectWithRarity item3 in list2) { ObjectList.Add(((Object)item3.spawnableObject.prefabToSpawn).name, item3.spawnableObject.prefabToSpawn); } foreach (KeyValuePair @object in ObjectList) { bool flag3 = false; foreach (KeyValuePair objectName in ObjectNameList) { if (@object.Key == objectName.Value) { flag3 = true; break; } } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Enum Warnings?") && !flag3) { Log.LogWarning($"Object:'{@object.Key}', isn't matched with enum, this may cause issues..."); } } Log.LogInfo($"Finished generating 'ObjectList', Count:{ObjectList.Count}"); Log.LogInfo($"Map Count:{factorySizeMultiplierList.Count}"); Log.LogInfo("Generating configuration"); Configuration.CreateConfig(); generatedList = true; } internal static void generateOriginalValuesLists() { //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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_01c5: Unknown result type (might be due to invalid IL or missing references) if (generatedOrignalValuesList) { return; } SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { factorySizeMultiplierList.Add(val.factorySizeMultiplier); List list = new List(); list.AddRange(val.spawnableScrap); float num = 0f; float num2 = 0f; foreach (SpawnableItemWithRarity item in list) { num += (float)((item.spawnableItem.minValue + item.spawnableItem.maxValue) * item.rarity); num2 += (float)item.rarity; } if (num2 != 0f) { averageScrapValueList.Add(num / (num2 * 2f)); } else { averageScrapValueList.Add(80f); } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Experimental Dont Handle Spawn Chance?")) { AnimationCurve val2 = new AnimationCurve(); AnimationCurve val3 = new AnimationCurve(); AnimationCurve val4 = new AnimationCurve(); Keyframe[] keys = val.enemySpawnChanceThroughoutDay.keys; foreach (Keyframe val5 in keys) { val2.AddKey(val5); } Keyframe[] keys2 = val.outsideEnemySpawnChanceThroughDay.keys; foreach (Keyframe val6 in keys2) { val3.AddKey(val6); } Keyframe[] keys3 = val.daytimeEnemySpawnChanceThroughDay.keys; foreach (Keyframe val7 in keys3) { val4.AddKey(val7); } insideSpawnChanceCurves.Add(val2); outsideSpawnChanceCurves.Add(val3); daytimeSpawnChanceCurves.Add(val4); } insideMaxPowerCounts.Add(val.maxEnemyPowerCount); outsideMaxPowerCounts.Add(val.maxOutsideEnemyPowerCount); daytimeMaxPowerCounts.Add(val.maxDaytimeEnemyPowerCount); spawnableMapObjects.Add(val.spawnableMapObjects); } generatedOrignalValuesList = true; } public static EnemyType GetEnemy(EnemyName name) { return GetEnemy(EnemyNameList[name]); } public static EnemyType GetEnemy(string name) { if (EnemyList.TryGetValue(name, out EnemyType value)) { return value; } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Get Method Warnings?")) { Log.LogWarning("GetEnemy(" + name + ") failed, returning an empty enemy type"); } EnemyType val = ScriptableObject.CreateInstance(); val.enemyName = name; ((Object)val).name = name; return val; } public static EnemyType GetEnemyOrDefault(string name) { if (EnemyList.TryGetValue(name, out EnemyType value)) { return value; } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Get Method Warnings?")) { Log.LogWarning("GetEnemyOrDefault(" + name + ") failed, returning kamikazie bug."); } return kamikazieBug; } public static Item GetItem(ItemName name) { return GetItem(ItemNameList[name]); } public static Item GetItem(string name) { if (ItemList.TryGetValue(name, out Item value)) { return value; } if (!ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", "Silence Get Method Warnings?")) { Log.LogWarning("GetItem(" + name + ") failed, returning an empty item"); } Item val = ScriptableObject.CreateInstance(); val.itemName = name; ((Object)val).name = name; return val; } [Obsolete("Causes the mod to fail, do not use on modded item events", false)] public static Item GetItemByName(string itemName, bool matchCase = true) { StringComparison comparisonType = ((!matchCase) ? StringComparison.OrdinalIgnoreCase : StringComparison.CurrentCulture); foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName.Equals(itemName, comparisonType)) { return items; } } return null; } [Obsolete("Causes the mod to fail, do not use on vanilla item events", true)] public static Item GetItemByNameModded(string itemName, bool isModPresent, bool matchCase = true) { if (isModPresent) { StringComparison comparisonType = ((!matchCase) ? StringComparison.OrdinalIgnoreCase : StringComparison.CurrentCulture); foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName.Equals(itemName, comparisonType)) { return items; } } return null; } return null; } public static GameObject GetObject(ObjectName name) { return GetObject(ObjectNameList[name]); } public static GameObject GetObject(string name) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (ObjectList.TryGetValue(name, out GameObject value)) { return value; } Log.LogWarning("GetObject(" + name + " failed, returning empty gameObject"); return new GameObject(name); } } [HarmonyPatch] public class Net : NetworkBehaviour { [Serializable] public struct CurrentWeatherEffect : INetworkSerializable, IEquatable { public FixedString128Bytes name; public bool state; public CurrentWeatherEffect(FixedString128Bytes name, bool state) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.state = state; } public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_003c: Unknown result type (might be due to invalid IL or missing references) if (serializer.IsReader) { FastBufferReader fastBufferReader = serializer.GetFastBufferReader(); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref name, default(ForFixedStrings)); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref state, default(ForPrimitives)); } else { FastBufferWriter fastBufferWriter = serializer.GetFastBufferWriter(); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref name, default(ForFixedStrings)); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref state, default(ForPrimitives)); } } public bool Equals(CurrentWeatherEffect other) { return (ref name) == (ref other.name); } } [Serializable] public struct OutsideObjectsToSpawnMethod : INetworkSerializable, IEquatable { public float density; public int objectEnumID; public OutsideObjectsToSpawnMethod(float density, int objectEnumID) { this.density = density; this.objectEnumID = objectEnumID; } public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) if (serializer.IsReader) { FastBufferReader fastBufferReader = serializer.GetFastBufferReader(); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref density, default(ForPrimitives)); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref objectEnumID, default(ForPrimitives)); } else { FastBufferWriter fastBufferWriter = serializer.GetFastBufferWriter(); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref density, default(ForPrimitives)); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref objectEnumID, default(ForPrimitives)); } } public bool Equals(OutsideObjectsToSpawnMethod other) { return objectEnumID == other.objectEnumID && density == other.density; } } public NetworkList currentWeatherMultipliers = new NetworkList(); public NetworkList outsideObjectsToSpawn; public NetworkList currentWeatherEffects; public NetworkVariable textUI = new NetworkVariable(default(FixedString4096Bytes), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public bool receivedSyncedValues = false; public List objectsToSpawn = new List(); public List objectsToSpawnAmount = new List(); public List objectsToSpawnRadius = new List(); public List objectsToSpawnOffsets = new List(); private float currentIntervalTime = 0f; public NetworkVariable LeverUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable WalkiesUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable JetpackUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable TerminalUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable TargetingUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable TeleporterUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable ItemChargerUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable CircuitUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable DoorOvUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable DoorUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable CameraUnityNet = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public int _seed = 49; public static Net Instance { get; private set; } public static GameObject netObject { get; private set; } private void Awake() { currentWeatherMultipliers = new NetworkList(); outsideObjectsToSpawn = new NetworkList(); currentWeatherEffects = new NetworkList(); Log.LogWarning("Net object Awake called"); } private void Update() { //IL_0125: 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_00c9: 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) if (currentIntervalTime > 0f) { currentIntervalTime -= Time.deltaTime; } else { currentIntervalTime = 0.5f; if (currentWeatherEffects.Count > 0) { foreach (CurrentWeatherEffect currentWeatherEffect in currentWeatherEffects) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null)) { if (localPlayerController.isPlayerDead) { UpdateAtmosphere(currentWeatherEffect.name, state: false); } else if (!localPlayerController.isInsideFactory) { UpdateAtmosphere(currentWeatherEffect.name, currentWeatherEffect.state); } else { UpdateAtmosphere(currentWeatherEffect.name, state: false); } } } } } if (objectsToSpawn.Count > 0) { Manager.Spawn.DoSpawnOutsideObjects(objectsToSpawnAmount[0], objectsToSpawnRadius[0], objectsToSpawnOffsets[0], objectsToSpawn[0]); objectsToSpawn.RemoveAt(0); objectsToSpawnAmount.RemoveAt(0); objectsToSpawnRadius.RemoveAt(0); objectsToSpawnOffsets.RemoveAt(0); } } public override void OnNetworkSpawn() { Instance = this; UI.SpawnObject(); if (((NetworkBehaviour)this).IsServer) { InitalizeCurrentWeatherMultipliersServerRpc(); } ((NetworkBehaviour)this).OnNetworkSpawn(); } public override void OnNetworkDespawn() { UI.Instance.UnsubscribeFromKeyboardEvent(); Object.Destroy((Object)(object)GameObject.Find("EventGUI")); ((NetworkBehaviour)this).OnNetworkDespawn(); } [ServerRpc(RequireOwnership = false)] public void GetSyncedTextServerRpc() { //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) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1644092438u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1644092438u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GetSyncedTextClientRpc(textUI.Value); } } } [ClientRpc] public void GetSyncedTextClientRpc(FixedString4096Bytes textUI) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1434020377u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref textUI, default(ForFixedStrings)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1434020377u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.textUI = FixedString4096Bytes.op_Implicit(((FixedString4096Bytes)(ref textUI)).Value); } } } [ServerRpc(RequireOwnership = false)] public void GiveSeedServerRpc() { //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(2319565597u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2319565597u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GiveSeedClientRpc(_seed++); } } } [ClientRpc] public void GiveSeedClientRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2006375022u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2006375022u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.seed = seed; } } } [ServerRpc(RequireOwnership = false)] public void ClearGameObjectsServerRpc() { //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(3809690504u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3809690504u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ClearGameObjectsClientRpc(); } } } [ClientRpc] public void ClearGameObjectsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(174694319u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 174694319u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; for (int i = 0; i < Manager.objectsToClear.Count; i++) { GameObject val3 = Manager.objectsToClear[i]; if ((Object)(object)val3 == (Object)null) { continue; } NetworkObject component = val3.GetComponent(); string name = ((Object)val3).name; try { if ((Object)(object)component != (Object)null) { component.Despawn(true); if (Configuration.ExtraLogging.Value) { Log.LogInfo("Despawned network object: " + name); } } else { Object.Destroy((Object)(object)val3); if (Configuration.ExtraLogging.Value) { Log.LogInfo("Destroyed non-network object: " + name); } } } catch (KeyNotFoundException ex) { Log.LogError("KeyNotFoundException while despawning/destroying '" + name + "': " + ex.Message); } catch (Exception ex2) { Log.LogError("Unexpected exception while despawning/destroying '" + name + "': " + ex2.Message); } } Manager.objectsToClear.Clear(); } [ClientRpc] public void SyncValuesClientRpc(float factorySizeMultiplier, float scrapValueMultiplier, float scrapAmountMultiplier, int bonusMaxHp) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011f: 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(2150416984u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref factorySizeMultiplier, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scrapValueMultiplier, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref scrapAmountMultiplier, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, bonusMaxHp); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2150416984u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RoundManager.Instance.currentLevel.factorySizeMultiplier = factorySizeMultiplier; Manager.bonusEnemyHp = bonusMaxHp; receivedSyncedValues = true; } } } [ServerRpc] public void SyncScrapValueServerRpc(NetworkObjectReference obj, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(875794818u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 875794818u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncScrapValueClientRpc(obj, value); } } [ClientRpc] private void SyncScrapValueClientRpc(NetworkObjectReference obj, int value) { //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_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_008c: 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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(268987115u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 268987115u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null); ((Component)val3).GetComponent().SetScrapValue(value); } } } [ServerRpc(RequireOwnership = false)] public void GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference netObject, int code) { //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_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_008c: 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) //IL_00ef: 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(2205229909u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObject, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, code); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2205229909u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GenerateAndSyncTerminalCodeClientRpc(netObject, code); } } } [ClientRpc] public void GenerateAndSyncTerminalCodeClientRpc(NetworkObjectReference netObject, int code) { //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_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_008c: 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(3849078077u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObject, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, code); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3849078077u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = null; if (!((NetworkObjectReference)(ref netObject)).TryGet(ref val3, (NetworkManager)null)) { Log.LogError("Network Object is null in GenerateAndSyncTerminalCodeClientRpc()"); return; } TerminalAccessibleObject componentInChildren = ((Component)val3).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Log.LogError("Terminal Accessible Object is null in GenerateAndSyncTerminalCodeClientRpc()"); return; } componentInChildren.InitializeValues(); componentInChildren.SetCodeTo(code); } [ServerRpc(RequireOwnership = false)] public void MoveTimeServerRpc(float amount, float speedMultiplier = 1f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2208211795u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref amount, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2208211795u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MoveTimeClientRpc(amount, speedMultiplier); } } } [ClientRpc] public void MoveTimeClientRpc(float amount, float speedMultiplier) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3436861046u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref amount, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3436861046u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.moveTime = true; Manager.moveTimeAmount += amount; Manager.timeSpeedMultiplier *= speedMultiplier; } } } [ServerRpc(RequireOwnership = false)] public void SetTimeMultiplierServerRpc(float speedMultiplier = 1f) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2853396074u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2853396074u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetTimeMultiplierClientRpc(speedMultiplier); } } } [ClientRpc] public void SetTimeMultiplierClientRpc(float speedMultiplier) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(512763078u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref speedMultiplier, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 512763078u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.moveTime = true; Manager.timeSpeedMultiplier = speedMultiplier; } } } private void UpdateAtmosphere(FixedString128Bytes name, bool state) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++) { FixedString128Bytes val = FixedString128Bytes.op_Implicit(TimeOfDay.Instance.effects[i].name); if ((ref val) == (ref name)) { TimeOfDay.Instance.effects[i].effectEnabled = state; } } } [ClientRpc] public void ShowCaseEventsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1744607847u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1744607847u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; UI.Instance.curretShowCaseEventTime = UI.Instance.showCaseEventTime; UI.Instance.TogglePanel(state: true); UI.Instance.panelScrollBar.value = 1f; UI.Instance.showCaseEvents = true; } } } [ServerRpc(RequireOwnership = false)] private void InitalizeCurrentWeatherMultipliersServerRpc() { //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(1335262659u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1335262659u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; currentWeatherMultipliers = Weather.InitalizeWeatherMultipliers(ref currentWeatherMultipliers); UpdateCurrentWeatherMultipliersServerRpc(); } } } [ServerRpc(RequireOwnership = false)] public void UpdateCurrentWeatherMultipliersServerRpc() { //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(466041418u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 466041418u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; currentWeatherMultipliers = Weather.RandomizeWeatherMultipliers(currentWeatherMultipliers); } } } [ServerRpc(RequireOwnership = false)] public void SetRecievedServerRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1853859009u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1853859009u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetRecievedClientRpc(state); } } } [ClientRpc] public void SetRecievedClientRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(603622741u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 603622741u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; receivedSyncedValues = state; } } } [ServerRpc(RequireOwnership = false)] public void SetRealityShiftActiveServerRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4203994123u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4203994123u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetRealityShiftActiveClientRpc(state); } } } [ClientRpc] public void SetRealityShiftActiveClientRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2568149201u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2568149201u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BrutalCompanyMinus.Minus.Events.RealityShift.Active = state; } } } [ServerRpc(RequireOwnership = false)] public void SetAllWeatherActiveServerRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1050877662u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1050877662u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetAllWeatherActiveClientRpc(state); } } } [ClientRpc] public void SetAllWeatherActiveClientRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1627891447u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1627891447u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BrutalCompanyMinus.Minus.Events.AllWeather.Active = state; } } } [ServerRpc(RequireOwnership = false)] public void SetEventActiveServerRPC(string eventName, bool state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) //IL_00d5: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2405040997u, val2, (RpcDelivery)0); bool flag = eventName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(eventName, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2405040997u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetEventActiveClientRPC(eventName, state); } } [ClientRpc] public void SetEventActiveClientRPC(string eventName, bool state) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) //IL_00d5: 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(1527620954u, val2, (RpcDelivery)0); bool flag = eventName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(eventName, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1527620954u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MEvent mEvent = MEvent.GetEvent(eventName); if (mEvent != null) { mEvent.Active = state; } } } [ServerRpc(RequireOwnership = false)] public void MessWithLightsServerRpc() { //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(3368901509u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3368901509u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MessWithLightsClientRpc(); } } } [ClientRpc] public void MessWithLightsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2808903510u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2808903510u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; RoundManager.Instance.FlickerLights(true, true); } } } [ServerRpc(RequireOwnership = false)] public void MessWithBreakerServerRpc(bool state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3941924814u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3941924814u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MessWithBreakerClientRpc(state); } } } [ClientRpc] public void MessWithBreakerClientRpc(bool state) { //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(3457555438u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3457555438u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BreakerBox val3 = Object.FindObjectOfType(); if ((Object)(object)val3 != (Object)null) { val3.SetSwitchesOff(); RoundManager.Instance.TurnOnAllLights(state); } } } [ServerRpc(RequireOwnership = false)] public void MessWithDoorsServerRpc(float openCloseChance, bool messWithLock = false, float messWithLockChance = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2842285472u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref openCloseChance, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref messWithLock, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref messWithLockChance, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2842285472u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (_seed == 0) { _seed = StartOfRound.Instance.randomMapSeed; } _seed++; MessWithDoorsClientRpc(openCloseChance, _seed, messWithLock, messWithLockChance); } } [ClientRpc] public void MessWithDoorsClientRpc(float openCloseChance, int seed, bool messWithLock, float messWithLockChance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00da: 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) 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(1683303265u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref openCloseChance, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, seed); ((FastBufferWriter)(ref val)).WriteValueSafe(ref messWithLock, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref messWithLockChance, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1683303265u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; DoorLock[] array = Object.FindObjectsOfType(); Random random = new Random(seed); DoorLock[] array2 = array; foreach (DoorLock val3 in array2) { if ((Object)(object)val3 == (Object)null || random.NextDouble() <= (double)openCloseChance) { continue; } if (messWithLock && random.NextDouble() <= (double)messWithLockChance) { if (random.Next(0, 2) == 0) { val3.LockDoor(30f); } else { val3.UnlockDoor(); } break; } if (!val3.isLocked) { ((Component)val3).gameObject.GetComponent().TriggerAnimationNonPlayer(false, true, false); val3.SetDoorAsOpen(Convert.ToBoolean(random.Next(0, 2))); } } } [ServerRpc(RequireOwnership = false)] public void UnlockAndOpenAllDoorsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1559123307u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1559123307u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TerminalAccessibleObject[] array = Object.FindObjectsOfType(); TerminalAccessibleObject[] array2 = array; foreach (TerminalAccessibleObject val3 in array2) { val3.SetDoorOpenServerRpc(true); } UnlockAndOpenAllDoorsClientRpc(); } } [ClientRpc] public void UnlockAndOpenAllDoorsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(969155834u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 969155834u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; DoorLock[] array = Object.FindObjectsOfType(); DoorLock[] array2 = array; foreach (DoorLock val3 in array2) { if (!((Object)(object)val3 == (Object)null)) { if (val3.isLocked) { val3.UnlockDoor(); } ((Component)val3).gameObject.GetComponent().TriggerAnimationNonPlayer(false, true, false); val3.SetDoorAsOpen(true); } } } [ServerRpc(RequireOwnership = false)] public void LockAndCloseAllDoorsServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2551708642u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2551708642u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TerminalAccessibleObject[] array = Object.FindObjectsOfType(); TerminalAccessibleObject[] array2 = array; foreach (TerminalAccessibleObject val3 in array2) { val3.SetDoorOpenServerRpc(false); } LockAndCloseAllDoorsClientRpc(); } } [ClientRpc] public void LockAndCloseAllDoorsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3849447749u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3849447749u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; DoorLock[] array = Object.FindObjectsOfType(); DoorLock[] array2 = array; foreach (DoorLock val3 in array2) { if (!((Object)(object)val3 == (Object)null)) { if (val3.isDoorOpened) { val3.isDoorOpened = false; val3.SetDoorAsOpen(false); } ((Component)val3).gameObject.GetComponent().TriggerAnimationNonPlayer(false, true, false); if (!val3.isLocked) { val3.LockDoor(30f); } } } } [ServerRpc(RequireOwnership = false)] public void SpawnTipServerRpc(string Title, string message, bool isWarning) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4214836272u, val2, (RpcDelivery)0); bool flag = Title != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(Title, false); } bool flag2 = message != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(message, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref isWarning, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4214836272u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnTipClientRpc(Title, message, isWarning); } } [ClientRpc] public void SpawnTipClientRpc(string Title, string message, bool isWarning) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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(2034080072u, val2, (RpcDelivery)0); bool flag = Title != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(Title, false); } bool flag2 = message != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(message, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref isWarning, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2034080072u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HUDManager.Instance.DisplayTip(Title, message, isWarning, false, "LC_Tip1"); } } [ServerRpc(RequireOwnership = false)] public void SpawnMudPilesOutsideServerRpc(int amount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3079998733u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, amount); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3079998733u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NavMeshHit val3 = default(NavMeshHit); Random random = new Random(_seed++); for (int i = 0; i < amount; i++) { Vector3 position = RoundManager.Instance.outsideAINodes[random.Next(0, RoundManager.Instance.outsideAINodes.Length)].transform.position; Vector3 position2 = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 30f, val3, random, -1, 1f) + Vector3.up; SpawnMudPilesOutsideClientRpc(position2, _seed++); } } } [ClientRpc] public void SpawnMudPilesOutsideClientRpc(Vector3 position, int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) 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(1000423920u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1000423920u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Object.Instantiate(RoundManager.Instance.quicksandPrefab, position, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); } } } [ServerRpc(RequireOwnership = false)] public void TeleportEnemyServerRpc(NetworkObjectReference enemy, Vector3 position) { //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_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_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) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) 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(234264786u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemy, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 234264786u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportEnemyClientRpc(enemy, position); } } } [ClientRpc] private void TeleportEnemyClientRpc(NetworkObjectReference enemy, Vector3 position) { //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_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_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) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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(1650168377u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemy, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1650168377u, 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 enemy)).TryGet(ref val3, (NetworkManager)null)) { Object.Instantiate(Assets.teleportAudio, ((Component)val3).transform.position, Quaternion.identity); Object.Instantiate(Assets.teleportAudio, position, Quaternion.identity); ((Component)val3).transform.position = position; } } } [ServerRpc(RequireOwnership = false)] public void SpawnAllWeatherServerRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3701680339u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, seed); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3701680339u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnAllWeatherClientRpc(seed); } } } [ClientRpc] public void SpawnAllWeatherClientRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected I4, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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(910007267u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 910007267u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (RoundManager.Instance.currentLevel.randomWeathers == null) { return; } Random random = new Random(); BrutalCompanyMinus.Minus.Handlers.AllWeather.raining = false; RandomWeatherWithVariables[] randomWeathers = RoundManager.Instance.currentLevel.randomWeathers; foreach (RandomWeatherWithVariables val3 in randomWeathers) { if (val3.weatherType == RoundManager.Instance.currentLevel.currentWeather) { continue; } LevelWeatherType weatherType = val3.weatherType; LevelWeatherType val4 = weatherType; switch (val4 - 1) { case 0: BrutalCompanyMinus.Minus.Handlers.AllWeather.raining = true; break; case 2: if (!((Object)(object)TimeOfDay.Instance.foggyWeather == (Object)null)) { LocalVolumetricFog val7 = Object.Instantiate(TimeOfDay.Instance.foggyWeather); Manager.objectsToClear.Add(((Component)val7).gameObject); val7.parameters.albedo = new Color(0.25f, 0.35f, 0.55f, 1f); val7.parameters.meanFreePath = random.Next((int)MathF.Max(4f, val3.weatherVariable), val3.weatherVariable2) * 5; val7.parameters.size.y = 255f; ((Component)val7).gameObject.SetActive(true); } break; case 3: { FloodWeather val6 = Object.Instantiate(Assets.flooded); Manager.objectsToClear.Add(((Component)val6).gameObject); BrutalCompanyMinus.Minus.Handlers.AllWeather.floodVariable1 = val3.weatherVariable; BrutalCompanyMinus.Minus.Handlers.AllWeather.floodVariable2 = val3.weatherVariable2; BrutalCompanyMinus.Minus.Handlers.AllWeather.spawnedFloodedWeather = val6; ((Component)val6).gameObject.SetActive(true); break; } case 1: { StormyWeather val5 = Object.Instantiate(Assets.stormy); Manager.objectsToClear.Add(((Component)val5).gameObject); BrutalCompanyMinus.Minus.Handlers.AllWeather.lightningVariable1 = val3.weatherVariable; BrutalCompanyMinus.Minus.Handlers.AllWeather.LightningVariable2 = val3.weatherVariable2; ((Component)val5).gameObject.SetActive(true); break; } case 4: Manager.minEnemiesToSpawnInside += val3.weatherVariable; Manager.minEnemiestoSpawnOutside += val3.weatherVariable2; break; } } } [ServerRpc(RequireOwnership = false)] public void ShiftServerRpc(NetworkObjectReference networkObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(716805725u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref networkObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 716805725u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList.Count == 0 || (Object)(object)BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList[0] == (Object)null) { return; } NetworkObject val3 = null; ((NetworkObjectReference)(ref networkObject)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 == (Object)null) { Log.LogError("NetworkObject in ShiftServerRpc() is null."); return; } GrabbableObject component = ((Component)val3).GetComponent(); GameObject val4 = Object.Instantiate(BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList[0], ((Component)component).transform.position, Quaternion.identity); GrabbableObject component2 = val4.GetComponent(); if ((Object)(object)component2 == (Object)null) { Log.LogError("GrabbableObject is null in ShiftServerRpc()"); return; } component2.targetFloorPosition = component2.GetItemFloorPosition(((Component)component).transform.position); component2.SetScrapValue(BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftListValues[0]); ((NetworkBehaviour)component2).NetworkObject.Spawn(false); SyncScrapValueClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component2).NetworkObject), BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftListValues[0]); AddObjectToGrabToListClientRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component2).NetworkObject)); NetworkObject component3 = ((Component)component).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.Despawn(true); } else { Log.LogError("NetworkObject is null in ShiftServerRpc(), destroying on client instead."); Object.Destroy((Object)(object)component); } if ((Object)(object)val4 != (Object)null) { BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftListValues.RemoveAt(0); BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftList.RemoveAt(0); } } [ClientRpc] public void AddObjectToGrabToListClientRpc(NetworkObjectReference obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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(4160371367u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4160371367u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BrutalCompanyMinus.Minus.Handlers.RealityShift.shiftedObjects.Add(obj); } } } [ServerRpc(RequireOwnership = false)] public void GenerateShiftableObjectsListServerRpc(NetworkObjectReference[] spawnedScrap) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3192420881u, val2, (RpcDelivery)0); bool flag = spawnedScrap != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(spawnedScrap, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3192420881u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GenerateShiftableObjectsListClientRpc(spawnedScrap); } } [ClientRpc] public void GenerateShiftableObjectsListClientRpc(NetworkObjectReference[] spawnedScrap) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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(2458116008u, val2, (RpcDelivery)0); bool flag = spawnedScrap != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(spawnedScrap, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2458116008u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; BrutalCompanyMinus.Minus.Handlers.RealityShift.ShiftableObjects.Clear(); for (int i = 0; i < spawnedScrap.Length; i++) { NetworkObjectReference val3 = spawnedScrap[i]; NetworkObject val4 = null; ((NetworkObjectReference)(ref val3)).TryGet(ref val4, (NetworkManager)null); if ((Object)(object)val4 != (Object)null) { BrutalCompanyMinus.Minus.Handlers.RealityShift.ShiftableObjects.Add(((Object)((Component)val4).gameObject).GetInstanceID()); } else { Log.LogError("Scrap spawn has null NetworkObject"); } } } [ServerRpc(RequireOwnership = false)] public void FireAtServerRpc(Vector3 at, Vector3 from) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1685788616u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref at); ((FastBufferWriter)(ref val)).WriteValueSafe(ref from); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1685788616u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FireAtClientRpc(at, from); } } } [ClientRpc] public void FireAtClientRpc(Vector3 at, Vector3 from) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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(2615626191u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref at); ((FastBufferWriter)(ref val)).WriteValueSafe(ref from); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2615626191u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(Assets.artilleryShell, from, Quaternion.identity); ArtilleryShell component = val3.GetComponent(); component.target = at; Manager.objectsToClear.Add(val3); } } } [ServerRpc(RequireOwnership = false)] public void DisplayTipServerRpc(string headerText, string bodyText, bool isWarning = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2734280710u, val2, (RpcDelivery)0); bool flag = headerText != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(headerText, false); } bool flag2 = bodyText != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(bodyText, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref isWarning, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2734280710u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DisplayTipClientRpc(headerText, bodyText, isWarning); } } [ClientRpc] public void DisplayTipClientRpc(string headerText, string bodyText, bool isWarning = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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(1885137978u, val2, (RpcDelivery)0); bool flag = headerText != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(headerText, false); } bool flag2 = bodyText != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(bodyText, false); } ((FastBufferWriter)(ref val)).WriteValueSafe(ref isWarning, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1885137978u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; HUDManager.Instance.DisplayTip(headerText, bodyText, isWarning, false, "LC_Tip1"); } } [ServerRpc(RequireOwnership = false)] public void BlackFridayServerRpc(int minPercentageCut, int maxPercentageCut) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) 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(688182791u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, minPercentageCut); BytePacker.WriteValueBitPacked(val, maxPercentageCut); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 688182791u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; BlackFridayClientRpc(minPercentageCut, maxPercentageCut, _seed++); } } } [ClientRpc] public void BlackFridayClientRpc(int minPercentageCut, int maxPercentageCut, int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) 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(1034762097u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, minPercentageCut); BytePacker.WriteValueBitPacked(val, maxPercentageCut); BytePacker.WriteValueBitPacked(val, seed); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1034762097u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Random random = new Random(seed); for (int i = 0; i < Manager.currentTerminal.buyableItemsList.Length; i++) { int num = 100 - (int)Mathf.Clamp((float)random.Next(minPercentageCut, maxPercentageCut), 0f, 90f); Manager.currentTerminal.itemSalesPercentages[i] = (int)Math.Round((double)num / 10.0) * 10; } } } [ServerRpc(RequireOwnership = false)] public void SetPhonesOutServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1342506232u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1342506232u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetPhonesOutClientRpc(active); } } } [ClientRpc] public void SetPhonesOutClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3705199930u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3705199930u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PhonesOut.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void SetFlashlightsServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2315487481u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2315487481u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetFlashlightsClientRpc(active); } } } [ClientRpc] public void SetFlashlightsClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2901997937u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2901997937u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; FlashLightsFailure.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void SetSlimeServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3267883328u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3267883328u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetSlimeClientRpc(active); } } } [ClientRpc] public void SetSlimeClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1874889081u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1874889081u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SlimeInside.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void SetSlimeSlipperyServerRpc(float slipperyness) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3551728206u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref slipperyness, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3551728206u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetSlimeSlipperyClientRpc(slipperyness); } } } [ClientRpc] public void SetSlimeSlipperyClientRpc(float slipperyness) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3810768433u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref slipperyness, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3810768433u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SlimeInside.SlippinessValue = slipperyness; } } } [ServerRpc(RequireOwnership = false)] public void SetEntranceServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(550970534u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 550970534u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetEntranceClientRpc(active); } } } [ServerRpc(RequireOwnership = false)] public void SetMetalOffNetServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3299014331u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3299014331u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetMetalOffNetClientRpc(active); } } } [ClientRpc] public void SetMetalOffNetClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3060036059u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3060036059u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NotMetal.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void SetMetalOnNetServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2499070959u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2499070959u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetMetalOnNetClientRpc(active); } } } [ClientRpc] public void SetMetalOnNetClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2443911055u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2443911055u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; IsMetal.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void CruiserFailureServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3964987524u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3964987524u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CruiserFailureClientRpc(active); } } } [ClientRpc] public void CruiserFailureClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1138105266u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1138105266u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CruiserFailure.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void SetMoldServerRpc(bool canSpawnMold, int iterations) { //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_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_008c: 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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(754265033u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref canSpawnMold, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, iterations); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 754265033u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetMoldClientRpc(canSpawnMold, iterations); } } } [ClientRpc] public void SetMoldClientRpc(bool canSpawnMold, int iterations) { //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_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_008c: 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(3513712149u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref canSpawnMold, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, iterations); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3513712149u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectableLevel currentLevel = RoundManager.Instance.currentLevel; if ((Object)(object)currentLevel != (Object)null) { currentLevel.canSpawnMold = canSpawnMold; currentLevel.moldSpreadIterations = iterations; } } } [ServerRpc(RequireOwnership = false)] public void SaveOriginalMoldPreviousDataServerRpc() { //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(2473314841u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2473314841u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SaveOriginalMoldPreviousDataClientRpc(); } } } [ClientRpc] public void SaveOriginalMoldPreviousDataClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1026406775u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1026406775u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectableLevel currentLevel = RoundManager.Instance.currentLevel; if ((Object)(object)currentLevel != (Object)null && !Manager.originalMoonMoldData.ContainsKey(currentLevel.PlanetName)) { Manager.originalMoonMoldData.Add(currentLevel.PlanetName, (currentLevel.canSpawnMold, currentLevel.moldSpreadIterations)); } } } [ServerRpc(RequireOwnership = false)] public void SyncHeatMapServerRpc(ServerRpcParams rpcParams = default(ServerRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: 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.IsClient || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2084493939u, rpcParams, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2084493939u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } ulong senderClientId = rpcParams.Receive.SenderClientId; Dictionary.KeyCollection keys = Manager.heatDifficulty.Keys; int num = 0; int[] array = new int[keys.Count]; foreach (int item in keys) { array[num] = item; num++; } int[] keys2 = array; Dictionary.ValueCollection values = Manager.heatDifficulty.Values; int num2 = 0; float[] array2 = new float[values.Count]; foreach (float item2 in values) { array2[num2] = item2; num2++; } float[] values2 = array2; ClientRpcParams rpcParams2 = new ClientRpcParams { Send = new ClientRpcSendParams { TargetClientIds = new ulong[1] { senderClientId } } }; SyncHeatMapClientRpc(keys2, values2, rpcParams2); } [ClientRpc] public void SyncHeatMapClientRpc(int[] keys, float[] values, ClientRpcParams rpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_00fd: 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)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(408349863u, rpcParams, (RpcDelivery)0); bool flag = keys != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(keys, default(ForPrimitives)); } bool flag2 = values != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val)).WriteValueSafe(values, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 408349863u, rpcParams, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Manager.heatDifficulty.Clear(); for (int i = 0; i < keys.Length; i++) { Log.LogInfo("Got heat for level ID " + keys[i] + ": " + values[i]); Manager.heatDifficulty.Add(keys[i], values[i]); } Log.LogInfo("Got data from the host"); } } [ServerRpc(RequireOwnership = false)] public void SetMetalSwitchNetServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(158049313u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 158049313u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetMetalSwitchNetClientRpc(active); } } } [ClientRpc] public void SetMetalSwitchNetClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3615018900u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3615018900u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; MetalSwitch.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void SetKidnapperFoxNetServerRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1975040828u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1975040828u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetKidnapperFoxNetClientRpc(active); } } } [ClientRpc] public void SetKidnapperFoxNetClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3932409819u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3932409819u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; KidnapperFox.Active = active; } } } [ClientRpc] public void SetEntranceClientRpc(bool active) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3843484901u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3843484901u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LockedEntrance.Active = active; } } } [ServerRpc(RequireOwnership = false)] public void LightsOffServerRpc() { //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(821412973u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 821412973u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LightsOffClientRpc(); } } } [ClientRpc] public void LightsOffClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1327168622u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1327168622u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; GameObject hangarShip = Assets.hangarShip; if ((Object)(object)hangarShip == (Object)null) { return; } GameObject gameObject = ((Component)hangarShip.transform.Find("ShipElectricLights")).gameObject; if (!((Object)(object)gameObject == (Object)null)) { Transform obj = gameObject.transform.Find("Area Light (3)"); GameObject val3 = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val3 != (Object)null) { val3.SetActive(false); } Transform obj2 = gameObject.transform.Find("Area Light (4)"); GameObject val4 = ((obj2 != null) ? ((Component)obj2).gameObject : null); if ((Object)(object)val4 != (Object)null) { val4.SetActive(false); } Transform obj3 = gameObject.transform.Find("Area Light (5)"); GameObject val5 = ((obj3 != null) ? ((Component)obj3).gameObject : null); if ((Object)(object)val5 != (Object)null) { val5.SetActive(false); } Transform obj4 = gameObject.transform.Find("Area Light (7)"); GameObject val6 = ((obj4 != null) ? ((Component)obj4).gameObject : null); if ((Object)(object)val6 != (Object)null) { val6.SetActive(false); } Transform obj5 = gameObject.transform.Find("Area Light (8)"); GameObject val7 = ((obj5 != null) ? ((Component)obj5).gameObject : null); if ((Object)(object)val7 != (Object)null) { val7.SetActive(false); } Transform obj6 = gameObject.transform.Find("Area Light (9)"); GameObject val8 = ((obj6 != null) ? ((Component)obj6).gameObject : null); if ((Object)(object)val8 != (Object)null) { val8.SetActive(false); } } } [ServerRpc(RequireOwnership = false)] public void LightsOnServerRpc() { //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(3721949995u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3721949995u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LightsOnClientRpc(); } } } [ClientRpc] public void LightsOnClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1497412850u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1497412850u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; GameObject hangarShip = Assets.hangarShip; if ((Object)(object)hangarShip == (Object)null) { return; } GameObject gameObject = ((Component)hangarShip.transform.Find("ShipElectricLights")).gameObject; if (!((Object)(object)gameObject == (Object)null)) { Transform obj = gameObject.transform.Find("Area Light (3)"); GameObject val3 = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val3 != (Object)null) { val3.SetActive(true); } Transform obj2 = gameObject.transform.Find("Area Light (4)"); GameObject val4 = ((obj2 != null) ? ((Component)obj2).gameObject : null); if ((Object)(object)val4 != (Object)null) { val4.SetActive(true); } Transform obj3 = gameObject.transform.Find("Area Light (5)"); GameObject val5 = ((obj3 != null) ? ((Component)obj3).gameObject : null); if ((Object)(object)val5 != (Object)null) { val5.SetActive(true); } Transform obj4 = gameObject.transform.Find("Area Light (7)"); GameObject val6 = ((obj4 != null) ? ((Component)obj4).gameObject : null); if ((Object)(object)val6 != (Object)null) { val6.SetActive(true); } Transform obj5 = gameObject.transform.Find("Area Light (8)"); GameObject val7 = ((obj5 != null) ? ((Component)obj5).gameObject : null); if ((Object)(object)val7 != (Object)null) { val7.SetActive(true); } Transform obj6 = gameObject.transform.Find("Area Light (9)"); GameObject val8 = ((obj6 != null) ? ((Component)obj6).gameObject : null); if ((Object)(object)val8 != (Object)null) { val8.SetActive(true); } } } [ServerRpc(RequireOwnership = false)] public void TeleportPlayerServerRPC(NetworkObjectReference obj, Vector3 pos) { //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_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_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) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) 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(2791130155u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2791130155u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayerClientRPC(obj, pos); } } } [ClientRpc] public void TeleportPlayerClientRPC(NetworkObjectReference obj, Vector3 pos) { //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_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_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) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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(1317211983u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1317211983u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = null; ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 == (Object)null) { Log.LogError("NetworkObject in TeleportPlayerClientRpc() is null."); return; } PlayerControllerB component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { component.isInElevator = false; component.isInHangarShipRoom = false; component.isInsideFactory = true; component.averageVelocity = 0f; component.velocityLastFrame = Vector3.zero; component.TeleportPlayer(pos, false, 0f, false, true); component.beamOutParticle.Play(); AudioReverbPresets val4 = Object.FindObjectOfType(); if ((Object)(object)val4 != (Object)null) { val4.audioPresets[2].ChangeAudioReverbForPlayer(component); } } } [HarmonyPostfix] [HarmonyPriority(700)] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void InitalizeServerObject() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if (!((Object)(object)netObject != (Object)null)) { netObject = (GameObject)Assets.bundle.LoadAsset("BrutalCompanyMinus"); netObject.AddComponent(); netObject.AddComponent(); NetworkManager.Singleton.AddNetworkPrefab(netObject); } } [HarmonyPrefix] [HarmonyPriority(700)] [HarmonyPatch(typeof(Terminal), "Start")] private static void SpawnServerObject() { if (Object.FindObjectOfType().IsServer) { GameObject val = Object.Instantiate(netObject); val.GetComponent().Spawn(false); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private static void OnGameEnd() { if (NetworkManager.Singleton.IsServer) { Instance.UpdateCurrentWeatherMultipliersServerRpc(); Instance.SetRecievedServerRpc(state: false); Instance.currentWeatherEffects.Clear(); Instance.outsideObjectsToSpawn.Clear(); } } [ServerRpc(RequireOwnership = false)] public void ResizeHotbarRandomlyServerRpc() { //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(891856511u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 891856511u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ResizeHotbarRandomlyClientRpc(); } } } [ClientRpc] public void ResizeHotbarRandomlyClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2283522242u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2283522242u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Compatibility.HotBarPlusPresent) { HotBarPlusCompat.ResizeHotbarRandomly(); } } } [ServerRpc(RequireOwnership = false)] public void ResizeHotbarRandomlySmallServerRpc() { //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(623290537u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 623290537u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ResizeHotbarRandomlySmallClientRpc(); } } } [ClientRpc] public void ResizeHotbarRandomlySmallClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(278466489u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 278466489u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Compatibility.HotBarPlusPresent) { HotBarPlusCompat.ResizeHotbarRandomlySmall(); } } } [ServerRpc(RequireOwnership = false)] public void ResetHotbarServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1475870770u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1475870770u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Compatibility.HotBarPlusPresent) { ResetHotbarClientRpc(); } } } [ClientRpc] public void ResetHotbarClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2241597322u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2241597322u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (Compatibility.HotBarPlusPresent) { HotBarPlusCompat.ResetHotbar(); } } } [ServerRpc(RequireOwnership = false)] public void SetCruiserOfflineServerRpc() { //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(3063201182u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3063201182u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetCruiserOfflineClientRpc(); } } } [ClientRpc] public void SetCruiserOfflineClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3008204u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3008204u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; try { GameObject cruiser = Assets.cruiser; if ((Object)(object)cruiser != (Object)null) { Log.LogInfo("Cruiser found, attempting to set ignition off."); try { VehicleController component = Assets.cruiser.GetComponent(); component.SetIgnition(false); return; } catch (Exception ex) { Log.LogError("Error setting cruiser ignition " + ex.Message); return; } } } catch (Exception ex2) { Log.LogError("Error finding cruiser or setting ignition " + ex2.Message); } } [ServerRpc(RequireOwnership = false)] public void SyncLeverTooltipServerRpc(string text) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1412564141u, val2, (RpcDelivery)0); bool flag = text != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(text, false); } ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1412564141u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncLeverTooltipClientRpc(text); } } [ClientRpc] public void SyncLeverTooltipClientRpc(string text) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) 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(2182180903u, val2, (RpcDelivery)0); bool flag = text != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(text, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2182180903u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; try { StartMatchLever val3 = Object.FindObjectOfType(); val3.triggerScript.disabledHoverTip = text; } catch (Exception data) { Log.LogError(data); } } protected override void __initializeVariables() { if (currentWeatherMultipliers == null) { throw new Exception("Net.currentWeatherMultipliers cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentWeatherMultipliers).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentWeatherMultipliers, "currentWeatherMultipliers"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)currentWeatherMultipliers); if (outsideObjectsToSpawn == null) { throw new Exception("Net.outsideObjectsToSpawn cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)outsideObjectsToSpawn).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)outsideObjectsToSpawn, "outsideObjectsToSpawn"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)outsideObjectsToSpawn); if (currentWeatherEffects == null) { throw new Exception("Net.currentWeatherEffects cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentWeatherEffects).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentWeatherEffects, "currentWeatherEffects"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)currentWeatherEffects); if (textUI == null) { throw new Exception("Net.textUI cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)textUI).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)textUI, "textUI"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)textUI); if (LeverUnityNet == null) { throw new Exception("Net.LeverUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)LeverUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)LeverUnityNet, "LeverUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)LeverUnityNet); if (WalkiesUnityNet == null) { throw new Exception("Net.WalkiesUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)WalkiesUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)WalkiesUnityNet, "WalkiesUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)WalkiesUnityNet); if (JetpackUnityNet == null) { throw new Exception("Net.JetpackUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)JetpackUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)JetpackUnityNet, "JetpackUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)JetpackUnityNet); if (TerminalUnityNet == null) { throw new Exception("Net.TerminalUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)TerminalUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)TerminalUnityNet, "TerminalUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)TerminalUnityNet); if (TargetingUnityNet == null) { throw new Exception("Net.TargetingUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)TargetingUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)TargetingUnityNet, "TargetingUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)TargetingUnityNet); if (TeleporterUnityNet == null) { throw new Exception("Net.TeleporterUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)TeleporterUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)TeleporterUnityNet, "TeleporterUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)TeleporterUnityNet); if (ItemChargerUnityNet == null) { throw new Exception("Net.ItemChargerUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)ItemChargerUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)ItemChargerUnityNet, "ItemChargerUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)ItemChargerUnityNet); if (CircuitUnityNet == null) { throw new Exception("Net.CircuitUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)CircuitUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)CircuitUnityNet, "CircuitUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)CircuitUnityNet); if (DoorOvUnityNet == null) { throw new Exception("Net.DoorOvUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)DoorOvUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)DoorOvUnityNet, "DoorOvUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)DoorOvUnityNet); if (DoorUnityNet == null) { throw new Exception("Net.DoorUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)DoorUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)DoorUnityNet, "DoorUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)DoorUnityNet); if (CameraUnityNet == null) { throw new Exception("Net.CameraUnityNet cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)CameraUnityNet).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)CameraUnityNet, "CameraUnityNet"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)CameraUnityNet); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Expected O, but got Unknown //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Expected O, but got Unknown //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Expected O, but got Unknown //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Expected O, but got Unknown //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Expected O, but got Unknown //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Expected O, but got Unknown //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Expected O, but got Unknown //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Expected O, but got Unknown //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Expected O, but got Unknown //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Expected O, but got Unknown //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Expected O, but got Unknown //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Expected O, but got Unknown //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Expected O, but got Unknown //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Expected O, but got Unknown //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Expected O, but got Unknown //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Expected O, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_055c: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Expected O, but got Unknown //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Expected O, but got Unknown //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Expected O, but got Unknown //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Expected O, but got Unknown //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Expected O, but got Unknown //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Expected O, but got Unknown //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Expected O, but got Unknown //IL_0649: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Expected O, but got Unknown //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Expected O, but got Unknown //IL_069d: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Expected O, but got Unknown //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Expected O, but got Unknown //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Expected O, but got Unknown //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_071c: Expected O, but got Unknown //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Expected O, but got Unknown //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Expected O, but got Unknown //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Expected O, but got Unknown //IL_077d: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Expected O, but got Unknown //IL_0799: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Expected O, but got Unknown //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Expected O, but got Unknown //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Expected O, but got Unknown //IL_07ed: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Expected O, but got Unknown //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Expected O, but got Unknown //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Expected O, but got Unknown //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0850: Expected O, but got Unknown //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Expected O, but got Unknown //IL_0879: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Expected O, but got Unknown //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Expected O, but got Unknown //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08c0: Expected O, but got Unknown //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Expected O, but got Unknown //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Expected O, but got Unknown //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Expected O, but got Unknown //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Expected O, but got Unknown //IL_093d: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Expected O, but got Unknown //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_0968: Expected O, but got Unknown //IL_0975: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Expected O, but got Unknown //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Expected O, but got Unknown //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Expected O, but got Unknown //IL_09c9: Unknown result type (might be due to invalid IL or missing references) //IL_09d8: Expected O, but got Unknown //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09f4: Expected O, but got Unknown //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0a10: Expected O, but got Unknown //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0a2c: Expected O, but got Unknown //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Expected O, but got Unknown //IL_0a55: Unknown result type (might be due to invalid IL or missing references) //IL_0a64: Expected O, but got Unknown //IL_0a71: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1644092438u, new RpcReceiveHandler(__rpc_handler_1644092438), "GetSyncedTextServerRpc"); ((NetworkBehaviour)this).__registerRpc(1434020377u, new RpcReceiveHandler(__rpc_handler_1434020377), "GetSyncedTextClientRpc"); ((NetworkBehaviour)this).__registerRpc(2319565597u, new RpcReceiveHandler(__rpc_handler_2319565597), "GiveSeedServerRpc"); ((NetworkBehaviour)this).__registerRpc(2006375022u, new RpcReceiveHandler(__rpc_handler_2006375022), "GiveSeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(3809690504u, new RpcReceiveHandler(__rpc_handler_3809690504), "ClearGameObjectsServerRpc"); ((NetworkBehaviour)this).__registerRpc(174694319u, new RpcReceiveHandler(__rpc_handler_174694319), "ClearGameObjectsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2150416984u, new RpcReceiveHandler(__rpc_handler_2150416984), "SyncValuesClientRpc"); ((NetworkBehaviour)this).__registerRpc(875794818u, new RpcReceiveHandler(__rpc_handler_875794818), "SyncScrapValueServerRpc"); ((NetworkBehaviour)this).__registerRpc(268987115u, new RpcReceiveHandler(__rpc_handler_268987115), "SyncScrapValueClientRpc"); ((NetworkBehaviour)this).__registerRpc(2205229909u, new RpcReceiveHandler(__rpc_handler_2205229909), "GenerateAndSyncTerminalCodeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3849078077u, new RpcReceiveHandler(__rpc_handler_3849078077), "GenerateAndSyncTerminalCodeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2208211795u, new RpcReceiveHandler(__rpc_handler_2208211795), "MoveTimeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3436861046u, new RpcReceiveHandler(__rpc_handler_3436861046), "MoveTimeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2853396074u, new RpcReceiveHandler(__rpc_handler_2853396074), "SetTimeMultiplierServerRpc"); ((NetworkBehaviour)this).__registerRpc(512763078u, new RpcReceiveHandler(__rpc_handler_512763078), "SetTimeMultiplierClientRpc"); ((NetworkBehaviour)this).__registerRpc(1744607847u, new RpcReceiveHandler(__rpc_handler_1744607847), "ShowCaseEventsClientRpc"); ((NetworkBehaviour)this).__registerRpc(1335262659u, new RpcReceiveHandler(__rpc_handler_1335262659), "InitalizeCurrentWeatherMultipliersServerRpc"); ((NetworkBehaviour)this).__registerRpc(466041418u, new RpcReceiveHandler(__rpc_handler_466041418), "UpdateCurrentWeatherMultipliersServerRpc"); ((NetworkBehaviour)this).__registerRpc(1853859009u, new RpcReceiveHandler(__rpc_handler_1853859009), "SetRecievedServerRpc"); ((NetworkBehaviour)this).__registerRpc(603622741u, new RpcReceiveHandler(__rpc_handler_603622741), "SetRecievedClientRpc"); ((NetworkBehaviour)this).__registerRpc(4203994123u, new RpcReceiveHandler(__rpc_handler_4203994123), "SetRealityShiftActiveServerRpc"); ((NetworkBehaviour)this).__registerRpc(2568149201u, new RpcReceiveHandler(__rpc_handler_2568149201), "SetRealityShiftActiveClientRpc"); ((NetworkBehaviour)this).__registerRpc(1050877662u, new RpcReceiveHandler(__rpc_handler_1050877662), "SetAllWeatherActiveServerRpc"); ((NetworkBehaviour)this).__registerRpc(1627891447u, new RpcReceiveHandler(__rpc_handler_1627891447), "SetAllWeatherActiveClientRpc"); ((NetworkBehaviour)this).__registerRpc(2405040997u, new RpcReceiveHandler(__rpc_handler_2405040997), "SetEventActiveServerRPC"); ((NetworkBehaviour)this).__registerRpc(1527620954u, new RpcReceiveHandler(__rpc_handler_1527620954), "SetEventActiveClientRPC"); ((NetworkBehaviour)this).__registerRpc(3368901509u, new RpcReceiveHandler(__rpc_handler_3368901509), "MessWithLightsServerRpc"); ((NetworkBehaviour)this).__registerRpc(2808903510u, new RpcReceiveHandler(__rpc_handler_2808903510), "MessWithLightsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3941924814u, new RpcReceiveHandler(__rpc_handler_3941924814), "MessWithBreakerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3457555438u, new RpcReceiveHandler(__rpc_handler_3457555438), "MessWithBreakerClientRpc"); ((NetworkBehaviour)this).__registerRpc(2842285472u, new RpcReceiveHandler(__rpc_handler_2842285472), "MessWithDoorsServerRpc"); ((NetworkBehaviour)this).__registerRpc(1683303265u, new RpcReceiveHandler(__rpc_handler_1683303265), "MessWithDoorsClientRpc"); ((NetworkBehaviour)this).__registerRpc(1559123307u, new RpcReceiveHandler(__rpc_handler_1559123307), "UnlockAndOpenAllDoorsServerRpc"); ((NetworkBehaviour)this).__registerRpc(969155834u, new RpcReceiveHandler(__rpc_handler_969155834), "UnlockAndOpenAllDoorsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2551708642u, new RpcReceiveHandler(__rpc_handler_2551708642), "LockAndCloseAllDoorsServerRpc"); ((NetworkBehaviour)this).__registerRpc(3849447749u, new RpcReceiveHandler(__rpc_handler_3849447749), "LockAndCloseAllDoorsClientRpc"); ((NetworkBehaviour)this).__registerRpc(4214836272u, new RpcReceiveHandler(__rpc_handler_4214836272), "SpawnTipServerRpc"); ((NetworkBehaviour)this).__registerRpc(2034080072u, new RpcReceiveHandler(__rpc_handler_2034080072), "SpawnTipClientRpc"); ((NetworkBehaviour)this).__registerRpc(3079998733u, new RpcReceiveHandler(__rpc_handler_3079998733), "SpawnMudPilesOutsideServerRpc"); ((NetworkBehaviour)this).__registerRpc(1000423920u, new RpcReceiveHandler(__rpc_handler_1000423920), "SpawnMudPilesOutsideClientRpc"); ((NetworkBehaviour)this).__registerRpc(234264786u, new RpcReceiveHandler(__rpc_handler_234264786), "TeleportEnemyServerRpc"); ((NetworkBehaviour)this).__registerRpc(1650168377u, new RpcReceiveHandler(__rpc_handler_1650168377), "TeleportEnemyClientRpc"); ((NetworkBehaviour)this).__registerRpc(3701680339u, new RpcReceiveHandler(__rpc_handler_3701680339), "SpawnAllWeatherServerRpc"); ((NetworkBehaviour)this).__registerRpc(910007267u, new RpcReceiveHandler(__rpc_handler_910007267), "SpawnAllWeatherClientRpc"); ((NetworkBehaviour)this).__registerRpc(716805725u, new RpcReceiveHandler(__rpc_handler_716805725), "ShiftServerRpc"); ((NetworkBehaviour)this).__registerRpc(4160371367u, new RpcReceiveHandler(__rpc_handler_4160371367), "AddObjectToGrabToListClientRpc"); ((NetworkBehaviour)this).__registerRpc(3192420881u, new RpcReceiveHandler(__rpc_handler_3192420881), "GenerateShiftableObjectsListServerRpc"); ((NetworkBehaviour)this).__registerRpc(2458116008u, new RpcReceiveHandler(__rpc_handler_2458116008), "GenerateShiftableObjectsListClientRpc"); ((NetworkBehaviour)this).__registerRpc(1685788616u, new RpcReceiveHandler(__rpc_handler_1685788616), "FireAtServerRpc"); ((NetworkBehaviour)this).__registerRpc(2615626191u, new RpcReceiveHandler(__rpc_handler_2615626191), "FireAtClientRpc"); ((NetworkBehaviour)this).__registerRpc(2734280710u, new RpcReceiveHandler(__rpc_handler_2734280710), "DisplayTipServerRpc"); ((NetworkBehaviour)this).__registerRpc(1885137978u, new RpcReceiveHandler(__rpc_handler_1885137978), "DisplayTipClientRpc"); ((NetworkBehaviour)this).__registerRpc(688182791u, new RpcReceiveHandler(__rpc_handler_688182791), "BlackFridayServerRpc"); ((NetworkBehaviour)this).__registerRpc(1034762097u, new RpcReceiveHandler(__rpc_handler_1034762097), "BlackFridayClientRpc"); ((NetworkBehaviour)this).__registerRpc(1342506232u, new RpcReceiveHandler(__rpc_handler_1342506232), "SetPhonesOutServerRpc"); ((NetworkBehaviour)this).__registerRpc(3705199930u, new RpcReceiveHandler(__rpc_handler_3705199930), "SetPhonesOutClientRpc"); ((NetworkBehaviour)this).__registerRpc(2315487481u, new RpcReceiveHandler(__rpc_handler_2315487481), "SetFlashlightsServerRpc"); ((NetworkBehaviour)this).__registerRpc(2901997937u, new RpcReceiveHandler(__rpc_handler_2901997937), "SetFlashlightsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3267883328u, new RpcReceiveHandler(__rpc_handler_3267883328), "SetSlimeServerRpc"); ((NetworkBehaviour)this).__registerRpc(1874889081u, new RpcReceiveHandler(__rpc_handler_1874889081), "SetSlimeClientRpc"); ((NetworkBehaviour)this).__registerRpc(3551728206u, new RpcReceiveHandler(__rpc_handler_3551728206), "SetSlimeSlipperyServerRpc"); ((NetworkBehaviour)this).__registerRpc(3810768433u, new RpcReceiveHandler(__rpc_handler_3810768433), "SetSlimeSlipperyClientRpc"); ((NetworkBehaviour)this).__registerRpc(550970534u, new RpcReceiveHandler(__rpc_handler_550970534), "SetEntranceServerRpc"); ((NetworkBehaviour)this).__registerRpc(3299014331u, new RpcReceiveHandler(__rpc_handler_3299014331), "SetMetalOffNetServerRpc"); ((NetworkBehaviour)this).__registerRpc(3060036059u, new RpcReceiveHandler(__rpc_handler_3060036059), "SetMetalOffNetClientRpc"); ((NetworkBehaviour)this).__registerRpc(2499070959u, new RpcReceiveHandler(__rpc_handler_2499070959), "SetMetalOnNetServerRpc"); ((NetworkBehaviour)this).__registerRpc(2443911055u, new RpcReceiveHandler(__rpc_handler_2443911055), "SetMetalOnNetClientRpc"); ((NetworkBehaviour)this).__registerRpc(3964987524u, new RpcReceiveHandler(__rpc_handler_3964987524), "CruiserFailureServerRpc"); ((NetworkBehaviour)this).__registerRpc(1138105266u, new RpcReceiveHandler(__rpc_handler_1138105266), "CruiserFailureClientRpc"); ((NetworkBehaviour)this).__registerRpc(754265033u, new RpcReceiveHandler(__rpc_handler_754265033), "SetMoldServerRpc"); ((NetworkBehaviour)this).__registerRpc(3513712149u, new RpcReceiveHandler(__rpc_handler_3513712149), "SetMoldClientRpc"); ((NetworkBehaviour)this).__registerRpc(2473314841u, new RpcReceiveHandler(__rpc_handler_2473314841), "SaveOriginalMoldPreviousDataServerRpc"); ((NetworkBehaviour)this).__registerRpc(1026406775u, new RpcReceiveHandler(__rpc_handler_1026406775), "SaveOriginalMoldPreviousDataClientRpc"); ((NetworkBehaviour)this).__registerRpc(2084493939u, new RpcReceiveHandler(__rpc_handler_2084493939), "SyncHeatMapServerRpc"); ((NetworkBehaviour)this).__registerRpc(408349863u, new RpcReceiveHandler(__rpc_handler_408349863), "SyncHeatMapClientRpc"); ((NetworkBehaviour)this).__registerRpc(158049313u, new RpcReceiveHandler(__rpc_handler_158049313), "SetMetalSwitchNetServerRpc"); ((NetworkBehaviour)this).__registerRpc(3615018900u, new RpcReceiveHandler(__rpc_handler_3615018900), "SetMetalSwitchNetClientRpc"); ((NetworkBehaviour)this).__registerRpc(1975040828u, new RpcReceiveHandler(__rpc_handler_1975040828), "SetKidnapperFoxNetServerRpc"); ((NetworkBehaviour)this).__registerRpc(3932409819u, new RpcReceiveHandler(__rpc_handler_3932409819), "SetKidnapperFoxNetClientRpc"); ((NetworkBehaviour)this).__registerRpc(3843484901u, new RpcReceiveHandler(__rpc_handler_3843484901), "SetEntranceClientRpc"); ((NetworkBehaviour)this).__registerRpc(821412973u, new RpcReceiveHandler(__rpc_handler_821412973), "LightsOffServerRpc"); ((NetworkBehaviour)this).__registerRpc(1327168622u, new RpcReceiveHandler(__rpc_handler_1327168622), "LightsOffClientRpc"); ((NetworkBehaviour)this).__registerRpc(3721949995u, new RpcReceiveHandler(__rpc_handler_3721949995), "LightsOnServerRpc"); ((NetworkBehaviour)this).__registerRpc(1497412850u, new RpcReceiveHandler(__rpc_handler_1497412850), "LightsOnClientRpc"); ((NetworkBehaviour)this).__registerRpc(2791130155u, new RpcReceiveHandler(__rpc_handler_2791130155), "TeleportPlayerServerRPC"); ((NetworkBehaviour)this).__registerRpc(1317211983u, new RpcReceiveHandler(__rpc_handler_1317211983), "TeleportPlayerClientRPC"); ((NetworkBehaviour)this).__registerRpc(891856511u, new RpcReceiveHandler(__rpc_handler_891856511), "ResizeHotbarRandomlyServerRpc"); ((NetworkBehaviour)this).__registerRpc(2283522242u, new RpcReceiveHandler(__rpc_handler_2283522242), "ResizeHotbarRandomlyClientRpc"); ((NetworkBehaviour)this).__registerRpc(623290537u, new RpcReceiveHandler(__rpc_handler_623290537), "ResizeHotbarRandomlySmallServerRpc"); ((NetworkBehaviour)this).__registerRpc(278466489u, new RpcReceiveHandler(__rpc_handler_278466489), "ResizeHotbarRandomlySmallClientRpc"); ((NetworkBehaviour)this).__registerRpc(1475870770u, new RpcReceiveHandler(__rpc_handler_1475870770), "ResetHotbarServerRpc"); ((NetworkBehaviour)this).__registerRpc(2241597322u, new RpcReceiveHandler(__rpc_handler_2241597322), "ResetHotbarClientRpc"); ((NetworkBehaviour)this).__registerRpc(3063201182u, new RpcReceiveHandler(__rpc_handler_3063201182), "SetCruiserOfflineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3008204u, new RpcReceiveHandler(__rpc_handler_3008204), "SetCruiserOfflineClientRpc"); ((NetworkBehaviour)this).__registerRpc(1412564141u, new RpcReceiveHandler(__rpc_handler_1412564141), "SyncLeverTooltipServerRpc"); ((NetworkBehaviour)this).__registerRpc(2182180903u, new RpcReceiveHandler(__rpc_handler_2182180903), "SyncLeverTooltipClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1644092438(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; ((Net)(object)target).GetSyncedTextServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1434020377(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) { FixedString4096Bytes val = default(FixedString4096Bytes); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val, default(ForFixedStrings)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GetSyncedTextClientRpc(val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2319565597(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; ((Net)(object)target).GiveSeedServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2006375022(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GiveSeedClientRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3809690504(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; ((Net)(object)target).ClearGameObjectsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_174694319(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; ((Net)(object)target).ClearGameObjectsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2150416984(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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float factorySizeMultiplier = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref factorySizeMultiplier, default(ForPrimitives)); float scrapValueMultiplier = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scrapValueMultiplier, default(ForPrimitives)); float scrapAmountMultiplier = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scrapAmountMultiplier, default(ForPrimitives)); int bonusMaxHp = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref bonusMaxHp); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncValuesClientRpc(factorySizeMultiplier, scrapValueMultiplier, scrapAmountMultiplier, bonusMaxHp); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_875794818(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncScrapValueServerRpc(obj, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_268987115(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_003e: 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_005c: 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) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncScrapValueClientRpc(obj, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2205229909(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_003e: 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_005c: 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) { NetworkObjectReference val = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val, default(ForNetworkSerializable)); int code = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref code); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GenerateAndSyncTerminalCodeServerRpc(val, code); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3849078077(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_003e: 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_005c: 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) { NetworkObjectReference val = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val, default(ForNetworkSerializable)); int code = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref code); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GenerateAndSyncTerminalCodeClientRpc(val, code); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2208211795(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 amount = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref amount, default(ForPrimitives)); float speedMultiplier = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref speedMultiplier, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).MoveTimeServerRpc(amount, speedMultiplier); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3436861046(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 amount = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref amount, default(ForPrimitives)); float speedMultiplier = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref speedMultiplier, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).MoveTimeClientRpc(amount, speedMultiplier); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2853396074(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float timeMultiplierServerRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref timeMultiplierServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetTimeMultiplierServerRpc(timeMultiplierServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_512763078(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float timeMultiplierClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref timeMultiplierClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetTimeMultiplierClientRpc(timeMultiplierClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1744607847(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; ((Net)(object)target).ShowCaseEventsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1335262659(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; ((Net)(object)target).InitalizeCurrentWeatherMultipliersServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_466041418(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; ((Net)(object)target).UpdateCurrentWeatherMultipliersServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1853859009(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool recievedServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref recievedServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetRecievedServerRpc(recievedServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_603622741(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool recievedClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref recievedClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetRecievedClientRpc(recievedClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4203994123(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool realityShiftActiveServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref realityShiftActiveServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetRealityShiftActiveServerRpc(realityShiftActiveServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2568149201(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool realityShiftActiveClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref realityShiftActiveClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetRealityShiftActiveClientRpc(realityShiftActiveClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1050877662(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool allWeatherActiveServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref allWeatherActiveServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetAllWeatherActiveServerRpc(allWeatherActiveServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1627891447(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool allWeatherActiveClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref allWeatherActiveClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetAllWeatherActiveClientRpc(allWeatherActiveClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2405040997(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_0067: 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_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string eventName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref eventName, false); } bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetEventActiveServerRPC(eventName, state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1527620954(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_0067: 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_009a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string eventName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref eventName, false); } bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetEventActiveClientRPC(eventName, state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3368901509(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; ((Net)(object)target).MessWithLightsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2808903510(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; ((Net)(object)target).MessWithLightsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3941924814(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).MessWithBreakerServerRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3457555438(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool state = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref state, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).MessWithBreakerClientRpc(state); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2842285472(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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float openCloseChance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref openCloseChance, default(ForPrimitives)); bool messWithLock = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref messWithLock, default(ForPrimitives)); float messWithLockChance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref messWithLockChance, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).MessWithDoorsServerRpc(openCloseChance, messWithLock, messWithLockChance); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1683303265(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_003e: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float openCloseChance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref openCloseChance, default(ForPrimitives)); int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); bool messWithLock = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref messWithLock, default(ForPrimitives)); float messWithLockChance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref messWithLockChance, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).MessWithDoorsClientRpc(openCloseChance, seed, messWithLock, messWithLockChance); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1559123307(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; ((Net)(object)target).UnlockAndOpenAllDoorsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_969155834(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; ((Net)(object)target).UnlockAndOpenAllDoorsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2551708642(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; ((Net)(object)target).LockAndCloseAllDoorsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3849447749(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; ((Net)(object)target).LockAndCloseAllDoorsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4214836272(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_0067: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string title = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref title, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string message = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false); } bool isWarning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isWarning, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SpawnTipServerRpc(title, message, isWarning); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2034080072(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_0067: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string title = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref title, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string message = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref message, false); } bool isWarning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isWarning, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SpawnTipClientRpc(title, message, isWarning); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3079998733(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int amount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref amount); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SpawnMudPilesOutsideServerRpc(amount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1000423920(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SpawnMudPilesOutsideClientRpc(position, seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_234264786(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemy = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemy, default(ForNetworkSerializable)); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).TeleportEnemyServerRpc(enemy, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1650168377(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemy = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemy, default(ForNetworkSerializable)); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).TeleportEnemyClientRpc(enemy, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3701680339(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SpawnAllWeatherServerRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_910007267(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SpawnAllWeatherClientRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_716805725(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 networkObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref networkObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).ShiftServerRpc(networkObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4160371367(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 obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).AddObjectToGrabToListClientRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3192420881(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] spawnedScrap = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnedScrap, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GenerateShiftableObjectsListServerRpc(spawnedScrap); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2458116008(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_006e: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] spawnedScrap = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnedScrap, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GenerateShiftableObjectsListClientRpc(spawnedScrap); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1685788616(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 at = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref at); Vector3 val = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).FireAtServerRpc(at, val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2615626191(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 at = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref at); Vector3 val = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).FireAtClientRpc(at, val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2734280710(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_0067: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string headerText = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref headerText, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string bodyText = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref bodyText, false); } bool isWarning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isWarning, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).DisplayTipServerRpc(headerText, bodyText, isWarning); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1885137978(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_0067: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string headerText = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref headerText, false); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); string bodyText = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref bodyText, false); } bool isWarning = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isWarning, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).DisplayTipClientRpc(headerText, bodyText, isWarning); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_688182791(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int minPercentageCut = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref minPercentageCut); int maxPercentageCut = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref maxPercentageCut); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).BlackFridayServerRpc(minPercentageCut, maxPercentageCut); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1034762097(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int minPercentageCut = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref minPercentageCut); int maxPercentageCut = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref maxPercentageCut); int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).BlackFridayClientRpc(minPercentageCut, maxPercentageCut, seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1342506232(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool phonesOutServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref phonesOutServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetPhonesOutServerRpc(phonesOutServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3705199930(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool phonesOutClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref phonesOutClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetPhonesOutClientRpc(phonesOutClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2315487481(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flashlightsServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flashlightsServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetFlashlightsServerRpc(flashlightsServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2901997937(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flashlightsClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flashlightsClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetFlashlightsClientRpc(flashlightsClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3267883328(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool slimeServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref slimeServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetSlimeServerRpc(slimeServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1874889081(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool slimeClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref slimeClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetSlimeClientRpc(slimeClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3551728206(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float slimeSlipperyServerRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref slimeSlipperyServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetSlimeSlipperyServerRpc(slimeSlipperyServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3810768433(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float slimeSlipperyClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref slimeSlipperyClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetSlimeSlipperyClientRpc(slimeSlipperyClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_550970534(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool entranceServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref entranceServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetEntranceServerRpc(entranceServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3299014331(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool metalOffNetServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref metalOffNetServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMetalOffNetServerRpc(metalOffNetServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3060036059(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool metalOffNetClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref metalOffNetClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMetalOffNetClientRpc(metalOffNetClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2499070959(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool metalOnNetServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref metalOnNetServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMetalOnNetServerRpc(metalOnNetServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2443911055(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool metalOnNetClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref metalOnNetClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMetalOnNetClientRpc(metalOnNetClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3964987524(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool active = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref active, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).CruiserFailureServerRpc(active); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1138105266(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool active = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref active, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).CruiserFailureClientRpc(active); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_754265033(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_003e: 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) { bool canSpawnMold = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref canSpawnMold, default(ForPrimitives)); int iterations = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref iterations); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMoldServerRpc(canSpawnMold, iterations); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3513712149(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_003e: 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) { bool canSpawnMold = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref canSpawnMold, default(ForPrimitives)); int iterations = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref iterations); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMoldClientRpc(canSpawnMold, iterations); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2473314841(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; ((Net)(object)target).SaveOriginalMoldPreviousDataServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1026406775(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; ((Net)(object)target).SaveOriginalMoldPreviousDataClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2084493939(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ServerRpcParams server = rpcParams.Server; target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncHeatMapServerRpc(server); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_408349863(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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] keys = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref keys, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); float[] values = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref values, default(ForPrimitives)); } ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncHeatMapClientRpc(keys, values, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_158049313(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool metalSwitchNetServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref metalSwitchNetServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMetalSwitchNetServerRpc(metalSwitchNetServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3615018900(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool metalSwitchNetClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref metalSwitchNetClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetMetalSwitchNetClientRpc(metalSwitchNetClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1975040828(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool kidnapperFoxNetServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref kidnapperFoxNetServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetKidnapperFoxNetServerRpc(kidnapperFoxNetServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3932409819(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool kidnapperFoxNetClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref kidnapperFoxNetClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetKidnapperFoxNetClientRpc(kidnapperFoxNetClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3843484901(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool entranceClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref entranceClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetEntranceClientRpc(entranceClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_821412973(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; ((Net)(object)target).LightsOffServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1327168622(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; ((Net)(object)target).LightsOffClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3721949995(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; ((Net)(object)target).LightsOnServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1497412850(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; ((Net)(object)target).LightsOnClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2791130155(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).TeleportPlayerServerRPC(obj, pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1317211983(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).TeleportPlayerClientRPC(obj, pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_891856511(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; ((Net)(object)target).ResizeHotbarRandomlyServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2283522242(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; ((Net)(object)target).ResizeHotbarRandomlyClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_623290537(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; ((Net)(object)target).ResizeHotbarRandomlySmallServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_278466489(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; ((Net)(object)target).ResizeHotbarRandomlySmallClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1475870770(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; ((Net)(object)target).ResetHotbarServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2241597322(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; ((Net)(object)target).ResetHotbarClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3063201182(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; ((Net)(object)target).SetCruiserOfflineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3008204(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; ((Net)(object)target).SetCruiserOfflineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1412564141(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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string text = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncLeverTooltipServerRpc(text); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2182180903(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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string text = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SyncLeverTooltipClientRpc(text); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Net"; } } [HarmonyPatch] public class UI : MonoBehaviour { public GameObject panelBackground; public GameObject upArrowPanel; public GameObject downArrowPanel; public TextMeshProUGUI panelText; public TextMeshProUGUI letter; public TextMeshProUGUI upArrow; public TextMeshProUGUI downArrow; public Scrollbar panelScrollBar; public string key = "K"; public KeyControl keyControl; public KeyControl upKeyControl; public KeyControl downKeyControl; public bool showCaseEvents = false; public float showCaseEventTime = 45f; public float curretShowCaseEventTime = 0f; public bool keyPressEnabledTyping = true; public bool keyPressEnabledTerminal = true; public bool keyPressEnabledSettings = true; public Keyboard keyboard; public static bool canClearText = true; public static string colorHex = "00A000"; public static float uiColorReduction = 0.6275f; public static Color letterColor = new Color(0f, 0.6275f, 0f); public static int hexColor = 40960; public static string colorArrowHex = "00A000"; public static Color arrowColor = new Color(0f, 0.6275f, 0f); public static float arrowColorActive = 1.59375f; public static int hexArrowColor = 40960; public static string colorTextHex = "00FF00"; public static UI Instance { get; private set; } public static GameObject eventUIObject { get; set; } public static string getColorInsane => Configuration.GetString(Configuration.colorInsane, "8B008B"); public static string getColorVeryBad => Configuration.GetString(Configuration.colorVeryBad, "800000"); public static string getColorBad => Configuration.GetString(Configuration.colorBad, "FF0000"); public static string getColorNeutral => Configuration.GetString(Configuration.colorNeutral, "FFFFFF"); public static string getColorGood => Configuration.GetString(Configuration.colorGood, "008000"); public static string getColorVeryGood => Configuration.GetString(Configuration.colorVeryGood, "00FF00"); public static string getColorRare => Configuration.GetString(Configuration.colorRare, "00FFFF"); public static string getColorRemove => Configuration.GetString(Configuration.colorRemove, "008000"); public unsafe void Start() { //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08e0: Unknown result type (might be due to invalid IL or missing references) //IL_09fc: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Unknown result type (might be due to invalid IL or missing references) //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_09a4: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09ba: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09c9: Unknown result type (might be due to invalid IL or missing references) //IL_09d1: Unknown result type (might be due to invalid IL or missing references) //IL_0a57: Unknown result type (might be due to invalid IL or missing references) //IL_0a63: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Unknown result type (might be due to invalid IL or missing references) //IL_0a8b: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0aa3: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Unknown result type (might be due to invalid IL or missing references) //IL_0acc: Unknown result type (might be due to invalid IL or missing references) //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0ada: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_0861: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_0892: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08a8: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0503: 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) Instance = this; showCaseEventTime = Configuration.UITime.Value; NetworkVariable textUI = Net.Instance.textUI; textUI.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)textUI.OnValueChanged, (Delegate?)(object)(OnValueChangedDelegate)delegate(FixedString4096Bytes previous, FixedString4096Bytes current) { ((TMP_Text)panelText).text = ((object)(*(FixedString4096Bytes*)(¤t))/*cast due to .constrained prefix*/).ToString(); }); try { colorTextHex = Configuration.colorText.Value.Replace("#", ""); } catch { Log.LogWarning("Failed to get text color configuration, using default color."); } Component[] componentsInChildren = eventUIObject.GetComponentsInChildren(true); Component[] array = componentsInChildren; foreach (Component val in array) { try { switch (((Object)val).name) { case "EventPanel": if ((Object)(object)panelBackground == (Object)null) { panelBackground = val.gameObject; } break; case "EventText": if ((Object)(object)panelText == (Object)null) { panelText = val.GetComponent(); } break; case "Letter": if (!((Object)(object)letter == (Object)null)) { break; } letter = val.GetComponent(); key = Configuration.UIKey.Value.ToUpper(); try { colorHex = Configuration.color.Value; uiColorReduction = Mathf.Max(Configuration.uiColorReduction.Value, 0f); try { hexColor = Convert.ToInt32(colorHex.Replace("#", ""), 16); letterColor = new Color((float)((hexColor >> 16) & 0xFF) / 255f * uiColorReduction, (float)((hexColor >> 8) & 0xFF) / 255f * uiColorReduction, (float)(hexColor & 0xFF) / 255f * uiColorReduction); ((Graphic)letter).color = letterColor; Log.LogDebug("Set UI letter color to: " + colorHex); } catch { ((Graphic)letter).color = new Color(0f, 0.6275f, 0f); Log.LogWarning("Failed to parse color hex string, using default color."); } } catch { ((Graphic)letter).color = new Color(0f, 0.6275f, 0f); Log.LogWarning("Failed to get color configurations correctly, using default color."); } ((TMP_Text)letter).text = key; break; case "LetterPanel": if (!Configuration.ShowUILetterBox.Value || !Configuration.EnableUI.Value) { val.gameObject.SetActive(false); } break; case "Scrollbar": if ((Object)(object)panelScrollBar == (Object)null) { panelScrollBar = val.GetComponent(); } break; case "UpArrowPannel": if ((Object)(object)upArrowPanel == (Object)null) { upArrowPanel = val.gameObject; } break; case "DownArrowPanel": if ((Object)(object)downArrowPanel == (Object)null) { downArrowPanel = val.gameObject; } break; case "UpArrow": if ((Object)(object)upArrow == (Object)null) { upArrow = val.GetComponent(); } try { colorArrowHex = Configuration.colorArrows.Value; arrowColorActive = Configuration.colorArrowsIncrease.Value; try { hexArrowColor = Convert.ToInt32(colorArrowHex.Replace("#", ""), 16); arrowColor = new Color((float)((hexArrowColor >> 16) & 0xFF) / 255f, (float)((hexArrowColor >> 8) & 0xFF) / 255f, (float)(hexArrowColor & 0xFF) / 255f); ((Graphic)upArrow).color = arrowColor; Log.LogDebug("Set UI Up Arrow color to: " + colorArrowHex); } catch { ((Graphic)upArrow).color = new Color(0f, 0.6275f, 0f); Log.LogWarning("Failed to parse color hex string, using default color."); } } catch { Log.LogWarning("Failed to get arrow color configuration, using default color."); } break; case "DownArrow": if ((Object)(object)downArrow == (Object)null) { downArrow = val.GetComponent(); } try { colorArrowHex = Configuration.colorArrows.Value; arrowColorActive = Mathf.Max(Configuration.colorArrowsIncrease.Value, 0f); try { hexArrowColor = Convert.ToInt32(colorArrowHex.Replace("#", ""), 16); arrowColor = new Color((float)((hexArrowColor >> 16) & 0xFF) / 255f, (float)((hexArrowColor >> 8) & 0xFF) / 255f, (float)(hexArrowColor & 0xFF) / 255f); ((Graphic)downArrow).color = arrowColor; Log.LogDebug("Set UI Down Arrow color to: " + colorArrowHex); } catch { ((Graphic)downArrow).color = new Color(0f, 0.6275f, 0f); Log.LogWarning("Failed to parse color hex string, using default color."); } } catch { Log.LogWarning("Failed to get arrow color configuration, using default color."); } break; } } catch { Log.LogError("Failed to capture EventUI component/s."); } } keyboard = Keyboard.current; if (keyboard != null && Configuration.EnableUI.Value) { keyControl = keyboard.FindKeyOnCurrentKeyboardLayout(key); if (keyControl == null) { try { string text = "/" + key.ToLower(); ref KeyControl reference = ref keyControl; InputControl obj9 = InputSystem.FindControl(text); reference = (KeyControl)(object)((obj9 is KeyControl) ? obj9 : null); } catch { Log.LogError("Failed to find key '" + key + "'. Input will be turned off for the main key."); return; } } downKeyControl = keyboard.downArrowKey; upKeyControl = keyboard.upArrowKey; keyboard.onTextInput += OnKeyboardInput; } ((TMP_Text)panelText).text = ((object)Unsafe.As(ref Manager.textUI)/*cast due to .constrained prefix*/).ToString(); try { Vector3 localScale = panelBackground.transform.localScale; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((Configuration.uiScaleX != null) ? Configuration.uiScaleX.Value : 1f, (Configuration.uiScaleY != null) ? Configuration.uiScaleY.Value : 1f, (Configuration.uiScaleZ != null) ? Configuration.uiScaleZ.Value : 1f); Log.LogMessage($"Got a default scale of {localScale.x}, {localScale.y}, {localScale.z}."); Log.LogMessage($"Modifying by a scale of {val2.x}, {val2.y}, {val2.z}."); panelBackground.transform.localScale = new Vector3(localScale.x * val2.x, localScale.y * val2.y, localScale.z * val2.z); } catch { Log.LogError("Failed to set UI scale from config."); } try { Vector3 localPosition = panelBackground.transform.localPosition; Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor((Configuration.uiPosX != null) ? Configuration.uiPosX.Value : 0f, (Configuration.uiPosY != null) ? Configuration.uiPosY.Value : 0f, (Configuration.uiPosZ != null) ? Configuration.uiPosZ.Value : 0f); Log.LogMessage($"Got a default position of {localPosition.x}, {localPosition.y}, {localPosition.z}."); Log.LogMessage($"Modifying to a position of {val3.x}, {val3.y}, {val3.z}."); panelBackground.transform.localPosition = new Vector3(localPosition.x + val3.x, localPosition.y + val3.y, localPosition.z + val3.z); } catch { Log.LogError("Failed to set UI offset from config."); } try { Vector3 localEulerAngles = panelBackground.transform.localEulerAngles; Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor((Configuration.uiRotX != null) ? Configuration.uiRotX.Value : 0f, (Configuration.uiRotY != null) ? Configuration.uiRotY.Value : 0f, (Configuration.uiRotZ != null) ? Configuration.uiRotZ.Value : 0f); Log.LogMessage($"Got a default position of {localEulerAngles.x}, {localEulerAngles.y}, {localEulerAngles.z}."); Log.LogMessage($"Modifying to a position of {val4.x}, {val4.y}, {val4.z}."); panelBackground.transform.localEulerAngles = new Vector3(val4.x, val4.y, val4.z); } catch { Log.LogError("Failed to set UI offset from config."); } } private void Update() { //IL_015f: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (showCaseEvents) { curretShowCaseEventTime -= Time.deltaTime; if (curretShowCaseEventTime <= showCaseEventTime * 0.6f) { Scrollbar obj = panelScrollBar; obj.value -= 1f / (showCaseEventTime * 0.8f) * Time.deltaTime * 2f; } if (curretShowCaseEventTime < 0f) { panelScrollBar.value = 1f; showCaseEvents = false; TogglePanel(state: false); } } if (!panelBackground.activeSelf || downKeyControl == null || upKeyControl == null) { return; } if (((ButtonControl)downKeyControl).isPressed) { showCaseEvents = false; try { ((Graphic)downArrow).color = new Color((float)((hexArrowColor >> 16) & 0xFF) / 255f * arrowColorActive, (float)((hexArrowColor >> 8) & 0xFF) / 255f * arrowColorActive, (float)(hexArrowColor & 0xFF) / 255f * arrowColorActive); } catch { ((Graphic)downArrow).color = new Color(0f, 1f, 0f); } Scrollbar obj3 = panelScrollBar; obj3.value -= Time.deltaTime * Configuration.scrollSpeed.Value; } else { try { ((Graphic)downArrow).color = new Color((float)((hexArrowColor >> 16) & 0xFF) / 255f, (float)((hexArrowColor >> 8) & 0xFF) / 255f, (float)(hexArrowColor & 0xFF) / 255f); } catch { ((Graphic)downArrow).color = new Color(0f, 0.6f, 0f); } } if (((ButtonControl)upKeyControl).isPressed) { showCaseEvents = false; try { ((Graphic)upArrow).color = new Color((float)((hexArrowColor >> 16) & 0xFF) / 255f * arrowColorActive, (float)((hexArrowColor >> 8) & 0xFF) / 255f * arrowColorActive, (float)(hexArrowColor & 0xFF) / 255f * arrowColorActive); } catch { ((Graphic)upArrow).color = new Color(0f, 1f, 0f); } Scrollbar obj6 = panelScrollBar; obj6.value += Time.deltaTime * Configuration.scrollSpeed.Value; return; } try { ((Graphic)upArrow).color = new Color((float)((hexArrowColor >> 16) & 0xFF) / 255f, (float)((hexArrowColor >> 8) & 0xFF) / 255f, (float)(hexArrowColor & 0xFF) / 255f); } catch { ((Graphic)upArrow).color = new Color(0f, 0.6f, 0f); } } public static void SpawnObject() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)eventUIObject != (Object)null)) { eventUIObject = (GameObject)Assets.bundle.LoadAsset("EventGUI"); eventUIObject.AddComponent(); eventUIObject = Object.Instantiate(eventUIObject, Vector3.zero, Quaternion.identity); } } public static void GenerateText(List events) { //IL_02ab: Unknown result type (might be due to invalid IL or missing references) string text = "
" + Configuration.LocalizationEventTitle.Replace("\\s", " ") + "
"; foreach (string currentEventDescription in EventManager.currentEventDescriptions) { text = text + "-" + currentEventDescription + "
"; } if (Configuration.ShowExtraProperties.Value) { float num = RoundManager.Instance.scrapValueMultiplier * Manager.scrapValueMultiplier; if (Configuration.NormaliseScrapValueDisplay.Value) { num *= 2.5f; } text += GetDifficultyText(); text = text + "

" + Configuration.LocalizationOther.Replace("\\s", " ") + ":"; text = text + string.Format("
-{1}: x{2:F2}", colorTextHex, Configuration.LocalizationScrapValue.Replace("\\s", " "), num) + string.Format("
-{1}: x{2:F2}", colorTextHex, Configuration.LocalizationScrapAmount.Replace("\\s", " "), RoundManager.Instance.scrapAmountMultiplier * Manager.scrapAmountMultiplier) + string.Format("
-{1}: x{2:F2}", colorTextHex, Configuration.LocalizationFactorySize.Replace("\\s", " "), RoundManager.Instance.currentLevel.factorySizeMultiplier) + string.Format("
-{1}: x{2:F2}", colorTextHex, Configuration.LocalizationSpawnChance.Replace("\\s", " "), Manager.spawnChanceMultiplier) + string.Format("
-{1}: x{2:F2}", colorTextHex, Configuration.LocalizationSpawnCap.Replace("\\s", " "), Manager.spawncapMultipler) + "
-" + Configuration.LocalizationBonusEnemyHp.Replace("\\s", " ") + ": " + plusMinus(Manager.bonusEnemyHp) + ""; } Net.Instance.textUI.Value = new FixedString4096Bytes(text); if (Configuration.PopUpUI.Value && Configuration.EnableUI.Value) { Net.Instance.ShowCaseEventsClientRpc(); } } private static string plusMinus(float value) { string text = value.ToString(); if (value >= 0f) { text = "+" + text; } return text; } private static string plusMinusExclusive(float value) { return (value < 0f) ? "" : "+"; } [ServerRpc(RequireOwnership = false)] private static void ClearTextServerRpc() { try { ClearText(); } catch (Exception ex) { Log.LogError("Failed to clear text in main function: " + ex.Message); Log.LogError("Stack trace: " + ex.StackTrace); } } public static void ClearText() { //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) if (Configuration.DisplayExtraPropertiesAfterShipLeaves.Value) { string text = ""; Manager.ComputeDifficultyValues(); if (!Configuration.useCustomWeights.Value) { EventManager.UpdateAllEventWeights(); text = text + "
" + Configuration.LocalizationEventType.Replace("\\s", " ") + ":
-" + Configuration.LocalizationInsane.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[0]) + "
-" + Configuration.LocalizationVeryBad.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[1]) + "
-" + Configuration.LocalizationBad.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[2]) + "
-" + Configuration.LocalizationNeutral.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[3]) + "
-" + Configuration.LocalizationGood.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[4]) + "
-" + Configuration.LocalizationVeryGood.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[5]) + "
-" + Configuration.LocalizationRare.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[6]) + "
-" + Configuration.LocalizationRemove.Replace("\\s", " ") + ": " + Helper.GetPercentage(EventManager.eventTypeRarities[7]) + "
"; } text += GetDifficultyText(); Net.Instance.textUI.Value = new FixedString4096Bytes(text); } else { Net.Instance.textUI.Value = new FixedString4096Bytes(" "); } } private static string GetDifficultyText() { string text = "
" + Configuration.LocalizationDifficultyTitle.Replace("\\s", " ") + ": " + Helper.GetDifficultyText() + string.Format("
-{1} {3:F1}", colorTextHex, Configuration.LocalizationDifficultyAmount.Replace("\\s", " "), Helper.GetDifficultyColorHex(Manager.difficulty, Configuration.difficultyMaxCap.Value), Manager.difficulty); if (Configuration.scaleByDaysPassed.Value) { text += string.Format("
-{1}{3}{4:F1}", colorTextHex, Configuration.LocalizationDay.Replace("\\s", " "), Helper.GetDifficultyColorHex(Manager.daysDifficulty, Configuration.daysPassedDifficultyCap.Value), plusMinusExclusive(Manager.daysDifficulty), Manager.daysDifficulty); } if (Configuration.scaleByQuota.Value) { text += string.Format("
-{1}{3}{4:F1}", colorTextHex, Configuration.LocalizationQuota.Replace("\\s", " "), Helper.GetDifficultyColorHex(Manager.quotaDifficulty, Configuration.quotaDifficultyCap.Value), plusMinusExclusive(Manager.quotaDifficulty), Manager.quotaDifficulty); } if (Configuration.scaleByScrapInShip.Value) { text += string.Format("
-{1}{3}{4:F1}", colorTextHex, Configuration.LocalizationShipScrap.Replace("\\s", " "), Helper.GetDifficultyColorHex(Manager.scrapInShipDifficulty, Configuration.scrapInShipDifficultyCap.Value), plusMinusExclusive(Manager.scrapInShipDifficulty), Manager.scrapInShipDifficulty); } if (Configuration.scaleByMoonGrade.Value) { text += string.Format("
-{1}{3}{4:F1}", colorTextHex, Configuration.LocalizationMoonRisk.Replace("\\s", " "), Helper.GetDifficultyColorHex(Manager.moonGradeDifficulty, Configuration.gradeAdditives["S+++"]), plusMinusExclusive(Manager.moonGradeDifficulty), Manager.moonGradeDifficulty); } if (Configuration.scaleByWeather.Value) { text += string.Format("
-{1}{3}{4:F1}", colorTextHex, Configuration.LocalizationWeather.Replace("\\s", " "), Helper.GetDifficultyColorHex(Manager.weatherDifficulty, 2.1474836E+09f), plusMinusExclusive(Manager.weatherDifficulty), Manager.weatherDifficulty); } if (Configuration.scaleHeat.Value) { text += string.Format("
-{1}{3}{4:F1}", colorTextHex, Configuration.LocalizationHeat.Replace("\\s", " "), Helper.GetDifficultyColorHex(EventManager.currentHeatDifficulty(), Configuration.heatMaxCap.Value), plusMinusExclusive(EventManager.currentHeatDifficulty()), EventManager.currentHeatDifficulty()); } return text; } private IEnumerator WaitForKeyboard() { while (Keyboard.current == null) { yield return null; } keyboard = Keyboard.current; keyControl = keyboard.FindKeyOnCurrentKeyboardLayout(key); keyboard.onTextInput += OnKeyboardInput; } public void OnKeyboardInput(char input) { if (keyboard == null) { return; } bool flag = false; flag = ((keyControl == null) ? (input.ToString().ToUpper() == key.ToUpper()) : ((ButtonControl)keyControl).isPressed); if (flag && keyPressEnabledTyping && keyPressEnabledTerminal && keyPressEnabledSettings) { bool flag2 = !panelBackground.activeSelf; if (!flag2 && showCaseEvents) { showCaseEvents = false; panelScrollBar.value = 1f; } TogglePanel(flag2); } } public void UnsubscribeFromKeyboardEvent() { if (Configuration.EnableUI.Value) { keyboard.onTextInput -= OnKeyboardInput; } } public void TogglePanel(bool state) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if (Configuration.DisplayExtraPropertiesAfterShipLeaves.Value) { FixedString4096Bytes value = Net.Instance.textUI.Value; if (((FixedString4096Bytes)(ref value)).IsEmpty) { ClearTextServerRpc(); } } panelBackground.SetActive(state); upArrowPanel.SetActive(state); downArrowPanel.SetActive(state); try { ((Graphic)letter).color = new Color(state ? ((float)((hexColor >> 16) & 0xFF) / 255f) : ((float)((hexColor >> 16) & 0xFF) / 255f * uiColorReduction), state ? ((float)((hexColor >> 8) & 0xFF) / 255f) : ((float)((hexColor >> 8) & 0xFF) / 255f * uiColorReduction), state ? ((float)(hexColor & 0xFF) / 255f) : ((float)(hexColor & 0xFF) / 255f * uiColorReduction)); } catch { ((Graphic)letter).color = new Color(0f, state ? 1f : 0.6275f, 0f); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "ArriveAtLevel")] [HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")] [HarmonyPatch(typeof(StartOfRound), "EndPlayersFiredSequenceClientRpc")] private static void OnChangeLevel(ref StartOfRound __instance) { if (!NetworkManager.Singleton.IsServer || !canClearText) { return; } try { ClearText(); } catch (Exception) { ((MonoBehaviour)__instance).StartCoroutine(ClearAfterDelay()); } } internal static IEnumerator ClearAfterDelay() { yield return (object)new WaitForSeconds(0.2f); try { ClearText(); } catch (Exception ex) { Exception e = ex; Log.LogError("Encountered an error in the ClearAfterDelay coroutine: " + e.Message); } } [HarmonyPrefix] [HarmonyPriority(800)] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private static void OnShipLeave() { canClearText = true; if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } if (!Configuration.DisplayUIAfterShipLeaves.Value) { ClearText(); return; } if (Configuration.EnableUI.Value) { GenerateText(EventManager.currentEvents); } if (!Configuration.showEventsInChat.Value) { return; } HUDManager.Instance.AddTextToChatOnServer("Events:", -1); foreach (string currentEventDescription in EventManager.currentEventDescriptions) { HUDManager.Instance.AddTextToChatOnServer(currentEventDescription, -1); } } [HarmonyPrefix] [HarmonyPatch(typeof(Terminal), "Update")] private static void OnTerminalUpdate(ref bool ___terminalInUse) { if ((Object)(object)Instance == (Object)null) { return; } try { Instance.keyPressEnabledTerminal = !___terminalInUse; } catch (Exception ex) { Log.LogError("Failed to update keyPressEnabledTerminal: " + ex.Message); } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "Update")] public static void OnPlayerControllerBUpdate(ref QuickMenuManager ___quickMenuManager) { if ((Object)(object)Instance == (Object)null) { return; } try { Instance.keyPressEnabledSettings = !___quickMenuManager.isMenuOpen; } catch (Exception ex) { Log.LogError("Failed to update keyPressEnabledSettings: " + ex.Message); } } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "Update")] public static void OnUpdate(ref PlayerControllerB ___localPlayer) { if ((Object)(object)Instance == (Object)null || (Object)(object)___localPlayer == (Object)null) { return; } try { Instance.keyPressEnabledTyping = !___localPlayer.isTypingChat; } catch (Exception ex) { Log.LogError("Failed to update keyPressEnabledTyping: " + ex.Message); } } } [HarmonyPatch] public class Compatibility { internal static bool yippeeModCompatibilityMode; internal static AudioClip[] yippeeNewSFX; internal static bool lethalEscapePresent; internal static bool lethalThingsPresent; internal static bool diversityPresent; internal static bool scopophobiaPresent; internal static bool shrimpPresent; internal static bool herobrinePresent; internal static bool peepersPresent; internal static bool sirenheadPresent; internal static bool rollinggiantPresent; internal static bool theFiendPresent; internal static bool immortalSnailPresent; internal static bool takeyPlushPresent; internal static bool lockerPresent; internal static bool theGiantSpecimensPresent; internal static bool mimicsPresent; internal static bool footballPresent; internal static bool emergencyDicePresent; internal static bool toilheadPresent; internal static bool goldScrapPresent; internal static bool cullFactoryPresent; internal static bool NonShippingAuthorisationPresent; internal static bool moonsweptPresent; internal static bool shockwaveDronesPresent; internal static bool zombiesPlushPresent; internal static bool takeyGokuPresent; internal static bool takeyGokuEssentialPresent; internal static bool crowdControlPresent; internal static bool officialExternalModulePresent; internal static bool facelessStalekerPresent; internal static bool gokuBrackenPresent; internal static bool moaiEnemyPresent; internal static bool BaldiPresent; internal static bool ShibaPresent; internal static bool SurfacedPresent; internal static bool VarietyPresent; internal static bool CodeRebirthPresent; internal static bool LegendWeathersPresent; internal static bool ShipInventoryPresent; internal static bool SelfSortingStorage; internal static bool SuperEclipsePresent; internal static bool SkullEnemyPresent; internal static bool ManStalkerPresent; internal static bool FoxyPresent; internal static bool PlaytimePresent; internal static bool CrittersPresent; internal static bool FacilityMeltdownPresent; internal static bool NeedyCatsPresent; internal static bool furniturePackPresent; internal static bool yesFoxPresent; internal static bool soulDevPresent; internal static bool lighteaterPresent; internal static bool BiodiversityPresent; internal static bool OoblterraPresent; internal static bool LethalPhonesPresent; internal static bool HotBarPlusPresent; internal static bool KidnapperFoxPresent; internal static bool EndlessElevatorPresent; internal static bool BarberFixesPresent; internal static bool SCP939Present; internal static bool SCP682Present; internal static bool CombinedWeatherToolKitPresent; internal static bool LethalElementsPresent; internal static bool DawnLibPresent; internal static bool ScanVanPresent; internal static bool StarLancereNemyEscapePresent; internal static bool WeatherRegistryPresent; internal static FieldInfo peeperSpawnChance; internal static MethodInfo cullOnTeleportLocalPlayer; internal static MethodInfo cullOnTeleportOtherPlayer; internal static MethodInfo DeafMakerShroom1; [HarmonyPostfix] [HarmonyPatch(typeof(PreInitSceneScript), "Awake")] private static void OnGameLoad() { Assembly assembly = GetAssembly("sunnobunno.YippeeMod"); if (assembly != null) { Log.LogInfo("Found YippeeMod, Will attempt to replace kamikazie bug SFX"); Type type = assembly.GetType("YippeeMod.YippeeModBase"); if (type != null) { FieldInfo field = type.GetField("newSFX", BindingFlags.Static | BindingFlags.NonPublic); if (field != null) { yippeeNewSFX = (AudioClip[])field.GetValue(null); if (yippeeNewSFX != null) { Log.LogInfo("YippeeMod compatibility succeeded."); yippeeModCompatibilityMode = true; } } } } Assembly assembly2 = GetAssembly("x753.Peepers"); if (assembly2 != null) { Log.LogInfo("Found PeepersMod, Will attempt to get spawnChance field."); Type type2 = assembly2.GetType("LCPeeper.Peeper"); if (type2 != null) { peeperSpawnChance = type2.GetField("PeeperSpawnChance", BindingFlags.Static | BindingFlags.Public); if (peeperSpawnChance != null) { Log.LogInfo("Found spawnChance Field, Peepers and NoPeepers event's will now occur"); NoPeepers.oldSpawnChance = (float)peeperSpawnChance.GetValue(null); peepersPresent = true; EventManager.moddedEvents.Add(new Peepers()); EventManager.moddedEvents.Add(new NoPeepers()); } } } Assembly assembly3 = GetAssembly("com.fumiko.CullFactory"); if (assembly3 != null) { Log.LogInfo("Found CullFactory mod, Will attempt to grab OnTeleportOtherPlayerThroughEntrance() and OnTeleportLocalPlayerThroughEntrance() methodInfos"); Type type3 = assembly3.GetType("CullFactory.Extenders.TeleportExtender"); if (type3 != null) { cullOnTeleportLocalPlayer = type3.GetMethod("OnTeleportLocalPlayerThroughEntrance", BindingFlags.Static | BindingFlags.NonPublic); cullOnTeleportOtherPlayer = type3.GetMethod("OnTeleportOtherPlayerThroughEntrance", BindingFlags.Static | BindingFlags.NonPublic); if (cullOnTeleportLocalPlayer != null && cullOnTeleportOtherPlayer != null) { Log.LogInfo("Found OnTeleportOtherPlayerThroughEntrance() and OnTeleportLocalPlayerThroughEntrance() methodInfos, passages are now compatible with cullfactory"); cullFactoryPresent = true; } } } Assembly assembly4 = GetAssembly("zigzag.combinedweatherstoolkit"); if (assembly4 != null) { CustomWeather.RegisterWeathers(); } lethalEscapePresent = IsModPresent("xCeezy.LethalEscape", "Will prevent SafeOutside event from occuring.") || IsModPresent("AudioKnight.StarlancerEnemyEscape", "Will prevent SafeOutside event from occuring"); lethalThingsPresent = IsModPresent("evaisa.lethalthings", "Roomba and TeleporterTraps event will now occur."); diversityPresent = IsModPresent("Chaos.Diversity", "Walker event will now occur."); scopophobiaPresent = IsModPresent("Scopophobia", "Shy Guy and NoShyGuy event will now occur."); shrimpPresent = IsModPresent("Piggy.Shrimp", "Shrimp event will now occur."); herobrinePresent = IsModPresent("Kittenji.HerobrineMod", "Herobrine event will now occur."); sirenheadPresent = IsModPresent("Ccode.SirenHead", "SirenHead event will now occur."); rollinggiantPresent = IsModPresent("nomnomab.rollinggiant", "RollingGiant and NoRollingGiant event will now occur."); theFiendPresent = IsModPresent("com.RuthlessCompany", "TheFiend and NoFiend event will now occur."); immortalSnailPresent = IsModPresent("ImmortalSnail", "ImmortalSnail and NoImmortalSnail event will now occur."); lockerPresent = IsModPresent("com.zealsprince.locker", "Locker and NoLocker event will now occur."); theGiantSpecimensPresent = IsModPresent("TheGiantSpecimens", "GiantShowdown event will now occur."); footballPresent = IsModPresent("Kittenji.FootballEntity", "Football event will now occur."); toilheadPresent = IsModPresent("com.github.zehsteam.ToilHead", "Toilhead event will now occur"); emergencyDicePresent = IsModPresent("Theronguard.EmergencyDice", "BadDice and Dice events will now occur."); goldScrapPresent = IsModPresent("LCGoldScrapMod", "CityOfGold event will now occur"); moonsweptPresent = IsModPresent("MoonsweptTeam.Moonswept", "Cleaner and MobileTurrets events will now occur"); shockwaveDronesPresent = IsModPresent("droneenemy", "Shockwave Drones event will now occur"); facelessStalekerPresent = IsModPresent("sparble.slendermanmod", "SlenderMan event will now occur"); NonShippingAuthorisationPresent = IsModPresent("NonShippingAuthorisation", "Authorisation accepted"); takeyGokuPresent = IsModPresent("com.github.zehsteam.TakeyGokuBracken", "Takey Goku dettected"); takeyGokuEssentialPresent = IsModPresent("Vulf.GokuBracken", "GokuBracken detected, proceeding with TakeyGoku check"); officialExternalModulePresent = IsModPresent("BCME-ExternalModule", "ExternalModule dettected..."); crowdControlPresent = IsModPresent("WarpWorld.CrowdControl", "Warning! CrowdControl dettected, shutting down incompatible events"); moaiEnemyPresent = IsModPresent("MoaiEnemy", "Moai Enemies were detected"); BaldiPresent = IsModPresent("com.riskivr.BaldiEnemy", "Baldi Mod Detected"); FacilityMeltdownPresent = IsModPresent("me.loaforc.facilitymeltdown", "Facility Meltdown Detected"); ShibaPresent = IsModPresent("ReavsStuff.ShibaEnemy", "Shiba Bat Detected"); SurfacedPresent = IsModPresent("Surfaced", "Surfaced Detected"); VarietyPresent = IsModPresent("TestAccount666.TestAccountVariety", "Test Account Variety Detected"); CodeRebirthPresent = IsModPresent("CodeRebirth", "CodeRebirth Detected"); SuperEclipsePresent = IsModPresent("Millie.SuperEclipse", "Super Eclipse Detected"); ManStalkerPresent = IsModPresent("menstalker_yaboiduckisnickerbar", "Man Stalker Detected"); SkullEnemyPresent = IsModPresent("SkullEnemy", "Skull Enemy Detected"); FoxyPresent = IsModPresent("NightmareFoxy", "NightmareFoxy Detected"); PlaytimePresent = IsModPresent("Nuclear_Fox.LethalPlaytime", "Lethal Playtime Detected"); CrittersPresent = IsModPresent("Nuclear_Fox.SmilingCritters", "Critters Present"); NeedyCatsPresent = IsModPresent("Jordo.NeedyCats", "Needy Cats Detected"); ShipInventoryPresent = IsModPresent("org.lethalcompanymodding.shipinventoryupdated", "Ship Inventory Detected. Including in inventory checks"); HotBarPlusPresent = IsModPresent("FlipMods.HotbarPlus", "HotBarPlus Detected."); yesFoxPresent = IsModPresent("uk.1a3.yesfox", "Yes Fox Detected"); soulDevPresent = IsModPresent("SoulDev", "Soul Dev Detected"); BiodiversityPresent = IsModPresent("com.github.biodiversitylc.Biodiversity", "Biodiversity Detected"); furniturePackPresent = IsModPresent("MelanieMelicious.furniturePack0", "Furniture Pack Detected"); OoblterraPresent = IsModPresent("SkullCrusher.WTO", "Ooblterra Detected"); lighteaterPresent = IsModPresent("Lega.LightEater", "Light Eater Detected"); LethalPhonesPresent = IsModPresent("LethalPhones", "Lethal Phones Detected"); SelfSortingStorage = IsModPresent("zigzag.SelfSortingStorage", "Self Sorting Storage Detected"); KidnapperFoxPresent = IsModPresent("uk.1a3.yesfox", "Kidnapper Fox Detected"); LethalElementsPresent = IsModPresent("voxx.LethalElementsPlugin", "Lethal Elements Detected"); BarberFixesPresent = IsModPresent("butterystancakes.lethalcompany.barberfixes", "Barber Fixes Detected"); SCP939Present = IsModPresent("project_scp.scp939", "SCP939 Detected"); SCP682Present = IsModPresent("ProjectSCP.SCP682", "SCP682 Detected"); WeatherRegistryPresent = IsModPresent("mrov.WeatherRegistry", "Weather Registry Detected"); LegendWeathersPresent = IsModPresent("zigzag.legendweathers", "Legend Weathers Detected"); EndlessElevatorPresent = IsModPresent("kite.ZelevatorCode", "Endless Elevator Detected"); CombinedWeatherToolKitPresent = IsModPresent("zigzag.combinedweatherstoolkit", "Combined Weathers Toolkit Detected"); DawnLibPresent = IsModPresent("com.github.teamxiaolan.dawnlib", "DawnLib Detected."); StarLancereNemyEscapePresent = IsModPresent("AudioKnight.StarlancerEnemyEscape", "Starlancer Enemy Escape Detected."); ScanVanPresent = IsModPresent("Scandal.CruiserXL", "ScanVan Detected."); } public static Assembly GetAssembly(string name) { if (Chainloader.PluginInfos.ContainsKey(name)) { return ((object)Chainloader.PluginInfos[name].Instance).GetType().Assembly; } return null; } public static bool IsModPresent(string name, string logMessage = "") { bool flag = Chainloader.PluginInfos.ContainsKey(name); if (flag) { Log.LogInfo(name + " is present. " + logMessage); } return flag; } } [HarmonyPatch] public class Configuration { [Flags] public enum HeatSettingsFlags { None = 0, Difficulty = 1, InsidePower = 2, OutsidePower = 4, All = -1 } public static ConfigFile? uiConfig; public static ConfigFile? eventConfig; public static ConfigFile? weatherConfig; public static ConfigFile? customAssetsConfig; public static ConfigFile? difficultyConfig; public static ConfigFile? moddedEventConfig; public static ConfigFile? customEventConfig; public static ConfigFile? allEnemiesConfig; public static ConfigFile? levelPropertiesConfig; public static ConfigFile? CorePropertiesConfig; public static ConfigFile? LanguageConfig; public static List> eventWeights = new List>(); public static List> eventDescriptions = new List>(); public static List> eventColorHexes = new List>(); public static List> eventTypes = new List>(); public static List> eventScales = new List>(); public static List> showTip = new List>(); public static List> TipsList = new List>(); public static List> TipsTitles = new List>(); public static List> TipIsWarning = new List>(); public static List> eventEnables = new List>(); public static List> eventsToRemove = new List>(); public static List> eventsToSpawnWith = new List>(); public static List> eventAliases = new List>(); public static List> moonBlacklist = new List>(); public static List> moonWhitelist = new List>(); public static List> moonMode = new List>(); public static List> eventSpecial = new List>(); public static List> eventBeta = new List>(); public static List> monsterEvents = new List>(); public static List transmutationEvents = new List(); public static ConfigEntry? useCustomWeights; public static ConfigEntry? showEventsInChat; public static MEvent.Scale eventsToSpawn; public static float[]? weightsForExtraEvents; public static MEvent.Scale[] eventTypeScales = new MEvent.Scale[8]; public static Dictionary scrapValueByEventTypeScale = new Dictionary(); public static Dictionary scrapAmountByEventTypeScale = new Dictionary(); public static ConfigEntry? MoonsToIgnore; public static MEvent.Scale factorySizeMultiplier = default(MEvent.Scale); public static EventManager.DifficultyTransition[]? difficultyTransitions; public static ConfigEntry? enableQuotaChanges; public static ConfigEntry? deadLineDaysAmount; public static ConfigEntry? startingCredits; public static ConfigEntry? startingQuota; public static ConfigEntry? baseIncrease; public static ConfigEntry? increaseSteepness; public static MEvent.Scale spawnChanceMultiplierScaling = default(MEvent.Scale); public static MEvent.Scale insideEnemyMaxPowerCountScaling = default(MEvent.Scale); public static MEvent.Scale outsideEnemyPowerCountScaling = default(MEvent.Scale); public static MEvent.Scale enemyBonusHpScaling = default(MEvent.Scale); public static MEvent.Scale spawnCapMultiplier = default(MEvent.Scale); public static MEvent.Scale scrapAmountMultiplier = default(MEvent.Scale); public static MEvent.Scale scrapValueMultiplier = default(MEvent.Scale); public static MEvent.Scale insideSpawnChanceAdditive = default(MEvent.Scale); public static MEvent.Scale outsideSpawnChanceAdditive = default(MEvent.Scale); public static ConfigEntry? difficultyMaxCap; public static ConfigEntry? scrapValueMax; public static ConfigEntry? scrapAmountMax; public static ConfigEntry? FactorySizeMax; public static ConfigEntry? FactorySizeMin; public static ConfigEntry? ignoreMaxCap; public static ConfigEntry? scaleByDaysPassed; public static ConfigEntry? scaleByScrapInShip; public static ConfigEntry? scaleByMoonGrade; public static ConfigEntry? scaleByWeather; public static ConfigEntry? scaleByQuota; public static ConfigEntry? scaleHeat; public static ConfigEntry? daysPassedDifficultyMultiplier; public static ConfigEntry? daysPassedDifficultyCap; public static ConfigEntry? scrapInShipDifficultyMultiplier; public static ConfigEntry? scrapInShipDifficultyCap; public static ConfigEntry? quotaDifficultyMultiplier; public static ConfigEntry? quotaDifficultyCap; public static Dictionary gradeAdditives = new Dictionary(); public static Dictionary weatherAdditives = new Dictionary(); public static ConfigEntry? enableCustomTimeAdjustments; public static MEvent.Scale timeScaling = default(MEvent.Scale); public static MEvent.Scale startingTime = default(MEvent.Scale); public static ConfigEntry? heatIncrementAmount; public static ConfigEntry? heatDecrementAmount; public static ConfigEntry? heatMaxCap; public static ConfigEntry? heatDampening; public static ConfigEntry? heatMultiplierDifficulty; public static ConfigEntry? heatMultiplierOtherCalculations; public static ConfigEntry? startingHeat; public static ConfigEntry? heatForceEventAtMax; public static ConfigEntry? heatEventsToForce; public static ConfigEntry? heatSettingsToAffect; public static ConfigEntry? enablePlayerScaling; public static ConfigEntry? playerScalingType; public static ConfigEntry? playerScalingMultiplier; public static ConfigEntry? basePlayerAmount; public static ConfigEntry? useWeatherMultipliers; public static ConfigEntry? randomizeWeatherMultipliers; public static ConfigEntry? enableTerminalText; public static ConfigEntry? weatherRandomRandomMinInclusive; public static ConfigEntry? weatherRandomRandomMaxInclusive; public static Weather noneMultiplier; public static Weather dustCloudMultiplier; public static Weather rainyMultiplier; public static Weather stormyMultiplier; public static Weather foggyMultiplier; public static Weather floodedMultiplier; public static Weather eclipsedMultiplier; public static ConfigEntry? UIKey; public static ConfigEntry? color; public static ConfigEntry? colorArrows; public static ConfigEntry? colorText; public static ConfigEntry? NormaliseScrapValueDisplay; public static ConfigEntry? EnableUI; public static ConfigEntry? ShowUILetterBox; public static ConfigEntry? ShowExtraProperties; public static ConfigEntry? PopUpUI; public static ConfigEntry? DisplayUIAfterShipLeaves; public static ConfigEntry? DisplayExtraPropertiesAfterShipLeaves; public static ConfigEntry? displayEvents; public static ConfigEntry? UITime; public static ConfigEntry? scrollSpeed; public static ConfigEntry? uiColorReduction; public static ConfigEntry? colorArrowsIncrease; public static ConfigEntry? uiScaleX; public static ConfigEntry? uiScaleY; public static ConfigEntry? uiScaleZ; public static ConfigEntry? uiPosX; public static ConfigEntry? uiPosY; public static ConfigEntry? uiPosZ; public static ConfigEntry? uiRotX; public static ConfigEntry? uiRotY; public static ConfigEntry? uiRotZ; public static ConfigEntry? colorInsane; public static ConfigEntry? colorVeryBad; public static ConfigEntry? colorBad; public static ConfigEntry? colorNeutral; public static ConfigEntry? colorGood; public static ConfigEntry? colorVeryGood; public static ConfigEntry? colorRare; public static ConfigEntry? colorRemove; public static ConfigEntry? nutSlayerLives; public static ConfigEntry? nutSlayerHp; public static ConfigEntry? slayerShotgunMinValue; public static ConfigEntry? slayerShotgunMaxValue; public static ConfigEntry? nutSlayerMovementSpeed; public static ConfigEntry? nutSlayerImmortal; public static ConfigEntry? onlyPlayersAttackSlayer; public static ConfigEntry? enableAllEnemies; public static ConfigEntry? enableAllAllEnemies; public static Dictionary levelProperties = new Dictionary(); public static CultureInfo en = new CultureInfo("en-US"); public static string scaleDescription = "Format: BaseScale, IncrementScale, MinCap, MaxCap, Forumla: BaseScale + (IncrementScale * Difficulty), By default difficulty goes between 0 to 100 depending on certain factors"; public static string LanguageDescription = "This is used for localization of text elements on the UI. Use \\s to represent a space. For event descriptions, you can find them in their respective config sections."; public static string customEventsFolder = Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CustomEvents"; public static ConfigEntry? MsgEventTitle; public static ConfigEntry? MsgScrapValue; public static ConfigEntry? MsgScrapAmount; public static ConfigEntry? MsgFactorySize; public static ConfigEntry? MsgSpawnChance; public static ConfigEntry? MsgSpawnCap; public static ConfigEntry? MsgBonusEnemyhp; public static ConfigEntry? MsgOther; public static ConfigEntry? MsgInsane; public static ConfigEntry? MsgVeryBad; public static ConfigEntry? MsgBad; public static ConfigEntry? MsgNeutral; public static ConfigEntry? MsgGood; public static ConfigEntry? MsgVeryGood; public static ConfigEntry? MsgRare; public static ConfigEntry? MsgRemove; public static ConfigEntry? MsgEventType; public static ConfigEntry? MsgDIfficultyTitle; public static ConfigEntry? MsgDifficultyAmount; public static ConfigEntry? MsgDay; public static ConfigEntry? MsgQuota; public static ConfigEntry? MsgShipScrap; public static ConfigEntry? MsgMoonRisk; public static ConfigEntry? MsgWeather; public static ConfigEntry? MsgHeat; public static ConfigEntry? enableCustomEvents; public static ConfigEntry? ExtraLogging; public static ConfigEntry? SilenceEnum; public static ConfigEntry? SilencePrefab; public static ConfigEntry? GetMethods; public static ConfigEntry? DisableAllEvents; public static ConfigEntry? dontHandlePower; public static ConfigEntry? dontHandleSpawnCurves; public static ConfigEntry? AffectPropertiesOutOfEvents; public static ConfigEntry? deferWeatherToMods; public static ConfigEntry? enforceEscapeModChecks; public static ConfigEntry? enableSpecialEvents; public static ConfigEntry? enableBetaEvents; public static MEvent.Scale timeChaosScale = default(MEvent.Scale); public static ConfigEntry? transmutationBlacklist; public static ConfigEntry? handleScanCommand; public static ConfigEntry? speedrunMode; public static MEvent.Scale EventChanceGlobal = default(MEvent.Scale); public static ConfigEntry? timeBetweenTips; public static ConfigEntry? InitTimePopUp; internal static bool Initalized = false; private static string header = "All Enemies"; public static string LocalizationEventTitle => GetString(MsgEventTitle, "Events:"); public static string LocalizationScrapValue => GetString(MsgScrapValue, "Scrap Value"); public static string LocalizationScrapAmount => GetString(MsgScrapAmount, "Scrap Amount"); public static string LocalizationFactorySize => GetString(MsgFactorySize, "Factory Size"); public static string LocalizationSpawnChance => GetString(MsgSpawnChance, "Spawn Chance"); public static string LocalizationSpawnCap => GetString(MsgSpawnCap, "Spawn Cap"); public static string LocalizationBonusEnemyHp => GetString(MsgBonusEnemyhp, "Bonus enemy hp"); public static string LocalizationOther => GetString(MsgOther, "Other"); public static string LocalizationEventType => GetString(MsgEventType, "EventType Chances"); public static string LocalizationInsane => GetString(MsgInsane, "Insane"); public static string LocalizationVeryBad => GetString(MsgVeryBad, "VeryBad"); public static string LocalizationBad => GetString(MsgBad, "Bad"); public static string LocalizationNeutral => GetString(MsgNeutral, "Neutral"); public static string LocalizationGood => GetString(MsgGood, "Good"); public static string LocalizationVeryGood => GetString(MsgVeryGood, "VeryGood"); public static string LocalizationRare => GetString(MsgRare, "Rare"); public static string LocalizationRemove => GetString(MsgRemove, "Remove"); public static string LocalizationDifficultyTitle => GetString(MsgDIfficultyTitle, "Difficulty"); public static string LocalizationDifficultyAmount => GetString(MsgDifficultyAmount, "Difficulty:"); public static string LocalizationDay => GetString(MsgDay, "Day:\\s\\s\\s\\s\\s\\s\\s\\s"); public static string LocalizationQuota => GetString(MsgQuota, "Quota:\\s\\s\\s\\s\\s\\s"); public static string LocalizationShipScrap => GetString(MsgShipScrap, "Ship Scrap:\\s"); public static string LocalizationMoonRisk => GetString(MsgMoonRisk, "Moon Risk:\\s\\s"); public static string LocalizationWeather => GetString(MsgWeather, "Weather:\\s\\s\\s"); public static string LocalizationHeat => GetString(MsgHeat, "Heat:\\s\\s\\s\\s\\s\\s"); public static string GetString(ConfigEntry? entry, string fallback) { if (entry == null || string.IsNullOrEmpty(entry.Value)) { return fallback; } return entry.Value; } private static void Initalize() { useCustomWeights = difficultyConfig.Bind("_Event Settings", "Use custom weights?", false, "'false'= Use eventType weights to set all the weights 'true'= Use custom set weights"); eventsToSpawn = Helper.getScale(difficultyConfig.Bind("_Event Settings", "Event scale amount", "2, 0.03, 2.0, 5.0", "The base amount of events Format: BaseScale, IncrementScale, MinCap, MaxCap, " + scaleDescription).Value); weightsForExtraEvents = Helper.ParseValuesFromString(difficultyConfig.Bind("_Event Settings", "Weights for bonus events", "40, 39, 15, 5, 1", "Weights for bonus events, can be expanded. (40, 39, 15, 5, 1) is equivalent to (+0, +1, +2, +3, +4) events").Value); eventTypeScales = new MEvent.Scale[8] { Helper.getScale(difficultyConfig.Bind("_EventType Weights", "Insane event scale", "3, 0.05, 3, 20", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "VeryBad event scale", "5, 0.25, 5, 30", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "Bad event scale", "40, -0.15, 25, 40", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "Neutral event scale", "10, -0.05, 5, 10", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "Good event scale", "23, -0.1, 13, 23", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "VeryGood event scale", "3, 0.14, 3, 17", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "Rare event scale", "1, 0.02, 1, 10", scaleDescription).Value), Helper.getScale(difficultyConfig.Bind("_EventType Weights", "Remove event scale", "15, -0.05, 10, 15", "These events remove something " + scaleDescription).Value) }; MsgEventTitle = LanguageConfig.Bind("UI Text (General)", "Event Title Text", "Events:", LanguageDescription); MsgOther = LanguageConfig.Bind("UI Text (Other)", "Other Text", "Other", LanguageDescription); MsgScrapValue = LanguageConfig.Bind("UI Text (Other)", "Scrap Value Text", "Scrap Value", LanguageDescription); MsgScrapAmount = LanguageConfig.Bind("UI Text (Other)", "Scrap Amount Text", "Scrap Amount", LanguageDescription); MsgFactorySize = LanguageConfig.Bind("UI Text (Other)", "Factory Size Text", "Factory Size", LanguageDescription); MsgSpawnChance = LanguageConfig.Bind("UI Text (Other)", "Spawn Chance Text", "Spawn Chance", LanguageDescription); MsgSpawnCap = LanguageConfig.Bind("UI Text (Other)", "Spawn Cap Text", "Spawn Cap", LanguageDescription); MsgBonusEnemyhp = LanguageConfig.Bind("UI Text (Other)", "Bonus Enemy Hp Text", "Bonus enemy hp", LanguageDescription); MsgEventType = LanguageConfig.Bind("UI Text (Event Type)", "Event Type Chances Text", "EventType Chances", LanguageDescription); MsgInsane = LanguageConfig.Bind("UI Text (Event Type)", "Insane Text", "Insane", LanguageDescription); MsgVeryBad = LanguageConfig.Bind("UI Text (Event Type)", "Very Bad Text", "VeryBad", LanguageDescription); MsgBad = LanguageConfig.Bind("UI Text (Event Type)", "Bad Text", "Bad", LanguageDescription); MsgNeutral = LanguageConfig.Bind("UI Text (Event Type)", "Neutral Text", "Neutral", LanguageDescription); MsgGood = LanguageConfig.Bind("UI Text (Event Type)", "Good Text", "Good", LanguageDescription); MsgVeryGood = LanguageConfig.Bind("UI Text (Event Type)", "Very Good Text", "VeryGood", LanguageDescription); MsgRare = LanguageConfig.Bind("UI Text (Event Type)", "Rare Text", "Rare", LanguageDescription); MsgRemove = LanguageConfig.Bind("UI Text (Event Type)", "Remove Text", "Remove", LanguageDescription); MsgDIfficultyTitle = LanguageConfig.Bind("UI Text (Difficulty)", "Difficulty Title Text", "Difficulty", LanguageDescription); MsgDifficultyAmount = LanguageConfig.Bind("UI Text (Difficulty)", "Difficulty Amount Text", "Difficulty:", LanguageDescription); MsgDay = LanguageConfig.Bind("UI Text (Difficulty)", "Day Text", "Day:\\s\\s\\s\\s\\s\\s\\s\\s", LanguageDescription); MsgQuota = LanguageConfig.Bind("UI Text (Difficulty)", "Quota Text", "Quota:\\s\\s\\s\\s\\s\\s", LanguageDescription); MsgShipScrap = LanguageConfig.Bind("UI Text (Difficulty)", "Ship Scrap Text", "Ship Scrap:\\s", LanguageDescription); MsgMoonRisk = LanguageConfig.Bind("UI Text (Difficulty)", "Moon Risk Text", "Moon Risk:\\s\\s", LanguageDescription); MsgWeather = LanguageConfig.Bind("UI Text (Difficulty)", "Weather Text", "Weather:\\s\\s", LanguageDescription); MsgHeat = LanguageConfig.Bind("UI Text (Difficulty)", "Heat Text", "Heat:\\s\\s\\s\\s\\s\\s", LanguageDescription); difficultyTransitions = Helper.GetDifficultyTransitionsFromString(difficultyConfig.Bind("Difficulty Scaling", "Difficulty Transitions", "Easy,00FF00,0|Medium,008000,15|Hard,FF0000,30|Very Hard,800000,50|Insane,140000,75", "Format: NAME,HEX,ABOVE, above is the value the name will be shown at.").Value); ignoreMaxCap = difficultyConfig.Bind("Difficulty Scaling", "Ignore max cap?", false, "Will ignore max cap if true, upperlimit is dictated by difficulty max cap setting as well."); difficultyMaxCap = difficultyConfig.Bind("Difficulty Scaling", "Difficulty max cap", 100f, "The difficulty value wont go beyond this."); scaleByDaysPassed = difficultyConfig.Bind("Difficulty Scaling", "Scale by days passed?", true, "Will add to difficulty depending on how many days have passed."); daysPassedDifficultyMultiplier = difficultyConfig.Bind("Difficulty Scaling", "Difficulty per days passed?", 1f, ""); daysPassedDifficultyCap = difficultyConfig.Bind("Difficulty Scaling", "Days passed difficulty cap", 60f, "Days passed difficulty scaling wont add beyond this."); scaleByScrapInShip = difficultyConfig.Bind("Difficulty Scaling", "Scale by scrap in ship?", true, "Will add to difficulty depending on how much scrap is inside the ship."); scrapInShipDifficultyMultiplier = difficultyConfig.Bind("Difficulty Scaling", "Difficulty per scrap value in ship?", 0.0025f, "By default +1.0 per 400 scrap in ship"); scrapInShipDifficultyCap = difficultyConfig.Bind("Difficulty Scaling", "Scrap in ship difficulty cap", 30f, "Scrap in ship difficulty scaling wont add beyond this."); scaleByQuota = difficultyConfig.Bind("Difficulty Scaling", "Scale by quota?", false, "Will add to difficulty depending on how high the quota is."); quotaDifficultyMultiplier = difficultyConfig.Bind("Difficulty Scaling", "Difficulty per quota value?", 0.005f, "By default +1.0 per 200 quota"); quotaDifficultyCap = difficultyConfig.Bind("Difficulty Scaling", "Quota difficulty cap", 100f, "Quota scaling wont add difficulty beyond this"); scaleByMoonGrade = difficultyConfig.Bind("Difficulty Scaling", "Scale by moon grade?", true, "Will add to difficulty depending on grade of moon you land on."); gradeAdditives = Helper.GetMoonRiskFromString(difficultyConfig.Bind("Difficulty Scaling", "Grade difficulty scaling", "D,-8|C,-8|B,-4|A,5|S,10|S+,15|S++,20|S+++,30|Other,10", "Format: GRADE,DIFFICULTY, Do not remove 'Other'").Value); scaleByWeather = difficultyConfig.Bind("Difficulty Scaling", "Scale by weather type?", false, "Will add to difficulty depending on weather of moon you land on."); scaleHeat = difficultyConfig.Bind("Difficulty Scaling", "Scale by Heat?", false, "Scales the difficulty by the current heat of the planet Heat values will never go below 0."); heatIncrementAmount = difficultyConfig.Bind("Difficulty Scaling", "Heat difficulty additive", 1f, "After visiting a moon, the next visit will incur this amount of heat."); heatDecrementAmount = difficultyConfig.Bind("Difficulty Scaling", "Heat difficulty decrement", 1f, "If visiting a moon different from the previous day, decrement by this value."); heatDampening = difficultyConfig.Bind("Difficulty Scaling", "Heat dampening factor", 0.15f, "The effective heat factor. Numbers closer to 0 will cause the calculated difficulty numbers to go higher. Higher numbers retain a value closer to the original value."); heatMultiplierDifficulty = difficultyConfig.Bind("Difficulty Scaling", "Heat multiplier (Difficulty)", 0.0015f, "This is used for calculating the difficulty of the current difficulty. Higher numbers will mulitply the value faster."); heatMultiplierOtherCalculations = difficultyConfig.Bind("Difficulty Scaling", "Heat multiplier (Non-Difficulty)", 0.004f, "This is used for calculations other than difficulty, affecting other properties like power values. Higher numbers will mulitply the value faster."); startingHeat = difficultyConfig.Bind("Difficulty Scaling", "Starting Heat", 0f, "The starting heat of every planet on its first run. Keep at 0 for default behavior."); heatMaxCap = difficultyConfig.Bind("Difficulty Scaling", "Heat Max Cap", 10f, "Heat values will never go beyond this value"); heatForceEventAtMax = difficultyConfig.Bind("Difficulty Scaling", "Force event at max heat?", false, "If true, when the heat reaches the max value, spawn the events you wrote below in the list."); heatEventsToForce = difficultyConfig.Bind("Difficulty Scaling", "Events to force at max heat", "", "When heat reaches max value, these events will be forced to spawn. Seperate by comma for each event name. Event names are case sensitive and must be exact to their entry name. Trailing white spaces are stripped from every name."); heatSettingsToAffect = difficultyConfig.Bind("Difficulty Scaling", "Heat Affects What Properties", HeatSettingsFlags.Difficulty, "Cchoose what additional properties you wish it to affect."); weatherAdditives = new Dictionary { { (LevelWeatherType)(-1), difficultyConfig.Bind("Difficulty Scaling", "None weather difficulty", 0f, "Difficulty added for playing on None weather").Value }, { (LevelWeatherType)1, difficultyConfig.Bind("Difficulty Scaling", "Rainy weather difficulty", 2f, "Difficulty added for playing on Rainy weather").Value }, { (LevelWeatherType)0, difficultyConfig.Bind("Difficulty Scaling", "DustClouds weather difficulty", 2f, "Difficulty added for playing on DustClouds weather").Value }, { (LevelWeatherType)4, difficultyConfig.Bind("Difficulty Scaling", "Flooded weather difficulty", 4f, "Difficulty added for playing on Flooded weather").Value }, { (LevelWeatherType)3, difficultyConfig.Bind("Difficulty Scaling", "Foggy weather difficulty", 4f, "Difficulty added for playing on Foggy weather").Value }, { (LevelWeatherType)2, difficultyConfig.Bind("Difficulty Scaling", "Stormy weather difficulty", 7f, "Difficulty added for playing on Stormy weather").Value }, { (LevelWeatherType)5, difficultyConfig.Bind("Difficulty Scaling", "Eclipsed weather difficulty", 7f, "Difficulty added for playing on Eclipsed weather").Value } }; scrapValueMax = difficultyConfig.Bind("Difficulty Scaling", "Scrap value max cap", 2.1474836E+09f, "The scrap value multipliers when added together wont go beyond this."); scrapAmountMax = difficultyConfig.Bind("Difficulty Scaling", "Scrap amount max cap", 2.1474836E+09f, "The scrap amount multipliers when added together wont go beyond this."); FactorySizeMax = difficultyConfig.Bind("Difficulty Scaling", "Factory size max cap", 2.1474836E+09f, "The factory size multipliers when added together wont go beyond this. Use at own risk"); FactorySizeMin = difficultyConfig.Bind("Difficulty Scaling", "Factory size min cap", 0.01f, "The factory size multipliers when added together wont go below this. Use at own risk."); enableCustomTimeAdjustments = difficultyConfig.Bind("Difficulty Scaling", "Enable Time Adjustments?", false, "Enable custom time adjustments globally for difficulty scaling."); timeScaling = Helper.getScale(difficultyConfig.Bind("Difficulty Scaling", "Time Scaling", "1, 0.0, 1, 1", "Time scaling multiplier with respect to difficulty scaling" + scaleDescription).Value); startingTime = Helper.getScale(difficultyConfig.Bind("Difficulty Scaling", "Starting Time", "100, 0.0, 100, 100", "Starting time with respect to difficulty" + scaleDescription).Value); spawnChanceMultiplierScaling = Helper.getScale(difficultyConfig.Bind("Difficulty", "Spawn chance multiplier scale", "1.0, 0.017, 1.0, 2.0", "This will multiply the spawn chance by this, " + scaleDescription).Value); insideSpawnChanceAdditive = Helper.getScale(difficultyConfig.Bind("Difficulty", "Inside spawn chance additive", "0.0, 0.0, 0.0, 0.0", "This will add to all keyframes for insideSpawns on the animationCurve, " + scaleDescription).Value); outsideSpawnChanceAdditive = Helper.getScale(difficultyConfig.Bind("Difficulty", "Outside spawn chance additive", "0.0, 0.0, 0.0, 0.0", "This will add to all keyframes for outsideSpawns on the animationCurve, " + scaleDescription).Value); spawnCapMultiplier = Helper.getScale(difficultyConfig.Bind("Difficulty", "Spawn cap multipler scale", "1.0, 0.017, 1.0, 2.0", "This will multiply outside and inside power counts by this, " + scaleDescription).Value); insideEnemyMaxPowerCountScaling = Helper.getScale(difficultyConfig.Bind("Difficulty", "Additional Inside Max Enemy Power Count", "0, 0, 0, 0", "Added max enemy power count for inside enemies., " + scaleDescription).Value); outsideEnemyPowerCountScaling = Helper.getScale(difficultyConfig.Bind("Difficulty", "Additional Outside Max Enemy Power Count", "0, 0, 0, 0", "Added max enemy power count for outside enemies., " + scaleDescription).Value); enemyBonusHpScaling = Helper.getScale(difficultyConfig.Bind("Difficulty", "Additional hp scale", "0, 0, 0, 0", "Added hp to all enemies, " + scaleDescription).Value); scrapValueMultiplier = Helper.getScale(difficultyConfig.Bind("Difficulty", "Scrap value multiplier scale", "1.0, 0.003, 1.0, 1.3", "Global scrap value multiplier, " + scaleDescription).Value); scrapAmountMultiplier = Helper.getScale(difficultyConfig.Bind("Difficulty", "Scrap amount multiplier scale", "1.0, 0.003, 1.0, 1.3", "Global scrap amount multiplier, " + scaleDescription).Value); factorySizeMultiplier = Helper.getScale(difficultyConfig.Bind("Difficulty", "Factory Size multiplier scale", "1.0, 0, 1.0, 1.0", "Factory size multiplier. Use at your own risk. May not load at all or will take a very long time to generate." + scaleDescription).Value); enablePlayerScaling = difficultyConfig.Bind("Player Scaling", "Enable player scaling?", false, "Enable player scaling"); playerScalingType = difficultyConfig.Bind("Player Scaling", "Player scaling type", "Linear", "Type of scaling for player amount. Options: Linear, Exponential, Logarithmic, Cubic"); playerScalingMultiplier = difficultyConfig.Bind("Player Scaling", "Player scaling multiplier", 1f, "Multiplier for player scaling"); basePlayerAmount = difficultyConfig.Bind("Player Scaling", "Base player amount", 4, "Base player amount"); MEvent.EventType[] array = (MEvent.EventType[])Enum.GetValues(typeof(MEvent.EventType)); foreach (MEvent.EventType eventType in array) { scrapAmountByEventTypeScale.Add(eventType, bindEventTypeScrapAmountMultiplier(eventType)); scrapValueByEventTypeScale.Add(eventType, bindEventTypeScrapValueMultiplier(eventType)); } MoonsToIgnore = difficultyConfig.Bind("Moons Settings", "Moons to Not Spawn Events On", "", "Events will not spawn on these moons. Seperate by comma for each moon name."); nutSlayerLives = customAssetsConfig.Bind("NutSlayer", "Lives", 5, "If hp reaches zero or below, decrement lives and reset hp until 0 lives."); nutSlayerHp = customAssetsConfig.Bind("NutSlayer", "Hp", 6, (ConfigDescription)null); nutSlayerMovementSpeed = customAssetsConfig.Bind("NutSlayer", "Speed?", 9.5f, (ConfigDescription)null); nutSlayerImmortal = customAssetsConfig.Bind("NutSlayer", "Immortal?", true, (ConfigDescription)null); onlyPlayersAttackSlayer = customAssetsConfig.Bind("NutSlayer", "Only players can attack NutSlayer?", false, "Does nothing if Nutslayer is immortal."); Assets.grabbableTurret.minValue = customAssetsConfig.Bind("Grabbable Landmine", "Min value", 50, (ConfigDescription)null).Value; Assets.grabbableTurret.maxValue = customAssetsConfig.Bind("Grabbable Landmine", "Max value", 75, (ConfigDescription)null).Value; Assets.grabbableLandmine.minValue = customAssetsConfig.Bind("Grabbable Turret", "Min value", 100, (ConfigDescription)null).Value; Assets.grabbableLandmine.maxValue = customAssetsConfig.Bind("Grabbable Turret", "Max value", 150, (ConfigDescription)null).Value; slayerShotgunMinValue = customAssetsConfig.Bind("Slayer Shotgun", "Min value", 200, (ConfigDescription)null); slayerShotgunMaxValue = customAssetsConfig.Bind("Slayer Shotgun", "Max value", 300, (ConfigDescription)null); useWeatherMultipliers = weatherConfig.Bind("_Weather Settings", "Enable weather multipliers?", true, "'false'= Disable all weather multipliers 'true'= Enable weather multipliers"); randomizeWeatherMultipliers = weatherConfig.Bind("_Weather Settings", "Weather multiplier randomness?", false, "'false'= disable 'true'= enable"); enableTerminalText = weatherConfig.Bind("_Weather Settings", "Enable terminal text?", true, (ConfigDescription)null); weatherRandomRandomMinInclusive = weatherConfig.Bind("_Weather Random Multipliers", "Min Inclusive", 0.9f, "Lower bound of random value"); weatherRandomRandomMaxInclusive = weatherConfig.Bind("_Weather Random Multipliers", "Max Inclusive", 1.2f, "Upper bound of random value"); noneMultiplier = createWeatherSettings(new Weather((LevelWeatherType)(-1), 1f, 1f)); dustCloudMultiplier = createWeatherSettings(new Weather((LevelWeatherType)0, 1.05f, 1f)); rainyMultiplier = createWeatherSettings(new Weather((LevelWeatherType)1, 1.05f, 1f)); stormyMultiplier = createWeatherSettings(new Weather((LevelWeatherType)2, 1.35f, 1.2f)); foggyMultiplier = createWeatherSettings(new Weather((LevelWeatherType)3, 1.15f, 1.1f)); floodedMultiplier = createWeatherSettings(new Weather((LevelWeatherType)4, 1.25f, 1.15f)); eclipsedMultiplier = createWeatherSettings(new Weather((LevelWeatherType)5, 1.35f, 1.2f)); UIKey = uiConfig.Bind("UI Options (Color)", "Toggle UI Key", "K", (ConfigDescription)null); color = uiConfig.Bind("UI Options (Color)", "UI Color Hex", "00A000", "Color hex for UI elements."); uiColorReduction = uiConfig.Bind("UI Options (Color)", "UI Color Reduction Factor", 0.6275f, "Changes the color of the UI element when not active (0-1)."); colorArrows = uiConfig.Bind("UI Options (Color)", "UI Arrow Color Hex", "00A000", "Color hex for UI arrows."); colorArrowsIncrease = uiConfig.Bind("UI Options (Color)", "UI Arrow Color Amplification", 1.59375f, "Mutliplies the color by this number when UI arrows are active."); colorText = uiConfig.Bind("UI Options (Color)", "UI Text Color Hex", "00FF00", "Color hex for UI text."); colorInsane = uiConfig.Bind("UI Options (Color)", "Insane Event UI Color Hex", "8B008B", "Color hex for insane event type. This only affects the category name color, not events itself."); colorVeryBad = uiConfig.Bind("UI Options (Color)", "Very Bad Event UI Color Hex", "800000", "Color hex for very bad event type. This only affects the category name color, not events itself."); colorBad = uiConfig.Bind("UI Options (Color)", "Bad Event UI Color Hex", "FF0000", "Color hex for bad event type. This only affects the category name color, not events itself."); colorNeutral = uiConfig.Bind("UI Options (Color)", "Neutral Event UI Color Hex", "FFFFFF", "Color hex for neutral event type. This only affects the category name color, not events itself."); colorGood = uiConfig.Bind("UI Options (Color)", "Good Event UI Color Hex", "008000", "Color hex for good event type. This only affects the category name color, not events itself."); colorVeryGood = uiConfig.Bind("UI Options (Color)", "Very Good Event UI Color Hex", "00FF00", "Color hex for very good event type. This only affects the category name color, not events itself."); colorRare = uiConfig.Bind("UI Options (Color)", "Rare Event UI Color Hex", "00FFFF", "Color hex for rare event type. This only affects the category name color, not events itself."); colorRemove = uiConfig.Bind("UI Options (Color)", "Remove Event UI Color Hex", "008000", "Color hex for remove event type. This only affects the category name color, not events itself."); NormaliseScrapValueDisplay = uiConfig.Bind("UI Options", "Normalize scrap value display number?", true, "In game default value is 0.4, having this set to true will multiply the 'displayed value' by 2.5 so it looks normal."); EnableUI = uiConfig.Bind("UI Options", "Enable UI?", true, (ConfigDescription)null); ShowUILetterBox = uiConfig.Bind("UI Options", "Display UI Letter Box?", true, (ConfigDescription)null); ShowExtraProperties = uiConfig.Bind("UI Options", "Display extra properties", true, "Display extra properties on UI such as scrap value and amount multipliers."); PopUpUI = uiConfig.Bind("UI Options", "PopUp UI?", true, "Will the UI popup whenever you start the day?"); UITime = uiConfig.Bind("UI Options", "PopUp UI time.", 45f, "UI popup time"); scrollSpeed = uiConfig.Bind("UI Options", "Scroll speed", 1f, "Multiplier speed on scrolling with arrows."); DisplayUIAfterShipLeaves = uiConfig.Bind("UI Options", "Display UI after ship leaves?", false, "Will only display event's after ship has left."); DisplayExtraPropertiesAfterShipLeaves = uiConfig.Bind("UI Options", "Display extra properties on UI after ship leaves?", true, "This will show Event Type raritys for next day and difficulty info."); displayEvents = uiConfig.Bind("UI Options", "Display events?", true, "Having this set to false wont show events in the UI."); showEventsInChat = uiConfig.Bind("UI Options", "Will Minus display events in chat?", false, (ConfigDescription)null); uiScaleX = uiConfig.Bind("UI Options", "UI Scale X", 1f, "Scale for UI on the X axis. Do not modify this unless you know what you are doing."); uiScaleY = uiConfig.Bind("UI Options", "UI Scale Y", 1f, "Scale for UI on the Y axis. Do not modify this unless you know what you are doing."); uiScaleZ = uiConfig.Bind("UI Options", "UI Scale Z", 1f, "Scale for UI on the Z axis. Do not modify this unless you know what you are doing."); uiPosX = uiConfig.Bind("UI Options", "UI Position X Offset", 0f, "Offset of UI on the X axis. Do not modify this unless you know what you are doing."); uiPosY = uiConfig.Bind("UI Options", "UI Position Y Offset", 0f, "Offset of UI on the Y axis. Do not modify this unless you know what you are doing."); uiPosZ = uiConfig.Bind("UI Options", "UI Position Z Offset", 0f, "Offset of UI on the Z axis. Do not modify this unless you know what you are doing."); uiRotX = uiConfig.Bind("UI Options", "UI Rotation X", 0f, "Rotation of UI on the X axis. Do not modify this unless you know what you are doing."); uiRotY = uiConfig.Bind("UI Options", "UI Rotation Y", 0f, "Rotation of UI on the Y axis. Do not modify this unless you know what you are doing."); uiRotZ = uiConfig.Bind("UI Options", "UI Rotation Z", 0f, "Rotation of UI on the Z axis. Do not modify this unless you know what you are doing."); enableCustomEvents = CorePropertiesConfig.Bind("Custom Events", "Enable Custom Events?", true, "Enables custom events to be loaded from the custom events folder."); ExtraLogging = CorePropertiesConfig.Bind("Debugging", "Enable Extra Logging?", false, "Enables extra logging for debugging purposes."); SilenceEnum = CorePropertiesConfig.Bind("Debugging", "Silence Enum Warnings?", true, "Silences warnings about potentially mismatched enums"); SilencePrefab = CorePropertiesConfig.Bind("Debugging", "Silence Prefab Warnings?", true, "Silences warnings about potentially missing prefabs"); GetMethods = CorePropertiesConfig.Bind("Debugging", "Silence Get Method Warnings?", true, "Silences warnings about missing enemies and items from mods not installed."); DisableAllEvents = CorePropertiesConfig.Bind("Events Features", "Disable all events?", false, "Setting this to true will disable all events from spawning. This forces zero events."); dontHandlePower = CorePropertiesConfig.Bind("Mod Compatibility", "Experimental Dont Handle Power?", false, "If you wish to let other mods handle power levels, enable this. Some settings may affect this."); dontHandleSpawnCurves = CorePropertiesConfig.Bind("Mod Compatibility", "Experimental Dont Handle Spawn Chance?", false, "If you wish to let other mods handle spawn curves, enable this. Some settings may affect this."); AffectPropertiesOutOfEvents = CorePropertiesConfig.Bind("Mod Compatibility", "Let Brutal handle properties outside of events?", true, "Disable this if you wish to let Brutal not handle any propeties outside of events."); deferWeatherToMods = CorePropertiesConfig.Bind("Mod Compatibility", "Defer Weather To Weather ToolKit Mod?", false, "If you wish to let other mods handle Brutal's weather setting effects, enable this. This has no effect on custom events as those use weather toolkit by default."); enforceEscapeModChecks = CorePropertiesConfig.Bind("Mod Compatibility", "Enforce Escape Mod Checks?", true, "If you don't have any enemy escape mods (Starlancer AI, for example) installed, should Brutal modify spawning of certain events to prevent improper enemy AI behaviour? Disable this if you wish to run events without the safety check."); enableSpecialEvents = CorePropertiesConfig.Bind("Events Features", "Enable Special Events?", false, "Enables special events to be loaded."); enableBetaEvents = CorePropertiesConfig.Bind("Events Features", "Enable Beta Events?", false, "Enables beta events to be loaded. These events are untested and may be very buggy, use at your own risk."); transmutationBlacklist = CorePropertiesConfig.Bind("Events Features", "Transmutation Blacklist", "", "Blacklist items here to prevent them from being used in scrap transmutation. Uses itemProperties.itemName Component Name."); handleScanCommand = CorePropertiesConfig.Bind("Mod Compatibility", "Let Brutal handle the SCAN command?", true, "If enabled, Brutal will handle the scan command with accurate scrap values to its modifiers. If you have other mods that handle this feature, disable it. Please note, if disabled, the scan command will not show the proper values for scrap value."); speedrunMode = CorePropertiesConfig.Bind("Events Features", "Enable Speedrun Mode?", false, "If enabled, Brutal will adjust certain events and features to be suited for speedrunning. I recommend keeping this off unless you are actively speedrunning the game."); EventChanceGlobal = Helper.getScale(CorePropertiesConfig.Bind("Events Features", "Chance of Events Occurring", "100, 0.0, 100, 100", "Chance of events occurring per day. " + scaleDescription).Value); InitTimePopUp = CorePropertiesConfig.Bind("Events Features", "Initial Time PopUp", 5f, "Time of initial popup of tips."); timeBetweenTips = CorePropertiesConfig.Bind("Events Features", "Time between tips", 5f, "Time in between tips messages in seconds."); try { if (!Directory.Exists(customEventsFolder)) { Directory.CreateDirectory(customEventsFolder); } } catch (Exception ex) { Log.LogWarning("Failed to create custom events folder: " + ex.Message); } RegisterEvents(eventConfig, EventManager.vanillaEvents); RegisterEvents(moddedEventConfig, EventManager.moddedEvents); if (enableCustomEvents.Value) { string[] files = Directory.GetFiles(customEventsFolder); foreach (string text in files) { if (text.EndsWith(".json")) { MEvent mEvent = new GeneralCustomEvent(text); mEvent.Initalize(); if (mEvent.Enabled) { EventManager.customEvents.Add(mEvent); } } } RegisterEvents(customEventConfig, EventManager.customEvents); } EventManager.events.AddRange(EventManager.vanillaEvents); EventManager.events.AddRange(EventManager.moddedEvents); EventManager.events.AddRange(EventManager.customEvents); BrutalCompanyMinus.Minus.Handlers.FacilityGhost.actionTimeCooldown = eventConfig.Bind("FacilityGhost", "Normal Action Time Interval", 15f, "How often does it take for the ghost to make a decision?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.ghostCrazyActionInterval = eventConfig.Bind("FacilityGhost", "Crazy Action Time Interval", 0.1f, "How often does it take for the ghost to make a decision while going crazy?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.ghostCrazyPeriod = eventConfig.Bind("FacilityGhost", "Crazy Period", 5f, "How long will the ghost go crazy for?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.crazyGhostChance = eventConfig.Bind("FacilityGhost", "Crazy Chance", 0.1f, "Whenever the ghost makes a decision, what is the chance that it will go crazy?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.DoNothingWeight = eventConfig.Bind("FacilityGhost", "Do Nothing Weight?", 25, "Whenever the ghost makes a decision, what is the weight to do nothing?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.OpenCloseBigDoorsWeight = eventConfig.Bind("FacilityGhost", "Open and close big doors weight", 20, "Whenever the ghost makes a decision, what is the weight for ghost to open and close big doors?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.MessWithLightsWeight = eventConfig.Bind("FacilityGhost", "Mess with lights weight", 16, "Whenever the ghost makes a decision, what is the weight to mess with lights?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.MessWithBreakerWeight = eventConfig.Bind("FacilityGhost", "Mess with breaker weight", 4, "Whenever the ghost makes a decision, what is the weight to mess with the breaker?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.disableTurretsWeight = eventConfig.Bind("FacilityGhost", "Disable turrets weight?", 5, "Whenever the ghost makes a decision, what is the weight to attempt to disable the turrets?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.disableLandminesWeight = eventConfig.Bind("FacilityGhost", "Disable landmines weight?", 5, "Whenever the ghost makes a decision, what is the weight to attempt to disable the landmines?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.turretRageWeight = eventConfig.Bind("FacilityGhost", "Turret rage weight?", 5, "Whenever the ghost makes a decision, what is the weight to attempt to make turrets rage?").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.OpenCloseDoorsWeight = eventConfig.Bind("FacilityGhost", "Open and close normal doors weight", 9, "Whenever the ghost makes a decision, what is the weight to attempt to open and close normal doors.").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.lockUnlockDoorsWeight = eventConfig.Bind("FacilityGhost", "Lock and unlock normal doors weight", 3, "Whenever the ghost makes a decision, what is the weight to attempt to lock and unlock normal doors.").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.chanceToOpenCloseDoor = eventConfig.Bind("FacilityGhost", "Chance to open and close normal doors", 0.3f, "Whenever the ghosts decides to open and close doors, what is the chance for each individual door that it will do that.").Value; BrutalCompanyMinus.Minus.Handlers.FacilityGhost.rageTurretsChance = eventConfig.Bind("FacilityGhost", "Chance to rage a turret", 0.3f, "Whenever the ghosts decides to rage a turret, what is the chance for each individual turret that it will do that.").Value; BrutalCompanyMinus.Minus.Handlers.RealityShift.normalScrapWeight = eventConfig.Bind("RealityShift", "Normal shift weight", 85, "Weight for transforming scrap into some other scrap?").Value; BrutalCompanyMinus.Minus.Handlers.RealityShift.grabbableLandmineWeight = eventConfig.Bind("RealityShift", "Grabbable landmine shift weight", 15, "Weight for transforming scrap into a grabbable landmine?").Value; BrutalCompanyMinus.Minus.Handlers.RealityShift.transmuteChance = eventConfig.Bind("RealityShift", "Chance to transmute", 0.5f, "Chance for transmutation to occur.").Value; BrutalCompanyMinus.Minus.Handlers.RealityShift.enemyTeleportChance = eventConfig.Bind("RealityShift", "Enemy teleport chance", 0.1f, "Chance enemy teleportation to occur when hit.").Value; DDay.bombardmentInterval = eventConfig.Bind("Warzone", "Bombardment interval", 100, "The time it takes before each bombardment event.").Value; DDay.bombardmentTime = eventConfig.Bind("Warzone", "Bombardment time", 15, "When a bombardment event occurs, how long will it last?").Value; DDay.fireInterval = eventConfig.Bind("Warzone", "Fire interval", 1, "During a bombardment event how often will it fire?").Value; DDay.fireAmount = eventConfig.Bind("Warzone", "Fire amount", 8, "For every fire interval, how many shot's will it take? This will get scaled higher on bigger maps.").Value; DDay.displayWarning = eventConfig.Bind("Warzone", "Display warning?", true, "Display warning message before bombardment?").Value; DDay.volume = eventConfig.Bind("Warzone", "Siren Volume?", 0.3f, "Volume of the siren? between 0.0 and 1.0").Value; ArtilleryShell.speed = eventConfig.Bind("Warzone", "Artillery shell speed", 100f, "How fast does the artillery shell travel?").Value; SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { if (!((Object)(object)val == (Object)null)) { MEvent.Scale scale = Helper.getScale(levelPropertiesConfig.Bind($"{val.levelID}:{((Object)val).name}", "Min scrap amount scale", "1.0, 0.0, 1.0, 1.0", scaleDescription).Value); MEvent.Scale scale2 = Helper.getScale(levelPropertiesConfig.Bind($"{val.levelID}:{((Object)val).name}", "Max scrap amount scale", "1.0, 0.0, 1.0, 1.0", scaleDescription).Value); MEvent.Scale scale3 = Helper.getScale(levelPropertiesConfig.Bind($"{val.levelID}:{((Object)val).name}", "Min scrap value scale", "1.0, 0.0, 1.0, 1.0", scaleDescription).Value); MEvent.Scale scale4 = Helper.getScale(levelPropertiesConfig.Bind($"{val.levelID}:{((Object)val).name}", "Max scrap value scale", "1.0, 0.0, 1.0, 1.0", scaleDescription).Value); levelProperties.TryAdd(val.levelID, new LevelProperties(val.levelID, scale, scale2, scale3, scale4)); } } static void RegisterEvents(ConfigFile toConfig, List events) { //IL_082f: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Expected O, but got Unknown foreach (MEvent @event in events) { eventWeights.Add(toConfig.Bind(@event.Name(), "Custom Weight", @event.Weight, "If you want to use custom weights change 'Use custom weights'? setting in '__Event Settings' to true.")); eventDescriptions.Add(Helper.ListToDescriptions(toConfig.Bind(@event.Name(), "Descriptions", Helper.StringsToList(@event.Descriptions, "|"), "Seperated by |").Value)); eventColorHexes.Add(toConfig.Bind(@event.Name(), "Color Hex", @event.ColorHex, (ConfigDescription)null)); eventTypes.Add(toConfig.Bind(@event.Name(), "Event Type", @event.Type, (ConfigDescription)null)); showTip.Add(toConfig.Bind(@event.Name(), "Show Tip?", @event.showTip, "Setting this to true will show tips.")); TipsTitles.Add(Helper.ListToDescriptions(toConfig.Bind(@event.Name(), "Tip Titles", Helper.StringsToList(@event.TipTitle, "|"), "Seperated by |").Value)); TipsList.Add(Helper.ListToDescriptions(toConfig.Bind(@event.Name(), "Tip Messages", Helper.StringsToList(@event.TipMessages, "|"), "Seperated by |").Value)); TipIsWarning.Add(toConfig.Bind(@event.Name(), "Is Tip A Warning?", @event.isWarning, "Setting this to true will make it appear as an red warning. If false, will appear yellow.")); eventEnables.Add(toConfig.Bind(@event.Name(), "Event Enabled?", @event.Enabled, "Setting this to false will stop the event from occuring.")); Dictionary dictionary = new Dictionary(); foreach (KeyValuePair scale5 in @event.ScaleList) { dictionary.Add(scale5.Key, Helper.getScale(toConfig.Bind(@event.Name(), scale5.Key.ToString(), Helper.GetStringFromScale(scale5.Value), MEvent.ScaleInfoList[scale5.Key] + " " + scaleDescription).Value)); } eventScales.Add(dictionary); eventsToRemove.Add(Helper.ListToStrings(toConfig.Bind(@event.Name(), "Events To Remove", Helper.StringsToList(@event.EventsToRemove, ", "), "Will prevent said event(s) from occuring.").Value)); eventsToSpawnWith.Add(Helper.ListToStrings(toConfig.Bind(@event.Name(), "Events To Spawn With", Helper.StringsToList(@event.EventsToSpawnWith, ", "), "Will spawn said events(s).").Value)); eventAliases.Add(Helper.ListToStrings(toConfig.Bind(@event.Name(), "Event Aliases", Helper.StringsToList(@event.Aliases, ", "), "Seperate by comma for each alias. Aliases are another name that can be used when forcing events. Aliases are case-insensitive. To prevent potential errors, do not use the same alias on multiple events.").Value)); moonMode.Add(toConfig.Bind(@event.Name(), "Whitelist Mode?", @event.MoonMode, "Which list should be used? Please note that if you are using the Whitelist mode, it must have at least one entry.")); eventSpecial.Add(toConfig.Bind(@event.Name(), "Special Event?", @event.isSpecialEvent, "Special events require Enable Special Events to be enabled.")); eventBeta.Add(toConfig.Bind(@event.Name(), "Beta Event?", @event.isBetaEvent, "Beta events require Enable Beta Events to be enabled.")); moonBlacklist.Add(Helper.ListToStrings(toConfig.Bind(@event.Name(), "Moons To Not Spawn On", Helper.StringsToList(@event.Blacklist, ", "), "Event will not spawn on these moons. Seperate by comma for each moon name. List must be populated").Value)); moonWhitelist.Add(Helper.ListToStrings(toConfig.Bind(@event.Name(), "Moons To Spawn Only On", Helper.StringsToList(@event.Whitelist, ", "), "Event will only spawn on these moons. Seperate by comma for each moon name. List must be populated.").Value)); List list = new List(); for (int l = 0; l < @event.monstersToSpawn.Count; l++) { list.Add(new MEvent.MonsterEvent(toConfig.Bind(@event.Name(), $"Enemy {l} Name", ((Object)@event.monstersToSpawn[l].enemy).name, "Inputting an invalid enemy name will cause it to return an empty enemyType").Value, Helper.getScale(toConfig.Bind(@event.Name(), $"{((Object)@event.monstersToSpawn[l].enemy).name} {MEvent.ScaleType.InsideEnemyRarity}", Helper.GetStringFromScale(@event.monstersToSpawn[l].insideSpawnRarity), MEvent.ScaleInfoList[MEvent.ScaleType.InsideEnemyRarity] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(@event.Name(), $"{((Object)@event.monstersToSpawn[l].enemy).name} {MEvent.ScaleType.OutsideEnemyRarity}", Helper.GetStringFromScale(@event.monstersToSpawn[l].outsideSpawnRarity), MEvent.ScaleInfoList[MEvent.ScaleType.OutsideEnemyRarity] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(@event.Name(), $"{((Object)@event.monstersToSpawn[l].enemy).name} {MEvent.ScaleType.MinInsideEnemy}", Helper.GetStringFromScale(@event.monstersToSpawn[l].minInside), MEvent.ScaleInfoList[MEvent.ScaleType.MinInsideEnemy] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(@event.Name(), $"{((Object)@event.monstersToSpawn[l].enemy).name} {MEvent.ScaleType.MaxInsideEnemy}", Helper.GetStringFromScale(@event.monstersToSpawn[l].maxInside), MEvent.ScaleInfoList[MEvent.ScaleType.MaxInsideEnemy] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(@event.Name(), $"{((Object)@event.monstersToSpawn[l].enemy).name} {MEvent.ScaleType.MinOutsideEnemy}", Helper.GetStringFromScale(@event.monstersToSpawn[l].minOutside), MEvent.ScaleInfoList[MEvent.ScaleType.MinOutsideEnemy] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(@event.Name(), $"{((Object)@event.monstersToSpawn[l].enemy).name} {MEvent.ScaleType.MaxOutsideEnemy}", Helper.GetStringFromScale(@event.monstersToSpawn[l].maxOutside), MEvent.ScaleInfoList[MEvent.ScaleType.MaxOutsideEnemy] + " " + scaleDescription).Value))); } monsterEvents.Add(list); MEvent.Scale amount = new MEvent.Scale(0f, 0f, 0f, 0f); if (@event.scrapTransmutationEvent.items.Length != 0) { amount = Helper.getScale(toConfig.Bind(@event.Name(), "Percentage", Helper.GetStringFromScale(@event.scrapTransmutationEvent.amount), MEvent.ScaleInfoList[MEvent.ScaleType.Percentage] + " " + scaleDescription).Value); } SpawnableItemWithRarity[] array2 = (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[@event.scrapTransmutationEvent.items.Length]; for (int m = 0; m < @event.scrapTransmutationEvent.items.Length; m++) { array2[m] = new SpawnableItemWithRarity(Assets.GetItem(toConfig.Bind(@event.Name(), $"Scrap {m} name", ((Object)@event.scrapTransmutationEvent.items[m].spawnableItem).name, "Inputting an invalid scrap name will cause it to return an empty item").Value), toConfig.Bind(@event.Name(), ((Object)@event.scrapTransmutationEvent.items[m].spawnableItem).name + " Rarity", @event.scrapTransmutationEvent.items[m].rarity, (ConfigDescription)null).Value); } transmutationEvents.Add(new MEvent.ScrapTransmutationEvent(amount, array2)); } } static MEvent.Scale bindEventTypeScrapAmountMultiplier(MEvent.EventType difficulty) { return Helper.getScale(difficultyConfig.Bind("_EventType Scrap Multipliers", difficulty.ToString() + " scrap amount scale", "1, 0.0, 1, 1", scaleDescription).Value); } static MEvent.Scale bindEventTypeScrapValueMultiplier(MEvent.EventType difficulty) { return Helper.getScale(difficultyConfig.Bind("_EventType Scrap Multipliers", difficulty.ToString() + " scrap value scale", "1, 0.0, 1, 1", scaleDescription).Value); } unsafe static Weather createWeatherSettings(Weather weather) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) string text2 = "(" + ((object)(*(LevelWeatherType*)(&weather.weatherType))/*cast due to .constrained prefix*/).ToString() + ") Weather multipliers"; float value = weatherConfig.Bind(text2, "Scrap Value Multiplier", weather.scrapValueMultiplier, "Multiply Scrap value for " + ((object)(*(LevelWeatherType*)(&weather.weatherType))/*cast due to .constrained prefix*/).ToString()).Value; float value2 = weatherConfig.Bind(text2, "Scrap Amount Multiplier", weather.scrapAmountMultiplier, "Multiply Scrap amount for " + ((object)(*(LevelWeatherType*)(&weather.weatherType))/*cast due to .constrained prefix*/).ToString()).Value; return new Weather(weather.weatherType, value, value2); } } public static void CreateConfig() { if (Initalized) { return; } foreach (MEvent vanillaEvent in EventManager.vanillaEvents) { vanillaEvent.Initalize(); } foreach (MEvent moddedEvent in EventManager.moddedEvents) { moddedEvent.Initalize(); } Initalize(); for (int i = 0; i != EventManager.events.Count; i++) { EventManager.events[i].Weight = eventWeights[i].Value; EventManager.events[i].Descriptions = eventDescriptions[i]; EventManager.events[i].ColorHex = eventColorHexes[i].Value; EventManager.events[i].Type = eventTypes[i].Value; EventManager.events[i].ScaleList = eventScales[i]; EventManager.events[i].showTip = showTip[i].Value; EventManager.events[i].isWarning = TipIsWarning[i].Value; EventManager.events[i].TipTitle = TipsTitles[i]; EventManager.events[i].TipMessages = TipsList[i]; EventManager.events[i].Enabled = eventEnables[i].Value; EventManager.events[i].EventsToRemove = eventsToRemove[i]; EventManager.events[i].EventsToSpawnWith = eventsToSpawnWith[i]; EventManager.events[i].Aliases = eventAliases[i]; EventManager.events[i].MoonMode = moonMode[i].Value; EventManager.events[i].Blacklist = moonBlacklist[i]; EventManager.events[i].Whitelist = moonWhitelist[i]; EventManager.events[i].isSpecialEvent = eventSpecial[i].Value; EventManager.events[i].isBetaEvent = eventBeta[i].Value; EventManager.events[i].monstersToSpawn = monsterEvents[i]; EventManager.events[i].scrapTransmutationEvent = transmutationEvents[i]; } List list = new List(); foreach (MEvent @event in EventManager.events) { if (!@event.Enabled) { EventManager.disabledEvents.Add(@event); continue; } list.Add(@event); switch (@event.Type) { case MEvent.EventType.Insane: EventManager.allInsane.Add(@event); break; case MEvent.EventType.VeryBad: EventManager.allVeryBad.Add(@event); break; case MEvent.EventType.Bad: EventManager.allBad.Add(@event); break; case MEvent.EventType.Neutral: EventManager.allNeutral.Add(@event); break; case MEvent.EventType.Good: EventManager.allGood.Add(@event); break; case MEvent.EventType.VeryGood: EventManager.allVeryGood.Add(@event); break; case MEvent.EventType.Rare: EventManager.allRare.Add(@event); break; case MEvent.EventType.Remove: EventManager.allRemove.Add(@event); break; } } EventManager.events = list; EventManager.UpdateEventTypeCounts(); EventManager.UpdateAllEventWeights(); Log.LogInfo($"\n\nTotal Events:{EventManager.events.Count}, Disabled Events:{EventManager.disabledEvents.Count}, Total Events - Remove Count:{(float)EventManager.events.Count - EventManager.eventTypeCount[5]}\n" + $"Very Bad:{EventManager.eventTypeCount[0]}\n" + $"Bad:{EventManager.eventTypeCount[1]}\n" + $"Neutral:{EventManager.eventTypeCount[2]}\n" + $"Good:{EventManager.eventTypeCount[3]}\n" + $"Very Good:{EventManager.eventTypeCount[4]}\n" + $"Remove:{EventManager.eventTypeCount[5]}\n"); CreateAllEnemiesConfig(); uiConfig.Save(); difficultyConfig.Save(); eventConfig.Save(); weatherConfig.Save(); customAssetsConfig.Save(); moddedEventConfig.Save(); allEnemiesConfig.Save(); levelPropertiesConfig.Save(); CorePropertiesConfig.Save(); LanguageConfig.Save(); Initalized = true; } private static void CreateAllEnemiesConfig() { enableAllEnemies = allEnemiesConfig.Bind("_All Enemies", "Enable?", false, "This will make all enemies capable of spawning on all moons, this will make the game harder."); enableAllAllEnemies = allEnemiesConfig.Bind("_All All Enemies", "Enable?", false, "This will make all inside enemies spawn inside and outside and all outside enemies spawn inside and outside, so giants and worms can spawn inside, enable both 'All' and 'All All' if you are a sadist. This will make the game harder."); List list = new List { CreateEnemyEntry(Assets.EnemyName.Bracken, 8f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.HoardingBug, 60f, 10, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.CoilHead, 20f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Thumper, 25f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.BunkerSpider, 35f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Jester, 7f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.SnareFlea, 45f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Hygrodere, 10f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.GhostGirl, 5f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.SporeLizard, 15f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.NutCracker, 15f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Masked, 10f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Butler, 20f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Lasso, 5f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(((Object)Assets.kamikazieBug).name, 30f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(((Object)Assets.antiCoilHead).name, 10f, 2, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(((Object)Assets.nutSlayer).name, 3f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.EyelessDog, 25f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.ForestKeeper, 10f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.EarthLeviathan, 8f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.BaboonHawk, 35f, 10, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.OldBird, 6f, 3, EnemySpawnCycle.SpawnLocation.Outside) }; foreach (EnemyType enemy in Assets.EnemyList.Values) { if (!((Object)(object)enemy == (Object)null) && !((Object)(object)enemy.enemyPrefab == (Object)null) && !enemy.isDaytimeEnemy && !list.Exists((EnemySpawnCycle.EnemySpawnInfo x) => ((Object)x.enemy).name == ((Object)enemy).name)) { if (enemy.isOutsideEnemy) { CreateEnemyEntry(((Object)enemy).name, 5f, 1, EnemySpawnCycle.SpawnLocation.Outside); } else { CreateEnemyEntry(((Object)enemy).name, 5f, 1, EnemySpawnCycle.SpawnLocation.Inside); } } } EnemySpawnCycle.allEnemiesCycle = new EnemySpawnCycle.SpawnCycle { enemies = list, nothingWeight = allEnemiesConfig.Bind("_All Enemies", "All enemies nothing weight", 400f, "This is the weight chance for a spawn to not occur.").Value, spawnAttemptInterval = allEnemiesConfig.Bind("_All Enemies", "Spawn interval", 86f, "How often will this cycle attempt to spawn an enemy? in seconds").Value, spawnCycleDuration = 0f }; header = "All All Enemies"; List enemies = new List { CreateEnemyEntry(Assets.EnemyName.Bracken, 8f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.HoardingBug, 60f, 10, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.CoilHead, 20f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Thumper, 25f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.BunkerSpider, 35f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Jester, 7f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.SnareFlea, 45f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Hygrodere, 10f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.GhostGirl, 5f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.SporeLizard, 15f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.NutCracker, 15f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Masked, 10f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Butler, 20f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Lasso, 5f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(((Object)Assets.kamikazieBug).name, 30f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(((Object)Assets.antiCoilHead).name, 10f, 2, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(((Object)Assets.nutSlayer).name, 3f, 1, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.EyelessDog, 10f, 5, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.ForestKeeper, 6f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.EarthLeviathan, 8f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.BaboonHawk, 20f, 10, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.OldBird, 6f, 3, EnemySpawnCycle.SpawnLocation.Inside), CreateEnemyEntry(Assets.EnemyName.Bracken, 4f, 1, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.HoardingBug, 30f, 10, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.CoilHead, 10f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.Thumper, 13f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.BunkerSpider, 18f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.Jester, 3f, 1, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.SnareFlea, 10f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.Hygrodere, 5f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.GhostGirl, 3f, 1, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.SporeLizard, 7f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.NutCracker, 8f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.Masked, 5f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.Butler, 10f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.Lasso, 3f, 1, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(((Object)Assets.kamikazieBug).name, 15f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(((Object)Assets.antiCoilHead).name, 5f, 2, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(((Object)Assets.nutSlayer).name, 2f, 1, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.EyelessDog, 15f, 5, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.ForestKeeper, 10f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.EarthLeviathan, 12f, 3, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.BaboonHawk, 35f, 10, EnemySpawnCycle.SpawnLocation.Outside), CreateEnemyEntry(Assets.EnemyName.OldBird, 10f, 3, EnemySpawnCycle.SpawnLocation.Outside) }; foreach (EnemyType enemy2 in Assets.EnemyList.Values) { if (!((Object)(object)enemy2 == (Object)null) && !((Object)(object)enemy2.enemyPrefab == (Object)null) && !list.Exists((EnemySpawnCycle.EnemySpawnInfo x) => ((Object)x.enemy).name == ((Object)enemy2).name)) { CreateEnemyEntry(((Object)enemy2).name, 5f, 1, EnemySpawnCycle.SpawnLocation.Inside); CreateEnemyEntry(((Object)enemy2).name, 5f, 1, EnemySpawnCycle.SpawnLocation.Outside); } } EnemySpawnCycle.allAllEnemiesCycle = new EnemySpawnCycle.SpawnCycle { enemies = enemies, nothingWeight = allEnemiesConfig.Bind("_All All Enemies", "All enemies nothing weight", 400f, "This is the weight chance for a spawn to not occur.").Value, spawnAttemptInterval = allEnemiesConfig.Bind("_All All Enemies", "Spawn interval", 86f, "How often will this cycle attempt to spawn enemies? in seconds").Value, spawnCycleDuration = 0f }; } private static EnemySpawnCycle.EnemySpawnInfo CreateEnemyEntry(string enemy, float defaultWeight, int spawnCap, EnemySpawnCycle.SpawnLocation spawnLocation) { return new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemyOrDefault(enemy).enemyPrefab, enemyWeight = allEnemiesConfig.Bind(header, $"{spawnLocation} {enemy} Weight", defaultWeight, "weight").Value, spawnCap = allEnemiesConfig.Bind(header, $"{spawnLocation} {enemy} Spawn Cap", spawnCap, "weight").Value, spawnLocation = spawnLocation }; } private static EnemySpawnCycle.EnemySpawnInfo CreateEnemyEntry(Assets.EnemyName name, float defaultWeight, int spawnCap, EnemySpawnCycle.SpawnLocation spawnLocation) { return CreateEnemyEntry(Assets.EnemyNameList[name], defaultWeight, spawnCap, spawnLocation); } [HarmonyPrefix] [HarmonyPatch(typeof(TimeOfDay), "Awake")] private static void OnTimeDayStart(ref TimeOfDay __instance) { enableQuotaChanges = difficultyConfig.Bind("Quota Settings", "_Enable Quota Changes", false, "Once set to true, load up a save to generate the rest of this config, this will take values from the game as default."); if (enableQuotaChanges.Value) { __instance.quotaVariables.deadlineDaysAmount = difficultyConfig.Bind("Quota Settings", "Deadline Days Amount", __instance.quotaVariables.deadlineDaysAmount, (ConfigDescription)null).Value; __instance.quotaVariables.startingCredits = difficultyConfig.Bind("Quota Settings", "Starting Credits", __instance.quotaVariables.startingCredits, (ConfigDescription)null).Value; __instance.quotaVariables.startingQuota = difficultyConfig.Bind("Quota Settings", "Starting Quota", __instance.quotaVariables.startingQuota, (ConfigDescription)null).Value; __instance.quotaVariables.baseIncrease = difficultyConfig.Bind("Quota Settings", "Base Increase", __instance.quotaVariables.baseIncrease, (ConfigDescription)null).Value; __instance.quotaVariables.increaseSteepness = difficultyConfig.Bind("Quota Settings", "Increase Steepness", __instance.quotaVariables.increaseSteepness, (ConfigDescription)null).Value; } } [HarmonyPrefix] [HarmonyPatch(typeof(Terminal), "Awake")] private static void OnTerminalAwake() { Manager.currentTerminal = Object.FindObjectOfType(); } } public static class Helper { private class CircularList : List { public T Last { get { return base[base.Count - 1]; } set { base[base.Count - 1] = value; } } public T First { get { return base[0]; } set { base[0] = value; } } public void PushLast(T obj) { Add(obj); } public T PopLast() { T result = base[base.Count - 1]; RemoveAt(base.Count - 1); return result; } public void PushFirst(T obj) { Insert(0, obj); } public T PopFirst() { T result = base[0]; RemoveAt(0); return result; } } internal static CultureInfo en = new CultureInfo("en-US"); public static List GetOutsideNodes() { return (from n in GameObject.FindGameObjectsWithTag("OutsideAINode") select n.transform.position).ToList(); } public static List GetInsideAINodes() { return (from n in GameObject.FindGameObjectsWithTag("AINode") select n.transform.position).ToList(); } public static List GetSpawnDenialNodes() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) List list = (from n in GameObject.FindGameObjectsWithTag("SpawnDenialPoint") select n.transform.position).ToList(); list.Add(GameObject.FindGameObjectWithTag("ItemShipLandingNode").transform.position); list.AddRange((from i in Object.FindObjectsOfType() select ((Component)i).gameObject.transform.position).ToList()); list.AddRange((from l in Object.FindObjectsOfType() where l.isLadder select ((Component)l).gameObject.transform.position).ToList()); return list; } internal static int[] IntArray(this float[] Values) { int[] array = new int[Values.Length]; for (int i = 0; i < Values.Length; i++) { array[i] = (int)Values[i]; } return array; } public static SpawnableMapObject[] Add(this SpawnableMapObject[] toObjects, SpawnableMapObject newObject) { SpawnableMapObject[] array = (SpawnableMapObject[])(object)new SpawnableMapObject[toObjects.Length + 1]; for (int i = 0; i < toObjects.Length; i++) { array[i] = toObjects[i]; } array[toObjects.Length] = newObject; return array; } internal static WeatherEffect[] Add(this WeatherEffect[] toObjects, WeatherEffect newObject) { WeatherEffect[] array = (WeatherEffect[])(object)new WeatherEffect[toObjects.Length + 1]; for (int i = 0; i < toObjects.Length; i++) { array[i] = toObjects[i]; } array[toObjects.Length] = newObject; return array; } public static Vector3 GetRandomNavMeshPositionInBox(Vector3 pos, float minRadius, float maxRadius) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) float num = (maxRadius + minRadius) * 0.5f; float num2 = (maxRadius - minRadius) * 0.5f; Vector3 val = default(Vector3); NavMeshHit val2 = default(NavMeshHit); for (int i = 0; i < 15; i++) { Random.InitState(Net.Instance._seed++ + Environment.TickCount); ((Vector3)(ref val))..ctor(Mathf.Cos(Random.Range(0f, MathF.PI * 2f)) * num + pos.x, pos.y, Mathf.Sin(Random.Range(0f, MathF.PI * 2f)) * num + pos.z); if (NavMesh.SamplePosition(val, ref val2, num2, -1) && Vector3.Distance(pos, val) >= minRadius) { return ((NavMeshHit)(ref val2)).position; } } return pos; } internal static string GetPercentage(float value) { return (value * 100f).ToString("F1") + "%"; } internal static string GetDifficultyColorHex(float difficulty, float cap) { if (cap == 0f) { cap = 1f; } difficulty *= Configuration.difficultyMaxCap.Value / cap; EventManager.DifficultyTransition[] chosenAndNextTransition = GetChosenAndNextTransition(difficulty); return chosenAndNextTransition[0].GetTransitionHex(chosenAndNextTransition[1]); } internal static string GetDifficultyText() { EventManager.DifficultyTransition[] chosenAndNextTransition = GetChosenAndNextTransition(Manager.difficulty); return "" + chosenAndNextTransition[0].name + ""; } internal static EventManager.DifficultyTransition[] GetChosenAndNextTransition(float difficulty) { EventManager.DifficultyTransition difficultyTransition = Configuration.difficultyTransitions[0]; EventManager.DifficultyTransition difficultyTransition2 = Configuration.difficultyTransitions[0]; int num = 0; for (int i = 0; i < Configuration.difficultyTransitions.Length; i++) { if (Configuration.difficultyTransitions[i].above <= difficulty) { difficultyTransition = Configuration.difficultyTransitions[i]; num = i; } } difficultyTransition2 = ((num != Configuration.difficultyTransitions.Length - 1) ? Configuration.difficultyTransitions[num + 1] : difficultyTransition); return new EventManager.DifficultyTransition[2] { difficultyTransition, difficultyTransition2 }; } internal unsafe static Vector3 GetSafePosition(List nodes, List denialNodes, float radius, int seed) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(seed); Random.InitState(seed); Vector3 val = nodes[random.Next(nodes.Count)]; int num = 0; while (true) { num++; Vector3 randomNavMeshPositionInRadius = RoundManager.Instance.GetRandomNavMeshPositionInRadius(val, radius, default(NavMeshHit)); bool flag = true; foreach (Vector3 denialNode in denialNodes) { if (Vector3.Distance(denialNode, randomNavMeshPositionInRadius) <= 16f) { flag = false; } } if (flag) { val = randomNavMeshPositionInRadius; break; } if (num > 51) { Vector3 val2 = val; Log.LogError("GetSafePosition() got stuck, returning " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString()); break; } if (num % 10 == 0) { val = nodes[Random.Range(0, nodes.Count)]; } } return val; } public static bool IsSafe(Vector3 testNode, List fromNodes, float radius) { //IL_000d: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) foreach (Vector3 fromNode in fromNodes) { if (Vector3.Distance(testNode, fromNode) <= radius) { return false; } } return true; } public static string MostCommon(List list) { string result = ""; if (list != null && list.Count > 0) { Dictionary dictionary = new Dictionary(); foreach (string item in list) { if (dictionary.ContainsKey(item)) { dictionary[item]++; } else { dictionary.Add(item, 1); } } int num = 0; foreach (KeyValuePair item2 in dictionary) { if (item2.Value > num) { result = item2.Key; num = item2.Value; } } } return result; } internal static MEvent.Scale getScale(string from) { float[] array = ParseValuesFromString(from); return new MEvent.Scale(array[0], array[1], array[2], array[3]); } internal static string GetStringFromScale(MEvent.Scale from) { return from.Base.ToString(en) + ", " + from.Increment.ToString(en) + ", " + from.MinCap.ToString(en) + ", " + from.MaxCap.ToString(en); } internal static float[] ParseValuesFromString(string from) { return (from x in @from.Split(',') select float.Parse(x, en)).ToArray(); } internal static string StringsToList(List strings, string seperator) { string text = ""; foreach (string @string in strings) { text += @string; text += seperator; } if (strings.Count > 0) { text = text.Substring(0, text.Length - seperator.Length); } return text; } internal static List ListToStrings(string text) { if (Utility.IsNullOrWhiteSpace(text)) { return new List(); } text = text.Replace(" ", ""); return text.Split(',').ToList(); } internal static List ListToDescriptions(string text) { if (Utility.IsNullOrWhiteSpace(text)) { return new List { "" }; } return text.Split("|").ToList(); } internal static EventManager.DifficultyTransition[] GetDifficultyTransitionsFromString(string s) { string[] array = s.Split("|"); EventManager.DifficultyTransition[] array2 = new EventManager.DifficultyTransition[array.Length]; for (int i = 0; i < array.Length; i++) { string[] array3 = array[i].Split(","); if (array3.Length != 3) { Log.LogError($"DifficultyTransition config entry is of length:{array3.Length}, must be of length 3, returning a working version of difficultyTransitions."); return new EventManager.DifficultyTransition[2] { new EventManager.DifficultyTransition("Easy", "FFFFFF", 10f), new EventManager.DifficultyTransition("Medium", "000000", 20f) }; } float above = i; try { above = float.Parse(array3[2]); } catch { Log.LogError($"Failed to parse number from difficulty transition, value is going to be {i}."); } array2[i] = new EventManager.DifficultyTransition(array3[0], array3[1], above); } Array.Sort(array2); return array2; } internal static Dictionary GetMoonRiskFromString(string text) { Dictionary dictionary = new Dictionary(); string[] array = text.Split("|"); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(","); float value = 0f; try { value = float.Parse(array2[1]); } catch { Log.LogError("Moon Risk Difficulty Entry contains a value that isn't a number, value will be 0, attempted input " + array2[1] + "."); } if (!dictionary.TryAdd(array2[0], value)) { Log.LogError("Entry " + array2[0] + " already exists in the dicitionary."); } } return dictionary; } internal static IList ComputeConvexHull(List points, bool sortInPlace = false) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: 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_008e: 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_00ac: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (!sortInPlace) { points = new List(points); } points.Sort((Vector2 a, Vector2 b) => (a.x == b.x) ? a.y.CompareTo(b.y) : ((a.x > b.x) ? 1 : (-1))); CircularList circularList = new CircularList(); int num = 0; int num2 = 0; for (int num3 = points.Count - 1; num3 >= 0; num3--) { Vector2 val = points[num3]; Vector2 last; while (num >= 2 && (last = circularList.Last).Sub(circularList[circularList.Count - 2]).Cross(val.Sub(last)) >= 0f) { circularList.PopLast(); num--; } circularList.PushLast(val); num++; while (num2 >= 2 && (last = circularList.First).Sub(circularList[1]).Cross(val.Sub(last)) <= 0f) { circularList.PopFirst(); num2--; } if (num2 != 0) { circularList.PushFirst(val); } num2++; } circularList.PopLast(); return circularList; } internal static SpawnableItemWithRarity? GetChosenScrap(Func scrapSelector) { List list = RoundManager.Instance.currentLevel.spawnableScrap.Where(scrapSelector).ToList(); int num = list.Sum((SpawnableItemWithRarity i) => i.rarity); int num2 = Random.Range(0, num); int num3 = 0; foreach (SpawnableItemWithRarity item in list) { num3 += item.rarity; if (num3 > num2) { return item; } } Log.LogError("Get chosen scrap could not find a random scrap to choose. Transmute events will not work."); return null; } private static Vector2 Sub(this Vector2 a, Vector2 b) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return a - b; } private static float Cross(this Vector2 a, Vector2 b) { //IL_0001: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) return a.x * b.y - a.y * b.x; } } internal class Log { internal static ManualLogSource logSource; internal static void Initalize(ManualLogSource LogSource) { logSource = LogSource; } internal static void LogDebug(object data) { logSource.LogDebug(data); } internal static void LogError(object data) { logSource.LogError(data); } internal static void LogFatal(object data) { logSource.LogFatal(data); } internal static void LogInfo(object data) { logSource.LogInfo(data); } internal static void LogMessage(object data) { logSource.LogMessage(data); } internal static void LogWarning(object data) { logSource.LogWarning(data); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("SoftDiamond.BrutalCompanyMinusExtraReborn", "BrutalCompanyMinusExtraReborn", "1.61.0")] internal class Plugin : BaseUnityPlugin { private const string GUID = "SoftDiamond.BrutalCompanyMinusExtraReborn"; private const string NAME = "BrutalCompanyMinusExtraReborn"; private const string VERSION = "1.61.0"; private static readonly Harmony harmony = new Harmony("SoftDiamond.BrutalCompanyMinusExtraReborn"); internal static Plugin Instance { get; private set; } private void Awake() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown if ((Object)(object)Instance == (Object)null) { Instance = this; } Log.Initalize(((BaseUnityPlugin)this).Logger); Configuration.uiConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\UI_Settings.cfg", true); Configuration.difficultyConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\Difficulty_Settings.cfg", true); Configuration.eventConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\VanillaEvents.cfg", true); Configuration.weatherConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\Weather_Settings.cfg", true); Configuration.customAssetsConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\Enemy_Scrap_Weights_Settings.cfg", true); Configuration.moddedEventConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\ModdedEvents.cfg", true); Configuration.customEventConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CustomEvents.cfg", true); Configuration.allEnemiesConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\AllEnemies.cfg", true); Configuration.levelPropertiesConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\LevelProperties.cfg", true); Configuration.CorePropertiesConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CoreProperties.cfg", true); Configuration.LanguageConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\Language.cfg", true); Configuration.uiConfig.SaveOnConfigSet = false; Configuration.difficultyConfig.SaveOnConfigSet = false; Configuration.eventConfig.SaveOnConfigSet = false; Configuration.weatherConfig.SaveOnConfigSet = false; Configuration.customAssetsConfig.SaveOnConfigSet = false; Configuration.moddedEventConfig.SaveOnConfigSet = false; Configuration.customEventConfig.SaveOnConfigSet = false; Configuration.allEnemiesConfig.SaveOnConfigSet = false; Configuration.levelPropertiesConfig.SaveOnConfigSet = false; Configuration.CorePropertiesConfig.SaveOnConfigSet = false; Configuration.LanguageConfig.SaveOnConfigSet = false; Assets.Load(); harmony.PatchAll(); harmony.PatchAll(typeof(GrabObjectTranspiler)); if (Compatibility.IsModPresent("FlipMods.HotbarPlus")) { HotBarPlusCompat.PatchAll(harmony); } if (Compatibility.IsModPresent("LethalPhones")) { PhonesOutPatching.PatchAllPhone(harmony); } if (Compatibility.IsModPresent("Scandal.CruiserXL")) { ScanVanPatching.PatchAllCruiserXL(harmony); } if (!Compatibility.IsModPresent("AudioKnight.StarlancerAIFix")) { _EnemyAI.PatchEnemyStart(harmony); } Log.LogInfo("BrutalCompanyMinusExtraReborn 1.61.0 is done patching."); if (Assets.ReadSettingEarly(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\DifficultySettings.cfg", "Enable time scaling?")) { } Log.LogInfo("Time adjustment is enabled."); try { File.Delete(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CustomEvents.cfg"); File.Create(Paths.ConfigPath + "\\BrutalCompanyMinusExtraReborn\\CustomEvents.cfg").Dispose(); } catch (Exception ex) { Log.LogWarning("Failed to delete custom event config file: " + ex.Message); } Init(); } private void Init() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "BrutalCompanyMinus"; public const string PLUGIN_NAME = "BrutalCompanyMinusExtraReborn"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace BrutalCompanyMinus.Minus { public class API { public static void RegenerateEvents() { try { SelectableLevel newLevel = Manager.currentLevel; EventManager.FixHazardsOnLeave(); EventManager.ModifyLevel(ref newLevel); } catch (Exception arg) { Log.LogError($"Error occurred with GenerateBrutalEvents: {arg}"); } } public static void ForceEvents(string[] eventNames) { try { EventManager.forcedEvents.AddRange(EventManager.GetEventsByName(eventNames)); } catch (Exception arg) { Log.LogError($"Error occurred while forcing event(s) {eventNames}: {arg}"); } } public static bool DoesEventExist(string name) { try { bool flag = EventManager.events.Any((MEvent x) => string.Equals(x.Name(), name, StringComparison.OrdinalIgnoreCase)); if (!flag) { Log.LogWarning("The event with the name '" + name + "' does not exist."); } return flag; } catch (Exception arg) { Log.LogError($"Error occurred while checking if event {name} exists: {arg}"); return false; } } public static float GetDifficulty() { try { return Manager.difficulty; } catch (Exception arg) { Log.LogError($"Error occurred while getting current difficulty: {arg}"); return 0f; } } public static float GetDaysDifficulty() { try { return Mathf.Clamp((float)Manager.daysPassed * Configuration.daysPassedDifficultyMultiplier.Value, 0f, Configuration.daysPassedDifficultyCap.Value); } catch (Exception arg) { Log.LogError($"Error occurred while getting current days difficulty: {arg}"); return 0f; } } public static float GetScrapDifficulty() { try { return Mathf.Clamp(Manager.GetScrapInShip() * Configuration.scrapInShipDifficultyMultiplier.Value, 0f, Configuration.scrapInShipDifficultyCap.Value); } catch (Exception arg) { Log.LogError($"Error occurred while getting current scrap difficulty: {arg}"); return 0f; } } public static float GetMoonDifficulty() { try { if (Configuration.gradeAdditives.TryGetValue(StartOfRound.Instance.currentLevel.riskLevel, out var value)) { return value; } return 0f; } catch (Exception arg) { Log.LogError($"Error occurred while getting current moon difficulty: {arg}"); return 0f; } } public static float GetWeatherDifficulty() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) try { return Configuration.weatherAdditives.GetValueOrDefault(StartOfRound.Instance.currentLevel.currentWeather, 0f); } catch (Exception arg) { Log.LogError($"Error occurred while getting current weather difficulty: {arg}"); return 0f; } } public static float GetQuotaDifficulty() { try { return Mathf.Clamp((float)TimeOfDay.Instance.profitQuota * Configuration.quotaDifficultyMultiplier.Value, 0f, Configuration.quotaDifficultyCap.Value); } catch (Exception arg) { Log.LogError($"Error occurred while getting current quota difficulty: {arg}"); return 0f; } } public static float GetHeatDifficulty(int levelID = -1) { try { if (levelID == -1) { levelID = RoundManager.Instance.currentLevel.levelID; } float value; return Manager.heatDifficulty.TryGetValue(levelID, out value) ? value : Configuration.startingHeat.Value; } catch (Exception arg) { Log.LogError($"Error occurred while getting current heat difficulty: {arg}"); return 0f; } } public static MEvent GetEventsByName(string names) { return EventManager.events.FirstOrDefault((MEvent x) => string.Equals(x.Name(), names, StringComparison.OrdinalIgnoreCase)); } public static List GetEventDescriptions(MEvent e) { try { return e.Descriptions; } catch (Exception ex) { Log.LogError("Error while getting event descriptions for " + e?.Name() + ": " + ex.Message); return new List(); } } public static List GetEventDescriptions(string thisEvent) { try { return GetEventsByName(thisEvent)?.Descriptions ?? new List(); } catch (Exception ex) { Log.LogError("Error while getting event descriptions for " + thisEvent + ": " + ex.Message); return new List(); } } public static string GetEventColorHex(MEvent e) { try { return e.ColorHex; } catch (Exception ex) { Log.LogError("Error while getting event color hex for " + e?.Name() + ": " + ex.Message); return ""; } } public static string GetEventColorHex(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.ColorHex; } catch (Exception ex) { Log.LogError("Error while getting event color hex for " + thisEvent + ": " + ex.Message); return ""; } } public static int GetEventWeight(MEvent e) { try { return e.Weight; } catch (Exception ex) { Log.LogError("Error while getting event weight for " + e?.Name() + ": " + ex.Message); return 0; } } public static int GetEventWeight(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.Weight; } catch (Exception ex) { Log.LogError("Error while getting event weight for " + thisEvent + ": " + ex.Message); return 0; } } public static string GetEventType(MEvent e) { try { return e.Type.ToString(); } catch (Exception ex) { Log.LogError("Error while getting event type for " + e?.Name() + ": " + ex.Message); return ""; } } public static string GetEventType(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.Type.ToString(); } catch (Exception ex) { Log.LogError("Error while getting event type for " + thisEvent + ": " + ex.Message); return ""; } } public static bool IsEventEnabled(MEvent e) { try { return e.Enabled; } catch (Exception ex) { Log.LogError("Error while getting event enabled status for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventEnabled(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.Enabled; } catch (Exception ex) { Log.LogError("Error while getting event enabled status for " + thisEvent + ": " + ex.Message); return false; } } public static bool IsEventSpecial(MEvent e) { try { return e.isSpecialEvent; } catch (Exception ex) { Log.LogError("Error while getting event special status for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventSpecial(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.isSpecialEvent; } catch (Exception ex) { Log.LogError("Error while getting event special status for " + thisEvent + ": " + ex.Message); return false; } } public static bool IsEventBeta(MEvent e) { try { return e.isBetaEvent; } catch (Exception ex) { Log.LogError("Error while getting event beta status for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventBeta(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.isBetaEvent; } catch (Exception ex) { Log.LogError("Error while getting event beta status for " + thisEvent + ": " + ex.Message); return false; } } public static bool IsEventActive(MEvent e) { try { return e.Active; } catch (Exception ex) { Log.LogError("Error while getting event active status for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventActive(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.Active; } catch (Exception ex) { Log.LogError("Error while getting event active status for " + thisEvent + ": " + ex.Message); return false; } } public static bool IsEventExecuted(MEvent e) { try { return e.Executed; } catch (Exception ex) { Log.LogError("Error while getting event executed status for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventExecuted(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.Executed; } catch (Exception ex) { Log.LogError("Error while getting event executed status for " + thisEvent + ": " + ex.Message); return false; } } public static List GetEventsToRemove(MEvent e) { try { return e.EventsToRemove; } catch (Exception ex) { Log.LogError("Error while getting events to remove for " + e?.Name() + ": " + ex.Message); return new List(); } } public static List GetEventsToRemove(string thisEvent) { try { return GetEventsByName(thisEvent)?.EventsToRemove ?? new List(); } catch (Exception ex) { Log.LogError("Error while getting events to remove for " + thisEvent + ": " + ex.Message); return new List(); } } public static List GetEventsToAdd(MEvent e) { try { return e.EventsToSpawnWith; } catch (Exception ex) { Log.LogError("Error while getting events to remove for " + e?.Name() + ": " + ex.Message); return new List(); } } public static List GetEventsToAdd(string thisEvent) { try { return GetEventsByName(thisEvent)?.EventsToSpawnWith ?? new List(); } catch (Exception ex) { Log.LogError("Error while getting events to remove for " + thisEvent + ": " + ex.Message); return new List(); } } public static bool IsEventSpeedRunSafe(MEvent e) { try { return e.SpeedRunSafe; } catch (Exception ex) { Log.LogError("Error while getting event speedrun safe status for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventSpeedRunSafe(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return eventsByName.SpeedRunSafe; } catch (Exception ex) { Log.LogError("Error while getting event speedrun safe status for " + thisEvent + ": " + ex.Message); return false; } } public static List GetEventAliases(MEvent e) { try { return e.Aliases; } catch (Exception ex) { Log.LogError("Error while getting event aliases for " + e?.Name() + ": " + ex.Message); return new List(); } } public static List GetEventAliases(string thisEvent) { try { return GetEventsByName(thisEvent)?.Aliases ?? new List(); } catch (Exception ex) { Log.LogError("Error while getting event aliases for " + thisEvent + ": " + ex.Message); return new List(); } } public static bool isEventOnWhitelist(MEvent e) { try { return EventManager.IsEventOnMoonWhitelist(e); } catch (Exception ex) { Log.LogError("Error while checking if event is on whitelist for " + e?.Name() + ": " + ex.Message); return false; } } public static bool isEventOnWhitelist(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return EventManager.IsEventOnMoonWhitelist(eventsByName); } catch (Exception ex) { Log.LogError("Error while checking if event is on whitelist for " + thisEvent + ": " + ex.Message); return false; } } public static bool isEventOnBlacklist(MEvent e) { try { return EventManager.IsIgnoredEventByMoonBlacklist(e); } catch (Exception ex) { Log.LogError("Error while checking if event is on blacklist for " + e?.Name() + ": " + ex.Message); return false; } } public static bool IsEventOnBlacklist(string thisEvent) { try { MEvent eventsByName = GetEventsByName(thisEvent); return EventManager.IsIgnoredEventByMoonBlacklist(eventsByName); } catch (Exception ex) { Log.LogError("Error while checking if event is on blacklist for " + thisEvent + ": " + ex.Message); return false; } } } [HarmonyPatch] public class EventManager { public struct DifficultyTransition : IComparable { internal const uint byteMask = 255u; public string name; public string hex; public float above; public uint[] rgb; public DifficultyTransition(string name, string hex, float above) { this.name = name; this.hex = hex; this.above = above; rgb = new uint[3]; uint num = 0u; try { num = uint.Parse(hex, NumberStyles.HexNumber); } catch { Log.LogError("Failed to parse hex."); } rgb[0] = (num >> 16) & 0xFF; rgb[1] = (num >> 8) & 0xFF; rgb[2] = num & 0xFF; } public string GetTransitionHex(DifficultyTransition next) { float at = Mathf.Clamp((next.above - Manager.difficulty) / (next.above - above), 0f, 1f); uint num = InBetween(rgb[0], next.rgb[0], at); uint num2 = InBetween(rgb[1], next.rgb[1], at); uint num3 = InBetween(rgb[2], next.rgb[2], at); return num.ToString("X2") + num2.ToString("X2") + num3.ToString("X2"); } private uint InBetween(uint min, uint max, float at) { return (uint)Mathf.Clamp(at * (float)(max - min) + (float)min, 0f, 255f); } public int CompareTo(DifficultyTransition other) { return above.CompareTo(other.above); } } internal class CustomEvents { public ConfigFile configFile; public List events; public CustomEvents(ConfigFile configFile, List events) { this.configFile = configFile; this.events = events; } } internal static List vanillaEvents = new List { new SID(), new BigBonus(), new ScrapGalore(), new GoldenBars(), new BigDelivery(), new PlentyOutsideScrap(), new BlackFriday(), new BrutalCompanyMinus.Minus.Events.SafeOutside(), new VeryEarlyShip(), new TrapsFailure(), new BrutalCompanyMinus.Minus.Events.Bounty(), new Bonus(), new SmallerMap(), new MoreScrap(), new HigherScrapValue(), new GoldenFacility(), new Dentures(), new Pickles(), new Honk(), new TransmuteScrapSmall(), new SmallDelivery(), new ScarceOutsideScrap(), new FragileEnemies(), new BrutalCompanyMinus.Minus.Events.FullAccess(), new EarlyShip(), new MoreExits(), new DoorOverdriveEv(), new ZedDog(), new NotMetal(), new Nothing(), new MetalSwitch(), new Locusts(), new Birds(), new Trees(), new LeaflessBrownTrees(), new LeaflessTrees(), new Raining(), new Gloomy(), new HeavyRain(), new MaskItem(), new EasterEggs(), new Clock(), new SussyPaintings(), new Train(), new ControlPad(), new PlasticCup(), new ToiletPaper(), new FootballScrap(), new GarbageLid(), new SeveredBits(), new HoardingBugs(), new Dustpans(), new Bees(), new ShipLightsFailure(), new Landmines(), new Lizard(), new Slimes(), new Thumpers(), new Turrets(), new Spiders(), new SnareFleas(), new BrutalCompanyMinus.Minus.Events.FacilityGhost(), new OutsideTurrets(), new OutsideLandmines(), new BrutalCompanyMinus.Minus.Events.ShipmentFees(), new GrabbableLandmines(), new GrabbableTurrets(), new StrongEnemies(), new KamikazieBugs(), new BrutalCompanyMinus.Minus.Events.RealityShift(), new Masked(), new Butlers(), new SpikeTraps(), new FlowerSnake(), new LateShip(), new HolidaySeason(), new TurretsEverywhere(), new ItemChargerFailure(), new CruiserFailure(), new TeleporterFailure(), new TerminalFailure(), new DoorFailure(), new WalkieFailure(), new ManualCameraFailure(), new LeverFailure(), new WelcomeToTheFactory(), new FlashLightsFailure(), new JetpackFailure(), new DoorCircuitFailure(), new Meteors(), new BrutalCompanyMinus.Minus.Events.AntiBounty(), new TargetingFailureEvent(), new TeleporterTraps(), new IsMetal(), new Stingray(), new Puma(), new KidnapperFox(), new Cadaver(), new CatsAndDogs(), new Nutcracker(), new KiwiBird(), new LockedEntrance(), new Arachnophobia(), new Bracken(), new Coilhead(), new BaboonHorde(), new Dogs(), new VeryLateShip(), new TeleportIn(), new GiantsOutside(), new Jester(), new LittleGirl(), new AntiCoilhead(), new BadProduce(), new TransmuteScrapBig(), new Warzone(), new BugHorde(), new ForestGiant(), new InsideBees(), new NutSlayer(), new BrutalCompanyMinus.Minus.Events.AllWeather(), new Worms(), new OldBirds(), new ShipCoreFailure(), new Dweller(), new BrutalCompanyMinus.Minus.Events.BerserkTurrets(), new BrutalCompanyMinus.Minus.Events.Hell(), new TimeChaos(), new NutSlayersMore(), new SlimeInside(), new NoBaboons(), new NoBracken(), new NoCoilhead(), new NoDogs(), new NoGiants(), new NoHoardingBugs(), new NoJester(), new NoGhosts(), new NoLizards(), new NoNutcracker(), new NoSpiders(), new NoThumpers(), new NoSnareFleas(), new NoWorm(), new NoSlimes(), new NoMasks(), new NoTurrets(), new NoLandmines(), new NoOldBird(), new NoButlers(), new NoBirds(), new NoSpikeTraps() }; public static List moddedEvents = new List { new CityOfGold(), new Dice(), new Nemo(), new HotBarMania(), new NeedyCats(), new Lockers(), new Hallowed(), new TakeyGokuBracken(), new Cleaners(), new ImmortalSnail(), new Peepers(), new RollingGiants(), new Roomba(), new ShockwaveDrones(), new Shrimp(), new Football(), new Baldi(), new Shiba(), new Seamine(), new YeetBomb(), new ManStalker(), new Foxy(), new HotBarHassle(), new Bellcrab(), new LightEaterEnemy(), new LeafBoys(), new WelcomeToOoblterra(), new PhonesOut(), new Barbers(), new SCP939(), new SCP682(), new SolarFlare(), new Heatwave(), new Windy(), new MeteorShower(), new Forsaken(), new MobileTurrets(), new Mantitoil(), new ToilSlayer(), new MantiToilSlayer(), new AllSlayers(), new BadDice(), new Herobrine(), new ShyGuy(), new SirenHead(), new SlenderMan(), new TheFiend(), new ToilHead(), new GiantShowdown(), new MoaiEnemy(), new Meltdown(), new SkullEnemy(), new Critters(), new PlaytimeBig(), new ItsPlaytime(), new Walkers(), new SoulDev(), new MajoraMoon(), new BloodMoon(), new Hurricane(), new Bertha(), new NoMantitoil(), new NoToilSlayer(), new NoMantiToilSlayer(), new NoSlayers(), new NoFiend(), new NoImmortalSnails(), new NoLockers(), new NoShyGuy(), new NoPeepers() }; internal static List customEvents = new List(); internal static List events = new List(); internal static List disabledEvents = new List(); internal static List currentEvents = new List(); internal static List forcedEvents = new List(); internal static List allVeryGood = new List(); internal static List allGood = new List(); internal static List allNeutral = new List(); internal static List allBad = new List(); internal static List allVeryBad = new List(); internal static List allRemove = new List(); internal static List allInsane = new List(); internal static List allRare = new List(); internal static List allSpecial = new List(); internal static List allBeta = new List(); internal static List sideEvents = new List(); private static List tipEventsToDo = new List(); internal static List currentEventDescriptions = new List(); internal static float eventTypeSum = 0f; internal static float[] eventTypeCount = new float[0]; internal static float[] eventTypeRarities = new float[0]; public static List hazards = new List(); internal static MEvent RandomWeightedEvent(List _events, Random rng) { if (_events.Count == 0) { return new Nothing(); } int num = 0; foreach (MEvent _event in _events) { num += _event.Weight; } foreach (MEvent _event2 in _events) { if (rng.Next(0, num) < _event2.Weight) { return _event2; } num -= _event2.Weight; } return _events[_events.Count - 1]; } internal static List ChooseEvents(out List additionalEvents) { currentEvents.Clear(); sideEvents.Clear(); List list = new List(); List list2 = new List(); foreach (MEvent @event in events) { list2.Add(@event); } Random random = new Random(StartOfRound.Instance.randomMapSeed + 32345 + Environment.TickCount); int num = (int)MEvent.Scale.Compute(Configuration.eventsToSpawn) + RoundManager.Instance.GetRandomWeightedIndex(Configuration.weightsForExtraEvents.IntArray(), random); if (Configuration.scaleHeat.Value) { float num2 = currentHeatDifficulty(); if (num2 == Configuration.heatMaxCap.Value && Configuration.heatForceEventAtMax.Value) { Log.LogInfo("Current heat has hit max cap, now forcing events"); Log.LogInfo("Attempting to force events: " + Configuration.heatEventsToForce.Value); string[] names = (from s in Configuration.heatEventsToForce.Value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select s.Trim()).ToArray(); forcedEvents.AddRange(GetEventsByName(names)); } } foreach (MEvent forcedEvent in forcedEvents) { list2.RemoveAll((MEvent x) => x.Name() == forcedEvent.Name()); foreach (string item in forcedEvent.EventsToRemove) { list2.RemoveAll((MEvent x) => x.Name() == forcedEvent.Name()); } } int num3; for (num3 = 0; num3 < num; num3++) { MEvent newEvent = RandomWeightedEvent(list2, random); if (!newEvent.AddEventIfOnly()) { num3--; list2.RemoveAll((MEvent x) => x.Name() == newEvent.Name()); } else { bool flag = (newEvent.MoonMode ? IsEventOnMoonWhitelist(newEvent) : (!IsIgnoredEventByMoonBlacklist(newEvent))); Log.LogInfo("Checking " + (newEvent.MoonMode ? "whitelist" : "blacklist") + " for event " + newEvent.Name()); if (!flag) { Log.LogInfo("Event " + newEvent.Name() + " is " + (newEvent.MoonMode ? "not whitelisted" : "blacklisted") + " on moon " + Manager.currentLevel.PlanetName + ", skipping."); } if (flag && (newEvent.isSpecialEvent || newEvent.isBetaEvent)) { bool flag2 = newEvent.isSpecialEvent && !Configuration.enableSpecialEvents.Value; bool flag3 = newEvent.isBetaEvent && !Configuration.enableBetaEvents.Value; flag = !(flag2 || flag3); } if (!flag) { num3--; list2.RemoveAll((MEvent x) => x.Name() == newEvent.Name()); } else if (flag) { list.Add(newEvent); list2.RemoveAll((MEvent x) => x.Name() == newEvent.Name()); int num4 = 0; foreach (string eventToRemove in newEvent.EventsToRemove) { list2.RemoveAll((MEvent x) => x.Name() == eventToRemove); num4 += list.RemoveAll((MEvent x) => x.Name() == eventToRemove); } foreach (string eventToSpawnWith in newEvent.EventsToSpawnWith) { list2.RemoveAll((MEvent x) => x.Name() == eventToSpawnWith); num4 += list.RemoveAll((MEvent x) => x.Name() == eventToSpawnWith); } num3 -= num4; } else { num3--; } } } List list3 = new List(); for (int num5 = 0; num5 < list.Count; num5++) { foreach (string eventToSpawnWith2 in list[num5].EventsToSpawnWith) { int num6 = list3.FindIndex((MEvent x) => x.Name() == eventToSpawnWith2); if (num6 == -1) { list3.Add(MEvent.GetEvent(eventToSpawnWith2)); } num6 = sideEvents.FindIndex((MEvent x) => x.Name() == eventToSpawnWith2); if (num6 == -1) { sideEvents.Add(MEvent.GetEvent(eventToSpawnWith2)); } } } foreach (MEvent e in disabledEvents) { int num7 = list3.FindIndex((MEvent x) => x.Name() == e.Name()); if (num7 != -1) { list3.RemoveAt(num7); } } additionalEvents = list3; currentEvents = list; return list; } internal static void ApplyEvents(List currentEvents) { foreach (MEvent currentEvent in currentEvents) { if (!currentEvent.Executed) { currentEvent.Executed = true; currentEvent.Execute(); } } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void FixHazardsOnLeave() { if (((NetworkBehaviour)RoundManager.Instance).IsHost && RoundManager.Instance?.currentLevel?.indoorMapHazards != null) { List list = RoundManager.Instance.currentLevel.indoorMapHazards.ToList(); list.RemoveAll((IndoorMapHazard hazard) => hazards.Contains(hazard)); RoundManager.Instance.currentLevel.indoorMapHazards = list.ToArray(); hazards.Clear(); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "OnLocalDisconnect")] public static void FixHazardsOnLeaveLocalDisconnect() { FixHazardsOnLeave(); } internal static void ExecuteOnShipLeave() { Log.LogInfo("Executing OnShipLeave for all events()"); foreach (MEvent @event in events) { @event.OnShipLeave(); } foreach (MEvent vanillaEvent in vanillaEvents) { vanillaEvent.OnShipLeave(); } foreach (MEvent moddedEvent in moddedEvents) { moddedEvent.OnShipLeave(); } foreach (MEvent customEvent in customEvents) { customEvent.OnShipLeave(); } } internal static void ExecuteOnGameStart() { Log.LogInfo("Executing OnGameStart for all events()"); if (currentEvents != null) { currentEvents.Clear(); } if (sideEvents != null) { sideEvents.Clear(); } foreach (MEvent @event in events) { @event.OnGameStart(); } foreach (MEvent vanillaEvent in vanillaEvents) { vanillaEvent.OnGameStart(); } foreach (MEvent moddedEvent in moddedEvents) { moddedEvent.OnGameStart(); } foreach (MEvent customEvent in customEvents) { customEvent.OnGameStart(); } } internal static void ExecuteOnLocalDisconnect() { Log.LogInfo("Executing OnLocalDisconnect for all events()"); foreach (MEvent @event in events) { @event.OnLocalDisconnect(); } foreach (MEvent vanillaEvent in vanillaEvents) { vanillaEvent.OnLocalDisconnect(); } foreach (MEvent moddedEvent in moddedEvents) { moddedEvent.OnLocalDisconnect(); } } internal static void UpdateAllEventWeights() { if (Configuration.useCustomWeights.Value) { return; } int num = Configuration.eventTypeScales.Length; float[] array = new float[num]; for (int i = 0; i < num; i++) { array[i] = MEvent.Scale.Compute(Configuration.eventTypeScales[i]); } float num2 = 0f; for (int j = 0; j < num; j++) { num2 += array[j]; } num2 = fix(num2); float[] array2 = new float[num]; for (int k = 0; k < num; k++) { array2[k] = array[k] / num2; } eventTypeRarities = array2; int[] array3 = new int[num]; for (int l = 0; l < num; l++) { array3[l] = (int)(eventTypeSum / fix(eventTypeCount[l]) * array2[l] * 1000f); Log.LogInfo($"Set eventType weight for {((MEvent.EventType)Enum.ToObject(typeof(MEvent.EventType), l)/*cast due to .constrained prefix*/).ToString()} to {array3[l]}"); } foreach (MEvent @event in events) { @event.Weight = array3[(int)@event.Type]; } static float fix(float value) { if (value < 1f) { return 1f; } return value; } } internal static void UpdateEventTypeCounts() { int num = Configuration.eventTypeScales.Length; eventTypeCount = new float[num]; for (int i = 0; i < num; i++) { eventTypeCount[i] = 0f; } foreach (MEvent @event in events) { eventTypeCount[(int)@event.Type] += 1f; } eventTypeSum = 0f; for (int j = 0; j < num; j++) { eventTypeSum += eventTypeCount[j]; } } internal static void UpdateEventDescriptions(List events) { if (!Configuration.displayEvents.Value) { return; } currentEventDescriptions.Clear(); foreach (MEvent @event in events) { currentEventDescriptions.Add("" + @event.Descriptions[Random.Range(0, @event.Descriptions.Count)] + ""); } } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "LoadNewLevel")] public static void ModifyLevel(ref SelectableLevel newLevel) { //IL_0084: 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_0b35: Unknown result type (might be due to invalid IL or missing references) //IL_0b3a: Unknown result type (might be due to invalid IL or missing references) //IL_0b95: Unknown result type (might be due to invalid IL or missing references) //IL_0b9a: Unknown result type (might be due to invalid IL or missing references) //IL_0bf5: Unknown result type (might be due to invalid IL or missing references) //IL_0bfa: Unknown result type (might be due to invalid IL or missing references) ExecuteOnShipLeave(); UI.canClearText = false; Manager.ComputeDifficultyValues(); Manager.currentLevel = newLevel; Manager.currentTerminal = Object.FindObjectOfType(); Assets.generateOriginalValuesLists(); Net.Instance.ClearGameObjectsServerRpc(); if (!((NetworkBehaviour)RoundManager.Instance).IsHost || newLevel.levelID == 3) { return; } LevelModifications.ResetValues(StartOfRound.Instance); foreach (Weather currentWeatherMultiplier in Net.Instance.currentWeatherMultipliers) { if (newLevel.currentWeather == currentWeatherMultiplier.weatherType && Configuration.AffectPropertiesOutOfEvents.Value) { Manager.scrapValueMultiplier *= currentWeatherMultiplier.scrapValueMultiplier; Manager.scrapAmountMultiplier *= currentWeatherMultiplier.scrapAmountMultiplier; } } LevelProperties valueOrDefault = Configuration.levelProperties.GetValueOrDefault(newLevel.levelID); if (valueOrDefault != null && Configuration.AffectPropertiesOutOfEvents.Value) { Manager.scrapValueMultiplier *= valueOrDefault.GetScrapValueMultiplier(); Manager.scrapAmountMultiplier *= valueOrDefault.GetScrapAmountMultiplier(); } if (Configuration.scaleHeat.Value) { Manager.levelNameOnLand = RoundManager.Instance.currentLevel.levelID; if (!Manager.heatDifficulty.ContainsKey(Manager.levelNameOnLand)) { Log.LogInfo("Adding an entry to the list with the ID " + Manager.levelNameOnLand + " and heat difficulty " + Configuration.startingHeat.Value); Manager.heatDifficulty.Add(Manager.levelNameOnLand, Configuration.startingHeat.Value); } if (Manager.heatDifficulty != null) { foreach (int item in Manager.heatDifficulty.Keys.ToList()) { if (item != Manager.levelNameOnLand) { Log.LogInfo(item + " is not equal to " + Manager.levelNameOnLand + ". Current heat difficulty was " + Manager.heatDifficulty[item] + ", decrementing by " + Configuration.heatDecrementAmount.Value); Manager.heatDifficulty[item] = Math.Max(Manager.heatDifficulty[item] - Math.Abs(Configuration.heatDecrementAmount.Value), 0f); Log.LogInfo("New decremented heat recieved for " + item + " is " + Manager.heatDifficulty[item]); } } } } if (Configuration.AffectPropertiesOutOfEvents.Value) { Manager.AddEnemyHp((int)MEvent.Scale.Compute(Configuration.enemyBonusHpScaling)); Manager.AddInsideSpawnChance(newLevel, MEvent.Scale.Compute(Configuration.insideSpawnChanceAdditive)); Manager.AddOutsideSpawnChance(newLevel, MEvent.Scale.Compute(Configuration.outsideSpawnChanceAdditive)); Manager.MultiplySpawnChance(newLevel, MEvent.Scale.Compute(Configuration.spawnChanceMultiplierScaling)); Manager.MultiplySpawnCap(MEvent.Scale.Compute(Configuration.spawnCapMultiplier)); Manager.AddInsidePower((int)MEvent.Scale.Compute(Configuration.insideEnemyMaxPowerCountScaling)); Manager.AddOutsidePower((int)MEvent.Scale.Compute(Configuration.outsideEnemyPowerCountScaling)); Manager.scrapValueMultiplier *= MEvent.Scale.Compute(Configuration.scrapValueMultiplier); Manager.scrapAmountMultiplier *= MEvent.Scale.Compute(Configuration.scrapAmountMultiplier); Manager.factorySizeMultiplier = MEvent.Scale.Compute(Configuration.factorySizeMultiplier); } List additionalEvents = new List(); List list = new List(); if (Configuration.ExtraLogging.Value && newLevel.PlanetName != null) { Log.LogInfo("Moon name is " + newLevel.PlanetName); } bool flag = IsIgnoredMoon(newLevel.PlanetName) || IsIgnoredMoon(((Object)newLevel).name); flag |= !DoesEventsRunByChance(); if (Configuration.DisableAllEvents.Value) { Log.LogInfo("All events are disabled. Skipping event activation."); flag = true; } if (!flag) { if (!Configuration.useCustomWeights.Value) { UpdateAllEventWeights(); } list = ChooseEvents(out additionalEvents); foreach (MEvent item2 in list) { Log.LogInfo("Event chosen: " + item2.Name()); Manager.scrapValueMultiplier *= MEvent.Scale.Compute(Configuration.scrapValueByEventTypeScale[item2.Type]); Manager.scrapAmountMultiplier *= MEvent.Scale.Compute(Configuration.scrapAmountByEventTypeScale[item2.Type]); } foreach (MEvent item3 in additionalEvents) { Log.LogInfo("Additional events: " + item3.Name()); } ApplyEvents(list); ApplyEvents(additionalEvents); } foreach (MEvent forcedEvent in forcedEvents) { forcedEvent.Execute(); foreach (string item4 in forcedEvent.EventsToSpawnWith) { MEvent.GetEvent(item4).Execute(); } } list.AddRange(forcedEvents); forcedEvents.Clear(); UpdateEventDescriptions(list); if (Configuration.showEventsInChat.Value && !Configuration.DisplayUIAfterShipLeaves.Value) { HUDManager.Instance.AddTextToChatOnServer("Events:", -1); foreach (string currentEventDescription in currentEventDescriptions) { HUDManager.Instance.AddTextToChatOnServer(currentEventDescription, -1); } } if (tipEventsToDo.Count > 0) { tipEventsToDo.Clear(); } tipEventsToDo.AddRange(list); RoundManager.Instance.currentLevel.maxEnemyPowerCount = (int)((float)(RoundManager.Instance.currentLevel.maxEnemyPowerCount + Manager.bonusMaxInsidePowerCount) * Manager.spawncapMultipler); if (Configuration.scaleHeat.Value && (Configuration.heatSettingsToAffect.Value.HasFlag(Configuration.HeatSettingsFlags.InsidePower) || Configuration.heatSettingsToAffect.Value.HasFlag(Configuration.HeatSettingsFlags.All))) { float num = currentHeatDifficulty(); if (num > 0f && Configuration.AffectPropertiesOutOfEvents.Value) { SelectableLevel currentLevel = RoundManager.Instance.currentLevel; currentLevel.maxEnemyPowerCount *= (int)((double)(Configuration.heatMultiplierOtherCalculations.Value * (float)RoundManager.Instance.currentLevel.maxEnemyPowerCount / Configuration.heatDampening.Value) * Math.Pow(1f + Configuration.heatDampening.Value, num) + 1.0); } } RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount = (int)((float)(RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount + Manager.bonusMaxOutsidePowerCount) * Manager.spawncapMultipler); if (Configuration.scaleHeat.Value && (Configuration.heatSettingsToAffect.Value.HasFlag(Configuration.HeatSettingsFlags.OutsidePower) || Configuration.heatSettingsToAffect.Value.HasFlag(Configuration.HeatSettingsFlags.All))) { float num2 = currentHeatDifficulty(); if (num2 > 0f && Configuration.AffectPropertiesOutOfEvents.Value) { SelectableLevel currentLevel2 = RoundManager.Instance.currentLevel; currentLevel2.maxOutsideEnemyPowerCount *= (int)((double)(Configuration.heatMultiplierOtherCalculations.Value * (float)RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount / Configuration.heatDampening.Value) * Math.Pow(1f + Configuration.heatDampening.Value, num2) + 1.0); } } Manager.scrapValueMultiplier = Mathf.Clamp(Manager.scrapValueMultiplier, 0f, Configuration.scrapValueMax.Value); Manager.scrapAmountMultiplier = Mathf.Clamp(Manager.scrapAmountMultiplier, 0f, Configuration.scrapAmountMax.Value); SelectableLevel currentLevel3 = RoundManager.Instance.currentLevel; currentLevel3.factorySizeMultiplier *= Math.Clamp(Math.Abs(Manager.factorySizeMultiplier), Math.Abs(Configuration.FactorySizeMin.Value), Math.Abs(Configuration.FactorySizeMax.Value)); if (Configuration.enableCustomTimeAdjustments.Value) { Net.Instance.MoveTimeServerRpc(Mathf.Min(MEvent.Scale.Compute(Configuration.startingTime), 2.1474836E+09f), Mathf.Clamp(MEvent.Scale.Compute(Configuration.timeScaling), 0.001f, 2.1474836E+09f)); } Net.Instance.SyncValuesClientRpc(Manager.currentLevel.factorySizeMultiplier, Manager.scrapValueMultiplier, Manager.scrapAmountMultiplier, Manager.bonusEnemyHp); if (!Configuration.DisplayUIAfterShipLeaves.Value) { UI.GenerateText(list); } else { UI.ClearText(); } Log.LogInfo("MapMultipliers = [" + $"scrapValueMultiplier: {Manager.scrapValueMultiplier}, " + $"scrapAmountMultiplier: {Manager.scrapAmountMultiplier}, " + $"factorySizeMultiplier: {Manager.factorySizeMultiplier}, " + $"EnemyHp: {(int)MEvent.Scale.Compute(Configuration.enemyBonusHpScaling)}, " + $"insideSpawnChanceAdditive: {MEvent.Scale.Compute(Configuration.insideSpawnChanceAdditive)}, " + $"outsideSpawnChanceAdditive: {MEvent.Scale.Compute(Configuration.outsideSpawnChanceAdditive)}, " + $"SpawnChanceMultiplier: {MEvent.Scale.Compute(Configuration.spawnChanceMultiplierScaling)}, " + $"SpawnCapMultiplier: {MEvent.Scale.Compute(Configuration.spawnCapMultiplier)}, " + $"InsidePower: {(int)MEvent.Scale.Compute(Configuration.insideEnemyMaxPowerCountScaling)}, " + $"OutsidePower: {(int)MEvent.Scale.Compute(Configuration.outsideEnemyPowerCountScaling)}]"); Log.LogInfo("Inside Spawn Curve"); Keyframe[] keys = newLevel.enemySpawnChanceThroughoutDay.keys; for (int i = 0; i < keys.Length; i++) { Keyframe val = keys[i]; Log.LogInfo($"Time:{((Keyframe)(ref val)).time} + $Value:{((Keyframe)(ref val)).value}"); } Log.LogInfo("Outside Spawn Curve"); Keyframe[] keys2 = newLevel.outsideEnemySpawnChanceThroughDay.keys; for (int j = 0; j < keys2.Length; j++) { Keyframe val2 = keys2[j]; Log.LogInfo($"Time:{((Keyframe)(ref val2)).time} + $Value:{((Keyframe)(ref val2)).value}"); } Log.LogInfo("Daytime Spawn Curve"); Keyframe[] keys3 = newLevel.daytimeEnemySpawnChanceThroughDay.keys; for (int k = 0; k < keys3.Length; k++) { Keyframe val3 = keys3[k]; Log.LogInfo($"Time:{((Keyframe)(ref val3)).time} + $Value:{((Keyframe)(ref val3)).value}"); } } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "RefreshEnemiesList")] private static void OnRefreshEnemiesList() { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { ((MonoBehaviour)HUDManager.Instance).StartCoroutine(EventTips(tipEventsToDo)); } } internal static IEnumerator EventTips(List events) { yield return (object)new WaitForSeconds(Mathf.Abs(Configuration.InitTimePopUp.Value)); foreach (MEvent e in events) { if (e.showTip && e.TipMessages.Count > 0 && e.TipTitle.Count > 0) { Net.Instance.SpawnTipServerRpc(e.TipTitle[Random.Range(0, e.TipTitle.Count)], e.TipMessages[Random.Range(0, e.TipMessages.Count)], e.isWarning); yield return (object)new WaitForSeconds(Mathf.Abs(Configuration.timeBetweenTips.Value)); } } tipEventsToDo.Clear(); } internal static bool IsIgnoredMoon(string moonName) { moonName = moonName.ToLower(); string serializedValue = ((ConfigEntryBase)Configuration.MoonsToIgnore).GetSerializedValue(); string[] array = (string.IsNullOrEmpty(serializedValue) ? new string[0] : (from moon in serializedValue.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select moon.Trim().ToLower()).ToArray()); bool result = false; string[] array2 = array; foreach (string text in array2) { string text2 = Regex.Replace(moonName, "-?\\d-?", string.Empty).Trim(); string text3 = Regex.Replace(text, "-?\\d-?", string.Empty).Trim(); if (moonName == text || text2 == text3) { result = true; Log.LogInfo("Moon is on list of moons to ignore events. Skipping Events"); break; } } return result; } internal static bool DoesEventsRunByChance() { float num = Mathf.Clamp(MEvent.Scale.Compute(Configuration.EventChanceGlobal), 0f, 100f); float num2 = Random.Range(0f, 100f); return num2 <= num; } internal static bool IsIgnoredEventByMoonBlacklist(MEvent mEvent) { string planetName = Manager.currentLevel.PlanetName; string text = Regex.Replace(planetName, "-?\\d-?", string.Empty).Trim(); string name = ((Object)Manager.currentLevel).name; string value = Regex.Replace(name, "-?\\d-?", string.Empty).Trim(); if (mEvent.Blacklist.Contains(planetName, StringComparer.OrdinalIgnoreCase) || mEvent.Blacklist.Contains(planetName, StringComparer.OrdinalIgnoreCase) || mEvent.Blacklist.Contains(name, StringComparer.OrdinalIgnoreCase) || mEvent.Blacklist.Contains(value, StringComparer.OrdinalIgnoreCase)) { Log.LogInfo("Event " + mEvent.Name() + " is ignored due to moon blacklist."); return true; } return false; } internal static bool IsEventOnMoonWhitelist(MEvent mEvent) { string planetName = Manager.currentLevel.PlanetName; string text = Regex.Replace(planetName, "-?\\d-?", string.Empty).Trim(); string name = ((Object)Manager.currentLevel).name; string value = Regex.Replace(name, "-?\\d-?", string.Empty).Trim(); if (mEvent.Whitelist.Count == 0) { Log.LogInfo("Event " + mEvent.Name() + " has an empty moon whitelist, but whitelist mode is on. Please consider either entering entries for the list or turn off the whitelist mode"); return false; } if (mEvent.Whitelist.Contains(planetName, StringComparer.OrdinalIgnoreCase) || mEvent.Blacklist.Contains(planetName, StringComparer.OrdinalIgnoreCase) || mEvent.Blacklist.Contains(name, StringComparer.OrdinalIgnoreCase) || mEvent.Blacklist.Contains(value, StringComparer.OrdinalIgnoreCase)) { Log.LogInfo("Event " + mEvent.Name() + " is chosen due to moon whitelist."); return true; } return false; } public static float currentHeatDifficulty() { float result = 0f; RoundManager instance = RoundManager.Instance; if (instance != null) { SelectableLevel currentLevel = instance.currentLevel; if (currentLevel != null) { _ = currentLevel.levelID; if (true) { int levelID = RoundManager.Instance.currentLevel.levelID; Log.LogInfo("Computing heat for level ID" + levelID); result = (Manager.heatDifficulty.TryGetValue(levelID, out var value) ? value : Configuration.startingHeat.Value); Log.LogInfo("Computed Heat is " + result + " for level ID " + levelID); } } } return result; } internal static List GetEventsByName(params string[] names) { HashSet nameSet = new HashSet(names); return events.Where((MEvent n) => nameSet.Contains(n.Name())).ToList(); } } public class LevelProperties { public int levelID; public MEvent.Scale minScrapAmount; public MEvent.Scale maxScrapAmount; public MEvent.Scale minScrapValue; public MEvent.Scale maxScrapValue; public LevelProperties(int levelID, MEvent.Scale minScrapAmount, MEvent.Scale maxScrapAmount, MEvent.Scale minScrapValue, MEvent.Scale maxScrapValue) { this.levelID = levelID; this.minScrapAmount = minScrapAmount; this.maxScrapAmount = maxScrapAmount; this.minScrapValue = minScrapValue; this.maxScrapValue = maxScrapValue; } public float GetScrapAmountMultiplier() { return Random.Range(minScrapAmount.Computef(MEvent.EventType.Neutral), maxScrapAmount.Computef(MEvent.EventType.Neutral)); } public float GetScrapValueMultiplier() { return Random.Range(minScrapValue.Computef(MEvent.EventType.Neutral), maxScrapValue.Computef(MEvent.EventType.Neutral)); } } [HarmonyPatch] public class Manager { public static class Spawn { internal static int randomSeedValue = 0; private static List spawnDenialPoints = new List(); private static int seed = 0; public static void OutsideObjects(GameObject obj, Vector3 offset, float density, float radius = -1f, int objectCap = 1000) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BatchOutsideObjects(obj, offset, density, radius, objectCap); } public static void OutsideObjects(Assets.ObjectName objName, Vector3 offset, float density, float radius = -1f, int objectCap = 1000) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) BatchOutsideObjects(Assets.GetObject(objName), offset, density, radius, objectCap); } private static void BatchOutsideObjects(GameObject obj, Vector3 offset, float density, float radius, int objectCap) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)obj == (Object)null)) { spawnDenialPoints = Helper.GetSpawnDenialNodes(); int num = (int)Mathf.Clamp(density * terrainArea, 0f, (float)objectCap); Log.LogInfo($"Spawning: {((Object)obj).name}, Count:{num}"); int num2 = 8; int num3 = num / num2; int item = num % num2; for (int i = 0; i < num3; i++) { Net.Instance.objectsToSpawn.Add(obj); Net.Instance.objectsToSpawnRadius.Add(radius); Net.Instance.objectsToSpawnOffsets.Add(offset); Net.Instance.objectsToSpawnAmount.Add(num2); } Net.Instance.objectsToSpawn.Add(obj); Net.Instance.objectsToSpawnRadius.Add(radius); Net.Instance.objectsToSpawnOffsets.Add(offset); Net.Instance.objectsToSpawnAmount.Add(item); } } public static void DoSpawnOutsideObjects(int count, float radius, Vector3 offset, GameObject obj) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: 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_01f4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); RaycastHit val2 = default(RaycastHit); for (int i = 0; i < count; i++) { randomSeedValue++; Random.InitState(randomSeedValue++); ((Vector3)(ref val))..ctor(0f, 0f, 0f); val = ((radius == -1f && outsideObjectSpawnNodes.Count != 0) ? RoundManager.Instance.GetRandomNavMeshPositionInRadius(outsideObjectSpawnNodes[Random.Range(0, outsideObjectSpawnNodes.Count)], outsideObjectSpawnRadius, default(NavMeshHit)) : RoundManager.Instance.GetRandomNavMeshPositionInRadius(RoundManager.Instance.outsideAINodes[Random.Range(0, RoundManager.Instance.outsideAINodes.Length)].transform.position, radius, default(NavMeshHit))); Quaternion rotation = obj.transform.rotation; bool flag = false; if (Physics.Raycast(new Ray(val, Vector3.down), ref val2)) { if (((Component)((RaycastHit)(ref val2)).collider).gameObject.tag != terrainTag && ((Object)((Component)((RaycastHit)(ref val2)).collider).gameObject).name != terrainName) { flag = true; } } else { flag = true; } foreach (Vector3 spawnDenialPoint in spawnDenialPoints) { if (Vector3.Distance(val, spawnDenialPoint) <= 10f) { flag = true; } } if (!flag) { val.y = ((RaycastHit)(ref val2)).point.y; val += offset; ((Quaternion)(ref rotation)).eulerAngles = ((Quaternion)(ref rotation)).eulerAngles + new Vector3(0f, (float)Random.Range(0, 360), 0f); GameObject val3 = Object.Instantiate(obj, val, rotation); NetworkObject component = val3.GetComponent(); if ((Object)(object)component != (Object)null) { val3.GetComponent().Spawn(true); } objectsToClear.Add(val3); } } } public static void OutsideEnemies(GameObject enemy, int count) { enemiesToSpawnOutside.Add(new ObjectInfo(enemy, count)); } public static void OutsideEnemies(EnemyType enemy, int count) { enemiesToSpawnOutside.Add(new ObjectInfo(enemy.enemyPrefab, count)); } public static void OutsideEnemies(Assets.EnemyName enemyName, int count) { enemiesToSpawnOutside.Add(new ObjectInfo(Assets.GetEnemy(enemyName).enemyPrefab, count)); } public static void InsideEnemies(GameObject enemy, int count, float radius = 0f) { enemiesToSpawnInside.Add(new ObjectInfo(enemy, count, 0f, radius)); } public static void InsideEnemies(EnemyType enemy, int count, float radius = 0f) { enemiesToSpawnInside.Add(new ObjectInfo(enemy.enemyPrefab, count, 0f, radius)); } public static void InsideEnemies(Assets.EnemyName enemyName, int count, float radius = 0f) { enemiesToSpawnInside.Add(new ObjectInfo(Assets.GetEnemy(enemyName).enemyPrefab, count, 0f, radius)); } public static void OutsideScrap(int Amount) { randomItemsToSpawnOutsideCount += Amount; } public static List DoSpawnOutsideEnemies() { //IL_0096: 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_00a0: Unknown result type (might be due to invalid IL or missing references) if (BrutalCompanyMinus.Minus.Events.SafeOutside.Active) { Log.LogInfo("Outside spawning prevented by OutsideSafe"); return new List(); } List list = new List(); List outsideNodes = Helper.GetOutsideNodes(); List spawnDenialNodes = Helper.GetSpawnDenialNodes(); for (int i = 0; i < enemiesToSpawnOutside.Count; i++) { for (int j = 0; j < enemiesToSpawnOutside[i].count; j++) { if ((Object)(object)enemiesToSpawnOutside[i].obj == (Object)null) { Log.LogError("Enemy prefab on DoSpawnOutsideEnemies() is null, continuing."); continue; } GameObject val = Object.Instantiate(enemiesToSpawnOutside[i].obj, Helper.GetSafePosition(outsideNodes, spawnDenialNodes, 20f, seed++), Quaternion.Euler(Vector3.zero)); EnemyAI component = val.GetComponent(); list.Add(component); RoundManager.Instance.SpawnedEnemies.Add(component); val.gameObject.GetComponentInChildren().Spawn(true); } } enemiesToSpawnOutside.Clear(); return list; } public static List DoSpawnInsideEnemies() { //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_0074: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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) //IL_00d3: 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) List list = new List(); for (int i = 0; i < enemiesToSpawnInside.Count; i++) { for (int j = 0; j < enemiesToSpawnInside[i].count; j++) { if ((Object)(object)enemiesToSpawnInside[i].obj == (Object)null) { Log.LogError("Enemy prefab on DoSpawnInsideEnemies() is null, continuing."); continue; } int num = Random.Range(0, RoundManager.Instance.allEnemyVents.Length); Vector3 position = RoundManager.Instance.allEnemyVents[num].floorNode.position; position = RoundManager.Instance.GetRandomNavMeshPositionInRadius(position, enemiesToSpawnInside[i].radius, RoundManager.Instance.navHit); Quaternion val = Quaternion.Euler(0f, RoundManager.Instance.allEnemyVents[num].floorNode.eulerAngles.y, 0f); GameObject val2 = Object.Instantiate(enemiesToSpawnInside[i].obj, position, val); val2.GetComponentInChildren().Spawn(true); EnemyAI component = val2.GetComponent(); list.Add(component); RoundManager.Instance.SpawnedEnemies.Add(component); } } enemiesToSpawnInside.Clear(); return list; } public static ScrapSpawnInfo DoSpawnScrapOutside(int Amount) { //IL_00b5: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) if (Amount <= 0) { return new ScrapSpawnInfo((NetworkObjectReference[])(object)new NetworkObjectReference[0], new int[0]); } RoundManager instance = RoundManager.Instance; Random random = new Random(); List scrapToSpawn = GetScrapToSpawn((int)((float)Amount * instance.scrapAmountMultiplier * scrapAmountMultiplier)); List list = new List(); List list2 = new List(); List outsideNodes = Helper.GetOutsideNodes(); Log.LogInfo($"Spawning {scrapToSpawn.Count} outside"); for (int i = 0; i < scrapToSpawn.Count; i++) { if ((Object)(object)scrapToSpawn[i] == (Object)null) { Log.LogError("Found null element in list ScrapToSpawn. Skipping it."); continue; } Vector3 randomNavMeshPositionInBoxPredictable = instance.GetRandomNavMeshPositionInBoxPredictable(outsideNodes[Random.Range(0, outsideNodes.Count)], 10f, instance.navHit, random, -1, 1f); GameObject val = Object.Instantiate(scrapToSpawn[i].spawnPrefab, randomNavMeshPositionInBoxPredictable, Quaternion.identity, instance.spawnedScrapContainer); GrabbableObject component = val.GetComponent(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; component.itemProperties.weight = scrapToSpawn[i].weight; component.itemProperties.isConductiveMetal = scrapToSpawn[i].isConductiveMetal; list.Add((int)((float)Random.Range(scrapToSpawn[i].minValue, scrapToSpawn[i].maxValue + 1) * instance.scrapValueMultiplier * scrapValueMultiplier)); component.scrapValue = list[list.Count - 1]; NetworkObject component2 = val.GetComponent(); component2.Spawn(false); list2.Add(NetworkObjectReference.op_Implicit(component2)); } return new ScrapSpawnInfo(list2.ToArray(), list.ToArray()); } public static ScrapSpawnInfo DoSpawnScrapInside(int Amount) { //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0287: 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_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) if (Amount <= 0) { return new ScrapSpawnInfo((NetworkObjectReference[])(object)new NetworkObjectReference[0], new int[0]); } RoundManager instance = RoundManager.Instance; Random random = new Random(); RandomScrapSpawn val = null; RandomScrapSpawn[] source = Object.FindObjectsOfType(); List usedSpawns = new List(); List ScrapToSpawn = GetScrapToSpawn(Amount); List list = new List(); List list2 = new List(); Log.LogInfo($"Spawning {ScrapToSpawn.Count} inside"); int i; for (i = 0; i < ScrapToSpawn.Count; i++) { if ((Object)(object)ScrapToSpawn[i] == (Object)null) { Log.LogError("Null entry in scrapToSpawn, skipping entry"); continue; } List list3 = ((ScrapToSpawn[i].spawnPositionTypes != null && ScrapToSpawn[i].spawnPositionTypes.Count != 0) ? source.Where((RandomScrapSpawn x) => ScrapToSpawn[i].spawnPositionTypes.Contains(x.spawnableItems) && !x.spawnUsed).ToList() : source.ToList()); if (list3.Count <= 0) { Log.LogError("No positions to spawn scrap: " + ScrapToSpawn[i].itemName); continue; } if (usedSpawns.Count > 0 && list3.Contains(val)) { list3.RemoveAll((RandomScrapSpawn x) => usedSpawns.Contains(x)); if (list3.Count <= 0) { usedSpawns.Clear(); i--; continue; } } val = list3[random.Next(0, list3.Count)]; usedSpawns.Add(val); Vector3 val2; if (val.spawnedItemsCopyPosition) { val.spawnUsed = true; val2 = ((Component)val).transform.position; } else { val2 = instance.GetRandomNavMeshPositionInBoxPredictable(((Component)val).transform.position, val.itemSpawnRange, instance.navHit, random, -1, 1f) + Vector3.up * ScrapToSpawn[i].verticalOffset; } if ((Object)(object)ScrapToSpawn[i].spawnPrefab.GetComponent() == (Object)null) { Log.LogError("GrabbableObject is null in scrapToSpawn, skipping entry."); continue; } GameObject val3 = Object.Instantiate(ScrapToSpawn[i].spawnPrefab, val2, Quaternion.identity, instance.spawnedScrapContainer); GrabbableObject component = val3.GetComponent(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; int num = (int)((float)Random.Range(ScrapToSpawn[i].minValue, ScrapToSpawn[i].maxValue + 1) * instance.scrapValueMultiplier * scrapValueMultiplier); list.Add(num); component.scrapValue = num; component.itemProperties.weight = ScrapToSpawn[i].weight; NetworkObject component2 = val3.GetComponent(); component2.Spawn(false); list2.Add(NetworkObjectReference.op_Implicit(component2)); } return new ScrapSpawnInfo(list2.ToArray(), list.ToArray()); } private static List GetScrapToSpawn(int Amount) { RoundManager instance = RoundManager.Instance; Random random = new Random(StartOfRound.Instance.randomMapSeed + seed); seed++; List list = new List(); List list2 = new List(); for (int i = 0; i < instance.currentLevel.spawnableScrap.Count; i++) { if (i == instance.increasedScrapSpawnRateIndex) { list2.Add(i); } else { list2.Add(instance.currentLevel.spawnableScrap[i].rarity); } } int[] array = list2.ToArray(); for (int j = 0; j < Amount; j++) { Item spawnableItem = instance.currentLevel.spawnableScrap[instance.GetRandomWeightedIndex(array, random)].spawnableItem; list.Add(Assets.GetItem(((Object)spawnableItem).name)); } return list; } } internal struct ObjectInfo { public int count; public float radius; public float density; public GameObject obj; public ObjectInfo(GameObject obj, int count) { this.obj = obj; this.count = count; radius = 0f; density = 0f; } public ObjectInfo(GameObject obj, float density) { this.obj = obj; this.density = density; radius = 0f; count = 0; } public ObjectInfo(GameObject obj, float density, float radius) { this.obj = obj; this.density = density; this.radius = radius; count = 0; } public ObjectInfo(GameObject obj, int count, float density, float radius) { this.obj = obj; this.density = density; this.radius = radius; this.count = count; } } public struct ScrapSpawnInfo { public NetworkObjectReference[] netObjects; public int[] scrapPrices; public ScrapSpawnInfo(NetworkObjectReference[] netObjects, int[] scrapPrices) { this.netObjects = netObjects; this.scrapPrices = scrapPrices; } } internal static float difficulty = 0f; internal static float daysDifficulty = 0f; internal static float scrapInShipDifficulty = 0f; internal static float moonGradeDifficulty = 0f; internal static float weatherDifficulty = 0f; internal static float quotaDifficulty = 0f; public static Dictionary heatDifficulty = new Dictionary(); public static int levelNameOnLeave = -1; public static int levelNameOnLand = 0; public static SelectableLevel currentLevel; public static Terminal currentTerminal; internal static float terrainArea = 0f; internal static string terrainTag = ""; internal static string terrainName = ""; private static GameObject _terrainObject; internal static List outsideObjectSpawnNodes = new List(); internal static float outsideObjectSpawnRadius = 0f; internal static List objectsToClear = new List(); internal static Dictionary networkedObjects = new Dictionary(); internal static List enemiesToSpawnInside = new List(); internal static List enemiesToSpawnOutside = new List(); internal static List insideObjectsToSpawnOutside = new List(); internal static float factorySizeMultiplier = 1f; internal static float scrapValueMultiplier = 1f; public static float scrapAmountMultiplier = 1f; internal static int randomItemsToSpawnOutsideCount = 0; internal static int bonusEnemyHp = 0; internal static int bonusMaxInsidePowerCount = 0; internal static int bonusMaxOutsidePowerCount = 0; internal static int minEnemiesToSpawnInside = 0; internal static int minEnemiestoSpawnOutside = 0; internal static float spawnChanceMultiplier = 1f; internal static float spawncapMultipler = 1f; public static bool transmuteScrap = false; internal static List scrapTransmuteAmount = new List(); internal static List ScrapToTransmuteTo = new List(); internal static bool moveTime = false; internal static float moveTimeAmount = 0f; internal static float timeSpeedMultiplier = 1f; internal static float inverseTimeSpeedMultiplier = 1f; internal static FixedString4096Bytes textUI; internal static int seed; public static Dictionary originalMoonMoldData = new Dictionary(); private static bool isApplicationQuitting = false; internal static int daysPassed { get { if ((Object)(object)StartOfRound.Instance != (Object)null) { return StartOfRound.Instance.gameStats.daysSpent; } return 0; } } internal static GameObject terrainObject { get { if ((Object)(object)_terrainObject == (Object)null) { SampleMap(); } return _terrainObject; } private set { _terrainObject = value; } } public static void TransmuteScrap(float amount, params SpawnableItemWithRarity[] Items) { transmuteScrap = true; scrapTransmuteAmount.Add(Mathf.Clamp(amount, 0f, 1f)); ScrapToTransmuteTo.AddRange(Items); if (Configuration.ExtraLogging.Value) { List list = new List(); foreach (SpawnableItemWithRarity val in Items) { list.Add($"{((Object)val.spawnableItem).name} (Rarity: {val.rarity})"); } Log.LogInfo(string.Format("TransmuteScrap called with amount: {0}, Items: {1}", amount, string.Join(", ", list))); } } public static void DeliverRandomItems(int Amount, int MinPrice, int MaxPrice) { if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } Terminal val = Object.FindObjectOfType(); List list = new List(); for (int i = 0; i < val.buyableItemsList.Length; i++) { if (val.buyableItemsList[i].creditsWorth >= MinPrice && val.buyableItemsList[i].creditsWorth <= MaxPrice) { list.Add(i); } } for (int j = 0; j < Amount; j++) { int item = list[Random.Range(0, list.Count)]; val.orderedItemsFromTerminal.Add(item); } } internal static int GetLevelIndex() { for (int i = 0; i < StartOfRound.Instance.levels.Length; i++) { if (((Object)StartOfRound.Instance.levels[i]).name == ((Object)RoundManager.Instance.currentLevel).name) { return i; } } return 0; } public static void AddEnemyHp(int amount) { bonusEnemyHp += amount; } public static void AddInsidePower(int amount) { bonusMaxInsidePowerCount += amount; } public static void AddOutsidePower(int amount) { bonusMaxOutsidePowerCount += amount; } public static void MultiplySpawnCap(float multiplier) { spawncapMultipler *= multiplier; } internal static void ComputeDifficultyValues() { //IL_017c: Unknown result type (might be due to invalid IL or missing references) difficulty = 0f; if (Configuration.scaleByDaysPassed.Value) { daysDifficulty = Mathf.Clamp((float)daysPassed * Configuration.daysPassedDifficultyMultiplier.Value, 0f, Configuration.daysPassedDifficultyCap.Value); difficulty += daysDifficulty; } if (Configuration.scaleByScrapInShip.Value) { scrapInShipDifficulty = Mathf.Clamp(GetScrapInShip() * Configuration.scrapInShipDifficultyMultiplier.Value, 0f, Configuration.scrapInShipDifficultyCap.Value); difficulty += scrapInShipDifficulty; } if (Configuration.scaleByMoonGrade.Value) { if (Configuration.gradeAdditives.TryGetValue(StartOfRound.Instance.currentLevel.riskLevel, out var value)) { moonGradeDifficulty = value; difficulty += value; } else { moonGradeDifficulty = Configuration.gradeAdditives["Other"]; difficulty += moonGradeDifficulty; } } if (Configuration.scaleByQuota.Value) { quotaDifficulty = Mathf.Clamp((float)TimeOfDay.Instance.profitQuota * Configuration.quotaDifficultyMultiplier.Value, 0f, Configuration.quotaDifficultyCap.Value); difficulty += quotaDifficulty; } if (Configuration.scaleByWeather.Value) { weatherDifficulty = Configuration.weatherAdditives.GetValueOrDefault(StartOfRound.Instance.currentLevel.currentWeather, 0f); difficulty += weatherDifficulty; } if (Configuration.enablePlayerScaling.Value) { float value2 = Configuration.playerScalingMultiplier.Value; int value3 = Configuration.basePlayerAmount.Value; int num = StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB x) => x.isPlayerDead || x.isPlayerControlled).Count(); int num2 = num - value3; if (Configuration.playerScalingType.Value.ToLower() == "linear") { difficulty *= 1f + (float)num2 * (value2 - 1f); } else if (Configuration.playerScalingType.Value.ToLower() == "exponential") { difficulty *= Mathf.Pow(value2, (float)num2); } else if (Configuration.playerScalingType.Value.ToLower() == "logarithmic") { difficulty *= 1f + Mathf.Log((float)Mathf.Max(num2, 1)) * value2; } else if (Configuration.playerScalingType.Value.ToLower() == "cubic") { difficulty *= 1f + Mathf.Pow((float)num2, 3f) * value2; } else { difficulty *= 1f + (float)num2 * (value2 - 1f); } } if (Configuration.scaleHeat.Value && (Configuration.heatSettingsToAffect.Value.HasFlag(Configuration.HeatSettingsFlags.Difficulty) || Configuration.heatSettingsToAffect.Value.HasFlag(Configuration.HeatSettingsFlags.All))) { float num3 = EventManager.currentHeatDifficulty(); if (num3 > 0f) { difficulty *= (float)((double)(Configuration.heatMultiplierDifficulty.Value * difficulty / Configuration.heatDampening.Value) * Math.Pow(1f + Configuration.heatDampening.Value, num3) + 1.0); } } if (Configuration.ignoreMaxCap.Value) { difficulty = Mathf.Clamp(difficulty, 0f, float.MaxValue); } else { difficulty = Mathf.Clamp(difficulty, 0f, Configuration.difficultyMaxCap.Value); } } internal static float GetScrapInShip() { GameObject hangarShip = Assets.hangarShip; if ((Object)(object)hangarShip == (Object)null) { return 0f; } GrabbableObject[] componentsInChildren = hangarShip.GetComponentsInChildren(); int num = 0; GrabbableObject[] array = componentsInChildren; foreach (GrabbableObject val in array) { if ((Object)(object)val != (Object)null) { num += val.scrapValue; } if (Configuration.ExtraLogging.Value) { Log.LogInfo($"Found item in ship with scrap value: {val.scrapValue}"); } } GameObject cruiser = Assets.cruiser; if ((Object)(object)cruiser != (Object)null) { GrabbableObject[] componentsInChildren2 = cruiser.GetComponentsInChildren(); GrabbableObject[] array2 = componentsInChildren2; foreach (GrabbableObject val2 in array2) { if ((Object)(object)val2 != (Object)null) { num += val2.scrapValue; } if (Configuration.ExtraLogging.Value) { Log.LogInfo($"Found item in cruiser with scrap value: {val2.scrapValue}"); } } } GameObject microwave = Assets.Microwave; if ((Object)(object)microwave != (Object)null) { GrabbableObject[] componentsInChildren3 = microwave.GetComponentsInChildren(); GrabbableObject[] array3 = componentsInChildren3; foreach (GrabbableObject val3 in array3) { if ((Object)(object)val3 != (Object)null) { num += val3.scrapValue; } if (Configuration.ExtraLogging.Value) { Log.LogInfo($"Found item in Microwave with scrap value: {val3.scrapValue}"); } } } if (Compatibility.ShipInventoryPresent) { num += ShipInventoryCompat.GetShipInventoryScrapValue(); } return num; } internal static void SampleMap() { //IL_0029: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_021e: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_015b: Unknown result type (might be due to invalid IL or missing references) List list = new List(); GameObject[] outsideAINodes = RoundManager.Instance.outsideAINodes; foreach (GameObject val in outsideAINodes) { list.Add(new Vector2(val.transform.position.x, val.transform.position.z)); } list = Helper.ComputeConvexHull(list).ToList(); if (list.Count > 0) { float num = 0f; float num2 = 0f; foreach (Vector2 item2 in list) { num += item2.x; num2 += item2.y; } Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(num / (float)list.Count, num2 / (float)list.Count); foreach (Vector2 item3 in list) { Vector2 val3 = (item3 + val2) * 0.5f; outsideObjectSpawnNodes.Add(new Vector3(val3.x, 100f, val3.y)); } outsideObjectSpawnRadius = Vector2.Distance(val2, list[0]) + 75f; } float num3 = 0f; for (int j = 0; j != list.Count - 1; j++) { Vector2 val4 = list[j]; Vector2 val5 = list[j + 1]; float num4 = (val4.y + val5.y) * 0.5f; float num5 = val4.x - val5.x; num3 += num4 * num5; } if (num3 < 0f) { num3 *= -1f; } terrainArea = num3; List outsideNodes = Helper.GetOutsideNodes(); List list2 = new List(); RaycastHit item = default(RaycastHit); for (int k = 0; k != outsideNodes.Count * 10; k++) { Vector3 val6 = outsideNodes[k % outsideNodes.Count]; Vector2 val7 = Random.insideUnitCircle * 3f; if (Physics.Raycast(new Ray(val6 + new Vector3(val7.x, 10f, val7.y), Vector3.down), ref item)) { list2.Add(item); } } terrainTag = Helper.MostCommon(list2.Select((RaycastHit x) => ((Component)((RaycastHit)(ref x)).collider).gameObject.tag).ToList()); terrainName = Helper.MostCommon(list2.Select((RaycastHit x) => ((Object)((Component)((RaycastHit)(ref x)).collider).gameObject).name).ToList()); GameObject val8 = GameObject.FindGameObjectWithTag(terrainTag); GameObject[] array = GameObject.FindGameObjectsWithTag(terrainTag); GameObject[] array2 = array; foreach (GameObject val9 in array2) { if (((Object)val9).name == terrainName) { val8 = val9; } } terrainObject = val8; } public static void AddEnemyToPoolWithRarity(ref List list, EnemyType enemy, int rarity) { DoAddEnemyToPoolWithRarity(ref list, enemy, rarity); } public static void AddEnemyToPoolWithRarity(ref List list, Assets.EnemyName enemy, int rarity) { DoAddEnemyToPoolWithRarity(ref list, Assets.GetEnemy(enemy), rarity); } public static void AddEnemyToPoolWithRarity(ref List list, string enemy, int rarity) { DoAddEnemyToPoolWithRarity(ref list, Assets.GetEnemy(enemy), rarity); } private static void DoAddEnemyToPoolWithRarity(ref List list, EnemyType enemy, int rarity) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown try { if ((Object)(object)enemy.enemyPrefab == (Object)null) { Log.LogError("Enemy prefab is null on AddEnemyToPoolWithRarity(), returning."); return; } SpawnableEnemyWithRarity item = new SpawnableEnemyWithRarity(enemy, rarity); list.Add(item); } catch (Exception ex) { Log.LogError("DoAddEnemyToPoolWithRarity failed: " + ex); } finally { LunarConfigCompat.DoAddEnemyToPoolWithRarityPostfix(ref list, enemy, rarity); } } public static void SetAtmosphere(string name, bool state) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) Net.Instance.currentWeatherEffects.Add(new Net.CurrentWeatherEffect(FixedString128Bytes.op_Implicit(name), state)); } public static void SetAtmosphere(Assets.AtmosphereName name, bool state) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) Net.Instance.currentWeatherEffects.Add(new Net.CurrentWeatherEffect(FixedString128Bytes.op_Implicit(Assets.AtmosphereNameList[name]), state)); } public static void RemoveSpawn(string name) { DoRemoveSpawn(name); } public static void RemoveSpawn(Assets.EnemyName name) { DoRemoveSpawn(Assets.EnemyNameList[name]); } private static void DoRemoveSpawn(string Name) { int num = 0; try { try { num += RoundManager.Instance.currentLevel.Enemies.RemoveAll((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name.ToUpper() == Name.ToUpper()); } catch { Log.LogError("RemoveAll() on insideEnemies failed"); } try { num += RoundManager.Instance.currentLevel.OutsideEnemies.RemoveAll((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name.ToUpper() == Name.ToUpper()); } catch { Log.LogError("RemoveAll() on outsideEnemies failed"); } try { num += RoundManager.Instance.currentLevel.DaytimeEnemies.RemoveAll((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name.ToUpper() == Name.ToUpper()); } catch { Log.LogError("RemoveAll() on daytimeEnemies failed"); } if (num == 0) { Log.LogInfo($"Failed to remove '{Name}' from enemy pool, either it dosen't exist on the map or wrong string used."); } } catch (Exception ex) { Log.LogError("RemoveAll() failed: " + ex); } finally { LunarConfigCompat.DoRemoveSpawnPostfix(Name); } } public static bool SpawnExists(string name) { return DoSpawnExists(name); } public static bool SpawnExists(Assets.EnemyName name) { return DoSpawnExists(Assets.EnemyNameList[name]); } private static bool DoSpawnExists(string name) { try { if (RoundManager.Instance.currentLevel.Enemies.Exists((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name == name)) { return true; } } catch { Log.LogError("Exists() on insideEnemies failed"); } try { if (RoundManager.Instance.currentLevel.OutsideEnemies.Exists((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name == name)) { return true; } } catch { Log.LogError("Exists() on outsideEnemies failed"); } try { if (RoundManager.Instance.currentLevel.DaytimeEnemies.Exists((SpawnableEnemyWithRarity x) => ((Object)x.enemyType).name == name)) { return true; } } catch { Log.LogError("Exists() on daytimeEnemies failed"); } return false; } public static void MultiplySpawnChance(SelectableLevel currentLevel, float by) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) spawnChanceMultiplier *= by; Keyframe[] array = (Keyframe[])(object)new Keyframe[currentLevel.enemySpawnChanceThroughoutDay.keys.Length]; for (int i = 0; i < currentLevel.enemySpawnChanceThroughoutDay.keys.Length; i++) { float num = by; if (((Keyframe)(ref currentLevel.enemySpawnChanceThroughoutDay.keys[i])).value <= 0f) { num = 1f; } array[i] = new Keyframe(((Keyframe)(ref currentLevel.enemySpawnChanceThroughoutDay.keys[i])).time, ((Keyframe)(ref currentLevel.enemySpawnChanceThroughoutDay.keys[i])).value * num); } currentLevel.enemySpawnChanceThroughoutDay = new AnimationCurve(array); Keyframe[] array2 = (Keyframe[])(object)new Keyframe[currentLevel.outsideEnemySpawnChanceThroughDay.keys.Length]; for (int j = 0; j < currentLevel.outsideEnemySpawnChanceThroughDay.keys.Length; j++) { float num2 = by; if (((Keyframe)(ref currentLevel.outsideEnemySpawnChanceThroughDay.keys[j])).value <= 0f) { num2 = 1f; } array2[j] = new Keyframe(((Keyframe)(ref currentLevel.outsideEnemySpawnChanceThroughDay.keys[j])).time, ((Keyframe)(ref currentLevel.outsideEnemySpawnChanceThroughDay.keys[j])).value * num2); } currentLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve(array2); Keyframe[] array3 = (Keyframe[])(object)new Keyframe[currentLevel.daytimeEnemySpawnChanceThroughDay.keys.Length]; for (int k = 0; k < currentLevel.daytimeEnemySpawnChanceThroughDay.keys.Length; k++) { float num3 = by; if (((Keyframe)(ref currentLevel.daytimeEnemySpawnChanceThroughDay.keys[k])).value <= 0f) { num3 = 1f; } array3[k] = new Keyframe(((Keyframe)(ref currentLevel.daytimeEnemySpawnChanceThroughDay.keys[k])).time, ((Keyframe)(ref currentLevel.daytimeEnemySpawnChanceThroughDay.keys[k])).value * num3); } currentLevel.daytimeEnemySpawnChanceThroughDay = new AnimationCurve(array3); } internal static void AddInsideSpawnChance(SelectableLevel currentLevel, float value) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown Keyframe[] array = (Keyframe[])(object)new Keyframe[currentLevel.enemySpawnChanceThroughoutDay.keys.Length]; for (int i = 0; i < currentLevel.enemySpawnChanceThroughoutDay.keys.Length; i++) { array[i] = new Keyframe(((Keyframe)(ref currentLevel.enemySpawnChanceThroughoutDay.keys[i])).time, ((Keyframe)(ref currentLevel.enemySpawnChanceThroughoutDay.keys[i])).value + value); } currentLevel.enemySpawnChanceThroughoutDay = new AnimationCurve(array); } internal static void AddOutsideSpawnChance(SelectableLevel currentLevel, float value) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown Keyframe[] array = (Keyframe[])(object)new Keyframe[currentLevel.outsideEnemySpawnChanceThroughDay.keys.Length]; for (int i = 0; i < currentLevel.outsideEnemySpawnChanceThroughDay.keys.Length; i++) { array[i] = new Keyframe(((Keyframe)(ref currentLevel.outsideEnemySpawnChanceThroughDay.keys[i])).time, ((Keyframe)(ref currentLevel.outsideEnemySpawnChanceThroughDay.keys[i])).value + value); } currentLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve(array); } public static void PayCredits(int amount) { Log.LogDebug("BCMER Cred Amt: " + amount); if (amount != 0) { Log.LogDebug("BCMER Cred Before: " + currentTerminal.groupCredits); Terminal obj = currentTerminal; obj.groupCredits += amount; Log.LogDebug("BCMER Cred After: " + currentTerminal.groupCredits); currentTerminal.SyncGroupCreditsServerRpc(currentTerminal.groupCredits, currentTerminal.numberOfItemsInDropship); bool flag = amount >= 0; HUDManager.Instance.AddTextToChatOnServer(string.Format("{1}{2}â– ", flag ? "#008000" : "#FF0000", flag ? "+" : "", amount), -1); } } [HarmonyPostfix] [HarmonyPatch(typeof(TimeOfDay), "MoveGlobalTime")] private static void OnMoveGlobaTime(ref TimeOfDay __instance, ref float ___timeUntilDeadline, ref float ___globalTime) { if (moveTime) { ___timeUntilDeadline -= moveTimeAmount; ___globalTime += moveTimeAmount; TimeOfDay obj = __instance; obj.globalTimeSpeedMultiplier *= timeSpeedMultiplier; moveTimeAmount = 0f; inverseTimeSpeedMultiplier = 1f / timeSpeedMultiplier; timeSpeedMultiplier = 1f; moveTime = false; } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private static void OnShipLeave() { TimeOfDay instance = TimeOfDay.Instance; instance.globalTimeSpeedMultiplier *= inverseTimeSpeedMultiplier; inverseTimeSpeedMultiplier = 1f; if (Configuration.scaleHeat.Value) { levelNameOnLeave = RoundManager.Instance.currentLevel.levelID; if (heatDifficulty.ContainsKey(levelNameOnLeave)) { heatDifficulty[levelNameOnLeave] = Math.Min(heatDifficulty[levelNameOnLand] + Math.Abs(Configuration.heatIncrementAmount.Value), Configuration.heatMaxCap.Value); } } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "OnLocalDisconnect")] private static void OnDisconnect() { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { try { if (((NetworkBehaviour)RoundManager.Instance).IsServer && Configuration.scaleHeat.Value && (heatDifficulty == null || heatDifficulty.Count > 0)) { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; ES3.Save>("heatDifficulty", heatDifficulty, currentSaveFileName + "_Brutal"); } } catch { Log.LogError("Failed to get game save name on disconnect, skipping heat difficulty save."); return; } } if (!isApplicationQuitting) { heatDifficulty.Clear(); } } [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "OnApplicationQuit")] private static void OnAppQuit() { isApplicationQuitting = true; if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } try { if (heatDifficulty == null || heatDifficulty.Count > 0) { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; ES3.Save>("heatDifficulty", heatDifficulty, currentSaveFileName + "_Brutal"); } } catch { Log.LogError("Failed to get game save name on application quit, skipping heat difficulty save."); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "FirePlayersAfterDeadlineClientRpc")] private static void OnFirePlayersAfterDeadline() { if (!Configuration.scaleHeat.Value) { return; } heatDifficulty.Clear(); if (((NetworkBehaviour)RoundManager.Instance).IsServer) { try { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; ES3.DeleteKey("heatDifficulty", currentSaveFileName + "_Brutal"); ES3.Save>("heatDifficulty", heatDifficulty, currentSaveFileName + "_Brutal"); } catch { Log.LogError("Failed to get game save name after deadline, skipping heat difficulty reset."); } } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void OnStart() { if (((NetworkBehaviour)RoundManager.Instance).IsServer && Configuration.scaleHeat.Value) { heatDifficulty.Clear(); string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; if (ES3.KeyExists("heatDifficulty", currentSaveFileName + "_Brutal")) { try { Log.LogInfo("Found a save called " + currentSaveFileName + "_Brutal, loading heat difficulty from it..."); Dictionary dictionary = ES3.Load>("heatDifficulty", currentSaveFileName + "_Brutal"); if (dictionary != null || dictionary.Count > 0) { heatDifficulty = dictionary; } Log.LogInfo("Manager.heatDifficulty successfully loaded."); if (!UI.canClearText) { return; } try { UI.ClearText(); } catch (Exception) { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(UI.ClearAfterDelay()); } } catch (Exception ex2) { Log.LogError("Failed to load Manager.heatDifficulty: " + ex2.Message); } } else { Log.LogInfo("No existing heat difficulty data found, starting fresh."); } } if (((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } try { UI.ClearText(); } catch (Exception) { try { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(UI.ClearAfterDelay()); } catch (Exception ex4) { Log.LogError("Failed to clear UI text on client coroutine after fallback attempt: " + ex4.Message); } } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] private static void OnPlayerConnect() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { Log.LogInfo("Requesting heat difficulty from server..."); Net.Instance.SyncHeatMapServerRpc(); } } [HarmonyPostfix] [HarmonyPatch(typeof(ES3), "DeleteFile", new Type[] { typeof(string) })] private static void OnDeleteSaveFile(string filePath) { if (string.IsNullOrEmpty(filePath)) { return; } Log.LogInfo(filePath + " is being deleted, checking for brutal file..."); string text = filePath + "_Brutal"; if (ES3.FileExists(text)) { try { ES3.DeleteFile(text); Log.LogInfo("Deleted " + text + " successfully."); } catch (Exception ex) { Log.LogError("Failed to delete " + text + ": " + ex.Message); } } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "AutoSaveShipData")] private static void OnSaveData() { if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } try { if (heatDifficulty != null && heatDifficulty.Count != 0) { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; Log.LogInfo("Attempting to save to " + currentSaveFileName + "_Brutal..."); ES3.Save>("heatDifficulty", heatDifficulty, currentSaveFileName + "_Brutal"); Log.LogInfo("Manager.heatDifficulty successfully saved"); } } catch (Exception ex) { Log.LogError("Failed to save Manager.heatDifficulty: " + ex.Message); } } [HarmonyPrefix] [HarmonyPatch(typeof(TimeOfDay), "Start")] private static void OnTimeOfDayStart() { inverseTimeSpeedMultiplier = 1f; } [HarmonyPostfix] [HarmonyPriority(800)] [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] private static void ObjectSpawnHandling() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) SampleMap(); Spawn.randomSeedValue = StartOfRound.Instance.randomMapSeed + 2 + seed; ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DelayedExecution()); foreach (ObjectInfo item in insideObjectsToSpawnOutside) { Spawn.OutsideObjects(item.obj, new Vector3(0f, -0.05f, 0f), item.density, -1f, 250); } } private static IEnumerator DelayedExecution() { yield return (object)new WaitForSeconds(5f); foreach (Net.OutsideObjectsToSpawnMethod obj in Net.Instance.outsideObjectsToSpawn) { Spawn.OutsideObjects(Assets.GetObject((Assets.ObjectName)obj.objectEnumID), new Vector3(0f, -1f, 0f), obj.density); } } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "AdvanceHourAndSpawnNewBatchOfEnemies")] private static void OnAdvanceHourAndSpawnNewBatchOfEnemies(ref RoundManager __instance) { RoundManager obj = __instance; obj.minEnemiesToSpawn += minEnemiesToSpawnInside; RoundManager obj2 = __instance; obj2.minOutsideEnemiesToSpawn += minEnemiestoSpawnOutside; minEnemiesToSpawnInside = 0; minEnemiestoSpawnOutside = 0; } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "RefreshEnemyVents")] private static void OnRefreshEnemyVents() { if (RoundManager.Instance.allEnemyVents.Length != 0) { List list = new List(); list.AddRange(Spawn.DoSpawnInsideEnemies()); list.AddRange(Spawn.DoSpawnOutsideEnemies()); } } } public class MEvent { public enum EventType { Insane, VeryBad, Bad, Neutral, Good, VeryGood, Rare, Remove } public enum ScaleType { InsideEnemyRarity, OutsideEnemyRarity, DaytimeEnemyRarity, MinOutsideEnemy, MinInsideEnemy, MaxOutsideEnemy, MaxInsideEnemy, ScrapValue, ScrapAmount, FactorySize, MinDensity, MaxDensity, MinCash, MaxCash, MinItemAmount, MaxItemAmount, MinValue, MaxValue, Rarity, MinRarity, MaxRarity, MinCut, MaxCut, MinHp, MaxHp, SpawnMultiplier, MaxInsideEnemyCount, MaxOutsideEnemyCount, SpawnCapMultiplier, MinPercentageCut, MaxPercentageCut, MinAmount, MaxAmount, Percentage, TimeSettings, TimeMin, TimeMax, MinPercentSelected, MaxPercentSelected, ObjectWidth, minMold, maxMold, Slipperyness } public struct Scale { public float Base; public float Increment; public float MinCap; public float MaxCap; public Scale(float Base, float Increment, float MinCap, float MaxCap) { this.Base = Base; this.Increment = Increment; this.MinCap = MinCap; this.MaxCap = MaxCap; } public static float Compute(Scale scale, EventType Type = EventType.Neutral) { float increment = scale.Increment; return Mathf.Clamp(scale.Base + increment * Manager.difficulty, scale.MinCap, Configuration.ignoreMaxCap.Value ? 2.1474836E+09f : scale.MaxCap); } public float Computef(EventType type) { return Compute(this, type); } public int Compute(EventType type) { return (int)Compute(this, type); } } public class MonsterEvent { public EnemyType enemy; public Scale insideSpawnRarity; public Scale outsideSpawnRarity; public Scale minInside; public Scale maxInside; public Scale minOutside; public Scale maxOutside; public EventType eventType; public MonsterEvent(EnemyType enemy, Scale insideSpawnRarity, Scale outsideSpawnRarity, Scale minInside, Scale maxInside, Scale minOutside, Scale maxOutside) { this.enemy = enemy; assignRarities(insideSpawnRarity, outsideSpawnRarity, minInside, maxInside, minOutside, maxOutside); } public MonsterEvent(Assets.EnemyName enemyName, Scale insideSpawnRarity, Scale outsideSpawnRarity, Scale minInside, Scale maxInside, Scale minOutside, Scale maxOutside) { enemy = Assets.GetEnemy(enemyName); assignRarities(insideSpawnRarity, outsideSpawnRarity, minInside, maxInside, minOutside, maxOutside); } public MonsterEvent(string enemyName, Scale insideSpawnRarity, Scale outsideSpawnRarity, Scale minInside, Scale maxInside, Scale minOutside, Scale maxOutside) { enemy = Assets.GetEnemy(enemyName); assignRarities(insideSpawnRarity, outsideSpawnRarity, minInside, maxInside, minOutside, maxOutside); } internal void assignRarities(Scale insideSpawnRarity, Scale outsideSpawnRarity, Scale minInside, Scale maxInside, Scale minOutside, Scale maxOutside) { this.insideSpawnRarity = insideSpawnRarity; this.outsideSpawnRarity = outsideSpawnRarity; this.minInside = minInside; this.maxInside = maxInside; this.minOutside = minOutside; this.maxOutside = maxOutside; } public void Execute() { Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.Enemies, enemy, insideSpawnRarity.Compute(eventType)); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.OutsideEnemies, enemy, outsideSpawnRarity.Compute(eventType)); Manager.Spawn.InsideEnemies(enemy, Random.Range(minInside.Compute(eventType), maxInside.Compute(eventType) + 1)); Manager.Spawn.OutsideEnemies(enemy, Random.Range(minOutside.Compute(eventType), maxOutside.Compute(eventType) + 1)); } } public class ScrapTransmutationEvent { public Scale amount; public SpawnableItemWithRarity[] items; public ScrapTransmutationEvent(Scale amount, params SpawnableItemWithRarity[] items) { this.items = items; this.amount = amount; } public void Execute() { Manager.TransmuteScrap(amount.Computef(EventType.Neutral), items); } } public List Descriptions = new List { "" }; public string ColorHex = "#FFFFFF"; public int Weight = 1; public EventType Type = EventType.Neutral; public bool Enabled = true; public bool isSpecialEvent = false; public bool isBetaEvent = false; public bool showTip = false; public List TipMessages = new List { "" }; public List TipTitle = new List { "" }; public bool isWarning = true; public Dictionary ScaleList = new Dictionary(); public List EventsToRemove = new List(); public bool MoonMode = false; public List Blacklist = new List(); public List Whitelist = new List(); public List EventsToSpawnWith = new List(); public bool Executed = false; public bool Active = false; public bool SpeedRunSafe = true; public List Aliases = new List(); public List monstersToSpawn = new List(); public ScrapTransmutationEvent scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0f, 0f, 0f, 0f)); internal static Dictionary ScaleInfoList = new Dictionary { { ScaleType.InsideEnemyRarity, "Enemy is added to Inside enemy list with rarity." }, { ScaleType.OutsideEnemyRarity, "Enemy is added to Outside enemy list with rarity." }, { ScaleType.DaytimeEnemyRarity, "Enemy is added to Daytime enemy list with rarity." }, { ScaleType.MinOutsideEnemy, "Minimum amount of enemies guranteed to spawn outside." }, { ScaleType.MaxOutsideEnemy, "Maximum amount of enemies guaranteed to spawn outside." }, { ScaleType.MinInsideEnemy, "Minimum amount of enemies guaranteed to spawn inside." }, { ScaleType.MaxInsideEnemy, "Maximum amount of enemies guaranteed to spawn inside." }, { ScaleType.ScrapValue, "The amount that scrap value is multiplied by." }, { ScaleType.ScrapAmount, "The amount that scrap amount is multiplied by." }, { ScaleType.FactorySize, "The amount that factory size is multiplied by." }, { ScaleType.MinDensity, "Minimum density value chosen." }, { ScaleType.MaxDensity, "Maximum density value chosen." }, { ScaleType.MinCash, "Minumum amount of cash given." }, { ScaleType.MaxCash, "Maximum amount of cash given." }, { ScaleType.MinItemAmount, "Minimum amount of items to spawn." }, { ScaleType.MaxItemAmount, "Maximum amount of items to spawn." }, { ScaleType.MinValue, "The minimum value of something." }, { ScaleType.MaxValue, "The maximum value of something." }, { ScaleType.Rarity, "The general chance of something." }, { ScaleType.MinRarity, "Minimum chance of something." }, { ScaleType.MaxRarity, "Maximum chance of something." }, { ScaleType.MinCut, "Minimum cut taken." }, { ScaleType.MaxCut, "Maximum cut taken." }, { ScaleType.MinHp, "Minimum possible to be chosen." }, { ScaleType.MaxHp, "Maxmimum possible hp to be chosen." }, { ScaleType.SpawnMultiplier, "Will multiply the spawn chance." }, { ScaleType.SpawnCapMultiplier, "Will multiply the spawn cap." }, { ScaleType.MaxInsideEnemyCount, "Changes max amount of inside enemies spawnable. " }, { ScaleType.MaxOutsideEnemyCount, "Changes max amount of outside enemies spawnable. " }, { ScaleType.MinPercentageCut, "Minimum possible percentage cut." }, { ScaleType.MaxPercentageCut, "Maximum possible percentage cut." }, { ScaleType.MinAmount, "Minimum amount of something to be chosen." }, { ScaleType.MaxAmount, "Maximum amount of something to be chosen." }, { ScaleType.Percentage, "This value goes between 0.0 to 1.0." }, { ScaleType.TimeSettings, "Time scaling factor." }, { ScaleType.TimeMin, "The minimum time to be chosen." }, { ScaleType.TimeMax, "The maximum time to be chosen." }, { ScaleType.MinPercentSelected, "Minimum percentage of something to be selected." }, { ScaleType.MaxPercentSelected, "Maximum percentage of something to be selected." }, { ScaleType.ObjectWidth, "How close an object can spawn to the edges of the navmesh" }, { ScaleType.minMold, "Minimum amount of mold to be chosen." }, { ScaleType.maxMold, "Maximum amount of mold to be chosen." }, { ScaleType.Slipperyness, "How slippery is the floor is" } }; public virtual string Name() { return ""; } public virtual void Initalize() { } public virtual bool AddEventIfOnly() { return true; } public virtual void Execute() { } public virtual void OnShipLeave() { } public virtual void OnGameStart() { } public virtual void OnLocalDisconnect() { } public virtual float Getf(ScaleType scaleType) { try { return Scale.Compute(ScaleList[scaleType], Type); } catch { Log.LogError($"Scalar '{scaleType.ToString()}' for '{Name()}' not found, returning 0."); } return 0f; } public int Get(ScaleType scaleType) { return (int)Getf(scaleType); } public void ExecuteAllMonsterEvents() { foreach (MonsterEvent item in monstersToSpawn) { item.Execute(); } } public static MEvent GetEvent(string name) { int num = EventManager.events.FindIndex((MEvent x) => x.Name() == name); if (num != -1) { return EventManager.events[num]; } Log.LogError($"Event '{name}' dosen't exist, returning nothing event"); return new Nothing(); } } [Serializable] public struct Weather : INetworkSerializable, IEquatable { public LevelWeatherType weatherType; public float scrapValueMultiplier; public float scrapAmountMultiplier; public Weather(LevelWeatherType weatherType, float scrapValueMultiplier, float scrapAmountMultiplier) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) this.weatherType = weatherType; this.scrapValueMultiplier = scrapValueMultiplier; this.scrapAmountMultiplier = scrapAmountMultiplier; } public static Weather operator *(Weather left, Weather right) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new Weather(left.weatherType, left.scrapValueMultiplier * right.scrapValueMultiplier, left.scrapAmountMultiplier * right.scrapAmountMultiplier); } public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (serializer.IsReader) { FastBufferReader fastBufferReader = serializer.GetFastBufferReader(); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref weatherType, default(ForEnums)); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref scrapValueMultiplier, default(ForPrimitives)); ((FastBufferReader)(ref fastBufferReader)).ReadValueSafe(ref scrapAmountMultiplier, default(ForPrimitives)); } else { FastBufferWriter fastBufferWriter = serializer.GetFastBufferWriter(); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref weatherType, default(ForEnums)); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref scrapValueMultiplier, default(ForPrimitives)); ((FastBufferWriter)(ref fastBufferWriter)).WriteValueSafe(ref scrapAmountMultiplier, default(ForPrimitives)); } } public bool Equals(Weather other) { //IL_0002: 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) return weatherType == other.weatherType; } public static NetworkList InitalizeWeatherMultipliers(ref NetworkList currentWeatherMultipliers) { currentWeatherMultipliers.Add(Configuration.noneMultiplier); Log.LogInfo("Added None Multiplier: " + Configuration.noneMultiplier); currentWeatherMultipliers.Add(Configuration.dustCloudMultiplier); Log.LogInfo("Added DustCloud Multiplier: " + Configuration.dustCloudMultiplier); currentWeatherMultipliers.Add(Configuration.rainyMultiplier); Log.LogInfo("Added Rainy Multiplier: " + Configuration.rainyMultiplier); currentWeatherMultipliers.Add(Configuration.stormyMultiplier); Log.LogInfo("Added Stormy Multiplier: " + Configuration.stormyMultiplier); currentWeatherMultipliers.Add(Configuration.foggyMultiplier); Log.LogInfo("Added Foggy Multiplier: " + Configuration.foggyMultiplier); currentWeatherMultipliers.Add(Configuration.floodedMultiplier); Log.LogInfo("Added Flooded Multiplier: " + Configuration.floodedMultiplier); currentWeatherMultipliers.Add(Configuration.eclipsedMultiplier); Log.LogInfo("Added Eclipsed Multiplier: " + Configuration.eclipsedMultiplier); return currentWeatherMultipliers; } public static NetworkList RandomizeWeatherMultipliers(NetworkList currentWeatherMultipliers) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0092: Expected I4, but got Unknown if (!Configuration.randomizeWeatherMultipliers.Value) { return currentWeatherMultipliers; } for (int i = 0; i < currentWeatherMultipliers.Count; i++) { float value = Configuration.weatherRandomRandomMinInclusive.Value; float value2 = Configuration.weatherRandomRandomMaxInclusive.Value; Weather weather = new Weather(currentWeatherMultipliers[i].weatherType, Random.Range(value, value2), Random.Range(value, value2)); LevelWeatherType val = currentWeatherMultipliers[i].weatherType; LevelWeatherType val2 = val; switch (val2 - -1) { case 0: currentWeatherMultipliers[i] = weather * Configuration.noneMultiplier; break; case 1: currentWeatherMultipliers[i] = weather * Configuration.dustCloudMultiplier; break; case 2: currentWeatherMultipliers[i] = weather * Configuration.rainyMultiplier; break; case 3: currentWeatherMultipliers[i] = weather * Configuration.stormyMultiplier; break; case 4: currentWeatherMultipliers[i] = weather * Configuration.foggyMultiplier; break; case 5: currentWeatherMultipliers[i] = weather * Configuration.floodedMultiplier; break; case 6: currentWeatherMultipliers[i] = weather * Configuration.eclipsedMultiplier; break; } } return currentWeatherMultipliers; } } [HarmonyPatch] [HarmonyPatch(typeof(Terminal))] internal class WeatherTerminal { [HarmonyPrefix] [HarmonyPatch("TextPostProcess")] [HarmonyPriority(800)] public static void OnLoadNewNode(ref string modifiedDisplayText) { if (Configuration.useWeatherMultipliers.Value && Configuration.enableTerminalText.Value && modifiedDisplayText.Contains("Welcome to the exomoons catalogue")) { if (modifiedDisplayText.Contains("[planetTime]")) { Log.LogInfo("Text contains '[planetTime]' modifying terminal text using ModifyTextVanilla()"); ModifyTextVanilla(ref modifiedDisplayText); } else { Log.LogInfo("Text dosen't contain '[planetTime]' modifying terminal text using ModifyTextNonVanilla()"); ModifyTextNonVanilla(ref modifiedDisplayText); } } } private unsafe static void ModifyTextNonVanilla(ref string modifiedDisplayText) { //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) int num = modifiedDisplayText.IndexOf("INFO."); if (num > 0) { modifiedDisplayText = modifiedDisplayText.Insert(num + 5, "\nFormat: (xScrapValue, xScrapAmount)"); } List list = new List(); num = modifiedDisplayText.IndexOf("*") + 1; while (num > 0) { num = modifiedDisplayText.IndexOf("*", num + 1); list.Add(num); } list.Remove(-1); List list2 = new List(); for (int i = 0; i < list.Count - 1; i++) { list2.Add(modifiedDisplayText.Substring(list[i], list[i + 1] - list[i] - 1)); } list2.Add(modifiedDisplayText.Substring(list[list.Count - 1], modifiedDisplayText.Length - list[list.Count - 1] - 1)); string[] array = list2.ToArray(); for (int j = 0; j < list2.Count; j++) { bool flag = false; list2[j] = Regex.Replace(list2[j], "\\r|\\n", ""); if (list2[j] != array[j]) { flag = true; } num = list2[j].IndexOf("("); if (num > 0) { foreach (Weather currentWeatherMultiplier in Net.Instance.currentWeatherMultipliers) { string text = list2[j]; LevelWeatherType weatherType = currentWeatherMultiplier.weatherType; if (text.Contains(((object)(*(LevelWeatherType*)(&weatherType))/*cast due to .constrained prefix*/).ToString())) { string value = " (x" + currentWeatherMultiplier.scrapValueMultiplier.ToString("F2", Configuration.en) + ", x" + currentWeatherMultiplier.scrapAmountMultiplier.ToString("F2", Configuration.en) + ")"; list2[j] = list2[j].Insert(list2[j].Length, value); } } } else { string text2 = "x" + Net.Instance.currentWeatherMultipliers[0].scrapValueMultiplier.ToString("F2", Configuration.en) + ", x" + Net.Instance.currentWeatherMultipliers[0].scrapAmountMultiplier.ToString("F2", Configuration.en); list2[j] = list2[j].Insert(list2[j].Length - 1, "( " + text2 + ")"); } if (flag) { list2[j] += "\r\n"; } } for (int k = 0; k < array.Length; k++) { modifiedDisplayText = modifiedDisplayText.Replace(array[k], list2[k]); } } private static void ModifyTextVanilla(ref string modifiedDisplayText) { //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_0099: 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_00b8: Invalid comparison between Unknown and I4 int num = modifiedDisplayText.IndexOf("INFO."); if (num > 0) { modifiedDisplayText = modifiedDisplayText.Insert(num + 5, "\nFormat: (xScrapValue, xScrapAmount)"); } int num2 = modifiedDisplayText.Split("[planetTime]").Length - 1; Regex regex = new Regex(Regex.Escape("[planetTime]")); for (int i = 0; i < num2 && i < Manager.currentTerminal.moonsCatalogueList.Length; i++) { LevelWeatherType currentWeather = Manager.currentTerminal.moonsCatalogueList[i].currentWeather; num = modifiedDisplayText.IndexOf("[planetTime]", num + 1); foreach (Weather currentWeatherMultiplier in Net.Instance.currentWeatherMultipliers) { if (currentWeatherMultiplier.weatherType == currentWeather) { string text = (((int)currentWeatherMultiplier.weatherType == -1) ? "" : " "); string replacement = "[planetTime]" + text + "(x" + currentWeatherMultiplier.scrapValueMultiplier.ToString("F2", Configuration.en) + ", x" + currentWeatherMultiplier.scrapAmountMultiplier.ToString("F2", Configuration.en) + ")"; modifiedDisplayText = regex.Replace(modifiedDisplayText, replacement, 1, num); } } } } } } namespace BrutalCompanyMinus.Minus.MonoBehaviours { [HarmonyPatch] internal class BerserkTurretsNet : NetworkBehaviour { public static BerserkTurretsNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("BerserkTurrets", state: true); } public static void DestroyInstance() { BrutalCompanyMinus.Minus.Events.BerserkTurrets.Instance.Active = false; GameObject val = GameObject.Find("BerserkTurretsEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "BerserkTurretsNet"; } } [HarmonyPatch] internal class DoorCircuitFailureNet : NetworkBehaviour { public static DoorCircuitFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("DoorCircuitFailure", state: true); } public static void DestroyInstance() { DoorCircuitFailure.Instance.Active = false; GameObject val = GameObject.Find("DoorCircuitFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "DoorCircuitFailureNet"; } } [HarmonyPatch] internal class DoorFailureFailureNet : NetworkBehaviour { public static DoorFailureFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("DoorFailure", state: true); } public static void DestroyInstance() { DoorFailure.Instance.Active = false; TimeOfDay.Instance.globalTimeSpeedMultiplier = 1f; GameObject val = GameObject.Find("DoorFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "DoorFailureFailureNet"; } } [HarmonyPatch] internal class DoorOverDriveNet : NetworkBehaviour { public static DoorOverDriveNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("DoorOverdriveEv", state: true); } public static void DestroyInstance() { DoorOverdriveEv.Instance.Active = false; GameObject val = GameObject.Find("DoorOverdriveEvEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "DoorOverDriveNet"; } } [HarmonyPatch] internal class ItemChargerFailureNet : NetworkBehaviour { public static ItemChargerFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("ItemChargerFailure", state: true); } public static void DestroyInstance() { ItemChargerFailure.Instance.Active = false; GameObject val = GameObject.Find("ItemChargerFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ItemChargerFailureNet"; } } [HarmonyPatch] internal class JetpackFailureNet : NetworkBehaviour { public static JetpackFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("JetpackFailure", state: true); } public static void DestroyInstance() { JetpackFailure.Instance.Active = false; GameObject val = GameObject.Find("JetPackFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "JetpackFailureNet"; } } [HarmonyPatch] internal class LeverNet : NetworkBehaviour { public static LeverNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("LeverFailure", state: true); } public static void DestroyInstance() { LeverFailure.Instance.Active = false; GameObject val = GameObject.Find("LeverEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "LeverNet"; } } [HarmonyPatch] internal class ManualCameraFailureNet : NetworkBehaviour { public static ManualCameraFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("ManualCameraFailure", state: true); } public static void DestroyInstance() { ManualCameraFailure.Active = false; GameObject val = GameObject.Find("ManualCameraFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ManualCameraFailureNet"; } } [HarmonyPatch] internal class ShipLightsFailureNet : NetworkBehaviour { public static ShipLightsFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("ShipLightsFailure", state: true); } public static void DestroyInstance() { ShipLightsFailure.Instance.Active = false; GameObject val = GameObject.Find("ShipLightsFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ShipLightsFailureNet"; } } [HarmonyPatch] internal class TargetingFailureNet : NetworkBehaviour { public static TargetingFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("TargetingFailureEvent", state: true); } public static void DestroyInstance() { TargetingFailureEvent.Instance.Active = false; GameObject val = GameObject.Find("TargetingFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "TargetingFailureNet"; } } [HarmonyPatch] internal class TeleporterFailureNet : NetworkBehaviour { public static TeleporterFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("TeleporterFailure", state: true); } public static void DestroyInstance() { TeleporterFailure.Instance.Active = false; GameObject val = GameObject.Find("TeleporterFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "TeleporterFailureNet"; } } [HarmonyPatch] internal class TerminalFailureNet : NetworkBehaviour { public static TerminalFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("TerminalFailure", state: true); } public static void DestroyInstance() { TerminalFailure.Instance.Active = false; TimeOfDay.Instance.globalTimeSpeedMultiplier = 1f; GameObject val = GameObject.Find("TerminalFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "TerminalFailureNet"; } } [HarmonyPatch] internal class TrapsFailureNet : NetworkBehaviour { public static TrapsFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("TrapsFailure", state: true); } public static void DestroyInstance() { TrapsFailure.Instance.Active = false; GameObject val = GameObject.Find("TrapsFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "TrapsFailureNet"; } } [HarmonyPatch] internal class WalkieFailureNet : NetworkBehaviour { public static WalkieFailureNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; Net.Instance.SetEventActiveServerRPC("WalkieFailure", state: true); } public static void DestroyInstance() { WalkieFailure.Instance.Active = false; GameObject val = GameObject.Find("WalkieFailureEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "WalkieFailureNet"; } } public class AntiCoilHeadAI : EnemyAI { public AISearchRoutine searchForPlayers = null; private readonly List lookingPlayerQueue = new List(); private bool stoppingMovement; private bool hasStopped; public AnimationStopPoints animStopPoints = null; private float currentChaseSpeed = 18f; private float currentAnimSpeed = 1f; private PlayerControllerB? previousTarget; private bool wasOwnerLastFrame; private float stopAndGoMinimumInterval; private float hitPlayerTimer; private float stopMovementTimer; public AudioClip[] springNoises = null; public Collider mainCollider = null; private bool PlayerIsInAntiCoilArea(PlayerControllerB player) { if (base.isOutside) { return !player.isInsideFactory && !player.isInHangarShipRoom; } return player.isInsideFactory; } private bool PlayerIsLookingAtAntiCoil(PlayerControllerB player) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (!PlayerIsInAntiCoilArea(player) || !((EnemyAI)this).PlayerIsTargetable(player, false, false, true)) { return false; } Transform val = base.eye ?? ((Component)this).transform; return player.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 1.6f, 60f, 60, -1f, -1) && Vector3.SqrMagnitude(((Component)player.gameplayCamera).transform.position - val.position) > 0.09f; } private bool ShouldRoamWithoutPlayers() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (StartOfRound.Instance.allPlayersDead) { return false; } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (PlayerIsInAntiCoilArea(val) && ((EnemyAI)this).PlayerIsTargetable(val, false, false, true) && (!base.isOutside || Vector3.SqrMagnitude(((Component)this).transform.position - ((Component)val).transform.position) < 2500f)) { return false; } } return true; } private bool TargetFirstLookingPlayer(out PlayerControllerB firstLookingPlayer) { for (int num = lookingPlayerQueue.Count - 1; num >= 0; num--) { if (!PlayerIsLookingAtAntiCoil(lookingPlayerQueue[num])) { lookingPlayerQueue.RemoveAt(num); } } for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (PlayerIsLookingAtAntiCoil(val) && !lookingPlayerQueue.Contains(val)) { lookingPlayerQueue.Add(val); } } if (lookingPlayerQueue.Count == 0) { firstLookingPlayer = null; return false; } firstLookingPlayer = lookingPlayerQueue[0]; base.targetPlayer = firstLookingPlayer; return true; } private void StopMovingOnOwner() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner && (base.agent.speed != 0f || base.movingTowardsTargetPlayer)) { base.agent.speed = 0f; base.movingTowardsTargetPlayer = false; ((EnemyAI)this).SetDestinationToPosition(((Component)this).transform.position, false); } } private void StopActiveSearches() { if (searchForPlayers.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } } public override void DoAIInterval() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (StartOfRound.Instance.allPlayersDead || base.isEnemyDead) { StopActiveSearches(); return; } switch (base.currentBehaviourStateIndex) { case 0: { if (!((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); break; } if (TargetFirstLookingPlayer(out PlayerControllerB firstLookingPlayer2)) { previousTarget = firstLookingPlayer2; ((EnemyAI)this).ChangeOwnershipOfEnemy(firstLookingPlayer2.actualClientId); ((EnemyAI)this).SwitchToBehaviourState(1); break; } if (ShouldRoamWithoutPlayers()) { previousTarget = null; base.addPlayerVelocityToDestination = 0f; base.agent.speed = 6f; base.movingTowardsTargetPlayer = false; if (!searchForPlayers.inProgress) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers); } break; } if (searchForPlayers.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } previousTarget = null; base.addPlayerVelocityToDestination = 0f; StopMovingOnOwner(); base.creatureAnimator.SetFloat("walkSpeed", 0f); currentAnimSpeed = 0f; break; } case 1: { if (searchForPlayers.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } if (TargetFirstLookingPlayer(out PlayerControllerB firstLookingPlayer)) { if ((Object)(object)previousTarget != (Object)(object)firstLookingPlayer) { previousTarget = firstLookingPlayer; ((EnemyAI)this).ChangeOwnershipOfEnemy(firstLookingPlayer.actualClientId); } base.agent.stoppingDistance = 0f; base.agent.acceleration = 50f; base.addPlayerVelocityToDestination = 0f; base.movingTowardsTargetPlayer = true; } else { base.addPlayerVelocityToDestination = 0f; base.movingTowardsTargetPlayer = false; StopMovingOnOwner(); ((EnemyAI)this).SwitchToBehaviourState(0); ((EnemyAI)this).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); } break; } } } public override void Update() { //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { return; } if (hitPlayerTimer >= 0f) { hitPlayerTimer -= Time.deltaTime; } if (base.currentBehaviourStateIndex != 1) { if (ShouldRoamWithoutPlayers()) { stoppingMovement = false; stopMovementTimer = 0f; if (hasStopped) { hasStopped = false; mainCollider.isTrigger = true; } currentAnimSpeed = Mathf.Lerp(currentAnimSpeed, 2f, 5f * Time.deltaTime); base.creatureAnimator.SetFloat("walkSpeed", currentAnimSpeed); if (((NetworkBehaviour)this).IsOwner) { base.addPlayerVelocityToDestination = 0f; base.agent.speed = 6f; base.movingTowardsTargetPlayer = false; } } else { stoppingMovement = true; stopMovementTimer = 0f; base.creatureAnimator.SetFloat("walkSpeed", 0f); currentAnimSpeed = 0f; StopMovingOnOwner(); } return; } if (!((NetworkBehaviour)this).IsOwner) { wasOwnerLastFrame = false; } if (((NetworkBehaviour)this).IsOwner) { if (stopAndGoMinimumInterval > 0f) { stopAndGoMinimumInterval -= Time.deltaTime; } if (!wasOwnerLastFrame) { wasOwnerLastFrame = true; if (!stoppingMovement) { base.agent.speed = currentChaseSpeed; } else { base.agent.speed = 0f; } } bool flag = true; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { if (PlayerIsLookingAtAntiCoil(StartOfRound.Instance.allPlayerScripts[i])) { flag = false; break; } } if (base.stunNormalizedTimer > 0f) { flag = true; } if (flag != stoppingMovement && stopAndGoMinimumInterval <= 0f) { stopAndGoMinimumInterval = 0.15f; if (flag) { SetAnimationStopServerRpc(); } else { SetAnimationGoServerRpc(); } stoppingMovement = flag; } } if (stoppingMovement) { if (!animStopPoints.canAnimationStop) { stopMovementTimer += Time.deltaTime; if (stopMovementTimer <= 0.27f) { return; } } else { stopMovementTimer = 0f; } if (!hasStopped) { hasStopped = true; if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position, 60f, 25, -1f, -1)) { float num = Vector3.SqrMagnitude(((Component)this).transform.position - ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); if (num < 16f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.9f, true); } else if (num < 81f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.4f, true); } } if (currentAnimSpeed > 2f) { RoundManager.PlayRandomClip(base.creatureVoice, springNoises, false, 1f, 0, 1000); if (animStopPoints.animationPosition == 1) { base.creatureAnimator.SetTrigger("springBoing"); } else { base.creatureAnimator.SetTrigger("springBoingPosition2"); } } } if (mainCollider.isTrigger && Vector3.SqrMagnitude(((Component)GameNetworkManager.Instance.localPlayerController).transform.position - ((Component)this).transform.position) > 0.0625f) { mainCollider.isTrigger = false; } base.creatureAnimator.SetFloat("walkSpeed", 0f); currentAnimSpeed = 0f; if (((NetworkBehaviour)this).IsOwner) { base.addPlayerVelocityToDestination = 0f; StopMovingOnOwner(); } } else { stopMovementTimer = 0f; if (hasStopped) { hasStopped = false; mainCollider.isTrigger = true; } currentAnimSpeed = Mathf.Lerp(currentAnimSpeed, 6f, 5f * Time.deltaTime); base.creatureAnimator.SetFloat("walkSpeed", currentAnimSpeed); if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 0f; base.agent.acceleration = 50f; base.addPlayerVelocityToDestination = 0f; base.agent.speed = Mathf.Lerp(base.agent.speed, currentChaseSpeed, 4.5f * Time.deltaTime); base.movingTowardsTargetPlayer = true; } } } public override void NavigateTowardsTargetPlayer() { //IL_0043: 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_007b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.targetPlayer == (Object)null) { return; } if (base.setDestinationToPlayerInterval <= 0f) { base.setDestinationToPlayerInterval = 0.05f; base.destination = ((Component)base.targetPlayer).transform.position; base.moveTowardsDestination = true; if (((Behaviour)base.agent).enabled && base.agent.isOnNavMesh) { base.agent.SetDestination(base.destination); } } else { base.setDestinationToPlayerInterval -= Time.deltaTime; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetAnimationStopServerRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2817700276u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2817700276u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAnimationStopClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetAnimationStopClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2307802674u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2307802674u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stoppingMovement = true; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetAnimationGoServerRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1927665513u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1927665513u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAnimationGoClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetAnimationGoClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2701346570u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2701346570u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stoppingMovement = false; } } } public override void OnCollideWithPlayer(Collider other) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_008d: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).OnCollideWithPlayer(other); if (!stoppingMovement && base.currentBehaviourStateIndex == 1 && !(hitPlayerTimer >= 0f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null && ((NetworkBehaviour)val).IsOwner) { hitPlayerTimer = 0.2f; Vector3 val2 = Vector3.Normalize(((Component)val.gameplayCamera).transform.position - ((Component)this).transform.position) * 80f; val.KillPlayer(val2, true, (CauseOfDeath)6, 0, default(Vector3), false); val.JumpToFearLevel(1f, true); } } } public override void KillEnemy(bool destroy = false) { StopActiveSearches(); ((EnemyAI)this).KillEnemy(destroy); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2817700276u, new RpcReceiveHandler(__rpc_handler_2817700276), "SetAnimationStopServerRpc"); ((NetworkBehaviour)this).__registerRpc(2307802674u, new RpcReceiveHandler(__rpc_handler_2307802674), "SetAnimationStopClientRpc"); ((NetworkBehaviour)this).__registerRpc(1927665513u, new RpcReceiveHandler(__rpc_handler_1927665513), "SetAnimationGoServerRpc"); ((NetworkBehaviour)this).__registerRpc(2701346570u, new RpcReceiveHandler(__rpc_handler_2701346570), "SetAnimationGoClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2817700276(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; ((AntiCoilHeadAI)(object)target).SetAnimationStopServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2307802674(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; ((AntiCoilHeadAI)(object)target).SetAnimationStopClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1927665513(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; ((AntiCoilHeadAI)(object)target).SetAnimationGoServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2701346570(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; ((AntiCoilHeadAI)(object)target).SetAnimationGoClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AntiCoilHeadAI"; } } [HarmonyPatch] internal class ArtilleryShell : MonoBehaviour { public Transform transform; public static float speed = 100f; private float timeTillExplode = 1f; public Vector3 target = Vector3.zero; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) transform.LookAt(target); timeTillExplode = Vector3.Distance(transform.position, target) / speed; } private void Update() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) Transform obj = transform; obj.position += transform.forward * Time.deltaTime * speed; if (timeTillExplode > 0f) { timeTillExplode -= Time.deltaTime; return; } try { Landmine.SpawnExplosion(transform.position, true, 5f, 6f, 50, 0f, (GameObject)null, false); } catch { } Object.Destroy((Object)(object)((Component)transform).gameObject); } public static void FireAt(Vector3 at, Vector3 from) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Net.Instance.FireAtServerRpc(at, from); } } internal class BunkerLadderPassage : Passage { internal BunkerLid bunkerLid; public override void TeleportPlayer() { base.TeleportPlayer(); PlayAudioAtTeleportPositionsServerRpc(); bunkerLid.ToggleLidServerRpc(_state: true); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BunkerLadderPassage"; } } internal class BunkerLid : NetworkBehaviour { public Animator animator; public AudioSource bunkerAudio; public GameObject passageInteractTrigger; public InteractTrigger bunkerInteractTrigger; public bool state = false; public void Start() { passageInteractTrigger.SetActive(false); } [ServerRpc(RequireOwnership = false)] public void ToggleLidServerRpc(bool _state) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2641716483u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref _state, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2641716483u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ToggleLidClientRpc(_state); } } } [ServerRpc(RequireOwnership = false)] public void ToggleLidServerRpc() { //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(2841680999u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2841680999u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ToggleLidClientRpc(!state); } } } [ClientRpc] private void ToggleLidClientRpc(bool newState) { //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(3863517122u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newState, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3863517122u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (newState != state) { state = newState; bunkerAudio.Play(); animator.SetBool("Open", newState); passageInteractTrigger.SetActive(newState); bunkerInteractTrigger.hoverTip = (newState ? "Close [LMB]" : "Open [LMB]"); } } } 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 ((NetworkBehaviour)this).__registerRpc(2641716483u, new RpcReceiveHandler(__rpc_handler_2641716483), "ToggleLidServerRpc"); ((NetworkBehaviour)this).__registerRpc(2841680999u, new RpcReceiveHandler(__rpc_handler_2841680999), "ToggleLidServerRpc"); ((NetworkBehaviour)this).__registerRpc(3863517122u, new RpcReceiveHandler(__rpc_handler_3863517122), "ToggleLidClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2641716483(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BunkerLid)(object)target).ToggleLidServerRpc(flag); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2841680999(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; ((BunkerLid)(object)target).ToggleLidServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3863517122(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool newState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newState, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BunkerLid)(object)target).ToggleLidClientRpc(newState); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BunkerLid"; } } internal class BunkerLidPassage : Passage { internal BunkerLid bunkerLid; public override void TeleportPlayer() { base.TeleportPlayer(); PlayAudioAtTeleportPositionsServerRpc(); bunkerLid.ToggleLidServerRpc(_state: false); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BunkerLidPassage"; } } [HarmonyPatch] internal class DDay : NetworkBehaviour { public static float currentTime = 0f; public static float bombardmentCurrentTime = 0f; public static float fireCurrentTime = 0f; public static float bombardmentInterval = 100f; public static float bombardmentTime = 15f; public static float fireInterval = 1f; public static int fireAmount = 8; public static bool displayedBombardmentWarning = false; public static bool displayWarning = true; private static float fireAmountMultiplier = 1f; private static int seed = 2352; public static DDay instance; public AudioSource sirensClose; public AudioSource sirensFar; public Transform transform; public static float volume = 0.3f; private List spawnDenialNodes = new List(); private LayerMask triggerLayerMask = LayerMask.op_Implicit(8192); private static Random rng; public void Start() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)instance != (Object)null) { DestroyInstance(); } instance = this; spawnDenialNodes = Helper.GetSpawnDenialNodes(); currentTime = 15f; sirensClose.volume = volume; sirensFar.volume = volume; triggerLayerMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Triggers" })); rng = new Random(seed); } public void Update() { //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) if (!Warzone.Active || !((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } if (currentTime > 0f) { currentTime -= Time.deltaTime; } else { float num = Mathf.Clamp(Manager.terrainArea / 9700f, 1f, 3f); currentTime = bombardmentInterval; bombardmentCurrentTime = bombardmentTime; displayedBombardmentWarning = false; } if (currentTime <= 15f && !displayedBombardmentWarning) { instance.PlayServerRpc(); if (displayWarning) { Net.Instance.DisplayTipServerRpc("BOMBARDMENT IN 15 SECONDS", "TAKE COVER!!!", isWarning: true); } displayedBombardmentWarning = true; } if (bombardmentCurrentTime > 0f) { bombardmentCurrentTime -= Time.deltaTime; fireCurrentTime -= Time.deltaTime; } if (!(fireCurrentTime < 0f)) { return; } fireCurrentTime = fireInterval; seed++; int num2 = rng.Next(); for (int i = 0; (float)i < (float)fireAmount * fireAmountMultiplier; i++) { int num3 = 0; if (num3 < 4) { num2 = rng.Next(); Vector3 val = Manager.outsideObjectSpawnNodes[rng.Next(Manager.outsideObjectSpawnNodes.Count)]; val += new Vector3((float)rng.Next(-75, 75), 0f, (float)rng.Next(-75, 75)); Vector3 val2 = val + new Vector3((float)rng.Next(-100, 100), (float)rng.Next(500, 800), (float)rng.Next(-100, 100)); RaycastHit val3 = default(RaycastHit); Vector3 val4 = val - val2; if (Physics.Raycast(new Ray(val2, ((Vector3)(ref val4)).normalized), ref val3, 1000f, ~LayerMask.op_Implicit(triggerLayerMask))) { val = ((RaycastHit)(ref val3)).point; } if (Helper.IsSafe(val, spawnDenialNodes, 15f)) { ArtilleryShell.FireAt(val, val2); } } } } [ServerRpc(RequireOwnership = false)] public void PlayServerRpc() { //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(4234545785u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4234545785u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayClientRpc(); } } } [ClientRpc] public void PlayClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3677798468u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3677798468u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; sirensClose.Play(); sirensFar.Play(); } } } [ServerRpc(RequireOwnership = false)] public void StopServerRpc() { //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(3325677646u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3325677646u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StopClientRpc(); } } } [ClientRpc] public void StopClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4008721163u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4008721163u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; sirensClose.Stop(); sirensFar.Stop(); } } } public static void SpawnInstance() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; GameObject val2 = GameObject.Find("HangarShip"); if ((Object)(object)val2 != (Object)null) { val = val2.transform.position; } GameObject val3 = Object.Instantiate(Assets.artillerySirens, val, Quaternion.identity); val3.GetComponent().Spawn(true); Manager.objectsToClear.Add(val3); } public static void DestroyInstance() { Warzone.Active = false; try { NetworkObject component = ((Component)instance.transform).GetComponent(); component.Despawn(true); } catch { } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { Warzone.Active = false; DestroyInstance(); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")] public static void OnShipLanded() { if (((NetworkBehaviour)RoundManager.Instance).IsHost && Warzone.Active) { SpawnInstance(); } } 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 ((NetworkBehaviour)this).__registerRpc(4234545785u, new RpcReceiveHandler(__rpc_handler_4234545785), "PlayServerRpc"); ((NetworkBehaviour)this).__registerRpc(3677798468u, new RpcReceiveHandler(__rpc_handler_3677798468), "PlayClientRpc"); ((NetworkBehaviour)this).__registerRpc(3325677646u, new RpcReceiveHandler(__rpc_handler_3325677646), "StopServerRpc"); ((NetworkBehaviour)this).__registerRpc(4008721163u, new RpcReceiveHandler(__rpc_handler_4008721163), "StopClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4234545785(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; ((DDay)(object)target).PlayServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3677798468(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; ((DDay)(object)target).PlayClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3325677646(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; ((DDay)(object)target).StopServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4008721163(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; ((DDay)(object)target).StopClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DDay"; } } [HarmonyPatch] public class EnemySpawnCycle : NetworkBehaviour { public enum SpawnLocation { Inside, Outside } public class SpawnCycle { public List enemies; public float spawnCycleDuration; public float spawnAttemptInterval; public float nothingWeight; public bool multiplyBySpawnCurve = true; private float currentSpawnAttemptIntervalTime; public bool Ellapse(float deltaTime) { spawnCycleDuration -= deltaTime; if (currentSpawnAttemptIntervalTime > 0f) { currentSpawnAttemptIntervalTime -= deltaTime; return false; } currentSpawnAttemptIntervalTime = spawnAttemptInterval; return true; } public bool EllapseOnlyInterval(float deltaTime) { if (currentSpawnAttemptIntervalTime > 0f) { currentSpawnAttemptIntervalTime -= deltaTime; return false; } currentSpawnAttemptIntervalTime = spawnAttemptInterval; return true; } public void Reset() { currentSpawnAttemptIntervalTime = spawnAttemptInterval * 0.33f; foreach (EnemySpawnInfo enemy in enemies) { enemy.Reset(); } } public void AttemptSpawnAll() { float num = (multiplyBySpawnCurve ? Instance.GetChanceMultiplier() : 1f); Log.LogInfo($"--- Attempting to spawn with a nothingWeight of {nothingWeight} and chanceMultiplier of {num}"); foreach (EnemySpawnInfo enemy in enemies) { enemy.AttemptSpawn(allEnemiesCycle.nothingWeight, num); } } } public class EnemySpawnInfo { public GameObject enemy; public float enemyWeight; public int spawnCap; public SpawnLocation spawnLocation; private int currentSpawned; public void AttemptSpawn(float nothingWeight, float chanceMultiplier) { rng = new Random(Net.Instance._seed++); switch (spawnLocation) { case SpawnLocation.Inside: AttemptSpawnInside(nothingWeight, chanceMultiplier); break; case SpawnLocation.Outside: AttemptSpawnOutside(nothingWeight, chanceMultiplier); break; } } private void AttemptSpawnInside(float nothingWeight, float chanceMultiplier) { float num = enemyWeight * chanceMultiplier; Log.LogInfo($"### Attempting to spawn {((Object)enemy).name} at {num:F2} weight;"); if ((float)(rng.NextDouble() * (double)nothingWeight) <= num) { if (currentSpawned < spawnCap) { currentSpawned++; Manager.Spawn.InsideEnemies(enemy, 1); Manager.Spawn.DoSpawnInsideEnemies(); Log.LogInfo("!!! Succeeded spawning " + ((Object)enemy).name + " inside."); } } else { Log.LogInfo("Failed to spawn " + ((Object)enemy).name + " inside."); } } private void AttemptSpawnOutside(float nothingWeight, float chanceMultiplier) { float num = enemyWeight * chanceMultiplier; Log.LogInfo($"### Attempting to spawn {((Object)enemy).name} at {num:F2} weight;"); if ((float)(rng.NextDouble() * (double)nothingWeight) <= num) { if (currentSpawned < spawnCap) { currentSpawned++; Manager.Spawn.OutsideEnemies(enemy, 1); Manager.Spawn.DoSpawnOutsideEnemies(); Log.LogInfo("!!! Succeeded spawning " + ((Object)enemy).name + " outside."); } } else { Log.LogInfo("Failed to spawn " + ((Object)enemy).name + " outside."); } } public void Reset() { currentSpawned = 0; } } public static EnemySpawnCycle Instance; public static bool Active = false; public List spawnCycles; public static SpawnCycle allEnemiesCycle = new SpawnCycle(); public static SpawnCycle allAllEnemiesCycle = new SpawnCycle(); public static Random rng; private void Awake() { rng = new Random(Environment.TickCount); Instance = this; spawnCycles = new List(); } private void Update() { if (!Active) { return; } foreach (SpawnCycle spawnCycle in spawnCycles) { if (!(spawnCycle.spawnCycleDuration <= 0f) && spawnCycle.Ellapse(Time.deltaTime)) { spawnCycle.AttemptSpawnAll(); } } if (Configuration.enableAllEnemies.Value && allEnemiesCycle.EllapseOnlyInterval(Time.deltaTime)) { allEnemiesCycle.AttemptSpawnAll(); } if (Configuration.enableAllAllEnemies.Value && allAllEnemiesCycle.EllapseOnlyInterval(Time.deltaTime)) { allAllEnemiesCycle.AttemptSpawnAll(); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private static void OnShipLeave() { Active = false; Instance.spawnCycles.Clear(); foreach (SpawnCycle spawnCycle in Instance.spawnCycles) { spawnCycle.Reset(); } allEnemiesCycle.Reset(); allAllEnemiesCycle.Reset(); allEnemiesCycle.enemies.Clear(); allAllEnemiesCycle.enemies.Clear(); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "openingDoorsSequence")] private static void OnGameStart() { if (EventManager.IsIgnoredMoon(StartOfRound.Instance.currentLevel.PlanetName)) { Active = false; } else { Active = true; } Log.LogInfo("Active State: " + Active); Instance.spawnCycles.Clear(); foreach (SpawnCycle spawnCycle in Instance.spawnCycles) { spawnCycle.Reset(); } allEnemiesCycle.Reset(); allAllEnemiesCycle.Reset(); } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "LoadNewLevel")] private static void OnLoadNewLevel() { if (EventManager.IsIgnoredMoon(StartOfRound.Instance.currentLevel.PlanetName)) { Active = false; } else { Active = true; } } private float GetChanceMultiplier() { float num = RoundManager.Instance.currentLevel.enemySpawnChanceThroughoutDay.Evaluate(RoundManager.Instance.timeScript.currentDayTime / RoundManager.Instance.timeScript.totalTime); if (num <= 0f) { return Mathf.Clamp(Mathf.Exp(num), 0.01f, 1f); } return Mathf.Clamp(Mathf.Log(num + MathF.E), 1f, 5f); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "EnemySpawnCycle"; } } [HarmonyPatch] public class GrabbableLandmine : GrabbableObject, IHittable { private bool mineActivated = true; public bool hasExploded; public Animator mineAnimator = null; public AudioSource mineAudio = null; public AudioSource mineTickSource = null; public AudioClip mineDetonate = null; public AudioClip mineTrigger = null; public AudioClip mineDeactivate = null; public AudioClip minePress = null; private bool sendingExplosionRPC; private float pressMineDebounceTimer; public bool mineGrabbed = false; public bool onBlowUpSchedule = false; public float countDown = 0f; public float dropSafetyTime = 0f; private static int seed; [HarmonyPrefix] [HarmonyPatch(typeof(Landmine), "Start")] private static void onLandmineStart(Landmine __instance) { if (GrabbableLandmines.Active) { GameObject rootObject = (((Object)(object)((Component)__instance).transform.parent != (Object)null) ? ((Component)((Component)__instance).transform.parent).gameObject : ((Component)__instance).gameObject); DisableTerminalAccessibleObjects(rootObject); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { ((MonoBehaviour)__instance).StartCoroutine(DestroySelfAndReplace(__instance)); } } else if (((NetworkBehaviour)RoundManager.Instance).IsHost) { seed++; Random rng = new Random(seed); ((MonoBehaviour)__instance).StartCoroutine(syncTerminalCodeWhenReady(__instance, rng)); } static IEnumerator DestroySelfAndReplace(Landmine landmine) { MEvent _event = GrabbableLandmines.Instance; float rarity = _event.Getf(MEvent.ScaleType.Rarity); seed++; Random rng2 = new Random(StartOfRound.Instance.randomMapSeed + seed); if (rng2.NextDouble() <= (double)rarity) { GameObject grabbableLandmine = Object.Instantiate(Assets.grabbableLandmine.spawnPrefab, ((Component)landmine).transform.position, Quaternion.identity); NetworkObject netObject = grabbableLandmine.GetComponent(); netObject.Spawn(false); Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(netObject), rng2.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); int scrapValue = Random.Range(Assets.grabbableLandmine.minValue, Assets.grabbableLandmine.maxValue + 1); int multipliedScrapValue = Mathf.RoundToInt((float)scrapValue * RoundManager.Instance.scrapValueMultiplier * Manager.scrapValueMultiplier); Net.Instance.SyncScrapValueServerRpc(NetworkObjectReference.op_Implicit(netObject), multipliedScrapValue); yield return (object)new WaitForSeconds(5f); NetworkObject vanillaNetObject = (((Object)(object)((Component)landmine).transform.parent != (Object)null) ? ((Component)((Component)landmine).transform.parent).GetComponent() : ((NetworkBehaviour)landmine).NetworkObject); if ((Object)(object)vanillaNetObject != (Object)null && vanillaNetObject.IsSpawned) { vanillaNetObject.Despawn(true); } } } } [HarmonyPostfix] [HarmonyPatch(typeof(Landmine), "SpawnExplosion")] private static void ChainGrabbableLandmines(Vector3 explosionPosition, float damageRange) { //IL_003b: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) if ((Object)(object)NetworkManager.Singleton == (Object)null || !NetworkManager.Singleton.IsServer) { return; } GrabbableLandmine[] array = Object.FindObjectsByType((FindObjectsSortMode)0); RaycastHit val = default(RaycastHit); foreach (GrabbableLandmine grabbableLandmine in array) { float num = Vector3.Distance(explosionPosition, ((Component)grabbableLandmine).transform.position); if (!grabbableLandmine.hasExploded && !(num >= damageRange) && !(num >= 6f) && (!Physics.Linecast(explosionPosition, ((Component)grabbableLandmine).transform.position + Vector3.up * 0.3f, ref val, 1073742080, (QueryTriggerInteraction)1) || (((Component)((RaycastHit)(ref val)).collider).gameObject.layer != 30 && !(num > 4f)))) { ((MonoBehaviour)grabbableLandmine).StartCoroutine(grabbableLandmine.TriggerOtherMineDelayed()); } } } private static void DisableTerminalAccessibleObjects(GameObject rootObject) { if ((Object)(object)rootObject == (Object)null) { return; } TerminalAccessibleObject[] componentsInChildren = rootObject.GetComponentsInChildren(true); foreach (TerminalAccessibleObject val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { ((Behaviour)val).enabled = false; } } } private static IEnumerator syncTerminalCodeWhenReady(Landmine landmine, Random rng) { float waitTime = 0f; while ((Object)(object)landmine != (Object)null && ((Object)(object)((NetworkBehaviour)landmine).NetworkObject == (Object)null || !((NetworkBehaviour)landmine).NetworkObject.IsSpawned) && waitTime < 2f) { waitTime += Time.deltaTime; yield return null; } if (!((Object)(object)landmine == (Object)null) && !((Object)(object)((NetworkBehaviour)landmine).NetworkObject == (Object)null) && ((NetworkBehaviour)landmine).NetworkObject.IsSpawned) { Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)landmine).NetworkObject), rng.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); } } public override void Start() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown ((MonoBehaviour)this).StartCoroutine(StartIdleAnimation()); ((GrabbableObject)this).Start(); TerminalAccessibleObject componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.terminalCodeEvent = new InteractEvent(); ((UnityEvent)(object)componentInChildren.terminalCodeEvent).AddListener((UnityAction)DetonateFromTerminal); componentInChildren.terminalCodeCooldownEvent = new InteractEvent(); } DisableTerminalAccessibleObjects(((Component)this).gameObject); if (((NetworkBehaviour)this).IsServer) { DisableTerminalAccessibleObjectsClientRpc(); } ScanNodeProperties componentInChildren2 = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { Rigidbody val = ((Component)componentInChildren2).gameObject.GetComponent() ?? ((Component)componentInChildren2).gameObject.AddComponent(); val.isKinematic = false; val.useGravity = false; val.constraints = (RigidbodyConstraints)126; } dropSafetyTime = 2f; mineGrabbed = true; IEnumerator StartIdleAnimation() { RoundManager roundManager = RoundManager.Instance; if (!((Object)(object)roundManager == (Object)null)) { if (roundManager.BreakerBoxRandom != null) { yield return (object)new WaitForSeconds((float)roundManager.BreakerBoxRandom.NextDouble() + 0.5f); } mineAnimator.SetTrigger("startIdle"); mineAudio.pitch = Random.Range(0.9f, 1.1f); } } } private void DetonateFromTerminal(PlayerControllerB playerWhoTriggered) { TriggerMineOnLocalClientByExiting(); } [Rpc(/*Could not decode attribute arguments.*/)] private void DisableTerminalAccessibleObjectsClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3041300710u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3041300710u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DisableTerminalAccessibleObjects(((Component)this).gameObject); } } } public override void OnDestroy() { DisableTerminalAccessibleObjects(((Component)this).gameObject); ((GrabbableObject)this).OnDestroy(); } public override void Update() { if (countDown > 0f) { countDown -= Time.deltaTime; } if (dropSafetyTime > 0f) { dropSafetyTime -= Time.deltaTime; } else { mineGrabbed = false; } if (countDown <= 0f && onBlowUpSchedule) { onBlowUpSchedule = false; dropSafetyTime = -1f; mineGrabbed = false; playMineTickSourceServerRpc(toggle: false); ExplodeMineServerRpc(); } if (pressMineDebounceTimer > 0f) { pressMineDebounceTimer -= Time.deltaTime; } ((GrabbableObject)this).Update(); } private void OnGrab() { mineGrabbed = true; onBlowUpSchedule = true; dropSafetyTime = 6f; countDown = 6f; playMineTickSourceServerRpc(toggle: true); } [Rpc(/*Could not decode attribute arguments.*/)] private void OnGrabServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2093032180u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2093032180u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnGrabClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void OnGrabClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1876802964u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1876802964u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnGrab(); } } } private void OnDiscard() { mineGrabbed = true; onBlowUpSchedule = false; dropSafetyTime = 1.5f; countDown = 0f; playMineTickSourceServerRpc(toggle: false); } [Rpc(/*Could not decode attribute arguments.*/)] private void OnDiscardServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3834327495u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3834327495u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnDiscardClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void OnDiscardClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2155830483u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2155830483u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnDiscard(); } } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); OnGrab(); OnGrabServerRpc(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); OnDiscard(); OnDiscardServerRpc(); } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); OnGrab(); OnGrabServerRpc(); } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); OnDiscard(); OnDiscardServerRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] private void playMineTickSourceServerRpc(bool toggle) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1401067709u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1401067709u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; playMineTickSourceClientRpc(toggle); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void playMineTickSourceClientRpc(bool toggle) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(506371000u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 506371000u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (toggle) { mineTickSource.Play(); } else { mineTickSource.Stop(); } } } public void ToggleMine(bool enabled) { if (mineActivated != enabled) { mineActivated = enabled; if (!enabled) { mineAudio.PlayOneShot(mineDeactivate); WalkieTalkie.TransmitOneShotAudio(mineAudio, mineDeactivate, 1f); } ToggleMineServerRpc(enabled); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ToggleMineServerRpc(bool enable) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1230610249u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1230610249u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleMineClientRpc(enable); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ToggleMineClientRpc(bool enable) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(67361316u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 67361316u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (mineActivated != enable) { mineActivated = enable; if (!enable) { mineAudio.PlayOneShot(mineDeactivate); WalkieTalkie.TransmitOneShotAudio(mineAudio, mineDeactivate, 1f); } } } private void OnTriggerEnter(Collider other) { MineCollisionEnter(other); } private void OnCollisionEnter(Collision collision) { MineCollisionEnter(collision.collider); } private void MineCollisionEnter(Collider other) { if (hasExploded || pressMineDebounceTimer > 0f || mineGrabbed || GrabbableLandmines.LandmineDisabled || dropSafetyTime > 0f || (!((Component)other).CompareTag("PhysicsProp") && !((Component)other).tag.StartsWith("PlayerRagdoll"))) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return; } pressMineDebounceTimer = 0.5f; PressMineServerRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] public void PressMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1995327364u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1995327364u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PressMineClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PressMineClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(173368889u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 173368889u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; pressMineDebounceTimer = 0.5f; mineAudio.PlayOneShot(minePress); WalkieTalkie.TransmitOneShotAudio(mineAudio, minePress, 1f); } } } private void OnTriggerExit(Collider other) { MineCollisionExit(other); } private void OnCollisionExit(Collision collision) { MineCollisionExit(collision.collider); } private void MineCollisionExit(Collider other) { if (hasExploded || !mineActivated || mineGrabbed || GrabbableLandmines.LandmineDisabled || dropSafetyTime > 0f || (!((Component)other).tag.StartsWith("PlayerRagdoll") && !((Component)other).CompareTag("PhysicsProp"))) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return; } TriggerMineOnLocalClientByExiting(); } private void TriggerMineOnLocalClientByExiting() { if (!hasExploded && !mineGrabbed && !(dropSafetyTime > 0f)) { SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ExplodeMineServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1510907801u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1510907801u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExplodeMineClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ExplodeMineClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3821524699u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3821524699u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (sendingExplosionRPC) { sendingExplosionRPC = false; } else { SetOffMineAnimation(); } } } public void SetOffMineAnimation() { if (!hasExploded && !(dropSafetyTime > 0f) && !mineGrabbed) { hasExploded = true; mineAnimator.SetTrigger("detonate"); mineAudio.PlayOneShot(mineTrigger, 1f); } } public void Detonate() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!(dropSafetyTime > 0f) && !mineGrabbed) { mineAudio.pitch = Random.Range(0.93f, 1.07f); mineAudio.PlayOneShot(mineDetonate, 1f); Vector3 val = ((Component)this).transform.position + Vector3.up; Landmine.SpawnExplosion(val, false, 5.7f, 6f, 50, 0f, (GameObject)null, false); if (NetworkManager.Singleton.IsServer) { ((MonoBehaviour)this).StartCoroutine(DestroyObject()); } } } private IEnumerator TriggerOtherMineDelayed() { if (!hasExploded) { mineAudio.pitch = Random.Range(0.75f, 1.07f); yield return (object)new WaitForSeconds(0.2f); dropSafetyTime = -1f; mineGrabbed = false; onBlowUpSchedule = false; countDown = 0f; SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } } private IEnumerator DestroyObject() { yield return (object)new WaitForSeconds(5f); if ((Object)(object)((NetworkBehaviour)this).NetworkObject != (Object)null && ((NetworkBehaviour)this).NetworkObject.IsSpawned) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (mineGrabbed) { return false; } SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); return true; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3041300710u, new RpcReceiveHandler(__rpc_handler_3041300710), "DisableTerminalAccessibleObjectsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2093032180u, new RpcReceiveHandler(__rpc_handler_2093032180), "OnGrabServerRpc"); ((NetworkBehaviour)this).__registerRpc(1876802964u, new RpcReceiveHandler(__rpc_handler_1876802964), "OnGrabClientRpc"); ((NetworkBehaviour)this).__registerRpc(3834327495u, new RpcReceiveHandler(__rpc_handler_3834327495), "OnDiscardServerRpc"); ((NetworkBehaviour)this).__registerRpc(2155830483u, new RpcReceiveHandler(__rpc_handler_2155830483), "OnDiscardClientRpc"); ((NetworkBehaviour)this).__registerRpc(1401067709u, new RpcReceiveHandler(__rpc_handler_1401067709), "playMineTickSourceServerRpc"); ((NetworkBehaviour)this).__registerRpc(506371000u, new RpcReceiveHandler(__rpc_handler_506371000), "playMineTickSourceClientRpc"); ((NetworkBehaviour)this).__registerRpc(1230610249u, new RpcReceiveHandler(__rpc_handler_1230610249), "ToggleMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(67361316u, new RpcReceiveHandler(__rpc_handler_67361316), "ToggleMineClientRpc"); ((NetworkBehaviour)this).__registerRpc(1995327364u, new RpcReceiveHandler(__rpc_handler_1995327364), "PressMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(173368889u, new RpcReceiveHandler(__rpc_handler_173368889), "PressMineClientRpc"); ((NetworkBehaviour)this).__registerRpc(1510907801u, new RpcReceiveHandler(__rpc_handler_1510907801), "ExplodeMineServerRpc"); ((NetworkBehaviour)this).__registerRpc(3821524699u, new RpcReceiveHandler(__rpc_handler_3821524699), "ExplodeMineClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_3041300710(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; ((GrabbableLandmine)(object)target).DisableTerminalAccessibleObjectsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2093032180(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; ((GrabbableLandmine)(object)target).OnGrabServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1876802964(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; ((GrabbableLandmine)(object)target).OnGrabClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3834327495(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; ((GrabbableLandmine)(object)target).OnDiscardServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2155830483(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; ((GrabbableLandmine)(object)target).OnDiscardClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1401067709(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool toggle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref toggle, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableLandmine)(object)target).playMineTickSourceServerRpc(toggle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_506371000(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool toggle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref toggle, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableLandmine)(object)target).playMineTickSourceClientRpc(toggle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1230610249(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enable = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enable, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableLandmine)(object)target).ToggleMineServerRpc(enable); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_67361316(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enable = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enable, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableLandmine)(object)target).ToggleMineClientRpc(enable); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1995327364(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; ((GrabbableLandmine)(object)target).PressMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_173368889(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; ((GrabbableLandmine)(object)target).PressMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1510907801(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; ((GrabbableLandmine)(object)target).ExplodeMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3821524699(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; ((GrabbableLandmine)(object)target).ExplodeMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GrabbableLandmine"; } } [HarmonyPatch] public class GrabbableTurret : GrabbableObject { public Transform turretTransform = null; private static int seed; [HarmonyPrefix] [HarmonyPatch(typeof(Turret), "Start")] private static void onTurretStart(Turret __instance) { if (GrabbableTurrets.Active) { GameObject rootObject = (((Object)(object)((Component)__instance).transform.parent != (Object)null) ? ((Component)((Component)__instance).transform.parent).gameObject : ((Component)__instance).gameObject); DisableTerminalAccessibleObjects(rootObject); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { ((MonoBehaviour)__instance).StartCoroutine(DestroySelfAndReplace(__instance)); } } else if (((NetworkBehaviour)RoundManager.Instance).IsHost) { seed++; Random rng = new Random(seed); ((MonoBehaviour)__instance).StartCoroutine(syncTerminalCodeWhenReady(__instance, rng)); } static IEnumerator DestroySelfAndReplace(Turret turret) { MEvent _event = GrabbableTurrets.Instance; float rarity = _event.Getf(MEvent.ScaleType.Rarity); seed++; Random rng2 = new Random(StartOfRound.Instance.randomMapSeed + seed); if (rng2.NextDouble() <= (double)rarity) { GameObject grabbableTurret = Object.Instantiate(Assets.grabbableTurret.spawnPrefab, RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)turret).transform.position, 30f, RoundManager.Instance.navHit, rng2, -1, 1f), ((Component)turret).transform.rotation); NetworkObject netObject = grabbableTurret.GetComponent(); netObject.Spawn(false); Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(netObject), rng2.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); int scrapValue = Random.Range(Assets.grabbableTurret.minValue, Assets.grabbableTurret.maxValue + 1); int multipliedScrapValue = Mathf.RoundToInt((float)scrapValue * RoundManager.Instance.scrapValueMultiplier * Manager.scrapValueMultiplier); Net.Instance.SyncScrapValueServerRpc(NetworkObjectReference.op_Implicit(netObject), multipliedScrapValue); yield return (object)new WaitForSeconds(5f); NetworkObject vanillaNetObject = (((Object)(object)((Component)turret).transform.parent != (Object)null) ? ((Component)((Component)turret).transform.parent).GetComponent() : ((NetworkBehaviour)turret).NetworkObject); if ((Object)(object)vanillaNetObject != (Object)null && vanillaNetObject.IsSpawned) { vanillaNetObject.Despawn(true); } } } } private static void DisableTerminalAccessibleObjects(GameObject rootObject) { if ((Object)(object)rootObject == (Object)null) { return; } TerminalAccessibleObject[] componentsInChildren = rootObject.GetComponentsInChildren(true); foreach (TerminalAccessibleObject val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { ((Behaviour)val).enabled = false; } } } private static IEnumerator syncTerminalCodeWhenReady(Turret turret, Random rng) { float waitTime = 0f; while ((Object)(object)turret != (Object)null && ((Object)(object)((NetworkBehaviour)turret).NetworkObject == (Object)null || !((NetworkBehaviour)turret).NetworkObject.IsSpawned) && waitTime < 2f) { waitTime += Time.deltaTime; yield return null; } if (!((Object)(object)turret == (Object)null) && !((Object)(object)((NetworkBehaviour)turret).NetworkObject == (Object)null) && ((NetworkBehaviour)turret).NetworkObject.IsSpawned) { Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)turret).NetworkObject), rng.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); } } public override void Start() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Start(); TerminalAccessibleObject componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.terminalCodeEvent = new InteractEvent(); ((UnityEvent)(object)componentInChildren.terminalCodeEvent).AddListener((UnityAction)DisableTurretFromTerminal); componentInChildren.terminalCodeCooldownEvent = new InteractEvent(); ((UnityEvent)(object)componentInChildren.terminalCodeCooldownEvent).AddListener((UnityAction)EnableTurretFromTerminal); } DisableTerminalAccessibleObjects(((Component)this).gameObject); if (((NetworkBehaviour)this).IsServer) { DisableTerminalAccessibleObjectsClientRpc(); } ((MonoBehaviour)this).StartCoroutine(UpdateTransform(11f, new Vector3(0f, (float)Random.Range(0, 360), 0f))); IEnumerator UpdateTransform(float time, Vector3 rotation) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(time); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { syncRotationServerRpc(rotation); } } } private void DisableTurretFromTerminal(PlayerControllerB playerWhoTriggered) { Turret component = ((Component)this).GetComponent(); if (component != null) { component.ToggleTurretEnabled(false); } } private void EnableTurretFromTerminal(PlayerControllerB playerWhoTriggered) { Turret component = ((Component)this).GetComponent(); if (component != null) { component.ToggleTurretEnabled(true); } } [Rpc(/*Could not decode attribute arguments.*/)] private void DisableTerminalAccessibleObjectsClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4284806721u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4284806721u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DisableTerminalAccessibleObjects(((Component)this).gameObject); } } } public override void OnDestroy() { DisableTerminalAccessibleObjects(((Component)this).gameObject); ((GrabbableObject)this).OnDestroy(); } [Rpc(/*Could not decode attribute arguments.*/)] private void syncRotationServerRpc(Vector3 eulerAngle) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3881441083u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref eulerAngle); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3881441083u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncRotationClientRpc(eulerAngle); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void syncRotationClientRpc(Vector3 eulerAngle) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2773635139u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref eulerAngle); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2773635139u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Transform obj = turretTransform; obj.eulerAngles += eulerAngle; } } } protected override void __initializeVariables() { ((GrabbableObject)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 ((NetworkBehaviour)this).__registerRpc(4284806721u, new RpcReceiveHandler(__rpc_handler_4284806721), "DisableTerminalAccessibleObjectsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3881441083u, new RpcReceiveHandler(__rpc_handler_3881441083), "syncRotationServerRpc"); ((NetworkBehaviour)this).__registerRpc(2773635139u, new RpcReceiveHandler(__rpc_handler_2773635139), "syncRotationClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_4284806721(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; ((GrabbableTurret)(object)target).DisableTerminalAccessibleObjectsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3881441083(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 eulerAngle = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref eulerAngle); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableTurret)(object)target).syncRotationServerRpc(eulerAngle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2773635139(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 eulerAngle = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref eulerAngle); target.__rpc_exec_stage = (__RpcExecStage)1; ((GrabbableTurret)(object)target).syncRotationClientRpc(eulerAngle); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GrabbableTurret"; } } internal class KamikazieBugAI : EnemyAI { public AISearchRoutine searchForItems = null; public AISearchRoutine searchForPlayer = null; [Header("Tracking/Memory")] [Space(3f)] public Vector3 nestPosition; private bool choseNestPosition; [Space(3f)] public static List HoarderBugItems = new List(); public static List grabbableObjectsInMap = new List(); public float angryTimer; public GrabbableObject targetItem = null; private GameObject targetDestinationObject = null; private Vector3 targetDestinationPosition; public HoarderBugItem heldItem = null; [Header("Animations")] [Space(5f)] private Vector3 agentLocalVelocity; private Vector3 previousPosition; private float velX; private float velZ; public Transform turnCompass = null; private float armsHoldLayerWeight; [Space(5f)] public Transform animationContainer = null; public Transform grabTarget = null; public MultiAimConstraint headLookRig = null; public Transform headLookTarget = null; [Header("Special behaviour states")] private float annoyanceMeter; public bool watchingPlayerNearPosition; public PlayerControllerB watchingPlayer = null; public Transform lookTarget = null; public bool lookingAtPositionOfInterest; private Vector3 positionOfInterest; private bool isAngry; [Header("Misc logic")] private bool sendingGrabOrDropRPC; private float waitingAtNestTimer; private bool waitingAtNest; private float timeSinceSeeingAPlayer; [Header("Chase logic")] private bool lostPlayerInChase; public PlayerControllerB angryAtPlayer = null; private bool inChase; [Header("Audios")] public AudioClip[] chitterSFX = null; [Header("Audios")] public AudioClip[] angryScreechSFX = null; public AudioClip angryVoiceSFX = null; public AudioClip bugFlySFX = null; public AudioClip hitPlayerSFX = null; private float timeSinceHittingPlayer; private float timeSinceLookingTowardsNoise; private float detectPlayersInterval; private bool inReturnToNestMode; public AudioSource tickingAudio = null; public Light bugLight = null; public Transform mainTransform = null; private bool onBlowUpSequence; private readonly List blowupCoroutines = new List(); public override void Start() { ((EnemyAI)this).Start(); heldItem = null; grabbableObjectsInMap.Clear(); GrabbableObject[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { if (array[i].grabbableToEnemies && !array[i].deactivated) { grabbableObjectsInMap.Add(((Component)array[i]).gameObject); } } if (Compatibility.yippeeModCompatibilityMode && Compatibility.yippeeNewSFX != null) { chitterSFX = Compatibility.yippeeNewSFX; } } private bool GrabTargetItemIfClose() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetItem != (Object)null && heldItem == null && Vector3.SqrMagnitude(((Component)this).transform.position - ((Component)targetItem).transform.position) < 0.5625f) { if (!((EnemyAI)this).SetDestinationToPosition(nestPosition, true)) { nestPosition = ((EnemyAI)this).ChooseClosestNodeToPosition(((Component)this).transform.position, false, 0).position; ((EnemyAI)this).SetDestinationToPosition(nestPosition, false); } NetworkObject component = ((Component)targetItem).GetComponent(); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); GrabItem(component); sendingGrabOrDropRPC = true; GrabItemServerRpc(NetworkObjectReference.op_Implicit(component)); return true; } return false; } private void ChooseNestPosition() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) HoarderBugAI[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)(object)this && !((EnemyAI)this).PathIsIntersectedByLineOfSight(array[i].nestPosition, false, false, false)) { nestPosition = array[i].nestPosition; SyncNestPositionServerRpc(nestPosition); return; } } nestPosition = ((EnemyAI)this).ChooseClosestNodeToPosition(((Component)this).transform.position, false, 0).position; SyncNestPositionServerRpc(nestPosition); } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncNestPositionServerRpc(Vector3 newNestPosition) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3108316121u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref newNestPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3108316121u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncNestPositionClientRpc(newNestPosition); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncNestPositionClientRpc(Vector3 newNestPosition) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1265518284u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref newNestPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1265518284u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; nestPosition = newNestPosition; } } } public override void DoAIInterval() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { StopActiveSearches(); return; } if (!choseNestPosition) { choseNestPosition = true; ChooseNestPosition(); return; } Transform val = base.eye ?? ((Component)this).transform; Vector3 val2 = nestPosition - val.position; if (((Vector3)(ref val2)).sqrMagnitude < 1600f && !Physics.Linecast(val.position, nestPosition, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && (Vector3.Angle(val.forward, val2) < 60f || Vector3.SqrMagnitude(((Component)this).transform.position - nestPosition) < 0.25f)) { for (int i = 0; i < HoarderBugItems.Count; i++) { if (HoarderBugItems[i].itemGrabbableObject.isHeld && HoarderBugItems[i].itemNestPosition == nestPosition) { HoarderBugItems[i].status = (HoarderBugItemStatus)1; } } } HoarderBugItem val3 = CheckLineOfSightForItem((HoarderBugItemStatus)1, 60f, 30, 3f); if (val3 != null && !val3.itemGrabbableObject.isHeld) { val3.status = (HoarderBugItemStatus)2; if (!val3.itemGrabbableObject.deactivated && !grabbableObjectsInMap.Contains(((Component)val3.itemGrabbableObject).gameObject)) { grabbableObjectsInMap.Add(((Component)val3.itemGrabbableObject).gameObject); } } switch (base.currentBehaviourStateIndex) { case 0: { inReturnToNestMode = false; ExitChaseMode(); if (GrabTargetItemIfClose()) { break; } if ((Object)(object)targetItem == (Object)null && !searchForItems.inProgress) { ((EnemyAI)this).StartSearch(nestPosition, searchForItems); break; } if ((Object)(object)targetItem != (Object)null) { SetGoTowardsTargetObject(((Component)targetItem).gameObject); break; } GameObject val5 = ((EnemyAI)this).CheckLineOfSight(grabbableObjectsInMap, 60f, 40, 5f, (Transform)null, (int[])null); if (Object.op_Implicit((Object)(object)val5)) { GrabbableObject component = val5.GetComponent(); if (Object.op_Implicit((Object)(object)component) && !component.deactivated && (!component.isHeld || (Random.Range(0, 100) < 4 && !component.isPocketed))) { SetGoTowardsTargetObject(val5); } } break; } case 1: ExitChaseMode(); if (!inReturnToNestMode) { inReturnToNestMode = true; if (((EnemyAI)this).SetDestinationToPosition(nestPosition, true)) { targetItem = null; ((EnemyAI)this).StopSearch(searchForItems, false); } else { ChooseNestPosition(); } } GrabTargetItemIfClose(); if (waitingAtNest) { if (heldItem != null) { DropItemAndCallDropRPC(((Component)heldItem.itemGrabbableObject).GetComponent()); } else { GameObject val4 = ((EnemyAI)this).CheckLineOfSight(grabbableObjectsInMap, 60f, 40, 5f, (Transform)null, (int[])null); if ((Object)(object)base.eye == (Object)null) { break; } if (Object.op_Implicit((Object)(object)val4) && Vector3.SqrMagnitude(base.eye.position - val4.transform.position) < 36f) { targetItem = val4.GetComponent(); if ((Object)(object)targetItem != (Object)null && !targetItem.isHeld && !targetItem.deactivated) { waitingAtNest = false; ((EnemyAI)this).SwitchToBehaviourState(0); break; } } } if (waitingAtNestTimer <= 0f && !watchingPlayerNearPosition) { waitingAtNest = false; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); } } else if (Vector3.SqrMagnitude(((Component)this).transform.position - nestPosition) < 0.5625f) { waitingAtNest = true; waitingAtNestTimer = 15f; } break; case 2: inReturnToNestMode = false; if (heldItem != null) { DropItemAndCallDropRPC(((Component)heldItem.itemGrabbableObject).GetComponent(), droppedInNest: false); } if (lostPlayerInChase) { if (!searchForPlayer.inProgress) { searchForPlayer.searchWidth = 30f; ((EnemyAI)this).StartSearch(((Component)base.targetPlayer).transform.position, searchForPlayer); } break; } if ((Object)(object)base.targetPlayer == (Object)null && (Object)(object)watchingPlayer != (Object)null) { base.targetPlayer = watchingPlayer; } if (searchForPlayer.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayer, true); } base.movingTowardsTargetPlayer = true; break; case 3: break; } } private void SetGoTowardsTargetObject(GameObject foundObject) { //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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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) if ((Object)(object)foundObject == (Object)null) { targetItem = null; targetDestinationObject = null; return; } GrabbableObject component = foundObject.GetComponent(); if (!grabbableObjectsInMap.Contains(foundObject) || !Object.op_Implicit((Object)(object)component) || component.deactivated) { targetItem = null; targetDestinationObject = null; return; } Vector3 position = foundObject.transform.position; if (!((Object)(object)targetItem == (Object)(object)component) || !((Object)(object)targetDestinationObject == (Object)(object)foundObject) || !(Vector3.SqrMagnitude(targetDestinationPosition - position) < 0.25f)) { if (((EnemyAI)this).SetDestinationToPosition(position, true)) { targetDestinationObject = foundObject; targetDestinationPosition = position; targetItem = component; ((EnemyAI)this).StopSearch(searchForItems, false); } else { targetItem = null; targetDestinationObject = null; } } } private void ExitChaseMode() { if (inChase) { inChase = false; if (searchForPlayer.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayer, true); } base.movingTowardsTargetPlayer = false; base.creatureAnimator.SetBool("Chase", false); base.creatureSFX.Stop(); } } private void LateUpdate() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0517: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_070b: 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_071a: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_0644: 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_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029d: 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) if (base.inSpecialAnimation || base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (detectPlayersInterval <= 0f) { detectPlayersInterval = 0.2f; Vector3 val = ((base.currentBehaviourStateIndex != 1) ? ((Component)this).transform.position : nestPosition); PlayerControllerB[] allPlayersInLineOfSight = ((EnemyAI)this).GetAllPlayersInLineOfSight(70f, 30, base.eye, 1.2f, -1); if (allPlayersInLineOfSight != null) { PlayerControllerB val2 = watchingPlayer; timeSinceSeeingAPlayer = 0f; float num = 250000f; bool flag = false; if ((Object)(object)base.stunnedByPlayer != (Object)null) { flag = true; angryAtPlayer = base.stunnedByPlayer; } for (int i = 0; i < allPlayersInLineOfSight.Length; i++) { if (!flag && (Object)(object)allPlayersInLineOfSight[i].currentlyHeldObjectServer != (Object)null) { for (int j = 0; j < HoarderBugItems.Count; j++) { if ((Object)(object)HoarderBugItems[j].itemGrabbableObject == (Object)(object)allPlayersInLineOfSight[i].currentlyHeldObjectServer) { HoarderBugItems[j].status = (HoarderBugItemStatus)1; angryAtPlayer = allPlayersInLineOfSight[i]; flag = true; } } } if (IsHoarderBugAngry() && (Object)(object)allPlayersInLineOfSight[i] == (Object)(object)angryAtPlayer) { watchingPlayer = angryAtPlayer; } else { float num2 = Vector3.SqrMagnitude(((Component)allPlayersInLineOfSight[i]).transform.position - val); if (num2 < num) { num = num2; watchingPlayer = allPlayersInLineOfSight[i]; } } float num3 = Vector3.SqrMagnitude(((Component)allPlayersInLineOfSight[i]).transform.position - nestPosition); if (HoarderBugItems.Count > 0) { if ((num3 < 16f || (inChase && num3 < 64f)) && angryTimer < 3.25f) { angryAtPlayer = allPlayersInLineOfSight[i]; watchingPlayer = allPlayersInLineOfSight[i]; angryTimer = 3.25f; break; } if (!isAngry && base.currentBehaviourStateIndex == 0 && num3 < 64f && ((Object)(object)targetItem == (Object)null || Vector3.SqrMagnitude(((Component)targetItem).transform.position - ((Component)this).transform.position) > 56.25f) && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).SwitchToBehaviourState(1); } } if (base.currentBehaviourStateIndex != 2 && Vector3.SqrMagnitude(((Component)this).transform.position - ((Component)allPlayersInLineOfSight[i]).transform.position) < 6.25f) { annoyanceMeter += 0.2f; if (annoyanceMeter > 2.5f) { angryAtPlayer = allPlayersInLineOfSight[i]; watchingPlayer = allPlayersInLineOfSight[i]; angryTimer = 3.25f; } } } watchingPlayerNearPosition = num < 36f; if ((Object)(object)watchingPlayer != (Object)(object)val2) { RoundManager.PlayRandomClip(base.creatureVoice, chitterSFX, true, 1f, 0, 1000); } if (((NetworkBehaviour)this).IsOwner) { if (base.currentBehaviourStateIndex != 2) { if (IsHoarderBugAngry()) { lostPlayerInChase = false; base.targetPlayer = watchingPlayer; ((EnemyAI)this).SwitchToBehaviourState(2); } } else { base.targetPlayer = watchingPlayer; if (lostPlayerInChase) { lostPlayerInChase = false; } } } } else { timeSinceSeeingAPlayer += 0.2f; watchingPlayerNearPosition = false; if (base.currentBehaviourStateIndex != 2) { if (timeSinceSeeingAPlayer > 1.5f) { watchingPlayer = null; } } else { if (timeSinceSeeingAPlayer > 1.25f) { watchingPlayer = null; } if (((NetworkBehaviour)this).IsOwner && !(timeSinceSeeingAPlayer > 15f) && timeSinceSeeingAPlayer > 2.5f) { lostPlayerInChase = true; } bool flag2 = false; } } } else { detectPlayersInterval -= Time.deltaTime; } bool flag3 = true; if ((Object)(object)watchingPlayer != (Object)null) { lookTarget.position = ((Component)watchingPlayer.gameplayCamera).transform.position; } else if (!lookingAtPositionOfInterest) { base.agent.angularSpeed = 220f; ((RigConstraint>)(object)headLookRig).weight = Mathf.Lerp(((RigConstraint>)(object)headLookRig).weight, 0f, 10f); flag3 = false; } else { lookTarget.position = positionOfInterest; } if (flag3) { if (((NetworkBehaviour)this).IsOwner) { base.agent.angularSpeed = 0f; turnCompass.LookAt(lookTarget); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, turnCompass.rotation, 6f * Time.deltaTime); ((Component)this).transform.localEulerAngles = new Vector3(0f, ((Component)this).transform.localEulerAngles.y, 0f); } float num4 = Vector3.Angle(((Component)this).transform.forward, lookTarget.position - ((Component)this).transform.position); if (num4 > 22f) { ((RigConstraint>)(object)headLookRig).weight = Mathf.Lerp(((RigConstraint>)(object)headLookRig).weight, 1f * (Mathf.Abs(num4 - 180f) / 180f), 7f); } else { ((RigConstraint>)(object)headLookRig).weight = Mathf.Lerp(((RigConstraint>)(object)headLookRig).weight, 1f, 7f); } headLookTarget.position = Vector3.Lerp(headLookTarget.position, lookTarget.position, 8f * Time.deltaTime); } agentLocalVelocity = animationContainer.InverseTransformDirection(Vector3.ClampMagnitude(((Component)this).transform.position - previousPosition, 1f) / (Time.deltaTime * 2f)); velX = Mathf.Lerp(velX, agentLocalVelocity.x, 10f * Time.deltaTime); base.creatureAnimator.SetFloat("VelocityX", Mathf.Clamp(velX, -1f, 1f)); velZ = Mathf.Lerp(velZ, agentLocalVelocity.z, 10f * Time.deltaTime); base.creatureAnimator.SetFloat("VelocityZ", Mathf.Clamp(velZ, -1f, 1f)); previousPosition = ((Component)this).transform.position; if (heldItem != null) { armsHoldLayerWeight = Mathf.Lerp(armsHoldLayerWeight, 0.85f, 8f * Time.deltaTime); } else { armsHoldLayerWeight = Mathf.Lerp(armsHoldLayerWeight, 0f, 8f * Time.deltaTime); } base.creatureAnimator.SetLayerWeight(1, armsHoldLayerWeight); } private bool IsHoarderBugAngry() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Invalid comparison between Unknown and I4 if (base.stunNormalizedTimer > 0f) { angryTimer = 4f; if (Object.op_Implicit((Object)(object)base.stunnedByPlayer)) { angryAtPlayer = base.stunnedByPlayer; } return true; } int num = 0; int num2 = 0; for (int i = 0; i < HoarderBugItems.Count; i++) { if ((int)HoarderBugItems[i].status == 1) { num2++; } else if ((int)HoarderBugItems[i].status == 2) { num++; } } if (!(angryTimer > 0f)) { return num2 > 0; } return true; } public override void Update() { //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); timeSinceHittingPlayer += Time.deltaTime; timeSinceLookingTowardsNoise += Time.deltaTime; if (timeSinceLookingTowardsNoise > 0.6f) { lookingAtPositionOfInterest = false; } if (base.inSpecialAnimation || base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (angryTimer >= 0f) { angryTimer -= Time.deltaTime; } base.creatureAnimator.SetBool("stunned", base.stunNormalizedTimer > 0f); bool flag = IsHoarderBugAngry(); if (!isAngry && flag) { isAngry = true; base.creatureVoice.clip = angryVoiceSFX; base.creatureVoice.Play(); } else if (isAngry && !flag) { isAngry = false; angryAtPlayer = null; base.creatureVoice.Stop(); } switch (base.currentBehaviourStateIndex) { case 0: ExitChaseMode(); base.addPlayerVelocityToDestination = 0f; if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } else { base.agent.speed = 6f; } waitingAtNest = false; break; case 1: ExitChaseMode(); base.addPlayerVelocityToDestination = 0f; if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } else { base.agent.speed = 6f; } base.agent.acceleration = 30f; if (waitingAtNest && waitingAtNestTimer > 0f) { waitingAtNestTimer -= Time.deltaTime; } break; case 2: if (!inChase) { inChase = true; base.creatureSFX.clip = bugFlySFX; base.creatureSFX.Play(); RoundManager.PlayRandomClip(base.creatureVoice, angryScreechSFX, true, 1f, 0, 1000); base.creatureAnimator.SetBool("Chase", true); waitingAtNest = false; if (((NetworkBehaviour)this).IsOwner) { doBlowupServerRpc(); } if (Vector3.SqrMagnitude(((Component)this).transform.position - ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 100f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.5f, true); } } base.addPlayerVelocityToDestination = 2f; if (!((NetworkBehaviour)this).IsOwner) { break; } if (!IsHoarderBugAngry()) { HoarderBugItem val = CheckLineOfSightForItem((HoarderBugItemStatus)2, 60f, 12, 3f); if (val != null && !val.itemGrabbableObject.isHeld) { SetGoTowardsTargetObject(((Component)val.itemGrabbableObject).gameObject); } break; } if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } else { base.agent.speed = 18f; } base.agent.acceleration = 16f; if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 0.75f, 60f, 15, -1f, -1)) { GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.4f, 1f); } break; } } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c6: 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_0090: 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_00a0: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); if (timesPlayedInOneSpot <= 10 && !(timeSinceLookingTowardsNoise < 0.6f)) { timeSinceLookingTowardsNoise = 0f; float num = Vector3.SqrMagnitude(noisePosition - nestPosition); if (((NetworkBehaviour)this).IsOwner && HoarderBugItems.Count > 0 && !isAngry && base.currentBehaviourStateIndex == 0 && num < 225f && ((Object)(object)targetItem == (Object)null || Vector3.SqrMagnitude(((Component)targetItem).transform.position - ((Component)this).transform.position) > 20.25f)) { ((EnemyAI)this).SwitchToBehaviourState(1); } positionOfInterest = noisePosition; lookingAtPositionOfInterest = true; } } private void DropItemAndCallDropRPC(NetworkObject dropItemNetworkObject, bool droppedInNest = true) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Vector3 targetFloorPosition = RoundManager.Instance.RandomlyOffsetPosition(heldItem.itemGrabbableObject.GetItemFloorPosition(default(Vector3)), 1.2f, 0.4f); DropItem(dropItemNetworkObject, targetFloorPosition); sendingGrabOrDropRPC = true; DropItemServerRpc(NetworkObjectReference.op_Implicit(dropItemNetworkObject), targetFloorPosition, droppedInNest); } [Rpc(/*Could not decode attribute arguments.*/)] public void DropItemServerRpc(NetworkObjectReference objectRef, Vector3 targetFloorPosition, bool droppedInNest) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1137852752u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetFloorPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref droppedInNest, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1137852752u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropItemClientRpc(objectRef, targetFloorPosition, droppedInNest); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DropItemClientRpc(NetworkObjectReference objectRef, Vector3 targetFloorPosition, bool droppedInNest) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(589164110u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref targetFloorPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref droppedInNest, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 589164110u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject item = default(NetworkObject); if (!((NetworkObjectReference)(ref objectRef)).TryGet(ref item, (NetworkManager)null)) { return; } try { DropItem(item, targetFloorPosition, droppedInNest); } catch { } } [Rpc(/*Could not decode attribute arguments.*/)] public void GrabItemServerRpc(NetworkObjectReference objectRef) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0092: 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_00c7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3677165395u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3677165395u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabItemClientRpc(objectRef); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void GrabItemClientRpc(NetworkObjectReference objectRef) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1025828854u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1025828854u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1); NetworkObject item = default(NetworkObject); if (((NetworkObjectReference)(ref objectRef)).TryGet(ref item, (NetworkManager)null)) { GrabItem(item); } } } private void DropItem(NetworkObject item, Vector3 targetFloorPosition, bool droppingInNest = true) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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) if (sendingGrabOrDropRPC) { sendingGrabOrDropRPC = false; } else if (heldItem != null) { GrabbableObject itemGrabbableObject = heldItem.itemGrabbableObject; itemGrabbableObject.parentObject = null; ((Component)itemGrabbableObject).transform.SetParent(StartOfRound.Instance.propsContainer, true); itemGrabbableObject.EnablePhysics(true); itemGrabbableObject.fallTime = 0f; itemGrabbableObject.startFallingPosition = ((Component)itemGrabbableObject).transform.parent.InverseTransformPoint(((Component)itemGrabbableObject).transform.position); itemGrabbableObject.targetFloorPosition = ((Component)itemGrabbableObject).transform.parent.InverseTransformPoint(targetFloorPosition); itemGrabbableObject.floorYRot = -1; itemGrabbableObject.DiscardItemFromEnemy(); heldItem = null; if (!droppingInNest && !grabbableObjectsInMap.Contains(((Component)itemGrabbableObject).gameObject)) { grabbableObjectsInMap.Add(((Component)itemGrabbableObject).gameObject); } } } private void GrabItem(NetworkObject item) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0044: 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_004b: Unknown result type (might be due to invalid IL or missing references) if (sendingGrabOrDropRPC) { sendingGrabOrDropRPC = false; return; } if (heldItem != null) { DropItem(((Component)heldItem.itemGrabbableObject).GetComponent(), heldItem.itemGrabbableObject.GetItemFloorPosition(default(Vector3))); } targetItem = null; targetDestinationObject = null; GrabbableObject component = ((Component)item).gameObject.GetComponent(); HoarderBugItems.Add(new HoarderBugItem(component, (HoarderBugItemStatus)0, nestPosition)); heldItem = HoarderBugItems[HoarderBugItems.Count - 1]; component.parentObject = grabTarget; component.hasHitGround = false; component.GrabItemFromEnemy((EnemyAI)(object)this); component.EnablePhysics(false); grabbableObjectsInMap.Remove(((Component)component).gameObject); } public override void OnCollideWithPlayer(Collider other) { //IL_0059: 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) ((EnemyAI)this).OnCollideWithPlayer(other); if (inChase && !(timeSinceHittingPlayer < 0.5f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)val != (Object)null) { timeSinceHittingPlayer = 0f; val.DamagePlayer(30, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); HitPlayerServerRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void HitPlayerServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4268145293u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4268145293u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitPlayerClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void HitPlayerClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3201014421u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3201014421u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.isEnemyDead) { base.creatureAnimator.SetTrigger("HitPlayer"); base.creatureSFX.PlayOneShot(hitPlayerSFX); WalkieTalkie.TransmitOneShotAudio(base.creatureSFX, hitPlayerSFX, 1f); } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!base.isEnemyDead) { base.creatureAnimator.SetTrigger("damage"); if ((Object)(object)playerWhoHit != (Object)null) { angryAtPlayer = playerWhoHit; } angryTimer += 18f; base.enemyHP -= force; if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } public override void KillEnemy(bool destroy = false) { StopActiveSearches(); ((EnemyAI)this).KillEnemy(false); DisableBlowupServerRpc(); base.agent.speed = 0f; base.creatureVoice.Stop(); base.creatureSFX.Stop(); } private void StopActiveSearches() { if (searchForItems.inProgress) { ((EnemyAI)this).StopSearch(searchForItems, true); } if (searchForPlayer.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayer, true); } } public HoarderBugItem? CheckLineOfSightForItem(HoarderBugItemStatus searchForItemsOfStatus = (HoarderBugItemStatus)(-1), float width = 45f, int range = 60, float proximityAwareness = -1f) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < HoarderBugItems.Count; i++) { if (HoarderBugItems[i] == null || (Object)(object)HoarderBugItems[i].itemGrabbableObject == (Object)null) { HoarderBugItems.RemoveAt(i); i--; continue; } GrabbableObject itemGrabbableObject = HoarderBugItems[i].itemGrabbableObject; if (!itemGrabbableObject.grabbableToEnemies || itemGrabbableObject.deactivated || itemGrabbableObject.isHeld || ((int)searchForItemsOfStatus != -1 && HoarderBugItems[i].status != searchForItemsOfStatus)) { continue; } Vector3 position = ((Component)itemGrabbableObject).transform.position; if (!Physics.Linecast(base.eye.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { Vector3 val = position - base.eye.position; if (Vector3.Angle(base.eye.forward, val) < width || (proximityAwareness != -1f && Vector3.SqrMagnitude(((Component)this).transform.position - position) < proximityAwareness * proximityAwareness)) { return HoarderBugItems[i]; } } } return null; } [Rpc(/*Could not decode attribute arguments.*/)] public void doBlowupServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3967474852u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3967474852u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)RoundManager.Instance).IsHost) { doBlowupClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void doBlowupClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1792094030u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1792094030u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!onBlowUpSequence) { onBlowUpSequence = true; tickingAudio.Play(); StartBlowupCoroutine(FlicketLights(0.2f, 0.15f)); StartBlowupCoroutine(FlicketLights(1.2f, 0.15f)); StartBlowupCoroutine(FlicketLights(2.2f, 0.15f)); StartBlowupCoroutine(FlicketLights(3.2f, 0.15f)); StartBlowupCoroutine(FlicketLights(4.2f, 0.15f)); StartBlowupCoroutine(FlicketLights(4.36f, 0.5f)); StartBlowupCoroutine(FlicketLights(4.46f, 0.5f)); StartBlowupCoroutine(FlicketLights(4.59f, 0.5f)); StartBlowupCoroutine(FlicketLights(4.71f, 0.5f)); StartBlowupCoroutine(FlicketLights(4.84f, 0.5f)); StartBlowupCoroutine(FlicketLights(4.96f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.09f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.21f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.34f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.45f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.56f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.7f, 0.5f)); StartBlowupCoroutine(FlicketLights(5.81f, 0.5f)); StartBlowupCoroutine(BlowUpAt(6f)); } } IEnumerator BlowUpAt(float timeStamp) { yield return (object)new WaitForSeconds(timeStamp); ((Component)bugLight).gameObject.SetActive(false); if (!base.isEnemyDead) { Landmine.SpawnExplosion(mainTransform.position + Vector3.up, true, 3f, 6f, 50, 0f, (GameObject)null, false); } } } private void StartBlowupCoroutine(IEnumerator routine) { blowupCoroutines.Add(((MonoBehaviour)this).StartCoroutine(routine)); } public IEnumerator FlicketLights(float timeStamp, float flickerLightTime) { yield return (object)new WaitForSeconds(timeStamp); ((Component)bugLight).gameObject.SetActive(true); yield return (object)new WaitForSeconds(flickerLightTime); ((Component)bugLight).gameObject.SetActive(false); } [Rpc(/*Could not decode attribute arguments.*/)] public void DisableBlowupServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4115349172u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4115349172u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DisableBlowupClientRpc(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DisableBlowupClientRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3999830196u, val3, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3999830196u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Component)bugLight).gameObject.SetActive(false); tickingAudio.Stop(); for (int i = 0; i < blowupCoroutines.Count; i++) { if (blowupCoroutines[i] != null) { ((MonoBehaviour)this).StopCoroutine(blowupCoroutines[i]); } } blowupCoroutines.Clear(); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3108316121u, new RpcReceiveHandler(__rpc_handler_3108316121), "SyncNestPositionServerRpc"); ((NetworkBehaviour)this).__registerRpc(1265518284u, new RpcReceiveHandler(__rpc_handler_1265518284), "SyncNestPositionClientRpc"); ((NetworkBehaviour)this).__registerRpc(1137852752u, new RpcReceiveHandler(__rpc_handler_1137852752), "DropItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(589164110u, new RpcReceiveHandler(__rpc_handler_589164110), "DropItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(3677165395u, new RpcReceiveHandler(__rpc_handler_3677165395), "GrabItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(1025828854u, new RpcReceiveHandler(__rpc_handler_1025828854), "GrabItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(4268145293u, new RpcReceiveHandler(__rpc_handler_4268145293), "HitPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3201014421u, new RpcReceiveHandler(__rpc_handler_3201014421), "HitPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3967474852u, new RpcReceiveHandler(__rpc_handler_3967474852), "doBlowupServerRpc"); ((NetworkBehaviour)this).__registerRpc(1792094030u, new RpcReceiveHandler(__rpc_handler_1792094030), "doBlowupClientRpc"); ((NetworkBehaviour)this).__registerRpc(4115349172u, new RpcReceiveHandler(__rpc_handler_4115349172), "DisableBlowupServerRpc"); ((NetworkBehaviour)this).__registerRpc(3999830196u, new RpcReceiveHandler(__rpc_handler_3999830196), "DisableBlowupClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3108316121(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 newNestPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newNestPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).SyncNestPositionServerRpc(newNestPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1265518284(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 newNestPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newNestPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).SyncNestPositionClientRpc(newNestPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1137852752(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference objectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectRef, default(ForNetworkSerializable)); Vector3 targetFloorPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetFloorPosition); bool droppedInNest = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref droppedInNest, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).DropItemServerRpc(objectRef, targetFloorPosition, droppedInNest); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_589164110(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference objectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectRef, default(ForNetworkSerializable)); Vector3 targetFloorPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetFloorPosition); bool droppedInNest = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref droppedInNest, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).DropItemClientRpc(objectRef, targetFloorPosition, droppedInNest); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3677165395(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 objectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).GrabItemServerRpc(objectRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1025828854(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 objectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref objectRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).GrabItemClientRpc(objectRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4268145293(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; ((KamikazieBugAI)(object)target).HitPlayerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3201014421(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; ((KamikazieBugAI)(object)target).HitPlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3967474852(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; ((KamikazieBugAI)(object)target).doBlowupServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1792094030(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; ((KamikazieBugAI)(object)target).doBlowupClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4115349172(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; ((KamikazieBugAI)(object)target).DisableBlowupServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3999830196(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; ((KamikazieBugAI)(object)target).DisableBlowupClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "KamikazieBugAI"; } } public class NutSlayerAI : EnemyAI { public int previousBehaviourState = -1; public int previousBehaviourStateAIInterval = -1; public float localPlayerTurnDistance; public GameObject gunPrefab = null; public SlayerShotgun gun = null; public Transform gunPoint = null; public NetworkObjectReference gunObjectRef; public AISearchRoutine patrol = null; public AISearchRoutine attackSearch = null; public Transform torsoContainer = null; public float currentTorsoRotation; public int targetTorsoDegrees; public float torsoTurnSpeed = 6f; public AudioSource torsoTurnAudio = null; public AudioSource longRangeAudio = null; public AudioClip[] torsoFinishTurningClips = null; public AudioClip aimSFX = null; public AudioClip kickSFX = null; public bool torsoTurning; public int lastPlayerSeenMoving = -1; public float timeSinceSeeingTarget; public float timeSinceFiringGun; public bool aimingGun; public Vector3 lastSeenPlayerPos; public RaycastHit rayHit; public Coroutine gunCoroutine = null; public Vector3 positionLastCheck; public Vector3 strafePosition; public bool reachedStrafePosition; public bool lostPlayerInChase; public float timeSinceHittingPlayer; public float walkCheckInterval; public int setShotgunScrapValue; public int timesSeeingSamePlayer; public int previousPlayerSeenWhenAiming; public float speedWhileAiming; public float speedWhileMoving = 9.5f; public float widthSearch = 45f; public int rangeSearch = 30; public Transform target = null; public bool isFiring = false; public int setHp = 5; public int Lives = 4; public bool Immortal = false; public bool onlyPlayers = false; public override void Start() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); lastPlayerSeenMoving = -1; if (((NetworkBehaviour)this).IsServer) { InitializeNutcrackerValuesServerRpc(); } rayHit = default(RaycastHit); setHp = Configuration.nutSlayerHp.Value; Lives = Configuration.nutSlayerLives.Value; speedWhileMoving = Configuration.nutSlayerMovementSpeed.Value; Immortal = Configuration.nutSlayerImmortal.Value; onlyPlayers = Configuration.onlyPlayersAttackSlayer.Value; base.enemyType.canDie = !Immortal; base.enemyHP = setHp; } [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeNutcrackerValuesServerRpc() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1891166366u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1891166366u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val4 = Object.Instantiate(gunPrefab, ((Component)this).transform.position + Vector3.up * 0.5f, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); val4.GetComponent().Spawn(false); setShotgunScrapValue = Random.Range(Configuration.slayerShotgunMinValue.Value, Configuration.slayerShotgunMaxValue.Value + 1); GrabGun(val4); InitializeNutcrackerValuesClientRpc(NetworkObjectReference.op_Implicit(val4.GetComponent()), setShotgunScrapValue); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeNutcrackerValuesClientRpc(NetworkObjectReference gunObject, int setShotgunValue) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2126988366u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gunObject, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, setShotgunValue); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2126988366u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; setShotgunScrapValue = setShotgunValue; gunObjectRef = gunObject; } } } private void GrabGun(GameObject gunObject) { gun = gunObject.GetComponent(); if ((Object)(object)gun == (Object)null) { ((EnemyAI)this).LogEnemyError("Gun in GrabGun function did not contain ShotgunItem component."); return; } ((GrabbableObject)gun).SetScrapValue(setShotgunScrapValue); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)((GrabbableObject)gun).scrapValue; ((GrabbableObject)gun).parentObject = gunPoint; ((GrabbableObject)gun).isHeldByEnemy = true; ((GrabbableObject)gun).grabbableToEnemies = false; ((GrabbableObject)gun).grabbable = false; ((GrabbableObject)gun).GrabItemFromEnemy((EnemyAI)(object)this); } [Rpc(/*Could not decode attribute arguments.*/)] public void DropGunServerRpc(Vector3 dropPosition) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(414091688u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dropPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 414091688u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropGunClientRpc(dropPosition); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DropGunClientRpc(Vector3 dropPosition) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1357508234u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref dropPosition); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1357508234u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)gun == (Object)null) { ((EnemyAI)this).LogEnemyError("Could not drop gun since no gun was held!"); return; } ((GrabbableObject)gun).DiscardItemFromEnemy(); ((GrabbableObject)gun).isHeldByEnemy = false; ((GrabbableObject)gun).grabbableToEnemies = true; ((GrabbableObject)gun).grabbable = true; } } public override void DoAIInterval() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0353: 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_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || base.stunNormalizedTimer > 0f || (Object)(object)gun == (Object)null) { if (base.isEnemyDead) { StopActiveSearches(); } return; } switch (base.currentBehaviourStateIndex) { case 0: if (previousBehaviourStateAIInterval != base.currentBehaviourStateIndex) { previousBehaviourStateAIInterval = base.currentBehaviourStateIndex; base.agent.stoppingDistance = 0.02f; } if (!patrol.inProgress) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, patrol); } break; case 2: if (previousBehaviourStateAIInterval != base.currentBehaviourStateIndex) { previousBehaviourStateAIInterval = base.currentBehaviourStateIndex; if (patrol.inProgress) { ((EnemyAI)this).StopSearch(patrol, true); } } if (timeSinceSeeingTarget >= 3f) { ((EnemyAI)this).SwitchToBehaviourState(0); } if (timeSinceFiringGun >= 10f && !attackSearch.inProgress) { ((EnemyAI)this).SwitchToBehaviourState(0); timeSinceFiringGun = 0f; } if (!((NetworkBehaviour)this).IsOwner) { break; } if (timeSinceSeeingTarget < 0.5f) { if (attackSearch.inProgress) { ((EnemyAI)this).StopSearch(attackSearch, true); } reachedStrafePosition = false; ((EnemyAI)this).SetDestinationToPosition(lastSeenPlayerPos, false); base.agent.stoppingDistance = 1f; if (lostPlayerInChase) { lostPlayerInChase = false; SetLostPlayerInChaseServerRpc(lostPlayer: false); } break; } base.agent.stoppingDistance = 0.02f; if (!reachedStrafePosition) { if (!base.agent.CalculatePath(lastSeenPlayerPos, base.path1)) { break; } if (base.path1.corners.Length > 1) { Ray val = default(Ray); ((Ray)(ref val))..ctor(base.path1.corners[base.path1.corners.Length - 1], base.path1.corners[base.path1.corners.Length - 1] - base.path1.corners[base.path1.corners.Length - 2]); if (Physics.Raycast(val, ref rayHit, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { strafePosition = RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val)).GetPoint(Mathf.Max(0f, ((RaycastHit)(ref rayHit)).distance - 2f)), default(NavMeshHit), 5f, -1); } else { strafePosition = RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val)).GetPoint(6f), default(NavMeshHit), 5f, -1); } } else { strafePosition = lastSeenPlayerPos; } ((EnemyAI)this).SetDestinationToPosition(strafePosition, false); if (Vector3.SqrMagnitude(((Component)this).transform.position - strafePosition) < 4f) { reachedStrafePosition = true; } } else { if (!lostPlayerInChase) { lostPlayerInChase = true; SetLostPlayerInChaseServerRpc(lostPlayer: true); } if (!attackSearch.inProgress) { ((EnemyAI)this).StartSearch(strafePosition, attackSearch); } } break; } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetLostPlayerInChaseServerRpc(bool lostPlayer) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3029536429u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lostPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3029536429u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetLostPlayerInChaseClientRpc(lostPlayer); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetLostPlayerInChaseClientRpc(bool lostPlayer) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1309004243u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lostPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1309004243u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; lostPlayerInChase = lostPlayer; if (!lostPlayer) { timeSinceSeeingTarget = 0f; } } } private void StopActiveSearches() { if (patrol.inProgress) { ((EnemyAI)this).StopSearch(patrol, true); } if (attackSearch.inProgress) { ((EnemyAI)this).StopSearch(attackSearch, true); } } public void TurnTorsoToTargetDegrees() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) currentTorsoRotation = Mathf.MoveTowardsAngle(currentTorsoRotation, (float)targetTorsoDegrees, Time.deltaTime * torsoTurnSpeed); torsoContainer.localEulerAngles = new Vector3(currentTorsoRotation + 90f, 90f, 90f); if (Mathf.Abs(currentTorsoRotation - (float)targetTorsoDegrees) > 5f) { if (!torsoTurning) { torsoTurning = true; torsoTurnAudio.Play(); } } else if (torsoTurning) { torsoTurning = false; torsoTurnAudio.Stop(); RoundManager.PlayRandomClip(torsoTurnAudio, torsoFinishTurningClips, true, 1f, 0, 1000); } torsoTurnAudio.volume = Mathf.Lerp(torsoTurnAudio.volume, 1f, Time.deltaTime * 2f); } private void SetTargetDegreesToPosition(Vector3 pos) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) pos.y = ((Component)this).transform.position.y; Vector3 val = pos - ((Component)this).transform.position; targetTorsoDegrees = (int)Vector3.Angle(val, ((Component)this).transform.forward); if (Vector3.Cross(((Component)this).transform.forward, val).y > 0f) { targetTorsoDegrees = 360 - targetTorsoDegrees; } torsoTurnSpeed = 1500f; } [Rpc(/*Could not decode attribute arguments.*/)] public void SeeMovingThreatServerRpc(Vector3 position, bool enterAttackFromPatrolMode = false, int playerId = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2375979427u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enterAttackFromPatrolMode, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2375979427u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SeeMovingThreatClientRpc(position, enterAttackFromPatrolMode, playerId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SeeMovingThreatClientRpc(Vector3 position, bool enterAttackFromPatrolMode = false, int playerId = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1812034362u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enterAttackFromPatrolMode, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1812034362u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchTargetTo(position, playerId); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } } } public override void Update() { //IL_00b0: 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_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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0684: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_0899: Unknown result type (might be due to invalid IL or missing references) //IL_089e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); TurnTorsoToTargetDegrees(); if (base.isEnemyDead) { return; } NetworkObject val = default(NetworkObject); if ((Object)(object)gun == (Object)null && ((NetworkObjectReference)(ref gunObjectRef)).TryGet(ref val, (NetworkManager)null)) { gun = ((Component)val).gameObject.GetComponent(); GrabGun(((Component)gun).gameObject); } if ((Object)(object)gun == (Object)null) { return; } Vector3 val2; if (walkCheckInterval <= 0f) { walkCheckInterval = 0.1f; Animator creatureAnimator = base.creatureAnimator; val2 = ((Component)this).transform.position - positionLastCheck; creatureAnimator.SetBool("IsWalking", ((Vector3)(ref val2)).sqrMagnitude > 0.001f); positionLastCheck = ((Component)this).transform.position; } else { walkCheckInterval -= Time.deltaTime; } if (base.stunNormalizedTimer >= 0f) { base.agent.speed = 0f; return; } timeSinceSeeingTarget += Time.deltaTime; timeSinceFiringGun += Time.deltaTime; timeSinceHittingPlayer += Time.deltaTime; base.creatureAnimator.SetInteger("State", base.currentBehaviourStateIndex); base.creatureAnimator.SetBool("Aiming", aimingGun); switch (base.currentBehaviourStateIndex) { case 0: if (previousBehaviourState != base.currentBehaviourStateIndex) { previousBehaviourState = base.currentBehaviourStateIndex; lostPlayerInChase = false; base.creatureVoice.Stop(); } base.agent.speed = speedWhileMoving; targetTorsoDegrees = 0; torsoTurnSpeed = 525f; if (CheckLineOfSightForTarget(widthSearch, rangeSearch, 1)) { if ((Object)(object)target == (Object)(object)((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform) { SeeMovingThreatServerRpc(Vector3.zero, enterAttackFromPatrolMode: false, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } else { SeeMovingThreatServerRpc(target.position); } } break; case 2: { if (previousBehaviourState != base.currentBehaviourStateIndex) { if (previousBehaviourState != 1) { longRangeAudio.PlayOneShot(base.enemyType.audioClips[3]); } previousBehaviourState = base.currentBehaviourStateIndex; } if (((NetworkBehaviour)this).IsOwner) { if (aimingGun || (timeSinceFiringGun < 1.2f && timeSinceSeeingTarget < 0.5f) || timeSinceHittingPlayer < 1f) { if (aimingGun) { base.agent.speed = speedWhileAiming; } else { base.agent.speed = 0f; } } else { base.agent.speed = 7f; } } if (lostPlayerInChase) { targetTorsoDegrees = 0; } else { SetTargetDegreesToPosition(lastSeenPlayerPos); } if (lastPlayerSeenMoving != -1) { PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[lastPlayerSeenMoving]; target = ((Component)val3.gameplayCamera).transform; if (((EnemyAI)this).CheckLineOfSightForPosition(target.position, widthSearch, rangeSearch, 1f, (Transform)null)) { timeSinceSeeingTarget = 0f; lastSeenPlayerPos = ((Component)val3).transform.position; } else if (!((EnemyAI)this).CheckLineOfSightForPosition(((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position, 70f, 12, 1f, (Transform)null)) { break; } if (((EnemyAI)this).CheckLineOfSightForPosition(target.position, widthSearch, 12, 1f, (Transform)null) && timeSinceSeeingTarget < 3f) { SetTargetDegreesToPosition(((Component)val3).transform.position); TurnTorsoToTargetDegrees(); if (timeSinceFiringGun > ((GrabbableObject)gun).useCooldown && !aimingGun && timeSinceHittingPlayer > 1f) { timeSinceFiringGun = 0f; base.agent.speed = 0f; AimGunServerRpc(((Component)this).transform.position, lastPlayerSeenMoving); } if (lostPlayerInChase) { lostPlayerInChase = false; SetLostPlayerInChaseServerRpc(lostPlayer: false); } timeSinceSeeingTarget = 0f; lastSeenPlayerPos = ((Component)val3).transform.position; } else if (IsLocalPlayerMoving()) { bool flag = (int)GameNetworkManager.Instance.localPlayerController.playerClientId == lastPlayerSeenMoving; if (flag) { timeSinceSeeingTarget = 0f; } val2 = ((Component)this).transform.position - ((Component)val3).transform.position; float magnitude = ((Vector3)(ref val2)).magnitude; val2 = ((Component)this).transform.position - ((Component)GameNetworkManager.Instance.localPlayerController).transform.position; float magnitude2 = ((Vector3)(ref val2)).magnitude; if (magnitude - magnitude2 > 3f || (timeSinceSeeingTarget > 3f && !flag)) { lastPlayerSeenMoving = (int)GameNetworkManager.Instance.localPlayerController.playerClientId; SwitchTargetServerRpc(Vector3.zero, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } break; } bool flag2 = false; if ((Object)(object)target != (Object)null) { Transform val4 = base.eye ?? ((Component)this).transform; Vector3 position = target.position; Vector3 val5 = position - val4.position; if (((Vector3)(ref val5)).sqrMagnitude < (float)(rangeSearch * rangeSearch) && !Physics.Linecast(val4.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { flag2 = Vector3.Angle(val4.forward, val5) < widthSearch || Vector3.SqrMagnitude(((Component)this).transform.position - position) < 1f; } } if (flag2) { timeSinceSeeingTarget = 0f; if ((Object)(object)target != (Object)null) { lastSeenPlayerPos = target.position; } } else if (!CheckLineOfSightForTarget(70f, 12, 1)) { break; } if (!CheckLineOfSightForTarget(widthSearch, 12, 1) || !(timeSinceSeeingTarget < 3f)) { break; } if ((Object)(object)target != (Object)null) { SetTargetDegreesToPosition(target.position); } TurnTorsoToTargetDegrees(); if (timeSinceFiringGun > ((GrabbableObject)gun).useCooldown && !aimingGun && timeSinceHittingPlayer > 1f) { timeSinceFiringGun = 0f; base.agent.speed = 0f; int playerId = lastPlayerSeenMoving; if ((Object)(object)target == (Object)(object)((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform) { playerId = (int)GameNetworkManager.Instance.localPlayerController.playerClientId; } AimGunServerRpc(((Component)this).transform.position, playerId); } if (lostPlayerInChase) { lostPlayerInChase = false; SetLostPlayerInChaseServerRpc(lostPlayer: false); } timeSinceSeeingTarget = 0f; if ((Object)(object)target != (Object)null) { lastSeenPlayerPos = target.position; } break; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void AimGunServerRpc(Vector3 enemyPos, int playerId) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_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)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3111086303u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyPos); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3111086303u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!aimingGun) { aimingGun = true; AimGunClientRpc(enemyPos, playerId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void AimGunClientRpc(Vector3 enemyPos, int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2103444652u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyPos); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2103444652u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerId != -1) { SwitchTargetTo(Vector3.zero, playerId); } StopAimingGun(); gunCoroutine = ((MonoBehaviour)this).StartCoroutine(AimGun(enemyPos)); } IEnumerator AimGun(Vector3 aimEnemyPos) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) aimingGun = true; if (lastPlayerSeenMoving == previousPlayerSeenWhenAiming) { timesSeeingSamePlayer++; } else { previousPlayerSeenWhenAiming = lastPlayerSeenMoving; timesSeeingSamePlayer = 0; } longRangeAudio.PlayOneShot(aimSFX); speedWhileAiming = speedWhileMoving * 0.35f; base.inSpecialAnimation = true; base.serverPosition = aimEnemyPos; yield return (object)new WaitForSeconds(0.9f); yield return (object)new WaitForEndOfFrame(); if (((NetworkBehaviour)this).IsOwner && !isFiring && (Object)(object)gun != (Object)null && (Object)(object)gun.shotgunRayPoint != (Object)null) { Vector3 gunPosition = gun.shotgunRayPoint.position; Vector3 gunForward = gun.shotgunRayPoint.forward; if ((Object)(object)target != (Object)null) { float x = gun.shotgunRayPoint.forward.x; Vector3 val4 = target.position - gun.shotgunRayPoint.position; gunForward = new Vector3(x, ((Vector3)(ref val4)).normalized.y, gun.shotgunRayPoint.forward.z); } FireGunServerRpc(gunPosition, gunForward); } timeSinceFiringGun = 0f; yield return (object)new WaitForSeconds(0.35f); aimingGun = false; base.inSpecialAnimation = false; base.creatureVoice.Play(); base.creatureVoice.pitch = Random.Range(0.9f, 1.1f); } } [Rpc(/*Could not decode attribute arguments.*/)] public void FireGunServerRpc(Vector3 gunPosition, Vector3 gunForward) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2519019212u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gunPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gunForward); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2519019212u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.stunNormalizedTimer <= 0f) { FireGunClientRpc(gunPosition, gunForward); } else { ((MonoBehaviour)this).StartCoroutine(WaitToFireGun(gunPosition, gunForward)); } } IEnumerator WaitToFireGun(Vector3 delayedGunPosition, Vector3 delayedGunForward) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitUntil((Func)(() => base.stunNormalizedTimer <= 0f)); yield return (object)new WaitForSeconds(0.5f); FireGunClientRpc(delayedGunPosition, delayedGunForward); } } [Rpc(/*Could not decode attribute arguments.*/)] public void FireGunClientRpc(Vector3 gunPosition, Vector3 gunForward) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1973840970u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gunPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref gunForward); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1973840970u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)gun == (Object)null) { Log.LogError("FireGunClientRpc failed: gun is null"); return; } if ((Object)(object)gun.shotgunRayPoint == (Object)null) { Log.LogError("FireGunClientRpc failed: gun.shotgunRayPoint is null"); return; } isFiring = true; Fire(gunPosition, gunForward); ((MonoBehaviour)this).StartCoroutine(FireAfterDelay(0.35f, gunPosition, gunForward)); ((MonoBehaviour)this).StartCoroutine(FireAfterDelay(0.7f, gunPosition, gunForward)); isFiring = false; } void Fire(Vector3 firePosition, Vector3 fireForward) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) base.creatureAnimator.ResetTrigger("ShootGun"); base.creatureAnimator.SetTrigger("ShootGun"); if ((Object)(object)gun == (Object)null) { ((EnemyAI)this).LogEnemyError("No gun held on local client, unable to shoot"); } else { gun.ShootGun(firePosition, fireForward); } } IEnumerator FireAfterDelay(float time, Vector3 delayedGunPosition, Vector3 delayedGunForward) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(time); ((GrabbableObject)gun).currentUseCooldown = -1f; Fire(delayedGunPosition, delayedGunForward); } } private void StopAimingGun() { base.inSpecialAnimation = false; aimingGun = false; if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SwitchTargetServerRpc(Vector3 position, int playerId = -1) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1627560924u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1627560924u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchTargetClientRpc(position, playerId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SwitchTargetClientRpc(Vector3 position, int playerId = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(447869165u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 447869165u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchTargetTo(position, playerId); } } } private void SwitchTargetTo(Vector3 position, int playerId = -1) { //IL_006e: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (playerId != -1) { lastPlayerSeenMoving = playerId; timeSinceSeeingTarget = 0f; target = ((Component)StartOfRound.Instance.allPlayerScripts[playerId].gameplayCamera).transform; lastSeenPlayerPos = ((Component)StartOfRound.Instance.allPlayerScripts[playerId]).transform.position; } else { lastPlayerSeenMoving = -1; timeSinceSeeingTarget = 0f; lastSeenPlayerPos = position; } } public bool CheckLineOfSightForTarget(float width = 45f, int range = 60, int proximityAwareness = -1) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) Transform val = base.eye ?? ((Component)this).transform; Vector3 position = val.position; float num = range * range; float num2 = proximityAwareness * proximityAwareness; Vector3 position2 = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position; Vector3 val2 = position2 - position; if (((Vector3)(ref val2)).sqrMagnitude < num && !Physics.Linecast(position, position2, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && (Vector3.Angle(val.forward, val2) < width || (proximityAwareness != -1 && ((Vector3)(ref val2)).sqrMagnitude < num2))) { target = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform; return true; } foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy == (Object)null) && !((Object)(object)((Component)spawnedEnemy).transform == (Object)null) && !spawnedEnemy.isEnemyDead) { position2 = ((Component)spawnedEnemy).transform.position; val2 = position2 - position; if (((Vector3)(ref val2)).sqrMagnitude < num && !Physics.Linecast(position, position2, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && (Vector3.Angle(val.forward, val2) < width || (proximityAwareness != -1 && ((Vector3)(ref val2)).sqrMagnitude < num2))) { target = ((Component)spawnedEnemy).transform; return true; } } } return false; } private bool IsLocalPlayerMoving() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) localPlayerTurnDistance += StartOfRound.Instance.playerLookMagnitudeThisFrame; if (localPlayerTurnDistance > 0.1f && Vector3.SqrMagnitude(((Component)GameNetworkManager.Instance.localPlayerController).transform.position - ((Component)this).transform.position) < 100f) { return true; } if (GameNetworkManager.Instance.localPlayerController.performingEmote) { return true; } if (Time.realtimeSinceStartup - StartOfRound.Instance.timeAtMakingLastPersonalMovement < 0.25f) { return true; } if (GameNetworkManager.Instance.localPlayerController.timeSincePlayerMoving < 0.02f) { return true; } return false; } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!base.isEnemyDead && !(timeSinceHittingPlayer < 1f) && !(base.stunNormalizedTimer >= 0f)) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, aimingGun, false); if ((Object)(object)val != (Object)null) { timeSinceHittingPlayer = 0f; LegKickPlayerServerRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void LegKickPlayerServerRpc(int playerId) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3545391484u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3545391484u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (playerId >= 0 && playerId < StartOfRound.Instance.allPlayerScripts.Length) { PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; if (!((Object)(object)val4 == (Object)null) && !val4.isPlayerDead && !(Vector3.SqrMagnitude(((Component)val4).transform.position - ((Component)this).transform.position) > 9f)) { LegKickPlayerClientRpc(playerId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void LegKickPlayerClientRpc(int playerId) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2431147278u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2431147278u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; timeSinceHittingPlayer = 0f; PlayerControllerB val4 = StartOfRound.Instance.allPlayerScripts[playerId]; RoundManager.Instance.tempTransform.position = ((Component)this).transform.position; RoundManager.Instance.tempTransform.LookAt(((Component)val4).transform.position); ((Component)this).transform.eulerAngles = new Vector3(0f, RoundManager.Instance.tempTransform.eulerAngles.y, 0f); base.serverRotation = new Vector3(0f, RoundManager.Instance.tempTransform.eulerAngles.y, 0f); Vector3 val5 = Vector3.Normalize((((Component)val4).transform.position + Vector3.up * 0.75f - ((Component)this).transform.position) * 100f) * 25f; if (((NetworkBehaviour)val4).IsOwner) { val4.KillPlayer(val5, true, (CauseOfDeath)12, 0, default(Vector3), false); } base.creatureAnimator.SetTrigger("Kick"); base.creatureSFX.Stop(); torsoTurnAudio.volume = 0f; base.creatureSFX.PlayOneShot(kickSFX); if (base.currentBehaviourStateIndex != 2) { SwitchTargetTo(Vector3.zero, playerId); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } } } public override void HitEnemy(int force = 1, PlayerControllerB? playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) if (Immortal || (onlyPlayers && (Object)(object)playerWhoHit == (Object)null)) { return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (!base.isEnemyDead) { if (base.currentBehaviourStateIndex == 2) { base.creatureSFX.PlayOneShot(base.enemyType.audioClips[0]); base.enemyHP -= force; } else { base.creatureSFX.PlayOneShot(base.enemyType.audioClips[1]); } if ((Object)(object)playerWhoHit != (Object)null) { SeeMovingThreatServerRpc(Vector3.zero, enterAttackFromPatrolMode: true, (int)playerWhoHit.playerClientId); } if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetLivesServerRpc(int value) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(320575105u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendRpc(ref val2, 320575105u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetLivesClientRpc(value); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetLivesClientRpc(int value) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2777929231u, val3, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2777929231u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Lives = value; base.enemyHP = setHp; } } } public override void KillEnemy(bool destroy = false) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (Immortal) { return; } Lives--; base.enemyHP = setHp; if (NetworkManager.Singleton.IsServer) { SetLivesServerRpc(Lives); } if (Lives <= 0) { StopActiveSearches(); ((EnemyAI)this).KillEnemy(destroy); targetTorsoDegrees = 0; StopAimingGun(); if (((NetworkBehaviour)this).IsOwner && (Object)(object)gun != (Object)null) { DropGunServerRpc(gunPoint.position); } base.creatureVoice.Stop(); torsoTurnAudio.Stop(); } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1891166366u, new RpcReceiveHandler(__rpc_handler_1891166366), "InitializeNutcrackerValuesServerRpc"); ((NetworkBehaviour)this).__registerRpc(2126988366u, new RpcReceiveHandler(__rpc_handler_2126988366), "InitializeNutcrackerValuesClientRpc"); ((NetworkBehaviour)this).__registerRpc(414091688u, new RpcReceiveHandler(__rpc_handler_414091688), "DropGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(1357508234u, new RpcReceiveHandler(__rpc_handler_1357508234), "DropGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(3029536429u, new RpcReceiveHandler(__rpc_handler_3029536429), "SetLostPlayerInChaseServerRpc"); ((NetworkBehaviour)this).__registerRpc(1309004243u, new RpcReceiveHandler(__rpc_handler_1309004243), "SetLostPlayerInChaseClientRpc"); ((NetworkBehaviour)this).__registerRpc(2375979427u, new RpcReceiveHandler(__rpc_handler_2375979427), "SeeMovingThreatServerRpc"); ((NetworkBehaviour)this).__registerRpc(1812034362u, new RpcReceiveHandler(__rpc_handler_1812034362), "SeeMovingThreatClientRpc"); ((NetworkBehaviour)this).__registerRpc(3111086303u, new RpcReceiveHandler(__rpc_handler_3111086303), "AimGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(2103444652u, new RpcReceiveHandler(__rpc_handler_2103444652), "AimGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(2519019212u, new RpcReceiveHandler(__rpc_handler_2519019212), "FireGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(1973840970u, new RpcReceiveHandler(__rpc_handler_1973840970), "FireGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(1627560924u, new RpcReceiveHandler(__rpc_handler_1627560924), "SwitchTargetServerRpc"); ((NetworkBehaviour)this).__registerRpc(447869165u, new RpcReceiveHandler(__rpc_handler_447869165), "SwitchTargetClientRpc"); ((NetworkBehaviour)this).__registerRpc(3545391484u, new RpcReceiveHandler(__rpc_handler_3545391484), "LegKickPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(2431147278u, new RpcReceiveHandler(__rpc_handler_2431147278), "LegKickPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(320575105u, new RpcReceiveHandler(__rpc_handler_320575105), "SetLivesServerRpc"); ((NetworkBehaviour)this).__registerRpc(2777929231u, new RpcReceiveHandler(__rpc_handler_2777929231), "SetLivesClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1891166366(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; ((NutSlayerAI)(object)target).InitializeNutcrackerValuesServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2126988366(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_003e: 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_005c: 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) { NetworkObjectReference gunObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gunObject, default(ForNetworkSerializable)); int setShotgunValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref setShotgunValue); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).InitializeNutcrackerValuesClientRpc(gunObject, setShotgunValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_414091688(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 dropPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dropPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).DropGunServerRpc(dropPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1357508234(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) { Vector3 dropPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref dropPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).DropGunClientRpc(dropPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3029536429(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool lostPlayerInChaseServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lostPlayerInChaseServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SetLostPlayerInChaseServerRpc(lostPlayerInChaseServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1309004243(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool lostPlayerInChaseClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lostPlayerInChaseClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SetLostPlayerInChaseClientRpc(lostPlayerInChaseClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2375979427(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_004b: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool enterAttackFromPatrolMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enterAttackFromPatrolMode, default(ForPrimitives)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SeeMovingThreatServerRpc(position, enterAttackFromPatrolMode, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1812034362(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_004b: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool enterAttackFromPatrolMode = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enterAttackFromPatrolMode, default(ForPrimitives)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SeeMovingThreatClientRpc(position, enterAttackFromPatrolMode, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3111086303(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 enemyPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyPos); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).AimGunServerRpc(enemyPos, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2103444652(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 enemyPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyPos); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).AimGunClientRpc(enemyPos, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2519019212(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 gunPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gunPosition); Vector3 gunForward = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gunForward); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).FireGunServerRpc(gunPosition, gunForward); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1973840970(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 gunPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gunPosition); Vector3 gunForward = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref gunForward); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).FireGunClientRpc(gunPosition, gunForward); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1627560924(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SwitchTargetServerRpc(position, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_447869165(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SwitchTargetClientRpc(position, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3545391484(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).LegKickPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2431147278(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).LegKickPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_320575105(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int livesServerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref livesServerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SetLivesServerRpc(livesServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2777929231(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int livesClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref livesClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).SetLivesClientRpc(livesClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NutSlayerAI"; } } [HarmonyPatch] public class Passage : NetworkBehaviour { internal Passage otherPassage; public bool isInsideBuilding; public Transform spawnPosition; public InteractTrigger passageTrigger; public int audioReverbPreset = -1; public AudioSource passageAudioSource; public AudioClip[] doorAudios; internal static float checkForEnemyInterval; private static int bunkerPassagesToSpawn; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); audioReverbPreset = ((!isInsideBuilding) ? 1 : 2); } public virtual void TeleportPlayer() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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: 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) Transform thisPlayerBody = GameNetworkManager.Instance.localPlayerController.thisPlayerBody; GameNetworkManager.Instance.localPlayerController.TeleportPlayer(otherPassage.spawnPosition.position, false, 0f, false, true); GameNetworkManager.Instance.localPlayerController.isInElevator = false; GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom = false; thisPlayerBody.eulerAngles = new Vector3(thisPlayerBody.eulerAngles.x, otherPassage.spawnPosition.eulerAngles.y, thisPlayerBody.eulerAngles.z); SetAudioPreset((int)GameNetworkManager.Instance.localPlayerController.playerClientId); for (int i = 0; i < GameNetworkManager.Instance.localPlayerController.ItemSlots.Length; i++) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController.ItemSlots[i] != (Object)null) { GameNetworkManager.Instance.localPlayerController.ItemSlots[i].isInFactory = isInsideBuilding; } } TeleportPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); GameNetworkManager.Instance.localPlayerController.isInsideFactory = isInsideBuilding; if (Compatibility.cullFactoryPresent) { Compatibility.cullOnTeleportLocalPlayer.Invoke(null, null); } } [ServerRpc(RequireOwnership = false)] private void TeleportPlayerServerRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1401561583u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1401561583u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayerClientRpc(playerID); } } } [ClientRpc] private void TeleportPlayerClientRpc(int playerID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) 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(1681378858u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1681378858u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { return; } instance.allPlayerScripts[playerID].TeleportPlayer(otherPassage.spawnPosition.position, true, otherPassage.spawnPosition.eulerAngles.y, false, true); instance.allPlayerScripts[playerID].isInElevator = false; instance.allPlayerScripts[playerID].isInHangarShipRoom = false; instance.allPlayerScripts[playerID].isInsideFactory = isInsideBuilding; for (int i = 0; i < instance.allPlayerScripts[playerID].ItemSlots.Length; i++) { if ((Object)(object)instance.allPlayerScripts[playerID].ItemSlots[i] != (Object)null) { instance.allPlayerScripts[playerID].ItemSlots[i].isInFactory = isInsideBuilding; } } if (GameNetworkManager.Instance.localPlayerController.isPlayerDead && (Object)(object)instance.allPlayerScripts[playerID] == (Object)(object)GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript) { SetAudioPreset(playerID); } if (Compatibility.cullFactoryPresent) { Compatibility.cullOnTeleportOtherPlayer.Invoke(null, new object[1] { playerID }); } } public void SetAudioPreset(int playerObj) { if (audioReverbPreset != -1) { Object.FindObjectOfType().audioPresets[audioReverbPreset].ChangeAudioReverbForPlayer(StartOfRound.Instance.allPlayerScripts[playerObj]); } } [ServerRpc(RequireOwnership = false)] public void PlayAudioAtTeleportPositionsServerRpc() { //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(841996285u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 841996285u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayAudioAtTeleportPositionsClientRpc(); } } } [ClientRpc] public void PlayAudioAtTeleportPositionsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(992909530u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 992909530u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayAudioAtTeleportPositions(); } } } public void PlayAudioAtTeleportPositions() { if (doorAudios.Length != 0) { passageAudioSource.PlayOneShot(doorAudios[Random.Range(0, doorAudios.Length)]); otherPassage.passageAudioSource.PlayOneShot(doorAudios[Random.Range(0, doorAudios.Length)]); } } [ServerRpc(RequireOwnership = false)] public void SyncBunkerPassagesServerRpc(NetworkObjectReference entrance, NetworkObjectReference exit) { //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_00fd: 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) 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(757507315u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref entrance, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref exit, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 757507315u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SyncBunkerPassagesClientRpc(entrance, exit); } } } [ClientRpc] public void SyncBunkerPassagesClientRpc(NetworkObjectReference entrance, NetworkObjectReference exit) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2493008230u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref entrance, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref exit, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2493008230u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref entrance)).TryGet(ref val3, (NetworkManager)null); NetworkObject val4 = default(NetworkObject); ((NetworkObjectReference)(ref exit)).TryGet(ref val4, (NetworkManager)null); BunkerLidPassage component = ((Component)((Component)val3).transform.Find("EntrancePassage")).GetComponent(); BunkerLadderPassage component2 = ((Component)((Component)val4).transform.Find("EscapePassage")).GetComponent(); BunkerLid component3 = ((Component)((Component)val3).transform.Find("Lid").Find("Interactable")).GetComponent(); component.otherPassage = component2; component2.otherPassage = component; component.bunkerLid = component3; component2.bunkerLid = component3; } } } public static void SpawnBunkerPassage(int amount) { bunkerPassagesToSpawn += amount; } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "RefreshEnemiesList")] private static void DoSpawnBunkerPassage() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0321: 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_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: 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_0416: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_044a: 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_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_035f: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) if (bunkerPassagesToSpawn <= 0) { return; } int num = Net.Instance._seed++ + Environment.TickCount; List list = new List(); List list2 = new List(); List outsideNodes = Helper.GetOutsideNodes(); List insideAINodes = Helper.GetInsideAINodes(); List spawnDenialNodes = Helper.GetSpawnDenialNodes(); List fromNodes = (from s in Object.FindObjectsOfType() select ((Component)s).transform.position).ToList(); List fromNodes2 = (from l in Object.FindObjectsOfType() select ((Component)l).transform.position).ToList(); RaycastHit val3 = default(RaycastHit); for (int num2 = 0; num2 < bunkerPassagesToSpawn; num2++) { Random random = new Random(num++); Vector3 val = Vector3.zero; Vector3 val2 = Vector3.zero; for (int num3 = 0; num3 < 20; num3++) { random = new Random(num++); Vector3 randomNavMeshPositionInBoxPredictable = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(outsideNodes[random.Next(outsideNodes.Count)], 30f, RoundManager.Instance.navHit, random, -1, 1f); if (Helper.IsSafe(randomNavMeshPositionInBoxPredictable, spawnDenialNodes, 20f) && Helper.IsSafe(randomNavMeshPositionInBoxPredictable, list2, 15f)) { Physics.Raycast(new Ray(randomNavMeshPositionInBoxPredictable, Vector3.down), ref val3); val = ((RaycastHit)(ref val3)).point + new Vector3(0f, 0.05f, 0f); break; } } if (val == Vector3.zero) { val = outsideNodes[random.Next(outsideNodes.Count)]; } list2.Add(val); for (int num4 = 0; num4 < 100; num4++) { random = new Random(num++); Vector3 val4 = insideAINodes[random.Next(insideAINodes.Count)]; if (!Helper.IsSafe(val4, spawnDenialNodes, 30f) || !Helper.IsSafe(val4, list, 15f) || !Helper.IsSafe(val4, fromNodes, 3f) || !Helper.IsSafe(val4, fromNodes2, 0.5f)) { continue; } RaycastHit[] array = Physics.RaycastAll(new Ray(val4, Vector3.up), 8f); if (array.Length == 0) { continue; } int num5 = 0; float num6 = 0f; for (int num7 = 0; num7 < array.Length; num7++) { float num8 = Vector3.Distance(((RaycastHit)(ref array[num7])).point, val4); if (num8 > num6) { num6 = num8; num5 = num7; } } if (Physics.Raycast(new Ray(val4 - new Vector3(0f, -2f, 0f), Vector3.down))) { val2 = ((RaycastHit)(ref array[num5])).point; break; } } if (val2 == Vector3.zero) { val2 = insideAINodes[random.Next(outsideNodes.Count)] + new Vector3(0f, 5.3f, 0f); } list.Add(val2); float num9 = RoundManager.Instance.YRotationThatFacesTheFarthestFromPosition(val2 + Vector3.up * 0.2f, 25f, 6) - 180f; Quaternion rotation = Assets.bunkerEntrance.transform.rotation; ((Quaternion)(ref rotation)).eulerAngles = new Vector3(((Quaternion)(ref rotation)).eulerAngles.x, num9, ((Quaternion)(ref rotation)).eulerAngles.z); GameObject val5 = Object.Instantiate(Assets.bunkerEntrance, val, rotation); val5.GetComponent().Spawn(true); BunkerLidPassage component = ((Component)val5.transform.Find("EntrancePassage")).GetComponent(); Quaternion rotation2 = Assets.bunkerEscape.transform.rotation; ((Quaternion)(ref rotation2)).eulerAngles = new Vector3(((Quaternion)(ref rotation2)).eulerAngles.x, num9 - 90f, ((Quaternion)(ref rotation2)).eulerAngles.z); GameObject val6 = Object.Instantiate(Assets.bunkerEscape, val2, rotation2); val6.GetComponent().Spawn(true); component.SyncBunkerPassagesServerRpc(NetworkObjectReference.op_Implicit(val5.GetComponent()), NetworkObjectReference.op_Implicit(val6.GetComponent())); Manager.objectsToClear.Add(val5); Manager.objectsToClear.Add(val6); } bunkerPassagesToSpawn = 0; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1401561583u, new RpcReceiveHandler(__rpc_handler_1401561583), "TeleportPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1681378858u, new RpcReceiveHandler(__rpc_handler_1681378858), "TeleportPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(841996285u, new RpcReceiveHandler(__rpc_handler_841996285), "PlayAudioAtTeleportPositionsServerRpc"); ((NetworkBehaviour)this).__registerRpc(992909530u, new RpcReceiveHandler(__rpc_handler_992909530), "PlayAudioAtTeleportPositionsClientRpc"); ((NetworkBehaviour)this).__registerRpc(757507315u, new RpcReceiveHandler(__rpc_handler_757507315), "SyncBunkerPassagesServerRpc"); ((NetworkBehaviour)this).__registerRpc(2493008230u, new RpcReceiveHandler(__rpc_handler_2493008230), "SyncBunkerPassagesClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1401561583(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Passage)(object)target).TeleportPlayerServerRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1681378858(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); target.__rpc_exec_stage = (__RpcExecStage)1; ((Passage)(object)target).TeleportPlayerClientRpc(playerID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_841996285(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; ((Passage)(object)target).PlayAudioAtTeleportPositionsServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_992909530(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; ((Passage)(object)target).PlayAudioAtTeleportPositionsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_757507315(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference entrance = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref entrance, default(ForNetworkSerializable)); NetworkObjectReference exit = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exit, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Passage)(object)target).SyncBunkerPassagesServerRpc(entrance, exit); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2493008230(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference entrance = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref entrance, default(ForNetworkSerializable)); NetworkObjectReference exit = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref exit, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Passage)(object)target).SyncBunkerPassagesClientRpc(entrance, exit); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Passage"; } } public class SlayerShotgun : GrabbableObject { public AudioSource gunShootAudio = null; public AudioSource gunBulletsRicochetAudio = null; public AudioClip[] gunShootSFX = null; private float misfireTimer = 30f; private bool hasHitGroundWithSafetyOff = true; private bool localClientSendingShootGunRPC; private PlayerControllerB? previousPlayerHeldBy; public ParticleSystem gunShootParticle = null; public Transform shotgunRayPoint = null; private readonly RaycastHit[] enemyColliders = (RaycastHit[])(object)new RaycastHit[32]; private EnemyAI? heldByEnemy; public override void Start() { ((GrabbableObject)this).Start(); misfireTimer = 10f; hasHitGroundWithSafetyOff = true; } public override void Update() { ((GrabbableObject)this).Update(); if (!((NetworkBehaviour)this).IsOwner || (Object)(object)heldByEnemy != (Object)null || base.isPocketed) { return; } if (base.hasHitGround && !hasHitGroundWithSafetyOff && !base.isHeld) { if (Random.Range(0, 100) < 5) { ShootGunAndSync(heldByPlayer: false); } hasHitGroundWithSafetyOff = true; } else if (misfireTimer <= 0f && !StartOfRound.Instance.inShipPhase) { if (Random.Range(0, 100) < 4) { ShootGunAndSync(base.isHeld); } if (Random.Range(0, 100) < 5) { misfireTimer = 2f; } else { misfireTimer = Random.Range(8f, 15f); } } else { misfireTimer -= Time.deltaTime; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); previousPlayerHeldBy = base.playerHeldBy; previousPlayerHeldBy.equippedUsableItemQE = true; hasHitGroundWithSafetyOff = false; } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); heldByEnemy = enemy; hasHitGroundWithSafetyOff = false; } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); heldByEnemy = null; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((NetworkBehaviour)this).IsOwner) { ShootGunAndSync(heldByPlayer: true); } } public void ShootGunAndSync(bool heldByPlayer) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) Vector3 shotgunPosition; Vector3 forward; if (!heldByPlayer) { shotgunPosition = shotgunRayPoint.position; forward = shotgunRayPoint.forward; } else { shotgunPosition = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position - ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.up * 0.45f; forward = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.forward; } ShootGun(shotgunPosition, forward); localClientSendingShootGunRPC = true; ShootGunServerRpc(shotgunPosition, forward); } [Rpc(/*Could not decode attribute arguments.*/)] public void ShootGunServerRpc(Vector3 shotgunPosition, Vector3 shotgunForward) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(61960284u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunForward); ((NetworkBehaviour)this).__endSendRpc(ref val2, 61960284u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShootGunClientRpc(shotgunPosition, shotgunForward); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ShootGunClientRpc(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(391005339u, val3, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref shotgunForward); ((NetworkBehaviour)this).__endSendRpc(ref val2, 391005339u, val3, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (localClientSendingShootGunRPC) { localClientSendingShootGunRPC = false; } else { ShootGun(shotgunPosition, shotgunForward); } } } public void ShootGun(Vector3 shotgunPosition, Vector3 shotgunForward) { //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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: 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_0418: Unknown result type (might be due to invalid IL or missing references) bool flag; try { flag = Configuration.ExtraLogging.Value; } catch (NullReferenceException) { Log.LogError("Extra Logging Feature Errored."); flag = false; } if (flag) { Log.LogInfo($"SlayerShotGun shot at {shotgunPosition}, towards {shotgunForward}"); } bool flag2 = false; if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { base.playerHeldBy.playerBodyAnimator.SetTrigger("ShootShotgun"); flag2 = true; } RoundManager.PlayRandomClip(gunShootAudio, gunShootSFX, true, 1f, 1840, 1000); WalkieTalkie.TransmitOneShotAudio(gunShootAudio, gunShootSFX[0], 1f); gunShootParticle.Play(true); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } float num = Vector3.SqrMagnitude(((Component)localPlayerController).transform.position - ((Component)shotgunRayPoint).transform.position); bool flag3 = false; int num2 = 0; float num3 = 0f; Vector3 val = localPlayerController.playerCollider.ClosestPoint(shotgunPosition); if (!flag2 && !Physics.Linecast(shotgunPosition, val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && Vector3.Angle(shotgunForward, val - shotgunPosition) < 30f) { flag3 = true; } if (num < 25f) { num3 = 0.8f; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); num2 = 100; } if (num < 225f) { num3 = 0.5f; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); num2 = 100; } else if (num < 529f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); num2 = 40; } else if (num < 900f) { num2 = 20; } if (num3 > 0f && SoundManager.Instance.timeSinceEarsStartedRinging > 16f) { ((MonoBehaviour)this).StartCoroutine(DelayedEarsRinging(num3)); } Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(shotgunPosition, shotgunForward); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, ref val3, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { ((Component)gunBulletsRicochetAudio).transform.position = ((Ray)(ref val2)).GetPoint(((RaycastHit)(ref val3)).distance - 0.5f); gunBulletsRicochetAudio.Play(); } if (flag3) { localPlayerController.DamagePlayer(num2, true, true, (CauseOfDeath)7, 0, false, shotgunRayPoint.forward * 30f); } if (!((NetworkBehaviour)this).IsOwner) { return; } int num4 = Physics.SphereCastNonAlloc(val2, 5f, enemyColliders, 15f, 524288, (QueryTriggerInteraction)2); if (flag) { Log.LogInfo($"Raycast hits: {num4}"); } EnemyAICollisionDetect val4 = default(EnemyAICollisionDetect); IHittable val5 = default(IHittable); for (int i = 0; i < num4; i++) { if (flag) { Log.LogInfo("Raycasting enemy"); } if (!((Component)((RaycastHit)(ref enemyColliders[i])).transform).TryGetComponent(ref val4)) { continue; } EnemyAI mainScript = val4.mainScript; if ((Object)(object)heldByEnemy != (Object)null && (Object)(object)heldByEnemy == (Object)(object)mainScript) { if (flag) { Log.LogInfo("Shotgun is held by enemy, skipping entry"); } } else if (((Component)((RaycastHit)(ref enemyColliders[i])).transform).TryGetComponent(ref val5)) { float num5 = Vector3.SqrMagnitude(shotgunPosition - ((RaycastHit)(ref enemyColliders[i])).point); int num6 = ((num5 < 13.69f) ? 5 : ((!(num5 < 36f)) ? 2 : 3)); if (flag) { Log.LogInfo($"Hit enemy, hitDamage: {num6}"); } val5.Hit(num6, shotgunForward, base.playerHeldBy, true, -1); } else if (flag) { Log.LogInfo("Could not get hittable script from collider, transform: " + ((Object)((RaycastHit)(ref enemyColliders[i])).transform).name); Log.LogInfo("collider: " + ((Object)((RaycastHit)(ref enemyColliders[i])).collider).name); } } static IEnumerator DelayedEarsRinging(float effectSeverity) { yield return (object)new WaitForSeconds(0.6f); SoundManager.Instance.earsRingingTimer = effectSeverity; } } public override void SetControlTipsForItem() { string[] toolTips = base.itemProperties.toolTips; if (toolTips.Length <= 2) { Log.LogError("Shotgun control tips array length is too short to set tips!"); return; } toolTips[2] = "No safety"; HUDManager.Instance.ChangeControlTipMultiple(toolTips, true, base.itemProperties); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); StopUsingGun(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); StopUsingGun(); } private void StopUsingGun() { previousPlayerHeldBy.equippedUsableItemQE = false; } protected override void __initializeVariables() { ((GrabbableObject)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 ((NetworkBehaviour)this).__registerRpc(61960284u, new RpcReceiveHandler(__rpc_handler_61960284), "ShootGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(391005339u, new RpcReceiveHandler(__rpc_handler_391005339), "ShootGunClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_61960284(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 shotgunPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunPosition); Vector3 shotgunForward = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)1; ((SlayerShotgun)(object)target).ShootGunServerRpc(shotgunPosition, shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_391005339(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 shotgunPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunPosition); Vector3 shotgunForward = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)1; ((SlayerShotgun)(object)target).ShootGunClientRpc(shotgunPosition, shotgunForward); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SlayerShotgun"; } } internal class TeleportAudioSource : MonoBehaviour { public float objectLifeTime = 5f; public AudioSource audioSource; private void Start() { audioSource.Play(); } private void Update() { objectLifeTime -= Time.deltaTime; if (objectLifeTime <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } [HarmonyPatch] internal class TimeChaosNet : NetworkBehaviour { public static TimeChaosNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyTimeInstance(); } instance = this; } public void Update() { if (!TimeChaos.Instance.Active) { return; } try { Net.Instance.MoveTimeServerRpc(0f, TimeChaos.timeMultiplier); } catch { Net.Instance.MoveTimeServerRpc(0f, 1.0001f); } } public static void DestroyTimeInstance() { TimeChaos.Instance.Active = false; TimeOfDay.Instance.globalTimeSpeedMultiplier = 1f; GameObject val = GameObject.Find("TimeChaosEvent"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyTimeInstance(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyTimeInstance(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "TimeChaosNet"; } } } namespace BrutalCompanyMinus.Minus.Handlers { [HarmonyPatch] public class AllMetalPatches { public static Dictionary OriginalStates = new Dictionary(); [HarmonyPostfix] [HarmonyPatch(typeof(GrabbableObject), "Start")] public static void MetalOffFix(GrabbableObject __instance) { if (NotMetal.Active) { ApplyMetalStates(__instance, state: false); } } [HarmonyPostfix] [HarmonyPatch(typeof(GrabbableObject), "Start")] public static void MetalOnFix(GrabbableObject __instance) { if (IsMetal.Active) { ApplyMetalStates(__instance, state: true); } } [HarmonyPostfix] [HarmonyPatch(typeof(GrabbableObject), "Start")] public static void MetalSwitch(GrabbableObject __instance) { if (BrutalCompanyMinus.Minus.Events.MetalSwitch.Active && (Object)(object)__instance != (Object)null && (Object)(object)__instance.itemProperties != (Object)null) { ApplyMetalStates(__instance, !__instance.itemProperties.isConductiveMetal); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OpenShipDoors")] public static void MetalOffSweep() { if (NotMetal.Active) { GrabbableObject[] array = Object.FindObjectsOfType(); GrabbableObject[] array2 = array; foreach (GrabbableObject item in array2) { ApplyMetalStates(item, state: false); } } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OpenShipDoors")] public static void MetalOnSweep() { if (IsMetal.Active) { GrabbableObject[] array = Object.FindObjectsOfType(); GrabbableObject[] array2 = array; foreach (GrabbableObject item in array2) { ApplyMetalStates(item, state: true); } } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OpenShipDoors")] public static void MetalSwitchSweep() { if (!BrutalCompanyMinus.Minus.Events.MetalSwitch.Active) { return; } GrabbableObject[] array = Object.FindObjectsOfType(); GrabbableObject[] array2 = array; foreach (GrabbableObject val in array2) { if ((Object)(object)val != (Object)null && (Object)(object)val.itemProperties != (Object)null) { ApplyMetalStates(val, !val.itemProperties.isConductiveMetal); } } } public static void ApplyMetalStates(GrabbableObject item, bool state) { if ((Object)(object)item == (Object)null || (Object)(object)item.itemProperties == (Object)null) { return; } item.itemProperties = Object.Instantiate(item.itemProperties); if (!OriginalStates.ContainsKey(item)) { OriginalStates.Add(item, item.itemProperties.isConductiveMetal); if (Configuration.ExtraLogging.Value) { Log.LogDebug($"Stored original state for item: {((Object)item).name}, isConductiveMetal: {item.itemProperties.isConductiveMetal}"); } } item.itemProperties.isConductiveMetal = state; } public static void RestoreOriginalStates() { foreach (KeyValuePair originalState in OriginalStates) { if ((Object)(object)originalState.Key != (Object)null && (Object)(object)originalState.Key.itemProperties != (Object)null) { originalState.Key.itemProperties.isConductiveMetal = originalState.Value; if (Configuration.ExtraLogging.Value) { Log.LogMessage($"Restored item: {((Object)originalState.Key).name} to original isConductiveMetal: {originalState.Value}"); } } } OriginalStates.Clear(); } } [HarmonyPatch] internal class AllWeather { public static FloodWeather spawnedFloodedWeather = null; public static FieldInfo floodLevelOffset = typeof(FloodWeather).GetField("floodLevelOffset", BindingFlags.Instance | BindingFlags.NonPublic); public static float floodVariable1 = 1f; public static float floodVariable2 = 1f; public static float lightningVariable1 = 1f; public static float LightningVariable2 = 1f; public static bool raining = false; [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "SpawnOutsideHazards")] private static void OnSpawnOutsideHazards() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (BrutalCompanyMinus.Minus.Events.AllWeather.Active && (int)RoundManager.Instance.currentLevel.currentWeather != 1 && raining && ((NetworkBehaviour)RoundManager.Instance).IsHost) { Net.Instance.SpawnMudPilesOutsideServerRpc(Random.Range(8, 16)); } } [HarmonyPostfix] [HarmonyPatch(typeof(FloodWeather), "OnGlobalTimeSync")] private static void OnGlobalTimeSync(ref FloodWeather __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (BrutalCompanyMinus.Minus.Events.AllWeather.Active && (int)RoundManager.Instance.currentLevel.currentWeather != 4 && !((Object)(object)spawnedFloodedWeather == (Object)null)) { floodLevelOffset.SetValue(spawnedFloodedWeather, Mathf.Clamp(TimeOfDay.Instance.globalTime / 1080f, 0f, 100f) * floodVariable2 + floodVariable1 - 1f); } } [HarmonyPostfix] [HarmonyPatch(typeof(FloodWeather), "OnEnable")] private static void OnOnEnable(ref FloodWeather __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (BrutalCompanyMinus.Minus.Events.AllWeather.Active && (int)RoundManager.Instance.currentLevel.currentWeather != 4 && !((Object)(object)spawnedFloodedWeather == (Object)null)) { ((Component)__instance).transform.position = new Vector3(0f, floodVariable1, 0f); floodLevelOffset.SetValue(spawnedFloodedWeather, Mathf.Clamp(TimeOfDay.Instance.globalTime / 1080f, 0f, 100f) * floodVariable2 + floodVariable1 - 1f); } } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "SetToCurrentLevelWeather")] private static void OnSetToCurrentLevelWeather() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (BrutalCompanyMinus.Minus.Events.AllWeather.Active && (int)RoundManager.Instance.currentLevel.currentWeather != 2) { TimeOfDay.Instance.currentWeatherVariable = lightningVariable1; TimeOfDay.Instance.currentWeatherVariable = LightningVariable2; } } } [HarmonyPatch] [HarmonyPatch(typeof(EnemyAI))] internal class AntiBounty { public static List enemyObjectIDs = new List(); private static int due = 0; [HarmonyPostfix] [HarmonyPatch("KillEnemyOnOwnerClient")] private static void PayOnkill(ref EnemyAI __instance) { if (due > 0 && Manager.currentTerminal.groupCredits > 0) { HUDManager.Instance.AddTextToChatOnServer("Due payment.", -1); int groupCredits = due; if (Manager.currentTerminal.groupCredits - due < 0) { groupCredits = Manager.currentTerminal.groupCredits; } Manager.PayCredits(-groupCredits); due -= groupCredits; HUDManager.Instance.AddTextToChatOnServer($"New Due balance: {due}", -1); } if (!BrutalCompanyMinus.Minus.Events.AntiBounty.AntiBountyActive) { return; } foreach (int enemyObjectID in enemyObjectIDs) { if (((Object)((Component)__instance).gameObject).GetInstanceID() == enemyObjectID) { return; } } MEvent instance = BrutalCompanyMinus.Minus.Events.AntiBounty.Instance; int num = Random.Range(instance.Get(MEvent.ScaleType.MinValue), instance.Get(MEvent.ScaleType.MaxValue) + 1); if (Manager.currentTerminal.groupCredits - num < 0) { due += num - Manager.currentTerminal.groupCredits; num = Manager.currentTerminal.groupCredits; HUDManager.Instance.AddTextToChatOnServer($"Since you lack credits to pay the full fine, you will be due {due} on the next kill.", -1); } Log.LogDebug("BCMER Fine " + -num); Manager.PayCredits(-num); enemyObjectIDs.Add(((Object)((Component)__instance).gameObject).GetInstanceID()); } } [HarmonyPatch(typeof(Turret))] internal class BerserkTurrets { [HarmonyPrefix] [HarmonyPatch("Update")] private static void TurretsHellMode(Turret __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (BrutalCompanyMinus.Minus.Events.BerserkTurrets.Instance.Active) { __instance.turretMode = (TurretMode)3; } } } [HarmonyPatch] [HarmonyPatch(typeof(EnemyAI))] internal class Bounty { public static List enemyObjectIDs = new List(); [HarmonyPostfix] [HarmonyPatch("KillEnemyOnOwnerClient")] private static void PayOnkill(ref EnemyAI __instance) { if (!BrutalCompanyMinus.Minus.Events.Bounty.Active) { return; } foreach (int enemyObjectID in enemyObjectIDs) { if (((Object)((Component)__instance).gameObject).GetInstanceID() == enemyObjectID) { return; } } MEvent instance = BrutalCompanyMinus.Minus.Events.Bounty.Instance; Manager.PayCredits(Random.Range(instance.Get(MEvent.ScaleType.MinValue), instance.Get(MEvent.ScaleType.MaxValue) + 1)); enemyObjectIDs.Add(((Object)((Component)__instance).gameObject).GetInstanceID()); } } [HarmonyPatch(typeof(VehicleController))] internal class CruiserFailures { [HarmonyPrefix] [HarmonyPatch("StartTryCarIgnition")] private static bool InterruptCruiser() { if (CruiserFailure.Active) { switch (Random.Range(0, 3)) { case 0: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Do you even have a license?!"; break; case 1: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Hope you have insurance!"; break; case 2: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Do you know how to operate the vehicle?"; break; default: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Your car is out of gas!"; break; } HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } return true; } } [HarmonyPatch(typeof(HangarShipDoor))] internal class HangarShipDoorPatches { private static float lockdownTime; [HarmonyPostfix] [HarmonyPatch("Update")] private static void OverwriteDoorPower(HangarShipDoor __instance) { if (DoorFailure.Instance.Active) { __instance.doorPower = 0f; __instance.SetDoorOpen(); __instance.buttonsEnabled = false; lockdownTime = (lockdownTime + Time.deltaTime) % 6f; ((TMP_Text)__instance.doorPowerDisplay).text = ((lockdownTime > 3f) ? "FAILURE" : "RETRYING") ?? ""; } } [HarmonyPostfix] [HarmonyPatch("Update")] private static void OverwriteDoorState(HangarShipDoor __instance) { if (DoorCircuitFailure.Instance.Active) { if ((TimeOfDay.Instance.hour == 9) | (TimeOfDay.Instance.hour == 10) | (TimeOfDay.Instance.hour == 11) | (TimeOfDay.Instance.hour == 12) | (TimeOfDay.Instance.hour == 13) | (TimeOfDay.Instance.hour == 14) | (TimeOfDay.Instance.hour == 15)) { __instance.doorPower = 1f; __instance.PlayDoorAnimation(true); __instance.buttonsEnabled = false; lockdownTime = (lockdownTime + Time.deltaTime) % 6f; ((TMP_Text)__instance.doorPowerDisplay).text = ((lockdownTime > 3f) ? "LOCKED" : "OPEN 10PM") ?? ""; } else if (TimeOfDay.Instance.hour == 16) { __instance.PlayDoorAnimation(false); __instance.buttonsEnabled = true; } } } } public class DoorLockPatches : NetworkBehaviour { public static DoorLockPatches instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyDoorLockPatches(); } instance = this; Net.Instance.SetEntranceServerRpc(active: true); } public static void DestroyDoorLockPatches() { LockedEntrance.Active = false; GameObject val = GameObject.Find("LockEntranceObject"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyDoorLockPatches(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyDoorLockPatches(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "DoorLockPatches"; } } [HarmonyPatch(typeof(HangarShipDoor))] internal class HangarShipDoorOvPatches { [HarmonyPostfix] [HarmonyPatch("Update")] private static void OverwriteDoorPower(HangarShipDoor __instance) { if (DoorOverdriveEv.Instance.Active) { __instance.doorPower = 1f; __instance.buttonsEnabled = true; } } } [HarmonyPatch] internal class FacilityGhost { public static float actionCurrentTime = 0f; public static float actionTimeCooldown = 15f; public static float ghostCrazyCurrentTime = 0f; public static float ghostCrazyPeriod = 3f; public static float ghostCrazyActionInterval = 0.1f; public static float crazyGhostChance = 0.1f; public static int DoNothingWeight = 20; public static int OpenCloseBigDoorsWeight = 20; public static int MessWithLightsWeight = 16; public static int MessWithBreakerWeight = 4; public static int OpenCloseDoorsWeight = 9; public static int lockUnlockDoorsWeight = 3; public static int disableTurretsWeight = 5; public static int disableLandminesWeight = 5; public static int disableSpikeTrapsWeight = 5; public static int turretRageWeight = 15; public static float chanceToOpenCloseDoor = 0.3f; public static float chanceToLockUnlockDoor = 0.1f; public static float rageTurretsChance = 0.33f; private static Random rng = new Random(); [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "Update")] private static void OnUpdate() { //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Invalid comparison between Unknown and I4 //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Invalid comparison between Unknown and I4 //IL_04be: Unknown result type (might be due to invalid IL or missing references) if (!BrutalCompanyMinus.Minus.Events.FacilityGhost.Active || !((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } if (ghostCrazyCurrentTime > 0f) { ghostCrazyCurrentTime -= Time.deltaTime; } if (actionCurrentTime > 0f) { actionCurrentTime -= Time.deltaTime; return; } rng = new Random(Net.Instance._seed++); if (rng.NextDouble() <= (double)crazyGhostChance && ghostCrazyCurrentTime <= 0f) { Log.LogInfo("Ghost has went crazy"); ghostCrazyCurrentTime = ghostCrazyPeriod; } if (ghostCrazyCurrentTime > 0f) { actionCurrentTime = ghostCrazyActionInterval; } else { actionCurrentTime = actionTimeCooldown; } int[] array = new int[10] { DoNothingWeight, OpenCloseDoorsWeight, MessWithLightsWeight, MessWithBreakerWeight, OpenCloseDoorsWeight, lockUnlockDoorsWeight, disableTurretsWeight, disableLandminesWeight, disableSpikeTrapsWeight, turretRageWeight }; if (ghostCrazyCurrentTime > 0f) { array[0] = 0; array[5] = 0; array[6] = 0; array[7] = 0; array[8] = 0; } switch (RoundManager.Instance.GetRandomWeightedIndex(array, rng)) { case 0: Log.LogInfo("Facility ghost did nothing"); break; case 1: { TerminalAccessibleObject[] array6 = Object.FindObjectsOfType(); if (array6.Length != 0) { Log.LogInfo("Facility ghost did OpenClose doors"); TerminalAccessibleObject[] array7 = array6; foreach (TerminalAccessibleObject val2 in array7) { val2.SetDoorOpenServerRpc(Convert.ToBoolean(rng.Next(2))); } } break; } case 2: Log.LogInfo("Facility ghost messed with the lights"); Net.Instance.MessWithLightsServerRpc(); break; case 3: Log.LogInfo("Facility ghost messed with breaker"); Net.Instance.MessWithBreakerServerRpc(Convert.ToBoolean(rng.Next(2))); break; case 4: Log.LogInfo("Facility ghost attempts to open and close doors"); Net.Instance.MessWithDoorsServerRpc(chanceToOpenCloseDoor); break; case 5: Log.LogInfo("Facility ghost attempts to lock and unlock doors"); Net.Instance.MessWithDoorsServerRpc(chanceToOpenCloseDoor, messWithLock: true, chanceToLockUnlockDoor); break; case 6: { Log.LogInfo("Facility ghost attempts to disable turrets"); Turret[] array4 = Object.FindObjectsOfType(); Turret[] array5 = array4; foreach (Turret turret in array5) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableTurret(turret)); } } if (Compatibility.toilheadPresent) { ToilHeadHandler.AttemptToDisableToilHeadTurrets(ref rng); } break; } case 7: { Log.LogInfo("Facility ghost attempts to disable landmines"); Landmine[] array10 = Object.FindObjectsOfType(); Landmine[] array11 = array10; foreach (Landmine landmine in array11) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableLandmine(landmine)); } } GrabbableLandmine[] array12 = Object.FindObjectsOfType(); GrabbableLandmine[] array13 = array12; foreach (GrabbableLandmine grabbableLandmine in array13) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableGrabbableLandmine(grabbableLandmine)); } } break; } case 8: { Log.LogInfo("Facility ghost attempts to disable spiketraps"); SpikeRoofTrap[] array8 = Object.FindObjectsOfType(); SpikeRoofTrap[] array9 = array8; foreach (SpikeRoofTrap trap in array9) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableSpikeTrap(trap)); } } break; } case 9: { Log.LogInfo("Facility ghost attempts to rage turrets"); Turret[] array2 = Object.FindObjectsOfType(); Turret[] array3 = array2; foreach (Turret val in array3) { if (rng.NextDouble() <= (double)rageTurretsChance && (int)val.turretMode != 3 && (int)val.turretMode != 2 && val.turretActive) { val.turretMode = (TurretMode)3; val.EnterBerserkModeServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } if (Compatibility.toilheadPresent) { ToilHeadHandler.AttemptToRageToilHeadTurrets(ref rng); } break; } } } private static IEnumerator DisableTurret(Turret turret) { turret.ToggleTurretEnabled(false); yield return (object)new WaitForSeconds(7f); turret.ToggleTurretEnabled(true); } private static IEnumerator DisableLandmine(Landmine landmine) { landmine.ToggleMine(false); yield return (object)new WaitForSeconds(7f); landmine.ToggleMine(true); } private static IEnumerator DisableGrabbableLandmine(GrabbableLandmine grabbableLandmine) { grabbableLandmine.ToggleMine(enabled: false); yield return (object)new WaitForSeconds(7f); grabbableLandmine.ToggleMine(enabled: true); } private static IEnumerator DisableSpikeTrap(SpikeRoofTrap trap) { trap.ToggleSpikesEnabled(false); yield return (object)new WaitForSeconds(7f); trap.ToggleSpikesEnabled(true); } } public class FlashlightItemsNet : NetworkBehaviour { public static FlashlightItemsNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyFlashlightFailure(); } instance = this; Net.Instance.SetFlashlightsServerRpc(active: true); } public static void DestroyFlashlightFailure() { FlashLightsFailure.Active = false; GameObject val = GameObject.Find("FlashlightsFailureObject"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyFlashlightFailure(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyFlashlightFailure(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "FlashlightItemsNet"; } } [HarmonyPatch] internal class FullAccess { [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "RefreshEnemiesList")] private static void OnRefreshEnemiesList() { if (BrutalCompanyMinus.Minus.Events.FullAccess.Active && NetworkManager.Singleton.IsServer) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(OpenAll()); BrutalCompanyMinus.Minus.Events.FullAccess.Active = false; } } private static IEnumerator OpenAll() { yield return (object)new WaitForSeconds(8f); Net.Instance.UnlockAndOpenAllDoorsServerRpc(); } } [HarmonyPatch] internal class Hell { [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "AssignRandomEnemyToVent")] private static void OnAssignRandomEnemyToVent(ref RoundManager __instance) { if (BrutalCompanyMinus.Minus.Events.Hell.Active) { __instance.currentMaxInsidePower = 0f; __instance.currentMaxOutsidePower = 0f; } } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "RefreshEnemiesList")] private static void OnRefreshEnemiesList() { if (BrutalCompanyMinus.Minus.Events.Hell.Active && BrutalCompanyMinus.Minus.Events.Hell.SpawnCycle) { EnemySpawnCycle.Instance.spawnCycles.Add(BrutalCompanyMinus.Minus.Events.Hell.insideHellSpawnCycle); ((MonoBehaviour)RoundManager.Instance).StartCoroutine(AddOutsideSpawnCycleAfterDelay()); BrutalCompanyMinus.Minus.Events.Hell.SpawnCycle = false; } } private static IEnumerator AddOutsideSpawnCycleAfterDelay() { yield return (object)new WaitForSeconds(75f); EnemySpawnCycle.Instance.spawnCycles.Add(BrutalCompanyMinus.Minus.Events.Hell.outsideHellSpawnCycle); } } public class IsMetalNet : NetworkBehaviour { public static IsMetalNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyMetalPatch(); } instance = this; Net.Instance.SetMetalOnNetServerRpc(active: true); } public static void DestroyMetalPatch() { IsMetal.Active = false; GameObject val = GameObject.Find("IsMetalObj"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyMetalPatch(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyMetalPatch(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "IsMetalNet"; } } [HarmonyPatch(typeof(ItemCharger))] internal class ItemChargerPatches { [HarmonyPrefix] [HarmonyPatch("ChargeItem")] private static bool InterruptChargeItem() { if (ItemChargerFailure.Instance.Active) { ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "CHARGING STATION FAILURE:\nINSUFFICIENT POWER"; HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } return true; } } [HarmonyPatch(typeof(JetpackItem))] internal class JetpackItemPatches { [HarmonyPostfix] [HarmonyPatch("Update")] private static void PreventItemActivation(JetpackItem __instance) { if (JetpackFailure.Instance.Active) { ((GrabbableObject)__instance).insertedBattery.empty = true; } } } public class kidnapperFoxNet : NetworkBehaviour { public static kidnapperFoxNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyKidnapperNet(); } instance = this; Net.Instance.SetKidnapperFoxNetServerRpc(active: true); } public static void DestroyKidnapperNet() { KidnapperFox.Active = false; GameObject val = GameObject.Find("KidnapperFoxNet"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyKidnapperNet(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyKidnapperNet(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "kidnapperFoxNet"; } } [HarmonyPatch] internal class LevelModifications { internal static List insideEnemies = new List(); internal static List outsideEnemies = new List(); internal static List daytimeEnemies = new List(); internal static List spawnableMapObjects = new List(); [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void onStartOfRoundStart() { if (Configuration.Initalized) { EventManager.forcedEvents.Clear(); UI.canClearText = true; EventManager.ExecuteOnGameStart(); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] private static void OnShipLeave() { EventManager.ExecuteOnShipLeave(); EventManager.currentEvents.Clear(); EventManager.sideEvents.Clear(); Net.Instance.ClearGameObjectsServerRpc(); Log.LogInfo("Restoring un-modified level enemy spawns on current level."); RoundManager.Instance.currentLevel.Enemies.Clear(); RoundManager.Instance.currentLevel.Enemies.AddRange(insideEnemies); RoundManager.Instance.currentLevel.OutsideEnemies.Clear(); RoundManager.Instance.currentLevel.OutsideEnemies.AddRange(outsideEnemies); RoundManager.Instance.currentLevel.DaytimeEnemies.Clear(); RoundManager.Instance.currentLevel.DaytimeEnemies.AddRange(daytimeEnemies); if (Compatibility.DawnLibPresent) { try { DawnLibHandling.OnEventEnd(); } catch { Log.LogWarning("Failed to restore DawnLib registry for hazards"); } } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "OnLocalDisconnect")] private static void OnLocalDisconnect() { EventManager.ExecuteOnLocalDisconnect(); if (Compatibility.HotBarPlusPresent) { HotBarPlusCompat.ResetHotbar(); } } public static void ResetValues(StartOfRound __instance) { //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)RoundManager.Instance).IsHost || __instance.currentLevel.levelID == 3) { return; } Manager.currentLevel = __instance.currentLevel; int levelIndex = Manager.GetLevelIndex(); Log.LogInfo($"Storing un-modified level paramaters on level:{((Object)__instance.currentLevel).name}"); insideEnemies.Clear(); insideEnemies.AddRange(__instance.currentLevel.Enemies); outsideEnemies.Clear(); outsideEnemies.AddRange(__instance.currentLevel.OutsideEnemies); daytimeEnemies.Clear(); daytimeEnemies.AddRange(__instance.currentLevel.DaytimeEnemies); Log.LogInfo("Resetting level values before changing."); __instance.currentLevel.spawnableMapObjects = Assets.spawnableMapObjects[levelIndex]; if (!Configuration.dontHandleSpawnCurves.Value) { __instance.currentLevel.enemySpawnChanceThroughoutDay.ClearKeys(); __instance.currentLevel.outsideEnemySpawnChanceThroughDay.ClearKeys(); __instance.currentLevel.daytimeEnemySpawnChanceThroughDay.ClearKeys(); Keyframe[] keys = Assets.insideSpawnChanceCurves[levelIndex].keys; foreach (Keyframe val in keys) { __instance.currentLevel.enemySpawnChanceThroughoutDay.AddKey(val); } Keyframe[] keys2 = Assets.outsideSpawnChanceCurves[levelIndex].keys; foreach (Keyframe val2 in keys2) { __instance.currentLevel.outsideEnemySpawnChanceThroughDay.AddKey(val2); } Keyframe[] keys3 = Assets.daytimeSpawnChanceCurves[levelIndex].keys; foreach (Keyframe val3 in keys3) { __instance.currentLevel.daytimeEnemySpawnChanceThroughDay.AddKey(val3); } } GrabbableLandmines.LandmineDisabled = false; foreach (MEvent @event in EventManager.events) { @event.Executed = false; } if (!Configuration.dontHandlePower.Value) { RoundManager.Instance.currentLevel.maxEnemyPowerCount = Assets.insideMaxPowerCounts[levelIndex]; RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount = Assets.outsideMaxPowerCounts[levelIndex]; RoundManager.Instance.currentLevel.maxDaytimeEnemyPowerCount = Assets.daytimeMaxPowerCounts[levelIndex]; } Manager.bonusEnemyHp = 0; Manager.spawnChanceMultiplier = 1f; Manager.spawncapMultipler = 1f; Manager.bonusMaxInsidePowerCount = 0; Manager.bonusMaxOutsidePowerCount = 0; try { Manager.currentLevel.factorySizeMultiplier = Assets.factorySizeMultiplierList[__instance.currentLevel.levelID]; } catch { Manager.currentLevel.factorySizeMultiplier = 1f; } Manager.scrapAmountMultiplier = 1f; Manager.scrapValueMultiplier = 1f; Manager.randomItemsToSpawnOutsideCount = 0; Manager.transmuteScrap = false; Manager.ScrapToTransmuteTo.Clear(); Manager.insideObjectsToSpawnOutside.Clear(); } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "waitForScrapToSpawnToSync")] public static void OnwaitForScrapToSpawnToSync(ref NetworkObjectReference[] spawnedScrap, ref int[] scrapValues) { //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) if (spawnedScrap.Length == 0) { return; } for (int i = 0; i < scrapValues.Length; i++) { if (Configuration.ExtraLogging.Value) { Log.LogDebug($"Old scrap value: {scrapValues[i]}"); } scrapValues[i] = (int)((float)scrapValues[i] * Manager.scrapValueMultiplier); if (Configuration.ExtraLogging.Value) { Log.LogDebug("New scrap value: " + scrapValues[i]); } } int num = (int)((float)spawnedScrap.Length * (Manager.scrapAmountMultiplier - 1f)); int num2 = 0; Manager.ScrapSpawnInfo scrapSpawnInfo = new Manager.ScrapSpawnInfo((NetworkObjectReference[])(object)new NetworkObjectReference[0], new int[0]); if (num >= 0) { scrapSpawnInfo = Manager.Spawn.DoSpawnScrapInside(num); } else { num2 = Mathf.Clamp(num * -1, 0, scrapValues.Length - 1); Log.LogInfo($"Removing {num2} scrap."); NetworkObject val = default(NetworkObject); for (int num3 = spawnedScrap.Length - 1; num3 >= spawnedScrap.Length - num2; num3--) { if (((NetworkObjectReference)(ref spawnedScrap[num3])).TryGet(ref val, (NetworkManager)null)) { val.Despawn(true); } } } Manager.ScrapSpawnInfo scrapSpawnInfo2 = Manager.Spawn.DoSpawnScrapOutside(Manager.randomItemsToSpawnOutsideCount); List list = new List(); List list2 = new List(); for (int j = 0; j < spawnedScrap.Length - num2; j++) { list.Add(spawnedScrap[j]); list2.Add(scrapValues[j]); } for (int k = 0; k < scrapSpawnInfo.netObjects.Length; k++) { list.Add(scrapSpawnInfo.netObjects[k]); list2.Add(scrapSpawnInfo.scrapPrices[k]); } for (int l = 0; l < scrapSpawnInfo2.netObjects.Length; l++) { list.Add(scrapSpawnInfo2.netObjects[l]); list2.Add(scrapSpawnInfo2.scrapPrices[l]); } spawnedScrap = list.ToArray(); scrapValues = list2.ToArray(); IncreaseApparaticeScrapValue(); if (!Manager.transmuteScrap) { return; } if (Manager.ScrapToTransmuteTo.Count == 0) { Log.LogError("ScrapToTransmuteTo Count is 0, returning."); return; } if (Manager.scrapTransmuteAmount.Count == 0) { Log.LogError("scrapTransmuteAmount Count is 0, returning."); return; } float num4 = 0f; foreach (float item in Manager.scrapTransmuteAmount) { num4 += item; } num4 /= (float)Manager.scrapTransmuteAmount.Count; Manager.scrapTransmuteAmount.Clear(); int num5 = Mathf.Clamp((int)((float)spawnedScrap.Length * num4) + 1, 1, spawnedScrap.Length); int num6 = 0; Log.LogInfo($"Transmuting {num5} scrap."); List list3 = new List(); NetworkObject val2 = default(NetworkObject); for (int m = 0; m < num5; m++) { if (((NetworkObjectReference)(ref spawnedScrap[m])).TryGet(ref val2, (NetworkManager)null)) { string text = ((Component)val2).GetComponent()?.itemProperties.itemName; if (Configuration.ExtraLogging.Value) { Log.LogInfo("Attempting to transmute scrap item: " + text); } if (!isIgnoredItem(text)) { list3.Add(((Component)val2).transform.position); val2.Despawn(true); num6++; } } } num5 = num6; List list4 = new List(); List list5 = new List(); for (int n = num5; n < spawnedScrap.Length; n++) { list4.Add(spawnedScrap[n]); list5.Add(scrapValues[n]); } List list6 = new List(); foreach (SpawnableItemWithRarity item2 in Manager.ScrapToTransmuteTo) { list6.Add(item2.rarity); } for (int num7 = 0; num7 < num5; num7++) { SpawnableItemWithRarity val3 = Manager.ScrapToTransmuteTo[RoundManager.Instance.GetRandomWeightedIndexList(list6, (Random)null)]; if ((Object)(object)val3.spawnableItem.spawnPrefab == (Object)null) { Log.LogWarning("chosenItem spawnPrefab is null, skipping entry."); continue; } GameObject val4 = Object.Instantiate(val3.spawnableItem.spawnPrefab, Vector3.zero, Quaternion.identity); GrabbableObject component = val4.GetComponent(); NetworkObject component2 = val4.GetComponent(); if ((Object)(object)component == (Object)null) { Log.LogWarning("chosenItem grabbableObject is null, skipping entry."); continue; } if ((Object)(object)component2 == (Object)null) { Log.LogWarning("chosenItem networkObject is null, skipping entry,"); continue; } ((Component)component).transform.position = list3[num7]; ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; int num8 = (int)((float)Random.Range(val3.spawnableItem.minValue, val3.spawnableItem.maxValue + 1) * RoundManager.Instance.scrapValueMultiplier * Manager.scrapValueMultiplier); list5.Add(num8); component.scrapValue = num8; component2.Spawn(false); list4.Add(NetworkObjectReference.op_Implicit(component2)); } spawnedScrap = list4.ToArray(); scrapValues = list5.ToArray(); } internal static bool isIgnoredItem(string itemNameToIgnore) { bool result = false; Log.LogInfo("Got item: " + itemNameToIgnore); string serializedValue = ((ConfigEntryBase)Configuration.transmutationBlacklist).GetSerializedValue(); string[] array = (string.IsNullOrEmpty(serializedValue) ? new string[0] : (from itemName in serializedValue.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries) select itemName.Trim()).ToArray()); if (Configuration.ExtraLogging.Value) { Log.LogInfo("List of items to ignore transmute: " + string.Join(", ", array)); } if (array.Contains(itemNameToIgnore)) { result = true; Log.LogInfo("Item is on list of items to ignore transmute. Skipping Transmute"); } return result; } private static void IncreaseApparaticeScrapValue() { //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)Net.Instance).IsServer) { return; } LungProp[] array = Object.FindObjectsOfType(); if (array.Length == 0 && (RoundManager.Instance.currentDungeonType == 0 || RoundManager.Instance.currentDungeonType == 3)) { Log.LogWarning("Could not find apparatice in facility interior to increase it's scrap value multiplier."); } LungProp[] array2 = array; foreach (LungProp val in array2) { Log.LogDebug($"LungProp stats: [isScrap: {((GrabbableObject)val).itemProperties.isScrap}] [isLungDocked: {val.isLungDocked}] " + $"[isLungPowered: {val.isLungPowered}] [hasBeenHeld: {((GrabbableObject)val).hasBeenHeld}] [isInShipRoom: {((GrabbableObject)val).isInShipRoom}] " + $"[isInElevator: {((GrabbableObject)val).isInElevator}] [name: {((Object)val).name}] [scrapname: {((GrabbableObject)val).itemProperties.itemName}] " + $"[currentDungeonType: {RoundManager.Instance.currentDungeonType}]"); if (((GrabbableObject)val).itemProperties.isScrap && val.isLungDocked && val.isLungPowered && !((GrabbableObject)val).hasBeenHeld && !((GrabbableObject)val).isInShipRoom && !((GrabbableObject)val).isInElevator) { ScanNodeProperties componentInChildren = ((Component)val).gameObject.GetComponentInChildren(); bool flag = componentInChildren.subText.Contains("???"); NetworkObject component = ((Component)val).GetComponent(); Net.Instance.SyncScrapValueServerRpc(NetworkObjectReference.op_Implicit(component), Mathf.RoundToInt((float)((GrabbableObject)val).scrapValue * Manager.scrapValueMultiplier)); if (flag) { componentInChildren.subText = "Value: ???"; } } } } } [HarmonyPatch(typeof(StartMatchLever))] internal class StartMatchLeverPatches { [HarmonyPrefix] [HarmonyPatch("PullLever")] private static bool InterruptPullLever(StartMatchLever __instance) { if (EventManager.sideEvents.Contains(LeverFailure.Instance)) { ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "SHIP CORE DEPLETION:\nAWAIT 12AM EMERGENCY AUTOPILOT"; HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); Net.Instance.SyncLeverTooltipServerRpc("[No power to hydraulics]"); return false; } if (LeverFailure.Instance.Active) { ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "SHIP LEVER HYDRAULICS JAM:\nAWAIT 12AM EMERGENCY AUTOPILOT"; HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); Net.Instance.SyncLeverTooltipServerRpc("[Hydraulics jammed]"); return false; } return true; } } [HarmonyPatch(typeof(ManualCameraRenderer))] internal class ManualCameraRendererPatches { [HarmonyPrefix] [HarmonyPatch("SwitchScreenButton")] private static bool InterruptSwitchScreenButton(ManualCameraRenderer __instance) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (ManualCameraFailure.Active) { __instance.offScreenMat.color = Color.black; return false; } return true; } [HarmonyPrefix] [HarmonyPatch("SwitchRadarTargetClientRpc")] private static bool InterruptSwitchCameraView(ManualCameraRenderer __instance) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (ManualCameraFailure.Active) { __instance.offScreenMat.color = Color.black; __instance.currentCameraDisabled = true; return false; } return true; } } public class MetalSwitchNet : NetworkBehaviour { public static MetalSwitchNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyMetalSwitchPatch(); } instance = this; Net.Instance.SetMetalSwitchNetServerRpc(active: true); } public static void DestroyMetalSwitchPatch() { MetalSwitch.Active = false; GameObject val = GameObject.Find("MetalSwitch"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyMetalSwitchPatch(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyMetalSwitchPatch(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "MetalSwitchNet"; } } public class ScanVanNet : NetworkBehaviour { public static ScanVanNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyCruiserFailure(); } instance = this; Net.Instance.CruiserFailureServerRpc(active: true); } public static void DestroyCruiserFailure() { CruiserFailure.Active = false; GameObject val = GameObject.Find("ScanVanFailure"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyCruiserFailure(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyCruiserFailure(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "ScanVanNet"; } } public class NotMetalNet : NetworkBehaviour { public static NotMetalNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyNotMetalPatch(); } instance = this; Net.Instance.SetMetalOffNetServerRpc(active: true); } public static void DestroyNotMetalPatch() { NotMetal.Active = false; GameObject val = GameObject.Find("NotMetal"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyNotMetalPatch(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroyNotMetalPatch(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "NotMetalNet"; } } [HarmonyPatch] internal class RealityShift { public static List shiftList = new List(); public static List shiftListValues = new List(); public static int normalScrapWeight = 85; public static int grabbableLandmineWeight = 15; public static float transmuteChance = 0.5f; public static float enemyTeleportChance = 0.1f; public static List ShiftableObjects = new List(); public static List shiftedObjects = new List(); public static MethodInfo grabObjectServerRpc = typeof(PlayerControllerB).GetMethod("GrabObjectServerRpc", BindingFlags.Instance | BindingFlags.NonPublic); public static MethodInfo firstEmptyItemSlot = typeof(PlayerControllerB).GetMethod("FirstEmptyItemSlot", BindingFlags.Instance | BindingFlags.NonPublic); public static MethodInfo setSpecialGrabAnimationBool = typeof(PlayerControllerB).GetMethod("SetSpecialGrabAnimationBool", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo grabObjectCoroutine = typeof(PlayerControllerB).GetField("grabObjectCoroutine", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo currentlyGrabbingObject = typeof(PlayerControllerB).GetField("currentlyGrabbingObject", BindingFlags.Instance | BindingFlags.NonPublic); public static bool invalidateGrab = false; [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")] public static void OnBeginGrabObject(ref PlayerControllerB __instance) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) if (!BrutalCompanyMinus.Minus.Events.RealityShift.Active || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, ref val2, __instance.grabDistance, 832) || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref val2)).collider).tag == "PhysicsProp") || __instance.twoHanded || __instance.sinkingValue > 0.73f) { return; } GrabbableObject component = ((Component)((RaycastHit)(ref val2)).collider).gameObject.GetComponent(); if (!((Object)(object)component != (Object)null) || !((Object)(object)((NetworkBehaviour)component).NetworkObject != (Object)null) || (int)firstEmptyItemSlot.Invoke(__instance, new object[1] { component }) == -1) { return; } foreach (int shiftableObject in ShiftableObjects) { if (shiftableObject == ((Object)((Component)component).gameObject).GetInstanceID() && Random.Range(0f, 1f) <= transmuteChance) { invalidateGrab = true; Net.Instance.ShiftServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component).NetworkObject)); ((MonoBehaviour)__instance).StopCoroutine(GrabShiftedObject(__instance)); ((MonoBehaviour)__instance).StartCoroutine(GrabShiftedObject(__instance)); break; } } } [HarmonyPrefix] [HarmonyPatch(typeof(EnemyAI), "HitEnemy")] private static void OnHitEnemy(ref EnemyAI __instance) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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) if (!BrutalCompanyMinus.Minus.Events.RealityShift.Active || !NetworkManager.Singleton.IsServer || (Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).transform == (Object)null) { return; } Random random = new Random(Net.Instance._seed++); if (random.NextDouble() <= (double)enemyTeleportChance) { Vector3 randomNavMeshPositionInBox = Helper.GetRandomNavMeshPositionInBox(((Component)__instance).transform.position, 15f, 25f); NetworkObject val = default(NetworkObject); if (((Component)__instance).TryGetComponent(ref val)) { Net.Instance.TeleportEnemyServerRpc(NetworkObjectReference.op_Implicit(val), randomNavMeshPositionInBox); } } } public static IEnumerator GrabShiftedObject(PlayerControllerB instance) { yield return (object)new WaitUntil((Func)(() => shiftedObjects.Count > 0)); NetworkObject networkObject = null; NetworkObjectReference targetRef; lock (shiftedObjects) { if (shiftedObjects.Count == 0) { Log.LogError("No shifted objects found in GrabShiftedObject()"); yield break; } targetRef = shiftedObjects[0]; shiftedObjects.RemoveAt(0); } if (!((NetworkObjectReference)(ref targetRef)).TryGet(ref networkObject, (NetworkManager)null) || (Object)(object)networkObject == (Object)null) { Log.LogError("Null network object in GrabShiftedObject()"); yield break; } GrabbableObject newObject = ((Component)networkObject).GetComponent(); currentlyGrabbingObject.SetValue(instance, newObject); if ((int)firstEmptyItemSlot.Invoke(instance, new object[1] { newObject }) == -1) { yield break; } newObject.InteractItem(); if (newObject.grabbable) { instance.playerBodyAnimator.SetBool("GrabInvalidated", false); instance.playerBodyAnimator.SetBool("GrabValidated", false); instance.playerBodyAnimator.SetBool("cancelHolding", false); instance.playerBodyAnimator.ResetTrigger("Throw"); setSpecialGrabAnimationBool.Invoke(instance, new object[2] { true, null }); instance.isGrabbingObjectAnimation = true; ((Behaviour)instance.cursorIcon).enabled = false; ((TMP_Text)instance.cursorTip).text = ""; instance.twoHanded = newObject.itemProperties.twoHanded; instance.carryWeight += Mathf.Clamp(newObject.itemProperties.weight - 1f, 0f, 10f); if (newObject.itemProperties.grabAnimationTime > 0f) { instance.grabObjectAnimationTime = newObject.itemProperties.grabAnimationTime; } else { instance.grabObjectAnimationTime = 0.4f; } if (grabObjectCoroutine.GetValue(instance) != null) { ((MonoBehaviour)instance).StopCoroutine("GrabObject"); } grabObjectCoroutine.SetValue(instance, ((MonoBehaviour)instance).StartCoroutine("GrabObject")); } grabObjectServerRpc.Invoke(instance, new object[1] { targetRef }); } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] public static void OnGrabObjectClientRpc() { lock (shiftedObjects) { shiftedObjects.Clear(); } } [HarmonyPrefix] [HarmonyPriority(0)] [HarmonyPatch(typeof(RoundManager), "waitForScrapToSpawnToSync")] public static void OnwaitForScrapToSpawnToSync(ref NetworkObjectReference[] spawnedScrap) { if (!BrutalCompanyMinus.Minus.Events.RealityShift.Active) { return; } shiftList.Clear(); shiftListValues.Clear(); Net.Instance.GenerateShiftableObjectsListServerRpc(spawnedScrap); List list = new List(); foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (item != null) { list.Add(item.rarity); } else { list.Add(0); } } for (int i = 0; i < ShiftableObjects.Count; i++) { int num = StartOfRound.Instance.randomMapSeed + i; Random random = new Random(num); Random.InitState(num); Item val = RoundManager.Instance.currentLevel.spawnableScrap[RoundManager.Instance.GetRandomWeightedIndexList(list, random)].spawnableItem; int num2 = RoundManager.Instance.GetRandomWeightedIndex(new int[2] { normalScrapWeight, grabbableLandmineWeight }, random); if ((Object)(object)val.spawnPrefab == (Object)null || (Object)(object)val.spawnPrefab.GetComponent() == (Object)null) { num2 = 1; } if (num2 == 1) { val = Assets.grabbableLandmine; } shiftList.Add(val.spawnPrefab); shiftListValues.Add((int)((float)Random.Range(val.minValue, val.maxValue + 1) * RoundManager.Instance.scrapValueMultiplier * Manager.scrapValueMultiplier)); } } } internal class GrabObjectTranspiler { [HarmonyTranspiler] [HarmonyPatch(typeof(PlayerControllerB), "BeginGrabObject")] private static IEnumerable OnBeginGrabIL(IEnumerable instructions, ILGenerator il) { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown List list = new List(instructions); int num = -1; object obj = null; for (int i = 0; i < list.Count; i++) { if (num == -1 && list[i].opcode == OpCodes.Ldfld && list[i + 1].opcode == OpCodes.Callvirt && list[i + 2].opcode == OpCodes.Callvirt && list[i + 3].opcode == OpCodes.Newobj && list[i + 4].opcode == OpCodes.Stfld) { num = i + 5; } if (list[i].opcode == OpCodes.Brfalse) { obj = list[i].operand; break; } } if (num != -1 && obj != null) { list.Insert(num, new CodeInstruction(OpCodes.Brtrue, obj)); list.Insert(num, new CodeInstruction(Transpilers.EmitDelegate>((Func)delegate { if (RealityShift.invalidateGrab) { RealityShift.invalidateGrab = false; return true; } return false; }))); } else { Log.LogError("Failed to patch BeginGrabObject()"); } Log.LogDebug("Patched Section PlayerControllerB.BeginGrabObject()"); for (int num2 = 0; num2 < num + 4; num2++) { string text = ""; string text2 = ""; foreach (Label label in list[num2].labels) { text += list[num2].labels; } if (num2 == num || num2 == num + 1) { text2 = "-> "; } } return list.AsEnumerable(); } } [HarmonyPatch] internal class SafeOutside { [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "AssignRandomEnemyToVent")] private static void OnAssignRandomEnemyToVent(ref RoundManager __instance) { if (BrutalCompanyMinus.Minus.Events.SafeOutside.Active) { __instance.currentMaxOutsidePower = 0f; } } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "Start")] private static void OnEnemyAIStart(ref EnemyAI __instance) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (BrutalCompanyMinus.Minus.Events.SafeOutside.Active) { GameObject terrainObject = Manager.terrainObject; float num = -100f; if ((Object)(object)terrainObject != (Object)null) { num = terrainObject.transform.position.y - 100f; } if (((Component)__instance).transform.position.y > num) { ((MonoBehaviour)__instance).StartCoroutine(DestroyEnemyAI(__instance)); } } } private static IEnumerator DestroyEnemyAI(EnemyAI ai) { yield return (object)new WaitForSeconds(0.1f); NetworkObject netObj = ((Component)ai).GetComponent(); if ((Object)(object)netObj != (Object)null) { netObj.Despawn(true); } else { Log.LogError("Failed to capture enemyAI networkobject while safeOutside is active"); } } } [HarmonyPatch] [HarmonyPatch(typeof(ItemDropship))] internal class ShipmentFees { private static int due; [HarmonyPrefix] [HarmonyPatch("LandShipOnServer")] private static void OnShipment() { if (due > 0 && Manager.currentTerminal.groupCredits > 0) { HUDManager.Instance.AddTextToChatOnServer("Due payment.", -1); int groupCredits = due; if (Manager.currentTerminal.groupCredits - due < 0) { groupCredits = Manager.currentTerminal.groupCredits; } Manager.PayCredits(-groupCredits); due -= groupCredits; HUDManager.Instance.AddTextToChatOnServer($"New Due balance: {due}", -1); } if (!BrutalCompanyMinus.Minus.Events.ShipmentFees.Active) { return; } MEvent instance = BrutalCompanyMinus.Minus.Events.ShipmentFees.Instance; float num = instance.Getf(MEvent.ScaleType.MinCut); float num2 = instance.Getf(MEvent.ScaleType.MaxCut); int num3 = 0; foreach (int item in Manager.currentTerminal.orderedItemsFromTerminal) { Item val = Manager.currentTerminal.buyableItemsList[item]; num3 += (int)((float)val.creditsWorth * Random.Range(num, num2)); } if (Manager.currentTerminal.groupCredits - num3 < 0) { due += num3 - Manager.currentTerminal.groupCredits; num3 = Manager.currentTerminal.groupCredits; HUDManager.Instance.AddTextToChatOnServer($"Since you lack credits to pay the full fee, you will be due {due} on the next shipment.", -1); } Manager.PayCredits(-num3); } } public class SlimeInsideNet : NetworkBehaviour { public static SlimeInsideNet instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroySlime(); } instance = this; Net.Instance.SetSlimeServerRpc(active: true); } public static void DestroySlime() { SlimeInside.Active = false; GameObject val = GameObject.Find("SlimeInsideObj"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroySlime(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyForGodsSake() { DestroySlime(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "SlimeInsideNet"; } } [HarmonyPatch(typeof(ShipTeleporter))] internal class ShipTeleporterPatches { [HarmonyPrefix] [HarmonyPatch("PressTeleportButtonOnLocalClient")] private static bool InterruptPressTeleportButton(ShipTeleporter __instance) { if (TeleporterFailure.Instance.Active) { __instance.buttonAnimator.SetTrigger("press"); __instance.buttonAudio.PlayOneShot(__instance.buttonPressSFX); return false; } return true; } [HarmonyPostfix] [HarmonyPatch("PressTeleportButtonOnLocalClient")] private static void RandomizePressTeleportButton() { if (TargetingFailureEvent.Instance.Active) { PlayerControllerB[] array = (from player in Object.FindObjectsByType((FindObjectsSortMode)0) where player.isPlayerControlled select player).ToArray(); if (array.Length != 0) { StartOfRound.Instance.mapScreen.targetedPlayer = array[Random.Range(0, array.Length)]; } } } } [HarmonyPatch(typeof(Terminal))] internal class TerminalPatches { [HarmonyPrefix] [HarmonyPatch("OnSubmit")] private static bool BlockMoonConfirmNode() { if (TerminalFailure.Instance.Active) { HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } return true; } } [HarmonyPatch] public class TerminalCommands { public class MCommand { public string command; public string tag; public string shortinfo; public string info; public Action execute; } private static string response = ""; private static bool _clearPreviousText = true; public static List mCommands = new List { new MCommand { command = "MHELP", shortinfo = "Provides help information for commands.", info = "MHELP [Command]\n Command - displays help information on that command.", execute = delegate(string[] arguments) { if (arguments.Length == 0) { string text = "To display extra information about a particular command use MHELP [Command]\n\n"; foreach (MCommand mCommand in mCommands) { text = text + mCommand.command.PadRight(10) + mCommand.shortinfo + "\n\n"; } Respond(text); } else { bool flag = false; foreach (MCommand mCommand2 in mCommands) { if (!(mCommand2.command != arguments[0].ToUpper())) { Respond(mCommand2.shortinfo + "\n\n" + mCommand2.info); flag = true; break; } } if (!flag) { Respond(arguments[0] + " is not a command."); } } } }, new MCommand { command = "MEVENT", tag = "SERVER", shortinfo = "Forces a mEvent to occur for next day.", info = "MEVENT [mEvent]\n mEvent - the name of said event.\n\nMEVENT [mEvent 1] [mEvent 2] ... [mEvent n]\n this can take multiple events.", execute = delegate(string[] arguments) { if (Configuration.speedrunMode.Value) { Respond("MEVENT command is disabled in speedrun mode."); } else if (arguments.Length == 0) { Respond("MEVENT command is missing argument(s)."); } else { string text = ""; foreach (string text2 in arguments) { if (!Utility.IsNullOrWhiteSpace(text2)) { bool flag = false; string upperArg = text2.ToUpper(); foreach (MEvent @event in EventManager.events) { bool flag2 = upperArg == @event.Name().ToUpper(); bool flag3 = @event.Aliases != null && @event.Aliases.Any((string alias) => alias.ToUpper() == upperArg); if (flag2 || flag3) { flag = true; text = text + @event.Name() + " will now be forced to occur.\n"; EventManager.forcedEvents.Add(@event); break; } } if (!flag) { text = text + "Failed to find " + text2 + " in events.\n"; } } } text = text + "\nCurrent forced events = [" + Helper.StringsToList(EventManager.forcedEvents.Select((MEvent n) => n.Name()).ToList(), ",") + "]"; Respond(text); } } }, new MCommand { command = "MCLEAR", tag = "SERVER", shortinfo = "Clears the forced event list.", info = "MCLEAR\n Clears the forced event list from MEVENT.", execute = delegate { if (Configuration.speedrunMode.Value) { Respond("MCLEAR command is disabled in speedrun mode."); } else { EventManager.forcedEvents.Clear(); Respond("Cleared forced event list\n\nCurrent forced events = [" + Helper.StringsToList(EventManager.forcedEvents.Select((MEvent n) => n.Name()).ToList(), ",") + "]"); } } }, new MCommand { command = "MEVENTS", tag = "SERVER", shortinfo = "Displays all events.", info = "MEVENTS\n This will display all events, excluding disabled ones and modded ones where said mod isn't present.\n\nMEVENTS [Name]\n Displays properties of said event.", execute = delegate(string[] arguments) { if (arguments.Length == 0) { foreach (MEvent event2 in EventManager.events) { if (event2.isSpecialEvent) { EventManager.allSpecial.Add(event2); } if (event2.isBetaEvent) { EventManager.allBeta.Add(event2); } } string text = "To display extra information about a particular event, use\nMEVENTS [Name]\n\n"; text += "[Rare] events:\n"; text += Helper.StringsToList(EventManager.allRare.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Very Good] events:\n"; text += Helper.StringsToList(EventManager.allVeryGood.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Good] events:\n"; text += Helper.StringsToList(EventManager.allGood.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Neutral] events:\n"; text += Helper.StringsToList(EventManager.allNeutral.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Bad] events:\n"; text += Helper.StringsToList(EventManager.allBad.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[VeryBad] events:\n"; text += Helper.StringsToList(EventManager.allVeryBad.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Insane] events:\n"; text += Helper.StringsToList(EventManager.allInsane.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Remove] events:\n"; text += Helper.StringsToList(EventManager.allRemove.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n\n[Special] events:\n"; text += Helper.StringsToList(EventManager.allSpecial.Select((MEvent n) => n.Name()).ToList(), ", "); text += "\n\n[Beta] events:\n"; text += Helper.StringsToList(EventManager.allBeta.Select((MEvent n) => n.Name()).ToList(), ", "); Respond(text); EventManager.allSpecial.Clear(); EventManager.allBeta.Clear(); } else if (!Utility.IsNullOrWhiteSpace(arguments[0])) { bool flag = false; foreach (MEvent event3 in EventManager.events) { if (event3.Name().ToUpper() == arguments[0].ToUpper()) { flag = true; string text2 = "[" + event3.Name() + "]:\n\n"; text2 += $"[ColorHex]: {event3.ColorHex}\n[Weight]: {event3.Weight}\n[Type]: {event3.Type}\n\n"; text2 = text2 + "[Descriptions]: " + Helper.StringsToList(event3.Descriptions, "|") + "\n\n"; text2 = text2 + "[Aliases]: " + Helper.StringsToList(event3.Aliases, ", ") + "\n\n"; text2 = text2 + "[EventsToRemove]: " + Helper.StringsToList(event3.EventsToRemove, ", ") + "\n\n"; text2 = text2 + "[EventsToSpawnWith]: " + Helper.StringsToList(event3.EventsToSpawnWith, ", ") + "\n\n"; text2 = text2 + "[EventEnabled]: " + event3.Enabled + "\n\n"; text2 = text2 + "[IsSpecialEvent]: " + event3.isSpecialEvent + "\n\n"; text2 = text2 + "[IsBetaEvent]: " + event3.isBetaEvent + "\n\n"; text2 = text2 + "[WhitelistMode]: " + event3.MoonMode + "\n\n"; text2 = text2 + "[MoonsToNotSpawnOn]: " + Helper.StringsToList(event3.Blacklist, ", ") + "\n\n"; text2 = text2 + "[MoonsToSpawnOn]: " + Helper.StringsToList(event3.Whitelist, ", ") + "\n\n"; text2 = text2 + "[SpeedRunSafe]: " + event3.SpeedRunSafe + "\n\n"; text2 += "[ScaleList]: \n"; foreach (KeyValuePair scale in event3.ScaleList) { text2 = text2 + ScaleTypePadded(scale.Key) + " " + Helper.GetStringFromScale(scale.Value) + "\n"; } text2 += "\n[MonsterEvents]:\n"; foreach (MEvent.MonsterEvent item in event3.monstersToSpawn) { text2 = text2 + "\n" + ((Object)item.enemy).name + "\n"; text2 = text2 + ScaleTypePadded(MEvent.ScaleType.InsideEnemyRarity) + Helper.GetStringFromScale(item.insideSpawnRarity) + "\n"; text2 = text2 + ScaleTypePadded(MEvent.ScaleType.OutsideEnemyRarity) + Helper.GetStringFromScale(item.outsideSpawnRarity) + "\n"; text2 = text2 + ScaleTypePadded(MEvent.ScaleType.MinInsideEnemy) + Helper.GetStringFromScale(item.minInside) + "\n"; text2 = text2 + ScaleTypePadded(MEvent.ScaleType.MaxInsideEnemy) + Helper.GetStringFromScale(item.maxInside) + "\n"; text2 = text2 + ScaleTypePadded(MEvent.ScaleType.MinOutsideEnemy) + Helper.GetStringFromScale(item.minOutside) + "\n"; text2 = text2 + ScaleTypePadded(MEvent.ScaleType.MaxOutsideEnemy) + Helper.GetStringFromScale(item.maxOutside) + "\n"; } text2 += "\n[TransmutationEvent]:\n"; SpawnableItemWithRarity[] items = event3.scrapTransmutationEvent.items; foreach (SpawnableItemWithRarity val in items) { text2 += $"[Item]: {((Object)val.spawnableItem).name.PadRight(18)} [Rarity]: {val.rarity}\n"; } Respond(text2); break; } } if (!flag) { Respond("Failed to find event " + arguments[0] + " in events list."); } } } }, new MCommand { command = "MPAY", tag = "SERVER", shortinfo = "Adds or subtracts credits.", info = "MPAY [Amount]\n Amount is the quantity of credits added or subtracted.", execute = delegate(string[] arguments) { int result; if (arguments.Length == 0) { Respond("MPAY command is missing argument(s)."); } else if (Configuration.speedrunMode.Value) { Respond("MPAY command is disabled in speedrun mode."); } else if (int.TryParse(arguments[0], out result)) { Manager.PayCredits(result); Respond("Added " + arguments[0] + " credits."); } else { Respond(arguments[0] + " is not an acceptable value, must be int32."); } } }, new MCommand { command = "MENEMIES", tag = "SERVER", shortinfo = "Displays all enemies.", info = "MENEMIES\n Will display the names of every enemy grabbed by this mod.", execute = delegate { int num = 0; string text = ""; foreach (string key in Assets.EnemyList.Keys) { num++; text = ((num % 2 != 0) ? (text + key.PadRight(23)) : (text + " " + key + "\n")); } Respond(text); } }, new MCommand { command = "MITEMS", tag = "SERVER", shortinfo = "Displays all items.", info = "MITEMS\n Will display the names of every item grabbed by this mod.", execute = delegate { int num = 0; string text = ""; foreach (string key2 in Assets.ItemList.Keys) { num++; text = ((num % 2 != 0) ? (text + key2.PadRight(23)) : (text + " " + key2 + "\n")); } Respond(text); } }, new MCommand { command = "MMOONS", tag = "SERVER", shortinfo = "Displays all moons.", info = "MMOONS\n This will display the names of every moon\nMMOONS [name/id]\n This will dump all information about said moon into the console.", execute = delegate(string[] arguments) { //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_0309: 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_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_09c9: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: Unknown result type (might be due to invalid IL or missing references) //IL_0a48: Unknown result type (might be due to invalid IL or missing references) //IL_0abd: Unknown result type (might be due to invalid IL or missing references) //IL_0ac2: Unknown result type (might be due to invalid IL or missing references) if (arguments.Length == 0) { string text = "To display extra information about a particular moon, use\nMOONS [name/id]\n Use moon name or ID\n\n"; SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { text += $"{val.levelID}:{((Object)val).name}\n"; } Respond(text); } else { int result = -42; try { int.TryParse(arguments[0], out result); } catch { result = -42; } SelectableLevel[] levels2 = StartOfRound.Instance.levels; foreach (SelectableLevel val2 in levels2) { if (!((Object)(object)val2 != (Object)null) || !(((Object)val2).name.ToUpper() != arguments[0].ToUpper()) || val2.levelID == result) { Respond("All moon info about " + ((Object)val2).name + " has been dumped into the console."); string text2 = "\n\n--------------------------------------------------------------------------------------"; text2 = text2 + "\nName: " + ((Object)val2).name; text2 = text2 + "\nScene Name: " + val2.sceneName; text2 += $"\nLevel ID: {val2.levelID}"; text2 += $"\nLocked For Demo: {val2.lockedForDemo}"; text2 += $"\nSpawn Enemies And Scrap: {val2.spawnEnemiesAndScrap}"; text2 = text2 + "\nPlanet Name: " + val2.PlanetName; text2 = text2 + "\nLevel Description: " + val2.LevelDescription; text2 = text2 + "\nRisk Level: " + val2.riskLevel; text2 += $"\nTime To Arrive: {val2.timeToArrive}"; text2 += $"\nOffset From Global Time: {val2.OffsetFromGlobalTime}"; text2 += $"\nDay Speed Multiplier: {val2.DaySpeedMultiplier}"; text2 += $"\nPlanet Has Time: {val2.planetHasTime}"; if (val2.randomWeathers != null) { text2 += "\nRandom Weather With Variables:"; RandomWeatherWithVariables[] randomWeathers = val2.randomWeathers; foreach (RandomWeatherWithVariables val3 in randomWeathers) { text2 += $"\n WeatherType:{val3.weatherType}:\n WeatherVariable: {val3.weatherVariable}\n WeatherVariable2: {val3.weatherVariable2}"; } } text2 += $"\nOverride Weather: {val2.overrideWeather}"; text2 += $"\nOverride Weather Type: {val2.overrideWeatherType}"; text2 += $"\nCurrent Weather: {val2.currentWeather}"; text2 += $"\nFactory Size Multiplier: {val2.factorySizeMultiplier}"; if (val2.dungeonFlowTypes != null) { text2 += "\nDungeon Flow Types:"; IntWithRarity[] dungeonFlowTypes = val2.dungeonFlowTypes; foreach (IntWithRarity val4 in dungeonFlowTypes) { text2 += $"\n ID:{val4.id}, Rarity:{val4.rarity}"; } } if (val2.spawnableMapObjects != null) { text2 += "\nSpawnable Map Objects:"; SpawnableMapObject[] spawnableMapObjects = val2.spawnableMapObjects; foreach (SpawnableMapObject val5 in spawnableMapObjects) { text2 += $"\n Prefab Name: {((Object)val5.prefabToSpawn).name}\n Spawn Facing Away From Wall: {val5.spawnFacingAwayFromWall}, \n Spawn Facing Wall: {val5.spawnFacingWall}\n Spawn With Back To Wall: {val5.spawnWithBackToWall}\n Spawn With Back Flush Against Wall: {val5.spawnWithBackFlushAgainstWall}\n Require Distance Between Spawns: {val5.requireDistanceBetweenSpawns}\n Disallow Spawning Near Entrances: {val5.disallowSpawningNearEntrances}"; if (val5.numberToSpawn != null) { text2 += "\n Number To Spawn:"; Keyframe[] keys = val5.numberToSpawn.keys; for (int n = 0; n < keys.Length; n++) { Keyframe val6 = keys[n]; text2 += $"\n Time: {((Keyframe)(ref val6)).time}, Value: {((Keyframe)(ref val6)).value}"; } } } } if (val2.spawnableOutsideObjects != null) { text2 += "\nSpawnable Outside Objects:"; SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val2.spawnableOutsideObjects; foreach (SpawnableOutsideObjectWithRarity val7 in spawnableOutsideObjects) { SpawnableOutsideObject spawnableObject = val7.spawnableObject; text2 += $"\n Prefab Name: {((Object)spawnableObject.prefabToSpawn).name}\n Spawn Facing Away from Wall: {spawnableObject.spawnFacingAwayFromWall}\n Object Width: {spawnableObject.objectWidth}"; if (spawnableObject.spawnableFloorTags != null) { text2 = text2 + "\n Spawnable Floor Tags: " + Helper.StringsToList(spawnableObject.spawnableFloorTags.ToList(), ","); } if (val7.randomAmount != null) { text2 += "\n Random Amount:"; Keyframe[] keys2 = val7.randomAmount.keys; for (int num2 = 0; num2 < keys2.Length; num2++) { Keyframe val8 = keys2[num2]; text2 += $"\n Time: {((Keyframe)(ref val8)).time}, Value: {((Keyframe)(ref val8)).value}"; } } } } if (val2.spawnableScrap != null) { text2 += "\nSpawnable Scrap:"; foreach (SpawnableItemWithRarity item2 in val2.spawnableScrap) { if (item2 != null && !((Object)(object)item2.spawnableItem == (Object)null)) { text2 += $"\n Name: {((Object)item2.spawnableItem).name}, Rarity: {item2.rarity}"; } } } text2 += $"\nMin Scrap: {val2.minScrap}"; text2 += $"\nMax Scrap: {val2.maxScrap}"; text2 += $"\nMin Total Scrap Value: {val2.minTotalScrapValue}"; text2 += $"\nMax Total Scrap Value: {val2.maxTotalScrapValue}"; text2 += $"\nMax Enemy Power Count: {val2.maxEnemyPowerCount}"; text2 += $"\nMax Outside Enemy Power Count: {val2.maxOutsideEnemyPowerCount}"; text2 += $"\nMax Daytime Enemy Power Count: {val2.maxDaytimeEnemyPowerCount}"; if (val2.Enemies != null) { text2 += "\nEnemies:"; foreach (SpawnableEnemyWithRarity enemy in val2.Enemies) { if (enemy != null && !((Object)(object)enemy.enemyType == (Object)null)) { text2 += $"\n Enemy: {((Object)enemy.enemyType).name}, Rarity: {enemy.rarity}"; } } } if (val2.OutsideEnemies != null) { text2 += "\nOutside Enemies:"; foreach (SpawnableEnemyWithRarity outsideEnemy in val2.OutsideEnemies) { if (outsideEnemy != null && !((Object)(object)outsideEnemy.enemyType == (Object)null)) { text2 += $"\n Enemy: {((Object)outsideEnemy.enemyType).name}, Rarity: {outsideEnemy.rarity}"; } } } if (val2.DaytimeEnemies != null) { text2 += "\nDaytime Enemies:"; foreach (SpawnableEnemyWithRarity daytimeEnemy in val2.DaytimeEnemies) { if (daytimeEnemy != null && !((Object)(object)daytimeEnemy.enemyType == (Object)null)) { text2 += $"\n Enemy: {((Object)daytimeEnemy.enemyType).name}, Rarity: {daytimeEnemy.rarity}"; } } } text2 += "\nEnemy Spawn Chance Throughout Day:"; if (val2.enemySpawnChanceThroughoutDay != null) { Keyframe[] keys3 = val2.enemySpawnChanceThroughoutDay.keys; for (int num3 = 0; num3 < keys3.Length; num3++) { Keyframe val9 = keys3[num3]; text2 += $"\n Time: {((Keyframe)(ref val9)).time}, Value: {((Keyframe)(ref val9)).value}"; } } text2 += "\nOutside Enemy Spawn Chance Throughout Day:"; if (val2.outsideEnemySpawnChanceThroughDay != null) { Keyframe[] keys4 = val2.outsideEnemySpawnChanceThroughDay.keys; for (int num4 = 0; num4 < keys4.Length; num4++) { Keyframe val10 = keys4[num4]; text2 += $"\n Time: {((Keyframe)(ref val10)).time}, Value: {((Keyframe)(ref val10)).value}"; } } text2 += "\nDaytime Enemy Spawn Chance Throughout Day:"; if (val2.daytimeEnemySpawnChanceThroughDay != null) { Keyframe[] keys5 = val2.daytimeEnemySpawnChanceThroughDay.keys; for (int num5 = 0; num5 < keys5.Length; num5++) { Keyframe val11 = keys5[num5]; text2 += $"\n Time: {((Keyframe)(ref val11)).time}, Value: {((Keyframe)(ref val11)).value}"; } } text2 += $"\nSpawn Probability Range: {val2.spawnProbabilityRange}"; text2 += $"\nDaytime Enemies Probability Range: {val2.daytimeEnemiesProbabilityRange}"; text2 += $"\nLevel Includes Snow Footprints: {val2.levelIncludesSnowFootprints}"; text2 = text2 + "\nLevel Icon String: " + val2.levelIconString; text2 += "\n--------------------------------------------------------------------------------------\n"; Console.WriteLine(text2); break; } } } } }, new MCommand { command = "MSCAN", shortinfo = "Provides a scan of all the items that are not on ship", info = "MSCAN [Command]\n Command - Provides an accurate scan on all items not on ship.", execute = delegate(string[] arguments) { if (arguments.Length >= 0) { string text = ""; int num = 0; int num2 = 0; GrabbableObject[] array = Object.FindObjectsOfType(); GrabbableObject[] array2 = array; foreach (GrabbableObject val in array2) { if ((Object)(object)val != (Object)null && val.itemProperties.isScrap && !val.isInElevator && !val.isInShipRoom) { num++; num2 += val.scrapValue; } } text += $"There are {num} items outside the ship, totaling a total of {num2} altogether."; Respond(text); } } }, new MCommand { command = "MHAZARDS", tag = "SERVER", shortinfo = "Displays all HAZARDS.", info = "MHAZARDS\n Will display the names of every Hazard grabbed by this mod.", execute = delegate { int num = 0; string text = ""; SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { SpawnableMapObject[] spawnableMapObjects = val.spawnableMapObjects; foreach (SpawnableMapObject val2 in spawnableMapObjects) { num++; text = ((num % 2 != 0) ? (text + ((Object)val2.prefabToSpawn).name.PadRight(23)) : (text + " " + ((Object)val2.prefabToSpawn).name + "\n")); } text += "\n"; SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val.spawnableOutsideObjects; foreach (SpawnableOutsideObjectWithRarity val3 in spawnableOutsideObjects) { num++; text = ((num % 2 != 0) ? (text + ((Object)val3.spawnableObject.prefabToSpawn).name.PadRight(23)) : (text + " " + ((Object)val3.spawnableObject.prefabToSpawn).name + "\n")); } } Respond(text); } } }; public static string ScaleTypePadded(MEvent.ScaleType type) { return $"[{type}]:".PadRight(23); } public static void Respond(string text, bool clearPreviousText = true) { Log.LogInfo(text); response = text; _clearPreviousText = clearPreviousText; } [HarmonyPostfix] [HarmonyPatch(typeof(Terminal), "ParsePlayerSentence")] private static void OnParsePlayerSentence(ref Terminal __instance, ref TerminalNode __result) { if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.screenText == (Object)null) { Log.LogError("Instance is null."); return; } try { string text = __instance.screenText.text; int textAdded = __instance.textAdded; int length = text.Length; int num = length - textAdded; string[] array = text.Substring(num, length - num).Split(" "); if (array.Length == 0) { return; } string text2 = array[0].ToUpper(); string[] array2 = ((array.Length > 1) ? array[1..] : Array.Empty()); if (Configuration.ExtraLogging.Value) { Log.LogDebug("MCommand Detected: " + text2 + " with arguments: " + string.Join(", ", array2)); } if (Configuration.handleScanCommand.Value && text2.ToLower() == "scan") { text2 = "mscan"; } foreach (MCommand mCommand in mCommands) { Log.LogDebug("Checking command: " + mCommand.command); if (string.Equals(mCommand.command, text2, StringComparison.OrdinalIgnoreCase)) { Log.LogDebug("Command " + mCommand.command + " matched a valid mCommand."); if (!NetworkManager.Singleton.IsServer && string.Equals(mCommand.tag, "server", StringComparison.OrdinalIgnoreCase)) { Log.LogDebug("Command " + mCommand.command + " is a server-only command. Ignoring execution."); return; } try { mCommand.execute(array2); } catch (Exception arg) { Log.LogError($"An error occurred while executing command {mCommand.command}: {arg}"); Respond("An error occurred trying to process the command."); } Log.LogDebug("Response: " + response); } } if (!Utility.IsNullOrWhiteSpace(response)) { __result = ScriptableObject.CreateInstance(); __result.displayText = response + "\n\n"; __result.clearPreviousText = _clearPreviousText; response = ""; } } catch (Exception arg2) { Log.LogError($"An error occurred while tryingt to process an mcommand {arg2}"); Respond("An error occurred trying to process the command."); } } } [HarmonyPatch(typeof(WalkieTalkie))] internal class WalkieTalkiePatches { [HarmonyPrefix] [HarmonyPatch("ItemActivate")] private static bool InterruptItemActivate(WalkieTalkie __instance) { if (WalkieFailure.Instance.Active) { __instance.thisAudio.PlayOneShot(__instance.playerDieOnWalkieTalkieSFX); ((GrabbableObject)__instance).UseUpBatteries(); return false; } return true; } } internal class _EnemyAI { [HarmonyPostfix] [HarmonyPatch("MeetsStandardPlayerCollisionConditions")] private static void OnMeetsStandardPlayerCollisionConditions(ref PlayerControllerB __result, ref Collider other, ref EnemyType ___enemyType, ref bool ___isEnemyDead, ref bool inKillAnimation, ref float ___stunNormalizedTimer) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && !___isEnemyDead && ___stunNormalizedTimer < 0f && !inKillAnimation && (Object)(object)__result == (Object)null && component.actualClientId == GameNetworkManager.Instance.localPlayerController.actualClientId) { __result = component; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchEnemyStart(Harmony harmony) { ApplyEnemyStart(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPostfix] public static void ApplyEnemyStart(Harmony harmony) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(EnemyAI), "Start", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(_EnemyAI), "OnStart", (Type[])null, (Type[])null); if (methodInfo != null && methodInfo2 != null) { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.LogInfo("Successfully patched EnemyAI"); } else { Log.LogError("Failed to locate methods for conditional patching."); } } public static void OnStart(ref EnemyAI __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ((MonoBehaviour)__instance).StartCoroutine(UpdateHP(__instance)); try { GameObject terrainObject = Manager.terrainObject; float num = -100f; if ((Object)(object)terrainObject != (Object)null) { num = terrainObject.transform.position.y - 100f; } if (((Component)__instance).transform.position.y > num) { __instance.isOutside = true; __instance.allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode"); if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { __instance.EnableEnemyMesh(!StartOfRound.Instance.hangarDoorsClosed || !GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom, false, false); } __instance.SyncPositionToClients(); } else { __instance.isOutside = false; __instance.allAINodes = GameObject.FindGameObjectsWithTag("AINode"); __instance.SyncPositionToClients(); } } catch { Log.LogError("Failed to set isOutside on EnemyAI.Start"); } } private static IEnumerator UpdateHP(EnemyAI __instance) { yield return (object)new WaitUntil((Func)(() => Net.Instance.receivedSyncedValues)); __instance.enemyHP = (int)Mathf.Clamp((float)(__instance.enemyHP + Manager.bonusEnemyHp), 1.1f, 100000000f); } } } namespace BrutalCompanyMinus.Minus.Handlers.Modded { public class CustomWeather { [MethodImpl(MethodImplOptions.NoInlining)] public static void SetCustomWeather(string WeatherName) { if (!Compatibility.WeatherRegistryPresent) { return; } try { Weather val = null; foreach (Weather weather in WeatherManager.Weathers) { if (string.Equals(weather.Name, WeatherName, StringComparison.OrdinalIgnoreCase)) { val = weather; break; } } if (val == null) { Log.LogError("Weather '" + WeatherName + "' not found."); } else { WeatherManager.CurrentWeathers.SetWeather(StartOfRound.Instance.currentLevel, val); } } catch (Exception ex) { Log.LogError("Error setting '" + WeatherName + "' weather: " + ex.Message); } } [MethodImpl(MethodImplOptions.NoInlining)] public static bool isWeatherPresent(string WeatherName) { if (!Compatibility.WeatherRegistryPresent) { return false; } try { foreach (Weather weather in WeatherManager.Weathers) { if (string.Equals(weather.Name, WeatherName, StringComparison.OrdinalIgnoreCase)) { return true; } } return false; } catch (Exception ex) { Log.LogError("Error checking for '" + WeatherName + "' weather: " + ex.Message); return false; } } [MethodImpl(MethodImplOptions.NoInlining)] public static void AddCustomWeather(string WeatherName) { if (!Compatibility.WeatherRegistryPresent) { return; } try { Weather val = null; foreach (Weather weather in WeatherManager.Weathers) { if (string.Equals(weather.Name, WeatherName, StringComparison.OrdinalIgnoreCase)) { val = weather; break; } } if (val == null) { Log.LogError("Weather '" + WeatherName + "' not found."); } else { WeatherController.AddWeatherEffect(val); } } catch (Exception ex) { Log.LogError("Error adding '" + WeatherName + "' weather: " + ex.Message); } } [MethodImpl(MethodImplOptions.NoInlining)] public static void RegisterWeathers() { if (Compatibility.CombinedWeatherToolKitPresent) { } } [MethodImpl(MethodImplOptions.NoInlining)] public static string GetCustomWeather() { if (!Compatibility.WeatherRegistryPresent) { return ""; } try { Weather currentWeather = WeatherManager.GetCurrentWeather(StartOfRound.Instance.currentLevel); return (currentWeather != null) ? ((object)currentWeather).ToString() : ""; } catch { return ""; } } } internal class HotBarPlusCompat { private static int _overrideSlots; private static int _defaultHotbarSize => SyncManager.hotbarSize + SyncManager.purchasedHotbarSlots; private static int _currentHotbarSize => SyncManager.currentHotbarSize; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchAll(Harmony harmony) { ApplyCurrentHotbarSizePatch(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void ResizeHotbarRandomly() { if (_overrideSlots <= 0) { int size = ((_defaultHotbarSize >= 20) ? _defaultHotbarSize : Random.Range(_defaultHotbarSize, 20)); Log.LogInfo("[HotBarMania] New big hotbar size: " + size); OverrideHotbarSlots(size); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void ResizeHotbarRandomlySmall() { if (_overrideSlots <= 0) { int size = Random.Range(1, _defaultHotbarSize); Log.LogInfo("[HotBarMania] New small hotbar size: " + size); OverrideHotbarSlots(size); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void OverrideHotbarSlots(int size) { if (size <= 0) { if (_defaultHotbarSize < _currentHotbarSize) { DropExtraItems(_defaultHotbarSize); } } else if (size < _currentHotbarSize) { DropExtraItems(size); } _overrideSlots = Mathf.Max(size, 0); SyncManager.OnUpdateHotbarSize(); } private static void DropExtraItems(int newSize) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } int num = localPlayerController.ItemSlots.Length; if (newSize >= num) { return; } for (int num2 = num - 1; num2 >= newSize; num2--) { if (num2 > localPlayerController.ItemSlots.Length - 1) { Log.LogWarning($"DropExtraItems(); Index {num2} is out of range. Slots: {num}"); } else if ((Object)(object)localPlayerController.ItemSlots[num2] != (Object)null) { localPlayerController.SwitchToItemSlot(num2, (GrabbableObject)null); localPlayerController.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } public static void ResetHotbar() { OverrideHotbarSlots(0); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void ApplyCurrentHotbarSizePatch(Harmony harmony) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.PropertyGetter(typeof(SyncManager), "currentHotbarSize"); MethodInfo methodInfo2 = AccessTools.Method(typeof(HotBarPlusCompat), "CurrentHotbarSizePatch", (Type[])null, (Type[])null); if (methodInfo != null && methodInfo2 != null) { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.LogInfo("Successfully patched SyncManager.currentHotbarSize."); } else { Log.LogError("Failed to locate methods for conditional patching."); } } private static bool CurrentHotbarSizePatch(ref short __result) { if (_overrideSlots <= 0) { return true; } __result = (short)_overrideSlots; return false; } } [HarmonyPatch] public class LunarConfigCompat { public enum EnemyPoolType { Add, Remove } public enum EnemyPoolList { Inside, Outside, Daytime } public readonly struct EnemyPool { public readonly EnemyPoolType PoolType; public readonly EnemyPoolList PoolList; public readonly EnemyType EnemyType; public readonly int Rarity; public readonly string EnemyName; public EnemyPool(EnemyPoolType poolType, EnemyPoolList poolList, EnemyType enemyType, int rarity, string enemyName) { PoolType = poolType; PoolList = poolList; EnemyType = enemyType; Rarity = rarity; EnemyName = enemyName; } } public static readonly List enemyPools = new List(); public static bool applying; public static void DoAddEnemyToPoolWithRarityPostfix(ref List list, EnemyType enemy, int rarity) { RoundManager instance = RoundManager.Instance; if (applying || !Compatibility.DawnLibPresent || (Object)(object)instance == (Object)null || (Object)(object)instance.currentLevel == (Object)null || list == null || (Object)(object)enemy == (Object)null || (Object)(object)enemy.enemyPrefab == (Object)null) { return; } SelectableLevel currentLevel = instance.currentLevel; EnemyPoolList poolList; if (list == currentLevel.Enemies) { poolList = EnemyPoolList.Inside; } else if (list == currentLevel.OutsideEnemies) { poolList = EnemyPoolList.Outside; } else { if (list != currentLevel.DaytimeEnemies) { return; } poolList = EnemyPoolList.Daytime; } enemyPools.Add(new EnemyPool(EnemyPoolType.Add, poolList, enemy, rarity, string.Empty)); } public static void DoRemoveSpawnPostfix(string Name) { RoundManager instance = RoundManager.Instance; if (!applying && Compatibility.DawnLibPresent && !((Object)(object)instance == (Object)null) && !((Object)(object)instance.currentLevel == (Object)null) && !string.IsNullOrWhiteSpace(Name)) { enemyPools.Add(new EnemyPool(EnemyPoolType.Remove, EnemyPoolList.Inside, null, 0, Name)); } } [HarmonyPatch(typeof(RoundManager), "RefreshEnemiesList")] [HarmonyPostfix] public static void RefreshEnemiesListPostfix() { RoundManager instance = RoundManager.Instance; if (!Compatibility.DawnLibPresent || (Object)(object)instance == (Object)null || !((NetworkBehaviour)instance).IsHost || (Object)(object)instance.currentLevel == (Object)null || enemyPools.Count == 0) { return; } SelectableLevel currentLevel = instance.currentLevel; try { applying = true; foreach (EnemyPool enemyPool in enemyPools) { if (enemyPool.PoolType == EnemyPoolType.Remove) { Manager.RemoveSpawn(enemyPool.EnemyName); continue; } EnemyPoolList poolList = enemyPool.PoolList; if (1 == 0) { } List list = poolList switch { EnemyPoolList.Inside => currentLevel.Enemies, EnemyPoolList.Outside => currentLevel.OutsideEnemies, EnemyPoolList.Daytime => currentLevel.DaytimeEnemies, _ => throw new ArgumentOutOfRangeException("PoolList", enemyPool.PoolList, null), }; if (1 == 0) { } List list2 = list; Manager.AddEnemyToPoolWithRarity(ref list2, enemyPool.EnemyType, enemyPool.Rarity); } } catch (Exception ex) { Log.LogWarning("Failed to apply enemy pool changes after LunarConfig/DawnLib: " + ex); } finally { applying = false; } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPatch(typeof(StartOfRound), "OnLocalDisconnect")] [HarmonyPostfix] public static void CleanupPostfix() { enemyPools.Clear(); } } public class PhonesOutPatches : NetworkBehaviour { public static PhonesOutPatches instance; public void Awake() { if ((Object)(object)instance != (Object)null) { DestroyPhonesOut(); } instance = this; Net.Instance.SetPhonesOutServerRpc(active: true); } public static void DestroyPhonesOut() { PhonesOut.Active = false; GameObject val = GameObject.Find("PhonesOutFailureObject"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { DestroyPhonesOut(); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")] public static void DestroyPhonesOutForGodsSake() { DestroyPhonesOut(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "PhonesOutPatches"; } } internal class PhonesOutPatching { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchAllPhone(Harmony harmony) { ApplyInterruptPhoneUsage(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPrefix] public static void ApplyInterruptPhoneUsage(Harmony harmony) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(PlayerPhone), "ToggleActive", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(PhonesOutPatching), "InterruptPhoneUsage", (Type[])null, (Type[])null); if (methodInfo != null && methodInfo2 != null) { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.LogInfo("Successfully patched PlayerPhone.ToggleActive."); } else { Log.LogError("Failed to locate methods for conditional patching."); } } public static bool InterruptPhoneUsage(bool active) { if (PhonesOut.Active) { ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "BAD PHONE RECEPTION!!!!"; HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } return true; } } internal class ScanVanPatching { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void PatchAllCruiserXL(Harmony harmony) { ApplyCruiserXLBlock(harmony); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPrefix] public static void ApplyCruiserXLBlock(Harmony harmony) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(CruiserXLController), "StartTryCarIgnition", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(ScanVanPatching), "InterruptCruiserXL", (Type[])null, (Type[])null); if (methodInfo != null && methodInfo2 != null) { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Log.LogInfo("Successfully patched Scanvan"); } else { Log.LogError("Failed to locate methods for conditional patching."); } } public static bool InterruptCruiserXL() { if (CruiserFailure.Active) { switch (Random.Range(0, 3)) { case 0: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "This is more complicated than the Cruiser!"; break; case 1: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "It wont work"; break; case 2: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Did you pass the drivers test first?"; break; default: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "Did you know that this vehicle doesn't work?"; break; } HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } return true; } } internal class SelfSortingStorageCompat { public static int GetSelfSortingStorageScrapValue() { try { int num = 0; foreach (List item in SmartMemory.Instance.ItemList) { foreach (Data item2 in item) { if (!item2.IsValid() || item2.Values.Count <= 0) { continue; } foreach (int value in item2.Values) { if (Configuration.ExtraLogging.Value) { Log.LogInfo($"Found SelfSortingStorage Item with total scrap value: {value}"); } num += value; } } } int num2 = sssFixCountFunc(); return num - num2; } catch (Exception) { Console.WriteLine("SelfSortingStorage types not found."); return 0; } } private static int sssFixCountFunc() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown int num = 0; GameObject val = GameObject.Find("SSS_Module(Clone)"); if ((Object)(object)val != (Object)null) { Log.LogInfo("sssBox Found"); foreach (Transform item in val.transform) { Transform val2 = item; Log.LogInfo("Shelf Spot Found: " + ((Object)val2).name); Transform child = val2.GetChild(0); Log.LogInfo("Item Found: " + ((Object)child).name); if (child.childCount <= 0) { continue; } foreach (Transform item2 in child) { Transform val3 = item2; if (((Object)val3).name.ToLower().StartsWith("scannode")) { ScanNodeProperties val4 = (ScanNodeProperties)((Component)val3).GetComponent("ScanNodeProperties"); if ((Object)(object)val4 != (Object)null) { num += val4.scrapValue; } } } } } return num; } } internal class ShipInventoryCompat { public static int GetShipInventoryScrapValue() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) try { int num = 0; ItemData[] items = Inventory.Items; for (int i = 0; i < items.Length; i++) { ItemData val = items[i]; Item item = ((ItemData)(ref val)).GetItem(); if ((Object)(object)item != (Object)null && item.isScrap) { num += val.SCRAP_VALUE; } } return num; } catch (Exception) { Console.WriteLine("ShipInventory types not found."); return 0; } } } internal class ToilHeadHandler { private static bool isToilHeadPresent() { return Chainloader.PluginInfos.ContainsKey("com.github.zehsteam.ToilHead"); } public static void AttemptToDisableToilHeadTurrets(ref Random rng) { Type type = Type.GetType("com.github.zehsteam.ToilHead.MonoBehaviours.ToilHeadTurretBehaviour, ToilHead"); if (type == null) { return; } Object[] array = Object.FindObjectsOfType(type); Object[] array2 = array; foreach (Object toilheadTurretobj in array2) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableToilHeadTurret(toilheadTurretobj)); } } } public static IEnumerator DisableToilHeadTurret(object toilheadTurretobj) { Type turretType = Type.GetType("com.github.zehsteam.ToilHead.MonoBehaviours.ToilHeadTurretBehaviour"); if (!(turretType == null)) { MethodInfo toggleMethod = turretType.GetMethod("ToggleTurretEnabled", BindingFlags.Instance | BindingFlags.Public); if (!(toggleMethod == null)) { toggleMethod.Invoke(toilheadTurretobj, new object[1] { false }); yield return (object)new WaitForSeconds(7f); toggleMethod.Invoke(toilheadTurretobj, new object[1] { true }); } } } public static void AttemptToRageToilHeadTurrets(ref Random rng) { Type type = Type.GetType("com.github.zehsteam.ToilHead.MonoBehaviours.ToilHeadTurretBehaviour, ToilHead"); if (type == null) { return; } Object[] array = Object.FindObjectsOfType(type); Object[] array2 = array; foreach (Object val in array2) { if (rng.NextDouble() <= (double)FacilityGhost.rageTurretsChance) { dynamic val2 = val; dynamic val3 = val2.turretMode == (TurretMode)3 || val2.turretMode == (TurretMode)2; if (!(val3 ? true : false) && !((val3 | !val2.turretActive) ? true : false)) { val2.turretMode = (TurretMode)3; val2.EnterBerserkModeServerRpc(); } } } } } } namespace BrutalCompanyMinus.Minus.Handlers.Enemies { [HarmonyPatch(typeof(RedLocustBees))] internal static class RedLocustBeesPatcher { [HarmonyTranspiler] [HarmonyPatch("SpawnHiveClientRpc")] internal static IEnumerable IncreaseHiveScrapValue(IEnumerable instructions) { FieldInfo scrapValueMultiplier = typeof(Manager).GetField("scrapValueMultiplier", BindingFlags.Static | BindingFlags.NonPublic); MethodInfo roundMethod = typeof(Mathf).GetMethod("RoundToInt"); bool found = false; foreach (CodeInstruction instruction in instructions) { if (CodeInstructionExtensions.IsLdarg(instruction, (int?)2) && !found) { found = true; yield return new CodeInstruction(OpCodes.Ldarg_2, (object)null); yield return new CodeInstruction(OpCodes.Conv_R4, (object)null); yield return new CodeInstruction(OpCodes.Ldsfld, (object)scrapValueMultiplier); yield return new CodeInstruction(OpCodes.Mul, (object)null); yield return new CodeInstruction(OpCodes.Call, (object)roundMethod); yield return new CodeInstruction(OpCodes.Starg, (object)2); } yield return instruction; } } } } namespace BrutalCompanyMinus.Minus.Handlers.CustomEvents { public abstract class BaseHazardData { public string PrefabName { get; set; } public BaseHazardData(string prefabName) { PrefabName = prefabName; } } internal class EventTypeConverter : StringEnumConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { writer.WriteValue(value.ToString()); } public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) string text = reader.Value?.ToString(); if (string.IsNullOrEmpty(text)) { return null; } if (Enum.TryParse(objectType, text, ignoreCase: true, out object result)) { return result; } throw new JsonSerializationException("Invalid EventType value: " + text); } } public class HazardConverter : JsonConverter { public override bool CanConvert(Type objectType) { return typeof(List).IsAssignableFrom(objectType); } public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Invalid comparison between Unknown and I4 //IL_0091: Unknown result type (might be due to invalid IL or missing references) if ((int)reader.TokenType == 2) { List list = new List(); while (reader.Read()) { if ((int)reader.TokenType == 1) { JObject val = JObject.Load(reader); string text = ((object)val["Type"]).ToString(); BaseHazardData baseHazardData = null; string text2 = text; string text3 = text2; if (!(text3 == "Inside")) { if (!(text3 == "Outside")) { throw new JsonSerializationException("Unknown hazard type: " + text); } baseHazardData = ((JToken)val).ToObject(); } else { baseHazardData = ((JToken)val).ToObject(); } if (baseHazardData != null) { list.Add(baseHazardData); } } else if ((int)reader.TokenType == 14) { break; } } return list; } throw new JsonSerializationException("Expected StartArray for Hazards, but got: " + ((object)reader.TokenType/*cast due to .constrained prefix*/).ToString()); } public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer) { throw new NotImplementedException(); } } internal class CustomEventHandling { public class EventData { public string Name; public MEvent.EventType Type; public int Weight; public string Color; public List Descriptions; public bool Enabled; public List? AddEventIfOnly; public ItemEventData? Items; public List? Enemies; public string? Weather; [JsonConverter(typeof(HazardConverter))] public List? Hazards; public List? EventsToRemove; public List? EventsToSpawnWith; public List? MoonBlacklist; public bool isSpecialEvent; public bool isBetaEvent; public bool showTip; public List? TipMessages; public List? TipTitle; public bool isWarning; public List? MoonWhitelist; public bool MoonMode; public List? Aliases; } public class ItemEventData { public float[] TransmuteAmount; public float[] ScrapAmount; public float[] ScrapValue; public List Items; } public struct ItemData { public string Name; public int Rarity; } public struct EnemyData { public string Name; public float[] InsideRarity; public float[] OutsideRarity; public float[] MinInside; public float[] MaxInside; public float[] MinOutside; public float[] MaxOutside; } public static EventData? ReadFile(string path) { //IL_001d: Expected O, but got Unknown string text = File.ReadAllText(path); CustomEventSerializer customEventSerializer = new CustomEventSerializer(); List list = null; try { list = JsonConvert.DeserializeObject>(text, (JsonSerializerSettings)(object)customEventSerializer); } catch (JsonReaderException ex) { JsonReaderException ex2 = ex; Log.LogError("An error occurred while parsing event file: " + path + " Message: " + ((Exception)(object)ex2).Message); return null; } if (list != null) { if (list.Count > 0) { Log.LogInfo("Adding custom event " + list[0].Name); return list[0]; } Log.LogInfo("File was read, but no events were found"); } else { Log.LogInfo("No data was read from the file"); } return null; } public static MEvent.Scale ArrayToScale(float[] array) { if (array.Length == 4) { return new MEvent.Scale(array[0], array[1], array[2], array[3]); } throw new ArgumentException($"ArrayToScale expected length of 4, got {array.Length}"); } public static MEvent.Scale ArrayToScale(int[] array) { if (array.Length == 4) { return new MEvent.Scale(array[0], array[1], array[2], array[3]); } throw new ArgumentException($"ArrayToScale expected length of 4, got {array.Length}"); } } internal class CustomEventSerializer : JsonSerializerSettings { public CustomEventSerializer() { ((JsonSerializerSettings)this).NullValueHandling = (NullValueHandling)1; ((JsonSerializerSettings)this).Converters.Add((JsonConverter)(object)new EventTypeConverter()); ((JsonSerializerSettings)this).Converters.Add((JsonConverter)(object)new HazardConverter()); } } public class DawnLibHandling { public struct DawnSnapshot { public object OutsideWeights; public object InsideWeights; public bool FacingAway; public bool FacingWall; public bool BackToWall; public bool BackFlush; public bool ReqDist; public bool DisallowNear; public bool AllowInMineshaft; } public static Queue eventQueue = new Queue(); public static Dictionary originalStates = new Dictionary(); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool ProcessHazardEvents() { bool flag = false; foreach (MEvent currentEvent in EventManager.currentEvents) { Log.LogInfo("Event name: " + currentEvent.GetType().Name); if (!(currentEvent is GeneralCustomEvent generalCustomEvent)) { continue; } Log.LogInfo("Event " + generalCustomEvent.Name() + " is a GeneralCustomEvent, checking hazard events..."); foreach (GeneralCustomEvent.HazardEvent hazardEvent in generalCustomEvent.hazardEvents) { Log.LogInfo("Processing..."); flag |= ProcessMapObject(hazardEvent); } } return flag; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void DynamicInsideHazard(string hazardName, MEvent.Scale minCount, MEvent.Scale maxCount, InsideHazardData.SpawnOptions_ options, MEvent.EventType eventType) { if (Compatibility.DawnLibPresent) { GeneralCustomEvent.HazardEvent hazard = new GeneralCustomEvent.HazardEvent(hazardName, minCount, maxCount, options.FacingAwayFromWall, options.FacingWall, options.BackToWall, options.BackFlushWithWall, options.RequireDistanceBetween, options.DisallowNearEntrances, options.AllowInMineshaft); ProcessMapObject(hazard, eventType); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void DynamicOutsideHazard(string hazardName, MEvent.Scale minDensity, MEvent.Scale maxDensity, MEvent.EventType eventType) { if (Compatibility.DawnLibPresent) { GeneralCustomEvent.HazardEvent hazard = new GeneralCustomEvent.HazardEvent(hazardName, minDensity, maxDensity); ProcessMapObject(hazard, eventType); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool IsDawnManaged(string hazardName) { bool flag = false; foreach (DawnMapObjectInfo value in ((Registry)(object)LethalContent.MapObjects).Values) { GameObject mapObjectPrefab = value.GetMapObjectPrefab(); if (!((DawnBaseInfo)(object)value).ShouldSkipIgnoreOverride() && !((Object)(object)mapObjectPrefab == (Object)null) && !(((Object)mapObjectPrefab).name != hazardName)) { DawnOutsideMapObjectInfo outsideInfo = value.OutsideInfo; DawnInsideMapObjectInfo insideInfo = value.InsideInfo; if (outsideInfo != null || insideInfo != null) { flag = true; break; } } } Log.LogInfo($"{hazardName} managed: {flag}"); return flag; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool ProcessMapObject(GeneralCustomEvent.HazardEvent hazard) { bool flag = false; foreach (DawnMapObjectInfo value2 in ((Registry)(object)LethalContent.MapObjects).Values) { GameObject mapObjectPrefab = value2.GetMapObjectPrefab(); if (((DawnBaseInfo)(object)value2).ShouldSkipIgnoreOverride() || (Object)(object)mapObjectPrefab == (Object)null) { continue; } string text = ((Object)mapObjectPrefab).name.Replace("(Clone)", "").Trim(); string text2 = ((Object)hazard.hazardObject).name.Replace("(Clone)", "").Trim(); if (!(text != text2)) { string name = ((Object)mapObjectPrefab).name; DawnInsideMapObjectInfo insideInfo = value2.InsideInfo; IndoorMapHazardType val = ((insideInfo != null) ? insideInfo.IndoorMapHazardType : null); if (!originalStates.ContainsKey(name)) { Dictionary dictionary = originalStates; DawnSnapshot value = default(DawnSnapshot); DawnOutsideMapObjectInfo outsideInfo = value2.OutsideInfo; value.OutsideWeights = ((outsideInfo != null) ? outsideInfo.SpawnWeights : null); DawnInsideMapObjectInfo insideInfo2 = value2.InsideInfo; value.InsideWeights = ((insideInfo2 != null) ? insideInfo2.SpawnWeights : null); value.FacingAway = val?.spawnFacingAwayFromWall ?? false; value.FacingWall = val?.spawnFacingWall ?? false; value.BackToWall = val?.spawnWithBackToWall ?? false; value.BackFlush = val?.spawnWithBackFlushAgainstWall ?? false; value.ReqDist = val?.requireDistanceBetweenSpawns ?? false; value.DisallowNear = val?.disallowSpawningNearEntrances ?? false; value.AllowInMineshaft = val?.allowInMineshaft ?? false; dictionary[name] = value; } DawnOutsideMapObjectInfo outsideInfo2 = value2.OutsideInfo; DawnInsideMapObjectInfo insideInfo3 = value2.InsideInfo; NamespacedKey typedKey = ((DawnBaseInfo)(object)SelectableLevelExtensions.GetDawnInfo(RoundManager.Instance.currentLevel)).TypedKey; float num = Random.Range(hazard.minDensity.Computef(hazard.Type), hazard.maxDensity.Computef(hazard.Type)); Log.LogInfo($"Raw computed: {num}"); if (outsideInfo2 != null) { num = Mathf.Clamp(num * Manager.terrainArea, 0f, 1000f); Log.LogInfo($"Outside adjusted computed: {num} Area: {Manager.terrainArea}"); outsideInfo2.SpawnWeights = new CurveTableBuilder().AddCurve(typedKey, AnimationCurve.Constant(0f, 1f, num)).Build(); value2.OutsideInfo = outsideInfo2; flag = true; } if (insideInfo3 != null) { Log.LogInfo("Inside adjusted computed: " + num); insideInfo3.SpawnWeights = new CurveTableBuilder().AddCurve(typedKey, AnimationCurve.Constant(0f, 1f, num)).Build(); insideInfo3.IndoorMapHazardType.spawnFacingAwayFromWall = hazard.facingAwayFromWall; insideInfo3.IndoorMapHazardType.spawnFacingWall = hazard.facingWall; insideInfo3.IndoorMapHazardType.spawnWithBackToWall = hazard.backToWall; insideInfo3.IndoorMapHazardType.spawnWithBackFlushAgainstWall = hazard.backFlushWithWall; insideInfo3.IndoorMapHazardType.requireDistanceBetweenSpawns = hazard.requireDistanceBetween; insideInfo3.IndoorMapHazardType.disallowSpawningNearEntrances = hazard.disallowNearEntrances; insideInfo3.IndoorMapHazardType.allowInMineshaft = hazard.allowInMineshaft; value2.InsideInfo = insideInfo3; flag = true; } if (flag) { break; } } } return flag; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool ProcessMapObject(GeneralCustomEvent.HazardEvent hazard, MEvent.EventType eventType) { bool flag = false; foreach (DawnMapObjectInfo value2 in ((Registry)(object)LethalContent.MapObjects).Values) { GameObject mapObjectPrefab = value2.GetMapObjectPrefab(); if (((DawnBaseInfo)(object)value2).ShouldSkipIgnoreOverride() || (Object)(object)mapObjectPrefab == (Object)null) { continue; } string text = ((Object)mapObjectPrefab).name.Replace("(Clone)", "").Trim(); string text2 = ((Object)hazard.hazardObject).name.Replace("(Clone)", "").Trim(); if (!(text != text2)) { string name = ((Object)mapObjectPrefab).name; DawnInsideMapObjectInfo insideInfo = value2.InsideInfo; IndoorMapHazardType val = ((insideInfo != null) ? insideInfo.IndoorMapHazardType : null); if (!originalStates.ContainsKey(name)) { Dictionary dictionary = originalStates; DawnSnapshot value = default(DawnSnapshot); DawnOutsideMapObjectInfo outsideInfo = value2.OutsideInfo; value.OutsideWeights = ((outsideInfo != null) ? outsideInfo.SpawnWeights : null); DawnInsideMapObjectInfo insideInfo2 = value2.InsideInfo; value.InsideWeights = ((insideInfo2 != null) ? insideInfo2.SpawnWeights : null); value.FacingAway = val?.spawnFacingAwayFromWall ?? false; value.FacingWall = val?.spawnFacingWall ?? false; value.BackToWall = val?.spawnWithBackToWall ?? false; value.BackFlush = val?.spawnWithBackFlushAgainstWall ?? false; value.ReqDist = val?.requireDistanceBetweenSpawns ?? false; value.DisallowNear = val?.disallowSpawningNearEntrances ?? false; value.AllowInMineshaft = val?.allowInMineshaft ?? false; dictionary[name] = value; } DawnOutsideMapObjectInfo outsideInfo2 = value2.OutsideInfo; DawnInsideMapObjectInfo insideInfo3 = value2.InsideInfo; NamespacedKey typedKey = ((DawnBaseInfo)(object)SelectableLevelExtensions.GetDawnInfo(RoundManager.Instance.currentLevel)).TypedKey; float num = Random.Range(hazard.minDensity.Computef(eventType), hazard.maxDensity.Computef(eventType)); Log.LogInfo($"Raw computed: {num}"); if (outsideInfo2 != null) { num = Mathf.Clamp(num * Manager.terrainArea, 0f, 1000f); Log.LogInfo($"Outside adjusted computed: {num} Area: {Manager.terrainArea}"); outsideInfo2.SpawnWeights = new CurveTableBuilder().AddCurve(typedKey, AnimationCurve.Constant(0f, 1f, num)).Build(); value2.OutsideInfo = outsideInfo2; flag = true; } if (insideInfo3 != null) { Log.LogInfo("Inside adjusted computed: " + num); insideInfo3.SpawnWeights = new CurveTableBuilder().AddCurve(typedKey, AnimationCurve.Constant(0f, 1f, num)).Build(); insideInfo3.IndoorMapHazardType.spawnFacingAwayFromWall = hazard.facingAwayFromWall; insideInfo3.IndoorMapHazardType.spawnFacingWall = hazard.facingWall; insideInfo3.IndoorMapHazardType.spawnWithBackToWall = hazard.backToWall; insideInfo3.IndoorMapHazardType.spawnWithBackFlushAgainstWall = hazard.backFlushWithWall; insideInfo3.IndoorMapHazardType.requireDistanceBetweenSpawns = hazard.requireDistanceBetween; insideInfo3.IndoorMapHazardType.disallowSpawningNearEntrances = hazard.disallowNearEntrances; insideInfo3.IndoorMapHazardType.allowInMineshaft = hazard.allowInMineshaft; value2.InsideInfo = insideInfo3; flag = true; } if (flag) { break; } } } return flag; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool OnEventStart() { return ProcessHazardEvents(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void OnEventEnd() { foreach (KeyValuePair originalState in originalStates) { foreach (DawnMapObjectInfo value in ((Registry)(object)LethalContent.MapObjects).Values) { GameObject mapObjectPrefab = value.GetMapObjectPrefab(); if ((Object)(object)mapObjectPrefab != (Object)null && ((Object)mapObjectPrefab).name == originalState.Key) { if (value.OutsideInfo != null) { value.OutsideInfo.SpawnWeights = (ProviderTable)originalState.Value.OutsideWeights; } if (value.InsideInfo != null) { value.InsideInfo.SpawnWeights = (ProviderTable)originalState.Value.InsideWeights; IndoorMapHazardType indoorMapHazardType = value.InsideInfo.IndoorMapHazardType; indoorMapHazardType.spawnFacingAwayFromWall = originalState.Value.FacingAway; indoorMapHazardType.spawnFacingWall = originalState.Value.FacingWall; indoorMapHazardType.spawnWithBackToWall = originalState.Value.BackToWall; indoorMapHazardType.spawnWithBackFlushAgainstWall = originalState.Value.BackFlush; indoorMapHazardType.requireDistanceBetweenSpawns = originalState.Value.ReqDist; indoorMapHazardType.disallowSpawningNearEntrances = originalState.Value.DisallowNear; indoorMapHazardType.allowInMineshaft = originalState.Value.AllowInMineshaft; } break; } } } originalStates.Clear(); } } [HarmonyPatch] internal class DawnlibPatching { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] [HarmonyPrefix] private static void DawnFixMethod() { if (Compatibility.DawnLibPresent) { Log.LogInfo($"Area gen: {Manager.terrainArea}"); if (Manager.terrainArea == 0f) { Manager.SampleMap(); } while (DawnLibHandling.eventQueue.Count > 0) { Log.LogInfo("Items left: " + DawnLibHandling.eventQueue.Count); DawnLibHandling.ProcessMapObject(DawnLibHandling.eventQueue.Dequeue()); } } } } public class InsideHazardData : BaseHazardData { public class SpawnOptions_ { [JsonProperty("FacingAwayFromWall")] public bool FacingAwayFromWall { get; set; } [JsonProperty("FacingWall")] public bool FacingWall { get; set; } [JsonProperty("BackToWall")] public bool BackToWall { get; set; } [JsonProperty("BackFlushToWall")] public bool BackFlushWithWall { get; set; } [JsonProperty("RequireDistanceBetween")] public bool RequireDistanceBetween { get; set; } [JsonProperty("DisallowNearEntrances")] public bool DisallowNearEntrances { get; set; } [JsonProperty("allowInMineshaft")] public bool AllowInMineshaft { get; set; } } [JsonProperty("MinSpawn")] public int[] MinSpawn { get; set; } [JsonProperty("MaxSpawn")] public int[] MaxSpawn { get; set; } [JsonProperty("SpawnOptions")] public SpawnOptions_ SpawnOptions { get; set; } public InsideHazardData(string prefabName, int[] minSpawn, int[] maxSpawn, SpawnOptions_ options) : base(prefabName) { MinSpawn = minSpawn; MaxSpawn = maxSpawn; SpawnOptions = options; } } internal class OutsideHazardData : BaseHazardData { [JsonProperty("MinDensity")] public float[] MinDensity { get; set; } [JsonProperty("MaxDensity")] public float[] MaxDensity { get; set; } public OutsideHazardData(string prefabName, float[] minDensity, float[] maxDensity) : base(prefabName) { MinDensity = minDensity; MaxDensity = maxDensity; } } } namespace BrutalCompanyMinus.Minus.Events { [HarmonyPatch] internal class AllWeather : MEvent { public new static bool Active; public static AllWeather Instance; public override string Name() { return "AllWeather"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "God hates you", "Chaos reigns as the skies unleash every weather pattern known to man.", "An umbrella might help here", "I hope you suffer here" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Gloomy", "Raining", "HeavyRain" }; ScaleList.Add(ScaleType.ScrapValue, new Scale(1.6f, 0f, 1.6f, 1.6f)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1.3f, 0f, 1.3f, 1.3f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.randomWeathers != null && RoundManager.Instance.currentLevel.randomWeathers.Length >= 3; } public override void Execute() { //IL_008c: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected I4, but got Unknown Net.Instance.SetAllWeatherActiveServerRpc(state: true); Net.Instance.SpawnAllWeatherServerRpc(Net.Instance._seed++); Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); Manager.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); if (RoundManager.Instance.currentLevel.randomWeathers == null) { return; } RandomWeatherWithVariables[] randomWeathers = RoundManager.Instance.currentLevel.randomWeathers; foreach (RandomWeatherWithVariables val in randomWeathers) { if (val.weatherType != RoundManager.Instance.currentLevel.currentWeather) { LevelWeatherType weatherType = val.weatherType; LevelWeatherType val2 = weatherType; switch (val2 - 1) { case 0: Manager.SetAtmosphere(Assets.AtmosphereName.Rainy, state: true); break; case 2: Manager.SetAtmosphere(Assets.AtmosphereName.Foggy, state: true); break; case 1: Manager.SetAtmosphere(Assets.AtmosphereName.Stormy, state: true); break; case 3: Manager.SetAtmosphere(Assets.AtmosphereName.Flooded, state: true); break; case 4: Manager.SetAtmosphere(Assets.AtmosphereName.Eclipsed, state: true); break; } } } } public override void OnShipLeave() { Net.Instance.SetAllWeatherActiveServerRpc(state: false); } public override void OnGameStart() { Active = false; } } internal class AntiBounty : MEvent { public static bool AntiBountyActive; public static AntiBounty Instance; public override string Name() { return "AntiBounty"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "The Company is issuing a fine for disturbing the wildlife", "Pacifist Run", "You will literally pay for kills..." }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "Bounty" }; ScaleList.Add(ScaleType.MinValue, new Scale(20f, 0.4f, 20f, 60f)); ScaleList.Add(ScaleType.MaxValue, new Scale(30f, 0.6f, 30f, 90f)); } public override void Execute() { BrutalCompanyMinus.Minus.Handlers.AntiBounty.enemyObjectIDs.Clear(); AntiBountyActive = true; } public override void OnShipLeave() { AntiBountyActive = false; } public override void OnGameStart() { AntiBountyActive = false; } } internal class AntiCoilhead : MEvent { public static AntiCoilhead Instance; public override string Name() { return "AntiCoilhead"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Dont look at them...", "Glowy eyes", "My favourite", "I hope you don't have friends when dealing with these" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Coilhead", "LeaflessBrownTrees", "Trees", "HeavyRain" }; EventsToSpawnWith = new List { "LeaflessTrees", "Gloomy" }; monstersToSpawn = new List { new MonsterEvent(Assets.antiCoilHead, new Scale(20f, 0.8f, 20f, 100f), new Scale(5f, 0.2f, 5f, 25f), new Scale(2f, 0.04f, 2f, 6f), new Scale(2f, 0.06f, 2f, 8f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.CoilHead); ExecuteAllMonsterEvents(); } } internal class Arachnophobia : MEvent { public static Arachnophobia Instance; public override string Name() { return "Arachnophobia"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Nightmare facility", "I recommend bringing a vacuum cleaner.", "You are going to want to burn this facility down.", "I wish Zeekers added a flamethrower." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Trees", "LeaflessBrownTrees", "Spiders" }; EventsToSpawnWith = new List { "LeaflessTrees" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.BunkerSpider, new Scale(33f, 0.66f, 33f, 100f), new Scale(5f, 0.2f, 5f, 25f), new Scale(7f, 0.14f, 7f, 21f), new Scale(9f, 0.18f, 9f, 27f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class BaboonHorde : MEvent { public static BaboonHorde Instance; public override string Name() { return "BaboonHorde"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "You feel outnumbered", "Keep the doors closed.", "Hear their calls, see their shadows cover the land.", "Why are they also inside??" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.BaboonHawk, new Scale(10f, 0.4f, 10f, 50f), new Scale(33f, 0.66f, 33f, 100f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(5f, 0.1f, 5f, 15f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class BadProduce : MEvent { public static BadProduce Instance; public override string Name() { return "BadProduce"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Everything here is made cheaply...", "Who produced this crap...", "Budget scrap...", "Quantity over quality" }; ColorHex = "#800000"; Type = EventType.VeryBad; ScaleList.Add(ScaleType.ScrapValue, new Scale(0.6f, 0f, 0.6f, 0.6f)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(2f, 0f, 2f, 2f)); } public override void Execute() { Manager.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); } } internal class Barbers : MEvent { public static Barbers Instance; public override string Name() { return "Barbers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Haircut time", "The Barber called!", "You are due for a trim" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("ClaySurgeon", new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.13f, 1f, 4f), new Scale(4f, 0.06f, 4f, 8f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.BarberFixesPresent; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class Bees : MEvent { public static Bees Instance; public override string Name() { return "Bees"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "BEES!!", "BZZZZZ", "Nature's architects are at work.", "Balls", "NOT THE BEES!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.CircuitBee, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f)) }; ScaleList.Add(ScaleType.DaytimeEnemyRarity, new Scale(20f, 0.8f, 20f, 100f)); } public override void Execute() { ExecuteAllMonsterEvents(); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.DaytimeEnemies, Assets.EnemyName.CircuitBee, Get(ScaleType.DaytimeEnemyRarity)); } } [HarmonyPatch] internal class BerserkTurrets : MEvent { public static BerserkTurrets Instance; public override string Name() { return "BerserkTurrets"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Absolute Hell", "Berserk... and I dont mean the anime.", "Don't get in line of sight", "You will have a VERY bad day!", "Loudness incoming!" }; ColorHex = "#280000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "Turrets" }; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("BerserkTurretsEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class BigBonus : MEvent { public static BigBonus Instance; public override string Name() { return "BigBonus"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Corporate is very pleased", "The company has sent you a stimulus check", "Yippeeee" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "Bonus" }; ScaleList.Add(ScaleType.MinCash, new Scale(330f, 7.7f, 330f, 1100f)); ScaleList.Add(ScaleType.MaxCash, new Scale(400f, 10.5f, 400f, 1450f)); } public override void Execute() { Manager.PayCredits(Random.Range(Get(ScaleType.MinCash), Get(ScaleType.MaxCash) + 1)); } } internal class BigDelivery : MEvent { public static BigDelivery Instance; public override string Name() { return "BigDelivery"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The company has ordered a big delivery on this planet.", "A Luxurious cargo descends.", "Corporate has sent you a massive package." }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "SmallDelivery" }; ScaleList.Add(ScaleType.MinItemAmount, new Scale(5f, 0.1f, 5f, 15f)); ScaleList.Add(ScaleType.MaxItemAmount, new Scale(7f, 0.14f, 7f, 21f)); ScaleList.Add(ScaleType.MinValue, new Scale(60f, 0f, 60f, 60f)); ScaleList.Add(ScaleType.MaxValue, new Scale(99999f, 0f, 99999f, 99999f)); } public override void Execute() { Manager.DeliverRandomItems(Random.Range(Get(ScaleType.MinItemAmount), Get(ScaleType.MaxItemAmount) + 1), Get(ScaleType.MinValue), Get(ScaleType.MaxValue)); } } internal class Birds : MEvent { public static Birds Instance; public override string Name() { return "Birds"; } public override void Initalize() { Instance = this; Weight = 8; Descriptions = new List { "Its bird migration season", "Birb", "Do these things have feathers?", "You can shoot these" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Manticoil, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(5f, 0f, 5f, 5f), new Scale(8f, 0f, 8f, 8f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class BlackFriday : MEvent { public static BlackFriday Instance; public override string Name() { return "BlackFriday"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Everything is on sale!!!!", "The marketplace is set ablaze with these discounts", "Dont miss out on these deals!" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "ShipmentFees" }; ScaleList.Add(ScaleType.MinPercentageCut, new Scale(25f, 0.7f, 25f, 95f)); ScaleList.Add(ScaleType.MaxPercentageCut, new Scale(55f, 0.7f, 55f, 95f)); } public override void Execute() { Net.Instance.BlackFridayServerRpc(Get(ScaleType.MinPercentageCut), Get(ScaleType.MaxPercentageCut)); } } internal class Bonus : MEvent { public static Bonus Instance; public override string Name() { return "Bonus"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Corporate is feeling good today.", "The company is giving you credits for existing", "â–  â–  â– ", "It's never enough." }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.MinCash, new Scale(75f, 2.25f, 75f, 300f)); ScaleList.Add(ScaleType.MaxCash, new Scale(125f, 3.75f, 125f, 400f)); } public override void Execute() { Manager.PayCredits(Random.Range(Get(ScaleType.MinCash), Get(ScaleType.MaxCash) + 1)); } } internal class Bounty : MEvent { public new static bool Active; public static Bounty Instance; public override string Name() { return "Bounty"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "The company is now paying for kills", "RIP AND TEAR", "Extermination time", "Monsters roam free, and the price on their heads is mediocre", "The hunt is on!" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "AntiBounty" }; ScaleList.Add(ScaleType.MinValue, new Scale(20f, 0.4f, 20f, 60f)); ScaleList.Add(ScaleType.MaxValue, new Scale(30f, 0.6f, 30f, 90f)); } public override void Execute() { BrutalCompanyMinus.Minus.Handlers.Bounty.enemyObjectIDs.Clear(); Active = true; } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class Bracken : MEvent { public static Bracken Instance; public override string Name() { return "Bracken"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Your neck tingles", "Your local chiropractors", "I hope you have nyctophobia", "You wont win this staring competition" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Bracken, new Scale(20f, 0.8f, 20f, 100f), new Scale(5f, 0.2f, 5f, 25f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { foreach (MonsterEvent item in Instance.monstersToSpawn) { item.outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); item.maxOutside = new Scale(0f, 0f, 0f, 0f); item.minOutside = new Scale(0f, 0f, 0f, 0f); } } ExecuteAllMonsterEvents(); } } internal class BugHorde : MEvent { public static BugHorde Instance; public override string Name() { return "BugHorde"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Theres too many of them...", "You better be ready for this", "Which ones explode?", "A buzzing doom approaches", "Best with served with yippeeeee mod" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "HoardingBugs", "KamikazieBugs" }; EventsToSpawnWith = new List { "ScarceOutsideScrap" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.HoardingBug, new Scale(33f, 0.66f, 33f, 100f), new Scale(10f, 0.4f, 10f, 50f), new Scale(6f, 0.12f, 6f, 18f), new Scale(8f, 0.16f, 8f, 24f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f)), new MonsterEvent(Assets.kamikazieBug, new Scale(33f, 0.66f, 33f, 100f), new Scale(10f, 0.4f, 10f, 50f), new Scale(6f, 0.12f, 6f, 18f), new Scale(8f, 0.16f, 8f, 24f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[1].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[1].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[1].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class Butlers : MEvent { public static Butlers Instance; public override string Name() { return "Butlers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Nicely fashioned gentlemen", "Pop!", "Knives" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Butler, new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.2f, 5f, 25f), new Scale(1f, 0.05f, 1f, 6f), new Scale(1f, 0.07f, 1f, 8f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class Cadaver : MEvent { public static Cadaver Instance; public override string Name() { return "Cadaver"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Day of the Triffids", "Plants..", "The infection..." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.CadaverGrowths, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class CatsAndDogs : MEvent { public static CatsAndDogs Instance; public override string Name() { return "CatsAndDogs"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Who let the Dogs (And Cats) Out?", "It's raining Cats And Dogs", "It's raining Dogs And Cats" }; ColorHex = "#000000"; Type = EventType.VeryBad; isBetaEvent = true; EventsToSpawnWith = new List { "Dogs", "Puma" }; } public override void Execute() { } public override void OnShipLeave() { } public override void OnGameStart() { } } internal class Clock : MEvent { public static Clock Instance; public override string Name() { return "Clock"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "Clock", "Your time is running out" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("Clock"), 95)); EventsToRemove = new List { "SID", "RealityShift" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Coilhead : MEvent { public static Coilhead Instance; public override string Name() { return "Coilhead"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Coilheads detected in the facility!", "Containment breach!", "Dont turn your back on them...", "Did you know that a severed head usually keeps it's consciousness for about 4 to 5 seconds." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.CoilHead, new Scale(20f, 0.8f, 20f, 100f), new Scale(5f, 0.2f, 5f, 25f), new Scale(2f, 0.04f, 2f, 6f), new Scale(2f, 0.06f, 2f, 8f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class ControlPad : MEvent { public static ControlPad Instance; public override string Name() { return "ControlPad"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Control pads", "Its like a remote, but more advanced" }; ColorHex = "#e84343"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("ControlPad"), 95)); EventsToRemove = new List { "SID", "RealityShift" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class CruiserFailure : MEvent { public static CruiserFailure Instance; public new static bool Active; public override string Name() { return "CruiserFailure"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "You should have got that extended warranty", "CRUISER SYSTEM FAILURE", "The cruiser has broken down", "Vehicles are not reliable today!", "Your ignition subscription expired", "We are here for your extended warranty" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown Net.Instance.SetCruiserOfflineServerRpc(); Active = true; if (Compatibility.ScanVanPresent) { GameObject val = new GameObject("ScanVanFailure"); val.AddComponent(); } } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class Dentures : MEvent { public static Dentures Instance; public override string Name() { return "Dentures"; } public override void Initalize() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Grandma forgot her dentures...", "The tooth fairies dream", "It grins from every corner" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.Teeth), 100)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Dogs : MEvent { public static Dogs Instance; public override string Name() { return "Dogs"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "They can hear you", "Who's a good boy?", "They aren't good boys ;(", "The ground trembles under their paws", "Bring out your whoopie cushions!", "Make sure to close the door behind you" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.EyelessDog, new Scale(10f, 0.4f, 10f, 50f), new Scale(20f, 0.8f, 20f, 100f), new Scale(1f, 0.03f, 1f, 4f), new Scale(1f, 0.04f, 1f, 5f), new Scale(1f, 0.03f, 1f, 4f), new Scale(2f, 0.04f, 2f, 6f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].insideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class Dustpans : MEvent { public static Dustpans Instance; public override string Name() { return "Dustpans"; } public override void Initalize() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown Instance = this; Weight = 1; Descriptions = new List { "What even is this thing?", "Dust pans?" }; ColorHex = "#FFA500"; Type = EventType.Bad; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.DustPan), 90)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class EarlyShip : MEvent { public static EarlyShip Instance; public override string Name() { return "EarlyShip"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The ship has arrived a little early.", "Warp drive activated!", "The early bird catches the worm." }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "LateShip", "VeryEarlyShip", "VeryLateShip", "Hell" }; ScaleList.Add(ScaleType.TimeMax, new Scale(-45f, -0.55f, -100f, -45f)); ScaleList.Add(ScaleType.TimeMin, new Scale(-60f, -0.55f, -100f, -60f)); } public override void Execute() { Net.Instance.MoveTimeServerRpc(Random.Range(Getf(ScaleType.TimeMin), Getf(ScaleType.TimeMax))); } } internal class EasterEggs : MEvent { public static EasterEggs Instance; public override string Name() { return "EasterEggs"; } public override void Initalize() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Egg Hunt", "Don't throw it too close", "Can you find them all?" }; ColorHex = "#FFA500"; Type = EventType.Neutral; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.1f, 1f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.EasterEgg), 100)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class FacilityGhost : MEvent { public new static bool Active; public static FacilityGhost Instance; public override string Name() { return "FacilityGhost"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "There is a ghost in the facility", "Who keeps turning the lights off...", "Paranormal signature detected", "Bring your ouija board" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { Active = true; } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class FlowerSnake : MEvent { public static FlowerSnake Instance; public override string Name() { return "FlowerSnake"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "It helps if you weight a little more", "These might take your head off", "Flower snakes!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.FlowerSnake, new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f)) }; ScaleList.Add(ScaleType.DaytimeEnemyRarity, new Scale(20f, 0.8f, 20f, 100f)); } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].insideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.DaytimeEnemies, Assets.EnemyName.FlowerSnake, Get(ScaleType.DaytimeEnemyRarity)); } } internal class FootballScrap : MEvent { public static FootballScrap Instance; public override string Name() { return "FootballScrap"; } public override void Initalize() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Its football not soccer", "Balls... quite lot of them" }; ColorHex = "#e84343"; Type = EventType.Neutral; Aliases = new List { "SoccerBall", "Soccer" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("SoccerBall"), 95)); EventsToRemove = new List { "SID", "RealityShift" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class ForestGiant : MEvent { public static ForestGiant Instance; public override string Name() { return "ForestGiant"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Eddie hall in the facility?", "Why not", "You hearing stomping inside the facility." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.ForestKeeper, new Scale(1f, 0.09f, 1f, 10f), new Scale(20f, 0.8f, 20f, 100f), new Scale(1f, 0.03f, 1f, 3f), new Scale(1f, 0.04f, 1f, 4f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override bool AddEventIfOnly() { return Compatibility.StarLancereNemyEscapePresent; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].insideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class FragileEnemies : MEvent { public static FragileEnemies Instance; public override string Name() { return "FragileEnemies"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Enemies here are a little more fragile than usual.", "Should take 1 less bonk", "A mysterious ailment is making the enemies fragile..." }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "StrongEnemies" }; ScaleList.Add(ScaleType.MinHp, new Scale(-2f, -0.04f, -6f, -2f)); ScaleList.Add(ScaleType.MaxHp, new Scale(-1f, -0.03f, -4f, -1f)); } public override void Execute() { Manager.AddEnemyHp(Random.Range(Get(ScaleType.MinHp), Get(ScaleType.MaxHp) + 1)); } } internal class FullAccess : MEvent { public static FullAccess Instance; public new static bool Active; public override string Name() { return "FullAccess"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Everything is open!", "Someone left the door's open", "Every burgler's dream", "Experience true exploration", "You wont need be needing keys here" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "FacilityGhost" }; } public override void Execute() { Active = true; } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class GarbageLid : MEvent { public static GarbageLid Instance; public override string Name() { return "GarbageLid"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Trash", "GarbageLid... lot of them" }; ColorHex = "#e84343"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("GarbageLid"), 95)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "SussyPaintings", "Dustpans", "Clock", "ControlPad", "ZedDog", "PlasticCup", "ToiletPaper", "FootballScrap" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class GiantsOutside : MEvent { public static GiantsOutside Instance; public override string Name() { return "GiantsOutside"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Attack on titan!!", "Battle of giants", "Take your bets..." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.ForestKeeper, new Scale(1f, 0f, 1f, 1f), new Scale(33f, 0.66f, 33f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(4f, 0.04f, 4f, 8f), new Scale(4f, 0.04f, 4f, 12f)) }; EventsToRemove = new List { "GiantShowdown" }; } public override bool AddEventIfOnly() { return !Compatibility.theGiantSpecimensPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Gloomy : MEvent { public static Gloomy Instance; public override string Name() { return "Gloomy"; } public override void Initalize() { Instance = this; Weight = 8; Descriptions = new List { "It's gloomy out here", "Misty", "Who turned on the fog machine?" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; } public override bool AddEventIfOnly() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown LevelWeatherType currentWeather = RoundManager.Instance.currentLevel.currentWeather; LevelWeatherType val = currentWeather; return (val - 2) switch { 3 => false, 0 => false, 2 => false, 1 => false, _ => true, }; } public override void Execute() { Manager.SetAtmosphere(Assets.AtmosphereName.Foggy, state: true); } } internal class GoldenBars : MEvent { public static GoldenBars Instance; public override string Name() { return "GoldenBars"; } public override void Initalize() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown Instance = this; Weight = 1; Descriptions = new List { "Bling Bling!", "It's just like robbing a bank", "I hope this is a sign of good luck", "Are you ready to gain an extra 300+ lbs" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "RealityShift", "SID" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.GoldBar), 100)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class GoldenFacility : MEvent { public static GoldenFacility Instance; public override string Name() { return "GoldenFacility"; } public override void Initalize() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "The scrap looks shiny", "Valuable scrap ahead", "This facility is rich" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "RealityShift", "SID" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.GoldenCup), 25), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.Ring), 20), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.GoldBar), 1), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.FancyLamp), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.PerfumeBottle), 26), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.Painting), 15), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.CashRegister), 3)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class GrabbableLandmines : MEvent { public new static bool Active; public static bool LandmineDisabled; public static GrabbableLandmines Instance; public override string Name() { return "GrabbableLandmines"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Some mines have turned into scrap...", "This was a wonderful idea", "Beep, Beep, Beep.", "You can now sell some of the landmines." }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.Rarity, new Scale(0.33f, 0.0066f, 0.33f, 1f)); ScaleList.Add(ScaleType.MinAmount, new Scale(2f, 0.08f, 2f, 10f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(3f, 0.12f, 3f, 15f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Landmine]); } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown Active = true; LandmineDisabled = false; IndoorMapHazard val = new IndoorMapHazard(); val.hazardType = new IndoorMapHazardType { prefabToSpawn = Assets.GetObject(Assets.ObjectName.Landmine), spawnFacingAwayFromWall = true, spawnFacingWall = false, spawnWithBackToWall = false, spawnWithBackFlushAgainstWall = false, requireDistanceBetweenSpawns = false, disallowSpawningNearEntrances = false }; val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); IndoorMapHazard val2 = val; EventManager.hazards.Add(val2); RoundManager.Instance.currentLevel.indoorMapHazards = CollectionExtensions.AddToArray(RoundManager.Instance.currentLevel.indoorMapHazards, val2); } public override void OnShipLeave() { Active = false; LandmineDisabled = true; } public override void OnGameStart() { Active = false; LandmineDisabled = false; } } internal class GrabbableTurrets : MEvent { public new static bool Active; public static GrabbableTurrets Instance; public override string Name() { return "GrabbableTurrets"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Some turrets have turned into scrap...", "You can now offically sell some of the turrets, enjoy", "You can bring these home for an automated defense system for intruders." }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.Rarity, new Scale(0.33f, 0.0066f, 0.33f, 1f)); ScaleList.Add(ScaleType.MinAmount, new Scale(2f, 0.06f, 2f, 8f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(3f, 0.09f, 3f, 12f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Turret]); } public override void Execute() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown Active = true; IndoorMapHazard val = new IndoorMapHazard(); val.hazardType = new IndoorMapHazardType { prefabToSpawn = Assets.GetObject(Assets.ObjectName.Turret), spawnFacingAwayFromWall = true, spawnFacingWall = false, spawnWithBackToWall = false, spawnWithBackFlushAgainstWall = false, requireDistanceBetweenSpawns = false, disallowSpawningNearEntrances = false }; val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); IndoorMapHazard val2 = val; EventManager.hazards.Add(val2); RoundManager.Instance.currentLevel.indoorMapHazards = CollectionExtensions.AddToArray(RoundManager.Instance.currentLevel.indoorMapHazards, val2); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class HeavyRain : MEvent { public static HeavyRain Instance; public override string Name() { return "HeavyRain"; } public override void Initalize() { Instance = this; Weight = 8; Descriptions = new List { "Id rather stay inside", "Even an umbrella wont stop this", "Monsoon!" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "Raining", "Gloomy" }; } public override void Execute() { Manager.SetAtmosphere(Assets.AtmosphereName.Rainy, state: true); Manager.SetAtmosphere(Assets.AtmosphereName.Flooded, state: true); Manager.SetAtmosphere(Assets.AtmosphereName.Stormy, state: true); } } internal class Hell : MEvent { public static Hell Instance; public static EnemySpawnCycle.SpawnCycle insideHellSpawnCycle; public static EnemySpawnCycle.SpawnCycle outsideHellSpawnCycle; public new static bool Active; public static bool SpawnCycle; private string currentIngameWeather; public override string Name() { return "Hell"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Great reward, but at what cost...", "This is the worst event of them all", "You are going to need jesus for this one", "Before crushing the life out of you, I will show you why my power is utterly beyond question!" }; ColorHex = "#8B008B"; Type = EventType.Insane; EventsToRemove = new List { "Trees", "LeaflessBrownTrees", "Gloomy", "Raining", "HeavyRain", "Warzone", "EarlyShip", "LateShip", "VeryEarlyShip", "VeryLateShip", "MajoraMoon" }; EventsToSpawnWith = new List { "LeaflessTrees", "FacilityGhost", "Spiders", "Thumpers", "Landmines" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Bracken, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(2f, 0f, 2f, 2f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f)), new MonsterEvent(Assets.antiCoilHead, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent(Assets.EnemyName.CoilHead, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f)), new MonsterEvent(Assets.kamikazieBug, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(3f, 0f, 3f, 3f), new Scale(3f, 0f, 3f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; ScaleList.Add(ScaleType.ScrapValue, new Scale(1.75f, 0.0225f, 1.75f, 4f)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1.75f, 0.0225f, 1.75f, 4f)); ScaleList.Add(ScaleType.SpawnMultiplier, new Scale(1f, 0.02f, 1f, 3f)); ScaleList.Add(ScaleType.FactorySize, new Scale(1.5f, 0.01f, 1.5f, 2.5f)); ScaleList.Add(ScaleType.TimeMin, new Scale(860f, 0f, 860f, 860f)); ScaleList.Add(ScaleType.TimeMax, new Scale(860f, 0f, 860f, 860f)); ScaleList.Add(ScaleType.TimeSettings, new Scale(0.13953489f, 0.13953489f, 0.13953489f, 0.13953489f)); insideHellSpawnCycle = new EnemySpawnCycle.SpawnCycle { nothingWeight = 100f, spawnAttemptInterval = 30f, spawnCycleDuration = 2000f, multiplyBySpawnCurve = false, enemies = new List { new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.SnareFlea).enemyPrefab, enemyWeight = 12f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.BunkerSpider).enemyPrefab, enemyWeight = 18f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.HoardingBug).enemyPrefab, enemyWeight = 12f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Bracken).enemyPrefab, enemyWeight = 35f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Thumper).enemyPrefab, enemyWeight = 24f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Hygrodere).enemyPrefab, enemyWeight = 2f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.GhostGirl).enemyPrefab, enemyWeight = 60f, spawnCap = 20, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.NutCracker).enemyPrefab, enemyWeight = 40f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.CoilHead).enemyPrefab, enemyWeight = 30f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Jester).enemyPrefab, enemyWeight = 10f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Lasso).enemyPrefab, enemyWeight = 1f, spawnCap = 1, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Masked).enemyPrefab, enemyWeight = 25f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Butler).enemyPrefab, enemyWeight = 35f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.EyelessDog).enemyPrefab, enemyWeight = 10f, spawnCap = 3, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.nutSlayer.enemyPrefab, enemyWeight = 1f, spawnCap = 1, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.kamikazieBug.enemyPrefab, enemyWeight = 12f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.antiCoilHead.enemyPrefab, enemyWeight = 15f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside } } }; outsideHellSpawnCycle = new EnemySpawnCycle.SpawnCycle { nothingWeight = 100f, spawnAttemptInterval = 30f, spawnCycleDuration = 2000f, multiplyBySpawnCurve = false, enemies = new List { new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.EyelessDog).enemyPrefab, enemyWeight = 25f, spawnCap = 15, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.ForestKeeper).enemyPrefab, enemyWeight = 15f, spawnCap = 10, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.EarthLeviathan).enemyPrefab, enemyWeight = 5f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.OldBird).enemyPrefab, enemyWeight = 5f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.BaboonHawk).enemyPrefab, enemyWeight = 50f, spawnCap = 25, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Bracken).enemyPrefab, enemyWeight = 15f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.Jester).enemyPrefab, enemyWeight = 3f, spawnCap = 1, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.NutCracker).enemyPrefab, enemyWeight = 10f, spawnCap = 5, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }, new EnemySpawnCycle.EnemySpawnInfo { enemy = Assets.GetEnemy(Assets.EnemyName.BunkerSpider).enemyPrefab, enemyWeight = 10f, spawnCap = 3, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside } } }; foreach (EnemyType value in Assets.EnemyList.Values) { if (!((Object)(object)value == (Object)null) && !((Object)(object)value.enemyPrefab == (Object)null) && !value.isDaytimeEnemy && !insideHellSpawnCycle.enemies.Select((EnemySpawnCycle.EnemySpawnInfo x) => ((Object)x.enemy).name).Contains(((Object)value).name)) { if (value.isOutsideEnemy) { outsideHellSpawnCycle.enemies.Add(new EnemySpawnCycle.EnemySpawnInfo { enemy = value.enemyPrefab, enemyWeight = 8f, spawnCap = 2, spawnLocation = EnemySpawnCycle.SpawnLocation.Outside }); } else { insideHellSpawnCycle.enemies.Add(new EnemySpawnCycle.EnemySpawnInfo { enemy = value.enemyPrefab, enemyWeight = 8f, spawnCap = 2, spawnLocation = EnemySpawnCycle.SpawnLocation.Inside }); } } } } public override void Execute() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //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_0189: Expected O, but got Unknown if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { outsideHellSpawnCycle.enemies.RemoveAll((EnemySpawnCycle.EnemySpawnInfo x) => (Object)(object)x.enemy == (Object)(object)Assets.GetEnemy(Assets.EnemyName.Jester).enemyPrefab); outsideHellSpawnCycle.enemies.RemoveAll((EnemySpawnCycle.EnemySpawnInfo x) => (Object)(object)x.enemy == (Object)(object)Assets.GetEnemy(Assets.EnemyName.Bracken).enemyPrefab); outsideHellSpawnCycle.enemies.RemoveAll((EnemySpawnCycle.EnemySpawnInfo x) => (Object)(object)x.enemy == (Object)(object)Assets.GetEnemy(Assets.EnemyName.BunkerSpider).enemyPrefab); insideHellSpawnCycle.enemies.RemoveAll((EnemySpawnCycle.EnemySpawnInfo x) => (Object)(object)x.enemy == (Object)(object)Assets.GetEnemy(Assets.EnemyName.EyelessDog).enemyPrefab); } currentIngameWeather = ((object)Unsafe.As(ref StartOfRound.Instance.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString(); RoundManager.Instance.currentLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, -100f), new Keyframe(1f, -100f) }); RoundManager.Instance.currentLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, -100f), new Keyframe(1f, -100f) }); Manager.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); Manager.factorySizeMultiplier *= Getf(ScaleType.FactorySize); insideHellSpawnCycle.nothingWeight = 100f / Getf(ScaleType.SpawnMultiplier); outsideHellSpawnCycle.nothingWeight = 100f / Getf(ScaleType.SpawnMultiplier); currentIngameWeather = ((object)Unsafe.As(ref StartOfRound.Instance.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString(); if (currentIngameWeather != "Majora Moon") { Net.Instance.MoveTimeServerRpc(Random.Range(Getf(ScaleType.TimeMin), Getf(ScaleType.TimeMax)), Getf(ScaleType.TimeSettings)); } Manager.SetAtmosphere("bloodyrain", state: true); Manager.SetAtmosphere(Assets.AtmosphereNameList[Assets.AtmosphereName.Eclipsed], state: true); ExecuteAllMonsterEvents(); Active = true; SpawnCycle = true; } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class HigherScrapValue : MEvent { public static HigherScrapValue Instance; public override string Name() { return "HigherScrapValue"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Everything is worth slightly more!", "Premium scrap", "Gucci scrap" }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.ScrapValue, new Scale(1.1f, 0.007f, 1.1f, 1.8f)); } public override void Execute() { Manager.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); } } internal class HoardingBugs : MEvent { public static HoardingBugs Instance; public override string Name() { return "HoardingBugs"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "They look cute.", "Best served bonked", "Pretty innocent" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToSpawnWith = new List { "ScarceOutsideScrap" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.HoardingBug, new Scale(10f, 0.4f, 10f, 50f), new Scale(4f, 0.08f, 4f, 12f), new Scale(2f, 0.08f, 2f, 10f), new Scale(3f, 0.12f, 3f, 15f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f)) }; } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class HolidaySeason : MEvent { public static HolidaySeason Instance; public override string Name() { return "HolidaySeason"; } public override void Initalize() { //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "It's holiday season", "All the holidays!", "Easter, Halloween and Christmas all in one day." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.NutCracker, new Scale(7f, 0.28f, 7f, 35f), new Scale(2f, 0.08f, 2f, 10f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.03f, 1f, 4f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent(Assets.EnemyName.HoardingBug, new Scale(5f, 0.2f, 5f, 25f), new Scale(2f, 0.04f, 2f, 6f), new Scale(1f, 0.04f, 1f, 5f), new Scale(2f, 0.05f, 2f, 7f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; EventsToRemove = new List { "SID", "Trees", "LeaflessTrees", "LeaflessBrownTrees" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.EasterEgg), 40), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.Gift), 60)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); ScaleList.Add(ScaleType.MinDensity, new Scale(0.0018f, 0f, 0.0018f, 0.0018f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.0025f, 0f, 0.0025f, 0.0025f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); ExecuteAllMonsterEvents(); scrapTransmutationEvent.Execute(); Net.Instance.outsideObjectsToSpawn.Add(new Net.OutsideObjectsToSpawnMethod(Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)), 5)); } } internal class Honk : MEvent { public static Honk Instance; public override string Name() { return "Honk"; } public override void Initalize() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Honk!", "Clown fiesta", "Horns" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "SID", "RealityShift", "MaskItem" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.AirHorn), 50), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.ClownHorn), 50)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class InsideBees : MEvent { public static InsideBees Instance; public override string Name() { return "InsideBees"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "BEES!! wait...", "The facility is abuzz!", "Bee careful", "The inside is sweet", "Why was the bee fired from the barbershop? He only knew how to give a buzz cut." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Bees" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.CircuitBee, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(3f, 0.05f, 2f, 9f), new Scale(4f, 0.084f, 3f, 12f), new Scale(3f, 0.06f, 3f, 9f), new Scale(5f, 0.1f, 5f, 15f)) }; ScaleList.Add(ScaleType.DaytimeEnemyRarity, new Scale(20f, 0.8f, 20f, 100f)); } public override void Execute() { EnemyType enemy = Assets.GetEnemy(Assets.EnemyName.CircuitBee); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.Enemies, enemy, monstersToSpawn[0].insideSpawnRarity.Compute(Type)); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.OutsideEnemies, enemy, monstersToSpawn[0].outsideSpawnRarity.Compute(Type)); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.DaytimeEnemies, enemy, Get(ScaleType.DaytimeEnemyRarity)); Manager.Spawn.InsideEnemies(enemy, Random.Range(monstersToSpawn[0].minInside.Compute(Type), monstersToSpawn[0].maxInside.Compute(Type) + 1), 30f); Manager.Spawn.OutsideEnemies(enemy, Random.Range(monstersToSpawn[0].minOutside.Compute(Type), monstersToSpawn[0].maxOutside.Compute(Type) + 1)); } } public class IsMetal : MEvent { public static IsMetal Instance; public new static bool Active; public override string Name() { return "IsMetal"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Somehow, all items are affected by lightning", "Consider yourself cursed by the storm gods!" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "MetalSwitch", "NotMetal" }; } public override void Execute() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Net.Instance.SetMetalOnNetServerRpc(active: true); GameObject val = new GameObject("IsMetalObj"); val.AddComponent(); } public override void OnShipLeave() { AllMetalPatches.RestoreOriginalStates(); Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { try { AllMetalPatches.RestoreOriginalStates(); } catch (Exception ex) { Debug.LogError((object)("Error restoring original states on disconnect: " + ex.Message)); } } } internal class Jester : MEvent { public static Jester Instance; public override string Name() { return "Jester"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "I want to go home", "Lovely...", "Freeee birdd" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Jester, new Scale(10f, 0.34f, 10f, 50f), new Scale(5f, 0.167f, 5f, 25f), new Scale(2f, 0.03f, 2f, 5f), new Scale(2f, 0.05f, 2f, 7f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0.02f, 0f, 1f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class KamikazieBugs : MEvent { public static KamikazieBugs Instance; public override string Name() { return "KamikazieBugs"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "I rather not anger them if I were you.", "Did you know that hoarding bugs have organs? Well these ones have bombs...", "I hope you meet an army of them.", "An invasion of self-destructing pests inside the facility." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.kamikazieBug, new Scale(10f, 0.4f, 10f, 50f), new Scale(4f, 0.08f, 4f, 12f), new Scale(2f, 0.08f, 2f, 10f), new Scale(3f, 0.12f, 3f, 15f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class KidnapperFox : MEvent { public static KidnapperFox Instance; public new static bool Active; public override string Name() { return "KidnapperFox"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "He's back, and he's not happy." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.BushWolf, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0.1f, 1f, 4f)) }; ScaleList.Add(ScaleType.minMold, new Scale(10f, 1f, 10f, 15f)); ScaleList.Add(ScaleType.maxMold, new Scale(30f, 2f, 30f, 40f)); } public override void Execute() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].insideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } Net.Instance.SaveOriginalMoldPreviousDataServerRpc(); Net.Instance.SetKidnapperFoxNetServerRpc(active: true); GameObject val = new GameObject("KidnapperFoxNet"); val.AddComponent(); Net.Instance.SetMoldServerRpc(canSpawnMold: true, (int)Random.Range(Getf(ScaleType.minMold), Getf(ScaleType.maxMold))); ExecuteAllMonsterEvents(); } public override void OnShipLeave() { RestoreOriginalStates(); Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { try { RestoreOriginalStatesOnDisconnect(); } catch (Exception ex) { Debug.LogError((object)("Error restoring original states on disconnect: " + ex.Message)); } } public void RestoreOriginalStates() { SelectableLevel currentLevel = RoundManager.Instance.currentLevel; if ((Object)(object)currentLevel != (Object)null && Manager.originalMoonMoldData.TryGetValue(currentLevel.PlanetName, out var value)) { Log.LogInfo("Resetting the moon mold data for " + currentLevel.PlanetName); (currentLevel.canSpawnMold, currentLevel.moldSpreadIterations) = value; } Manager.originalMoonMoldData.Clear(); } public void RestoreOriginalStatesOnDisconnect() { foreach (KeyValuePair originalMoonMoldDatum in Manager.originalMoonMoldData) { string planetName = originalMoonMoldDatum.Key; (bool, int) value = originalMoonMoldDatum.Value; bool item = value.Item1; int item2 = value.Item2; SelectableLevel val = ((IEnumerable)StartOfRound.Instance.levels).FirstOrDefault((Func)((SelectableLevel l) => l.PlanetName == planetName)); if ((Object)(object)val != (Object)null) { Log.LogInfo("Resetting the moon mold data for " + planetName); val.canSpawnMold = item; val.moldSpreadIterations = item2; } } Manager.originalMoonMoldData.Clear(); } } internal class KiwiBird : MEvent { public static KiwiBird Instance; public override string Name() { return "KiwiBird"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Eggs for breakfast!", "Egging you on", "Is it worth it?", "Beware of the Giant Kiwi", "Whats that pecking noise?", "Its like a woodpecker but..." }; ColorHex = "#800000"; Type = EventType.VeryBad; isSpecialEvent = true; isBetaEvent = false; } public override void Execute() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) GameObject hangarShip = Assets.hangarShip; if ((Object)(object)hangarShip == (Object)null) { return; } try { Vector3 position = hangarShip.transform.position; Vector3 randomNavMeshPositionInRadiusSpherical = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 170f, default(NavMeshHit)); EnemyType enemy = Assets.GetEnemy(Assets.EnemyName.GiantKiwi); RoundManager.Instance.SpawnEnemyGameObject(randomNavMeshPositionInRadiusSpherical, 0f, 1, enemy); if ((Object)(object)Object.FindObjectOfType() == (Object)null) { Log.LogWarning("A nest was not found. Spawning Next"); GiantKiwiAI val = Object.FindObjectOfType(); try { val.SpawnBirdNest(); return; } catch (Exception ex) { Log.LogError("Error while spawning GiantKiwiAI nest: " + ex.Message); return; } } } catch (Exception ex2) { Log.LogError("Error while spawning GiantKiwiAI: " + ex2.Message); } } } internal class Landmines : MEvent { public static Landmines Instance; public override string Name() { return "Landmines"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Watch your step", "This facility is rigged", "Landmines, yes", "+Landmines" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinAmount, new Scale(5f, 0.2f, 5f, 25f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(7f, 0.28f, 7f, 35f)); ScaleList.Add(ScaleType.MinPercentSelected, new Scale(0f, 0f, 0f, 0f)); ScaleList.Add(ScaleType.MaxPercentSelected, new Scale(1f, 0f, 1f, 1f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Landmine]); } public override void Execute() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0049: Expected O, but got Unknown //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_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown IndoorMapHazard val = new IndoorMapHazard(); val.hazardType = new IndoorMapHazardType { prefabToSpawn = Assets.GetObject(Assets.ObjectName.Landmine), spawnFacingAwayFromWall = true, spawnFacingWall = false, spawnWithBackToWall = false, spawnWithBackFlushAgainstWall = false, requireDistanceBetweenSpawns = false, disallowSpawningNearEntrances = false }; val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(Getf(ScaleType.MinPercentSelected), (float)Get(ScaleType.MinAmount)), new Keyframe(Getf(ScaleType.MaxPercentSelected), (float)Get(ScaleType.MaxAmount)) }); IndoorMapHazard val2 = val; EventManager.hazards.Add(val2); RoundManager.Instance.currentLevel.indoorMapHazards = CollectionExtensions.AddToArray(RoundManager.Instance.currentLevel.indoorMapHazards, val2); } } internal class LateShip : MEvent { public static LateShip Instance; private string currentIngameWeather; private string currentSelectableLevel; public override string Name() { return "LateShip"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The ship has arrived a little late.", "Warp drive failed!", "Behind schedule." }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "VeryEarlyShip", "EarlyShip", "VeryLateShip", "Hell", "MajoraMoon" }; ScaleList.Add(ScaleType.TimeMin, new Scale(50f, 1f, 50f, 150f)); ScaleList.Add(ScaleType.TimeMax, new Scale(60f, 1.2f, 60f, 180f)); } public override bool AddEventIfOnly() { currentIngameWeather = ((object)Unsafe.As(ref StartOfRound.Instance.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString(); currentSelectableLevel = ((object)Unsafe.As(ref Manager.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString(); if (currentIngameWeather == "Majora Moon" || currentSelectableLevel == "Majora Moon") { if (Configuration.ExtraLogging.Value) { Log.LogInfo("Event not added due to Majora Moon weather."); } return false; } return true; } public override void Execute() { Net.Instance.MoveTimeServerRpc(Random.Range(Getf(ScaleType.TimeMin), Getf(ScaleType.TimeMax))); } } internal class LeaflessBrownTrees : MEvent { public static LeaflessBrownTrees Instance; public override string Name() { return "LeaflessBrownTrees"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "These trees look spooky", "Brown leafless trees", "Ok" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "Trees", "LeaflessTrees" }; ScaleList.Add(ScaleType.MinDensity, new Scale(0.018f, 0f, 0.018f, 0.018f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.025f, 0f, 0.025f, 0.025f)); } public override void Execute() { if (!LeaflessTrees.Instance.Executed && !Trees.Instance.Executed) { Net.Instance.outsideObjectsToSpawn.Add(new Net.OutsideObjectsToSpawnMethod(Random.Range(Getf(ScaleType.MinDensity) * 0.5f, Getf(ScaleType.MaxDensity) * 0.5f), 4)); } } } internal class LeaflessTrees : MEvent { public static LeaflessTrees Instance; public override string Name() { return "LeaflessTrees"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "These trees look dead", "These trees have lost their touch", "It's winter" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "Trees", "LeaflessBrownTrees" }; ScaleList.Add(ScaleType.MinDensity, new Scale(0.018f, 0f, 0.018f, 0.018f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.025f, 0f, 0.025f, 0.025f)); } public override void Execute() { if (!LeaflessBrownTrees.Instance.Executed && !Trees.Instance.Executed) { Net.Instance.outsideObjectsToSpawn.Add(new Net.OutsideObjectsToSpawnMethod(Random.Range(Getf(ScaleType.MinDensity) * 0.25f, Getf(ScaleType.MaxDensity) * 0.25f), 9)); Net.Instance.outsideObjectsToSpawn.Add(new Net.OutsideObjectsToSpawnMethod(Random.Range(Getf(ScaleType.MinDensity) * 0.25f, Getf(ScaleType.MaxDensity) * 0.25f), 10)); } } } internal class LittleGirl : MEvent { public static LittleGirl Instance; public override string Name() { return "LittleGirl"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "They just want to touch you", "Do you want your head to explode?", "They just want to play with you", "A kingergarten of dead children" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.GhostGirl, new Scale(20f, 0.8f, 20f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(3f, 0.06f, 3f, 9f), new Scale(3f, 0.09f, 3f, 12f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Lizard : MEvent { public static Lizard Instance; public override string Name() { return "Lizard"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "They dont bite... i swear", "Annoying ones...", "MOVE!!!!!!!!", "These will fart on you, And it isn't pleasent." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.SporeLizard, new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(1f, 0.02f, 1f, 3f), new Scale(2f, 0.04f, 2f, 6f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } [HarmonyPatch] internal class LockedEntrance : MEvent { public static LockedEntrance Instance; public new static bool Active; public override string Name() { return "LockedEntrance"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The entrance is locked", "The entrance is blocked", "Time for the fire exit" }; ColorHex = "#000000"; Type = EventType.VeryBad; isSpecialEvent = true; } public override void Execute() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Net.Instance.SetEntranceServerRpc(active: true); GameObject val = new GameObject("LockEntranceObject"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { } [HarmonyPrefix] [HarmonyPatch(typeof(InteractTrigger), "Interact")] public static bool InterruptEntranceTeleport(Transform playerTransform, InteractTrigger __instance) { if (Active) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null) { Transform transform = ((Component)__instance).transform; if (((Object)transform).name.Contains("EntranceTeleportA")) { __instance.interactable = false; switch (Random.Range(0, 3)) { case 0: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "The entrance is locked!"; break; case 1: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "You can't go through here!"; break; case 2: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "The door is blocked!"; break; default: ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "DOOR IS LOCKED!!!!"; break; } HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } } } return true; } } internal class Locusts : MEvent { public static Locusts Instance; public override string Name() { return "Locusts"; } public override void Initalize() { Instance = this; Weight = 8; Descriptions = new List { "Locust season is here", "Locusts", "The air fills with the sound of wings." }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.RoamingLocust, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(5f, 0f, 5f, 5f), new Scale(8f, 0f, 8f, 8f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Masked : MEvent { public static Masked Instance; public override string Name() { return "Masked"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Friends!!", "Say hi to your new friends", "Lovely bunch of lads", "You might have trust issues after this", "Who's this new guy???" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Masked, new Scale(10f, 0.4f, 10f, 50f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.03f, 1f, 4f), new Scale(1f, 0.05f, 1f, 6f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class MaskItem : MEvent { public static MaskItem Instance; public override string Name() { return "MaskItem"; } public override void Initalize() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Funny Faces, Everywhere", "As long as you dont put it on", "Silly masks, guaranteed comedic fun", "Just dont become of one of them with this..." }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(1f, 0f, 1f, 1f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.Comedy), 50), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.Tragedy), 50)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } public class MetalSwitch : MEvent { public static MetalSwitch Instance; public new static bool Active; public override string Name() { return "MetalSwitch"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The conduction of lightning has been switched!", "Metal items are now not metal, and non-metal items are now metal!" }; ColorHex = "#CF9FFF"; Type = EventType.Neutral; EventsToRemove = new List { "IsMetal", "NotMetal" }; } public override void Execute() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Net.Instance.SetMetalSwitchNetServerRpc(active: true); GameObject val = new GameObject("MetalSwitch"); val.AddComponent(); } public override void OnShipLeave() { AllMetalPatches.RestoreOriginalStates(); Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { try { AllMetalPatches.RestoreOriginalStates(); } catch (Exception ex) { Debug.LogError((object)("Error restoring original states on disconnect: " + ex.Message)); } } } internal class Meteors : MEvent { public static Meteors Instance; public override string Name() { return "Meteors"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Maybe looking up isnt such a bad idea", "Meteors, seek cover!", "Falling rocks... great" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "Raining", "Gloomy", "HeavyRain" }; } public override void Execute() { TimeOfDay.Instance.overrideMeteorChance = 1000; TimeOfDay.Instance.meteorShowerAtTime = 6f; } public override void OnShipLeave() { TimeOfDay.Instance.overrideMeteorChance = -1; TimeOfDay.Instance.meteorShowerAtTime = -1f; } public override void OnGameStart() { TimeOfDay.Instance.overrideMeteorChance = -1; TimeOfDay.Instance.meteorShowerAtTime = -1f; } } internal class MoreExits : MEvent { public static MoreExits Instance; public override string Name() { return "MoreExits"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "More entrances!", "More exits!", "Where does this lead?" }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.MinAmount, new Scale(2f, 0.03f, 2f, 5f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(3f, 0.05f, 3f, 8f)); } public override void Execute() { Passage.SpawnBunkerPassage(Random.Range(Get(ScaleType.MinAmount), Get(ScaleType.MaxAmount) + 1)); } } internal class MoreScrap : MEvent { public static MoreScrap Instance; public override string Name() { return "MoreScrap"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "There is slighly more scrap in the facility!", "This facility was slighly more productive than others.", "Scrap but more." }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1.1f, 0.007f, 1.1f, 1.8f)); } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); } } internal class NoBaboons : MEvent { public static NoBaboons Instance; public override string Name() { return "NoBaboons"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No gangs", "No stealing", "It's free real estate" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "BaboonHorde", "Hell" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.BaboonHawk); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.BaboonHawk); } } internal class NoBirds : MEvent { public static NoBirds Instance; public override string Name() { return "NoBirds"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No birds", "No birbs", "No flower snakes!" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Birds", "Hell", "FlowerSnake" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Manticoil) || Manager.SpawnExists(Assets.EnemyName.FlowerSnake); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Manticoil); Manager.RemoveSpawn(Assets.EnemyName.FlowerSnake); } } internal class NoBracken : MEvent { public static NoBracken Instance; public override string Name() { return "NoBracken"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No stalkers", "No chiropractor's", "No more disappearing." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Bracken", "Hell" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Bracken); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Bracken); } } internal class NoButlers : MEvent { public static NoButlers Instance; public override string Name() { return "NoButlers"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No suits", "No bubblewrap", "No popping", "This facility is missing knives.", "This facility is dirty." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Butlers", "Hell" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Butler); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Butler); } } internal class NoCoilhead : MEvent { public static NoCoilhead Instance; public override string Name() { return "NoCoilhead"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Nothing to stare at today", "No decapitation today, i hope", "No more springs." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "Hell" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.CoilHead); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.CoilHead); } } internal class NoDogs : MEvent { public static NoDogs Instance; public override string Name() { return "NoDogs"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No Barking", "You can now party without uninvited guests", "No more doggos" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Dogs", "Hell", "Shrimp" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.EyelessDog) || Manager.SpawnExists("ShrimpEnemy") || Manager.SpawnExists("Football"); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.EyelessDog); Manager.RemoveSpawn("ShrimpEnemy"); Manager.RemoveSpawn("Football"); } } internal class NoGhosts : MEvent { public static NoGhosts Instance; public override string Name() { return "NoGhosts"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No ghosts", "No more paranormal activity", "The ghost busters have cleared this facility of ghosts." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "LittleGirl", "FacilityGhost", "Hell", "Walkers", "Herobrine", "SlenderMan" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.GhostGirl) || Manager.SpawnExists("WalkerType") || Manager.SpawnExists("Herobrine") || Manager.SpawnExists("Football"); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.GhostGirl); Manager.RemoveSpawn("WalkerType"); Manager.RemoveSpawn("Herobrine"); Manager.RemoveSpawn("Football"); } } internal class NoGiants : MEvent { public static NoGiants Instance; public override string Name() { return "NoGiants"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No stomping", "Eddie hall isn't allowed here", "No creature's with an IQ of a toddler here, I hope." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "ForestGiant", "Hell", "SirenHead", "RollingGiants" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.ForestKeeper) || Manager.SpawnExists("PinkGiantObj") || Manager.SpawnExists("RollingGiant_EnemyType") || Manager.SpawnExists("RollingGiant_EnemyType_Outside") || Manager.SpawnExists("RollingGiant_EnemyType_Outside_Daytime") || Manager.SpawnExists("SirenHead"); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.ForestKeeper); Manager.RemoveSpawn("PinkGiantObj"); Manager.RemoveSpawn("RollingGiant_EnemyType"); Manager.RemoveSpawn("RollingGiant_EnemyType_Outside"); Manager.RemoveSpawn("RollingGiant_EnemyType_Outside_Daytime"); Manager.RemoveSpawn("SirenHead"); } } internal class NoHoardingBugs : MEvent { public static NoHoardingBugs Instance; public override string Name() { return "NoHoardingBugs"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No critters", "No cuties", "Why are they gone :(" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "HoardingBugs", "BugHorde", "KamikazieBugs", "Hell", "HolidaySeason" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.HoardingBug); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.HoardingBug); } } internal class NoJester : MEvent { public static NoJester Instance; public override string Name() { return "NoJester"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No more jackbox's", "No cranking", "You dont need to go home today" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Jester", "Hell" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Jester); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Jester); } } internal class NoLandmines : MEvent { public static NoLandmines Instance; public override string Name() { return "NoLandmines"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No landmines", "No need to be wary of the floor today.", "Dont expect mines" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Landmines", "OutsideLandmines", "Warzone", "GrabbableLandmines", "Hell", "Roomba" }; } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Landmine]) || Manager.SpawnExists("Boomba"); } public override void Execute() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown AnimationCurve numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 0f) }); SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { if (((Object)val.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Landmine]) { val.numberToSpawn = numberToSpawn; } } Manager.RemoveSpawn("Boomba"); } } internal class NoLizards : MEvent { public static NoLizards Instance; public override string Name() { return "NoLizards"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No lizards", "No immortal things for whatever reason", "No gas gas gas" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Lizard" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.SporeLizard); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.SporeLizard); } } internal class NoMasks : MEvent { public static NoMasks Instance; public override string Name() { return "NoMasks"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "Masked", "NutSlayer" }; Weight = 1; Descriptions = new List { "No friends :(", "No more hugs", "No more trust issues" }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Masked); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Masked); } } internal class NoNutcracker : MEvent { public static NoNutcracker Instance; public override string Name() { return "NoNutcracker"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No nutcrackers", "You are allowed to move", "You wont need to bring your metal codpiece here." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Nutcracker", "NutSlayer", "Hell", "HolidaySeason" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.NutCracker); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.NutCracker); } } internal class NoOldBird : MEvent { public static NoOldBird Instance; public override string Name() { return "NoOldBird"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "OldBirds", "Hell" }; Weight = 1; Descriptions = new List { "No robots", "No deranged children", "No more giant killers" }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.OldBird); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.OldBird); } } internal class NoSlimes : MEvent { public static NoSlimes Instance; public override string Name() { return "NoSlimes"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No goo", "No slimes", "A mysterious force repels slimes", "The absence of slimes bring a calm to this planet." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Slimes", "Hell" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Hygrodere); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Hygrodere); } } internal class NoSnareFleas : MEvent { public static NoSnareFleas Instance; public override string Name() { return "NoSnareFleas"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No Ceiling campers!", "Your head is safe, I hope...", "No fine dining" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "SnareFleas", "Worms" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.SnareFlea); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.SnareFlea); } } internal class NoSpiders : MEvent { public static NoSpiders Instance; public override string Name() { return "NoSpiders"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No 8 legged creatures", "No arachnophobia", "You don't need to bring a hoover inside the facility." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Spiders", "Arachnophobia", "Hell", "NutSlayer" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.BunkerSpider); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.BunkerSpider); } } internal class NoSpikeTraps : MEvent { public static NoSpikeTraps Instance; public override string Name() { return "NoSpikeTraps"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No spikes!", "No roof traps", "No hydraulic press" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "SpikeTraps", "Hell" }; } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.SpikeRoofTrap]); } public override void Execute() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown AnimationCurve numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 0f) }); SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { if (((Object)val.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.SpikeRoofTrap]) { val.numberToSpawn = numberToSpawn; } } } } internal class Nothing : MEvent { public static Nothing Instance; public override string Name() { return "Nothing"; } public override void Initalize() { Instance = this; Weight = 8; Descriptions = new List { "--Nothing--", "Literlly nothing", "Wow it's nothing", "---", "The clouds are happy", "In a suprising twist, nothing happens.", "Consider this a good thing" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; } } internal class NoThumpers : MEvent { public static NoThumpers Instance; public override string Name() { return "NoThumpers"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No crawlers", "No drifing", "No more running", "No more sharks", "No legless" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Thumpers", "Hell", "NutSlayer" }; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.Thumper); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.Thumper); } } public class NotMetal : MEvent { public static NotMetal Instance; public new static bool Active; public override string Name() { return "NotMetal"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Items are not affected by lightning", "Consider yourself blessed by the storm gods!" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "MetalSwitch", "IsMetal" }; } public override void Execute() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Net.Instance.SetMetalOffNetServerRpc(active: true); GameObject val = new GameObject("NotMetal"); val.AddComponent(); } public override void OnShipLeave() { AllMetalPatches.RestoreOriginalStates(); Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { try { AllMetalPatches.RestoreOriginalStates(); } catch (Exception ex) { Debug.LogError((object)("Error restoring original states on disconnect: " + ex.Message)); } } } internal class NoTurrets : MEvent { public static NoTurrets Instance; public override string Name() { return "NoTurrets"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "No turrets", "No more home security defense system", "This planet is safe from it's tyranny." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Turrets", "OutsideTurrets", "Warzone", "GrabbableTurrets", "Hell", "MobileTurrets" }; } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Turret]); } public override void Execute() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown Manager.RemoveSpawn("WalkerTurret"); AnimationCurve numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 0f) }); SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { if (((Object)val.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Turret]) { val.numberToSpawn = numberToSpawn; } } } } internal class NoWorm : MEvent { public static NoWorm Instance; public override string Name() { return "NoWorm"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "Worms" }; Weight = 1; Descriptions = new List { "No worms", "No leviathans", "The earth is safe", "No delicacy" }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists(Assets.EnemyName.EarthLeviathan); } public override void Execute() { Manager.RemoveSpawn(Assets.EnemyName.EarthLeviathan); } } internal class Nutcracker : MEvent { public static Nutcracker Instance; public override string Name() { return "Nutcracker"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "This facility is armed.", "You better bring your codpiece", "Try moving, i dare you..." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "Turrets" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.NutCracker, new Scale(33f, 0.66f, 33f, 100f), new Scale(10f, 0.4f, 10f, 50f), new Scale(2f, 0.04f, 2f, 6f), new Scale(3f, 0.06f, 3f, 9f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class NutSlayer : MEvent { public static NutSlayer Instance; public override string Name() { return "NutSlayer"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The nut slayer is inside the facility...", "Enjoy", "I should make this thing play doom music.", "Even god wont save you from him." }; ColorHex = "#280000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "Gloomy", "Thumpers", "Spiders", "Masked" }; EventsToRemove = new List { "HeavyRain", "Raining" }; monstersToSpawn = new List { new MonsterEvent(Assets.nutSlayer, new Scale(1f, 0.04f, 1f, 5f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; ScaleList.Add(ScaleType.SpawnMultiplier, new Scale(1.25f, 0.0075f, 1.25f, 2f)); ScaleList.Add(ScaleType.SpawnCapMultiplier, new Scale(1.4f, 0.016f, 1.4f, 3f)); } public override void Execute() { ExecuteAllMonsterEvents(); Manager.MultiplySpawnChance(RoundManager.Instance.currentLevel, Getf(ScaleType.SpawnMultiplier)); Manager.MultiplySpawnCap(Getf(ScaleType.SpawnCapMultiplier)); } } internal class OldBirds : MEvent { public static OldBirds Instance; public override string Name() { return "OldBirds"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Who put that thing in there??", "Mentally deranged toddlers", "Does the lighnting kill them?" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "Landmines", "OutsideLandmines" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.OldBird, new Scale(1f, 0.4f, 1f, 5f), new Scale(33f, 0.66f, 33f, 100f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(2f, 0.04f, 2f, 6f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].insideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class OutsideLandmines : MEvent { public static OutsideLandmines Instance; public override string Name() { return "OutsideLandmines"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "There are landmines, Outside.", "This facility also has setup its own booby traps outside", "Watch your step... but outside", "Step outside and meet your doom!" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinDensity, new Scale(0.003f, 0.00012f, 0.003f, 0.015f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.0042f, 0.000168f, 0.0042f, 0.021f)); } public override void Execute() { Manager.insideObjectsToSpawnOutside.Add(new Manager.ObjectInfo(Assets.GetObject(Assets.ObjectName.Landmine), Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)))); } } internal class OutsideTurrets : MEvent { public static OutsideTurrets Instance; public override string Name() { return "OutsideTurrets"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The turrets blend in with the trees...", "I hope you enjoy getting shot", "A beautiful day to go outside." }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToSpawnWith = new List { "Trees" }; EventsToRemove = new List { "LeaflessBrownTrees", "LeaflessTrees" }; ScaleList.Add(ScaleType.MinDensity, new Scale(0.0008f, 2.4E-05f, 0.0008f, 0.0032f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.0012f, 3.6E-05f, 0.0012f, 0.0048f)); } public override void Execute() { Manager.insideObjectsToSpawnOutside.Add(new Manager.ObjectInfo(Assets.GetObject(Assets.ObjectName.Turret), Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)))); } } internal class Pickles : MEvent { public static Pickles Instance; public override string Name() { return "Pickles"; } public override void Initalize() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Tastes salty...", "Reminds me of grandma", "This cellar is massive" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.JarOfPickles), 100)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class PlasticCup : MEvent { public static PlasticCup Instance; public override string Name() { return "PlasticCup"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "Cups... nothing more", "Plastic cups" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("PlasticCup"), 95)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "SussyPaintings", "Dustpans", "Clock", "ControlPad", "ZedDog" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class PlentyOutsideScrap : MEvent { public static PlentyOutsideScrap Instance; public override string Name() { return "PlentyOutsideScrap"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "There is some scrap to be found outside.", "This facility lacks proper waste disposal", "Yay, scrap outside" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "ScarceOutsideScrap" }; ScaleList.Add(ScaleType.MinItemAmount, new Scale(9f, 0.09f, 9f, 18f)); ScaleList.Add(ScaleType.MaxItemAmount, new Scale(12f, 0.12f, 12f, 24f)); } public override void Execute() { Manager.Spawn.OutsideScrap(Random.Range(Get(ScaleType.MinItemAmount), Get(ScaleType.MaxItemAmount) + 1)); } } internal class Puma : MEvent { public static Puma Instance; public override string Name() { return "Puma"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Kitties", "They exist for hunting you..", "Puma.. and we don't mean the brand." }; ColorHex = "#FF0000"; Type = EventType.Bad; MoonMode = true; Whitelist = new List { "Vow", "March" }; isBetaEvent = true; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Puma, new Scale(0f, 0f, 0f, 0f), new Scale(5f, 0.2f, 5f, 25f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(2f, 0.6f, 2f, 6f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Raining : MEvent { public static Raining Instance; public override string Name() { return "Raining"; } public override void Initalize() { Instance = this; Weight = 8; Descriptions = new List { "It's raining out here", "Rain...", "The only thing you will see in Ireland" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; } public override bool AddEventIfOnly() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown LevelWeatherType currentWeather = RoundManager.Instance.currentLevel.currentWeather; LevelWeatherType val = currentWeather; return (val - 1) switch { 0 => false, 1 => false, 3 => false, _ => true, }; } public override void Execute() { Manager.SetAtmosphere(Assets.AtmosphereName.Rainy, state: true); } } internal class RealityShift : MEvent { public new static bool Active; public static RealityShift Instance; public override string Name() { return "RealityShift"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Reality is not what it seems", "The scrap might turn into a landmine", "I hope you are ready to cry", "You might be lucky" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { Net.Instance.SetRealityShiftActiveServerRpc(state: true); } public override void OnShipLeave() { Net.Instance.SetRealityShiftActiveServerRpc(state: false); } public override void OnGameStart() { Active = false; } } internal class SafeOutside : MEvent { public static SafeOutside Instance; public new static bool Active; public override string Name() { return "SafeOutside"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "NoOldBird", "NoDogs", "NoGiants", "NoBaboons", "NoWorm", "NoMasks", "NoBirds", "Warzone", "OutsideTurrets", "OutsideLandmines", "Masked", "AllWeather" }; Weight = 1; Descriptions = new List { "Outside is safe!", "It's unusally quiet outside", "You might find bees outside but that is about it", "You can hear your own footstep's echo as you walk outside." }; ColorHex = "#00FF00"; Type = EventType.VeryGood; } public override bool AddEventIfOnly() { return !Compatibility.lethalEscapePresent; } public override void Execute() { Active = true; Manager.RemoveSpawn(Assets.EnemyName.Masked); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class ScarceOutsideScrap : MEvent { public static ScarceOutsideScrap Instance; public override string Name() { return "ScarceOutsideScrap"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "There is a scarce amount of scrap outside.", "Someone dumped these out here...", "Grab it before the baboons do" }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.MinItemAmount, new Scale(3f, 0.06f, 3f, 9f)); ScaleList.Add(ScaleType.MaxItemAmount, new Scale(4f, 0.08f, 4f, 12f)); } public override void Execute() { Manager.Spawn.OutsideScrap(Random.Range(Get(ScaleType.MinItemAmount), Get(ScaleType.MaxItemAmount) + 1)); } } internal class ScrapGalore : MEvent { public static ScrapGalore Instance; public override string Name() { return "ScrapGalore"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Scrap here is plentiful and of high quality.", "This planet is blessed with scrap", "You are going to be rich after this haul" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; ScaleList.Add(ScaleType.ScrapValue, new Scale(1.35f, 0.0115f, 1.35f, 2.5f)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1.35f, 0.0115f, 1.35f, 2.5f)); EventsToRemove = new List { "HigherScrapValue", "MoreScrap" }; } public override void Execute() { Manager.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); } } internal class SeveredBits : MEvent { public static SeveredBits Instance; public override string Name() { return "SeveredBits"; } public override void Initalize() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "Yoshikage Kira", "All the little pieces", "Company has interesting tastes", "I hope these are not real" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "SID" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredBone), 13), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredBoneRib), 12), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredEar), 12), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredFoot), 12), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredHand), 13), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredHeart), 13), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredThigh), 12), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SeveredTongue), 13)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.1f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } [HarmonyPatch] internal class ShipLightsFailure : MEvent { public static ShipLightsFailure Instance; public override string Name() { return "ShipLightsFailure"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Lighting system: OFFLINE", "The lights are busted!" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown Net.Instance.LightsOffServerRpc(); Active = true; GameObject val = new GameObject("ShipLightsFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Net.Instance.LightsOnServerRpc(); } public override void OnLocalDisconnect() { } } internal class ShipmentFees : MEvent { public new static bool Active; public static ShipmentFees Instance; public override string Name() { return "ShipmentFees"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The company is now incurring a fee for shipments!", "You are going to be taxed for any shipments...", "I don't recommend buying anything today.", "You might go into debt, beware" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinCut, new Scale(0.2f, 0.004f, 0.2f, 0.6f)); ScaleList.Add(ScaleType.MaxCut, new Scale(0.3f, 0.006f, 0.3f, 0.9f)); } public override void Execute() { Active = true; } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class SID : MEvent { public static SID Instance; public override string Name() { return "SID"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Single Item Day", "Very Special Day" }; ColorHex = "#00FFFF"; Type = EventType.Rare; isBetaEvent = true; ScaleList.Add(ScaleType.ScrapValue, new Scale(1.35f, 0.0115f, 1.35f, 2.5f)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1.35f, 0.0115f, 1.35f, 2.5f)); EventsToRemove = new List { "Clock", "ControlPad", "Dentures", "Dustpans", "FootballScrap", "EasterEggs", "GarbageLid", "GoldenBars", "GoldenFacility", "Honk", "HolidaySeason", "MaskItem", "SeveredBits", "SussyPaintings", "ToiletPaper", "Train", "ZedDog", "CityOfGold", "Bellcrab", "Dice", "BadDice", "TakeyGokuBracken", "TakeyGokuPlush", "TakeyGokuPlushBig", "TakeyPlush", "Pickles" }; } public override void Execute() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown Assets.ItemName[] array = new Assets.ItemName[65] { Assets.ItemName.LargeAxle, Assets.ItemName.V_TypeEngine, Assets.ItemName.PlasticFish, Assets.ItemName.MetalSheet, Assets.ItemName.LaserPointer, Assets.ItemName.BigBolt, Assets.ItemName.Bottles, Assets.ItemName.Ring, Assets.ItemName.SteeringWheel, Assets.ItemName.CookieMoldPan, Assets.ItemName.EggBeater, Assets.ItemName.JarOfPickles, Assets.ItemName.DustPan, Assets.ItemName.AirHorn, Assets.ItemName.ClownHorn, Assets.ItemName.CashRegister, Assets.ItemName.Candy, Assets.ItemName.GoldBar, Assets.ItemName.YieldSign, Assets.ItemName.HomemadeFlashbang, Assets.ItemName.Gift, Assets.ItemName.Flask, Assets.ItemName.ToyCube, Assets.ItemName.Remote, Assets.ItemName.ToyRobot, Assets.ItemName.MagnifyingGlass, Assets.ItemName.StopSign, Assets.ItemName.TeaKettle, Assets.ItemName.Mug, Assets.ItemName.RedSoda, Assets.ItemName.OldPhone, Assets.ItemName.HairDryer, Assets.ItemName.Brush, Assets.ItemName.Bell, Assets.ItemName.WhoopieCushion, Assets.ItemName.Comedy, Assets.ItemName.Tragedy, Assets.ItemName.RubberDucky, Assets.ItemName.ChemicalJug, Assets.ItemName.FancyLamp, Assets.ItemName.GoldenCup, Assets.ItemName.Painting, Assets.ItemName.Toothpaste, Assets.ItemName.PillBottle, Assets.ItemName.PerfumeBottle, Assets.ItemName.Teeth, Assets.ItemName.Magic7Ball, Assets.ItemName.EasterEgg, Assets.ItemName.ToyTrain, Assets.ItemName.ToiletPaper, Assets.ItemName.SoccerBall, Assets.ItemName.PlasticCup, Assets.ItemName.GarbageLid, Assets.ItemName.ControlPad, Assets.ItemName.Clock, Assets.ItemName.ZedDog, Assets.ItemName.BabyKiwiEgg, Assets.ItemName.SeveredThigh, Assets.ItemName.SeveredHand, Assets.ItemName.SeveredEar, Assets.ItemName.SeveredBone, Assets.ItemName.SeveredTongue, Assets.ItemName.SeveredHeart, Assets.ItemName.SeveredFoot, Assets.ItemName.SeveredBoneRib }; Assets.ItemName name = array[new Random(StartOfRound.Instance.randomMapSeed).Next(0, array.Length)]; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(1f, 1f, 1f, 1f), new SpawnableItemWithRarity(Assets.GetItem(name), 100)); Manager.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } [HarmonyPatch] internal class SlimeInside : MEvent { public static SlimeInside Instance; public new static bool Active; public static float SlippinessValue; public override string Name() { return "SlimeInside"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The facility is very slippery", "Be careful moving around" }; ColorHex = "#8B008B"; Type = EventType.Insane; isBetaEvent = true; isSpecialEvent = true; ScaleList.Add(ScaleType.Slipperyness, new Scale(2f, 0f, 2f, 2f)); } public override void Execute() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Net.Instance.SetSlimeServerRpc(active: true); GameObject val = new GameObject("SlimeInsideObj"); val.AddComponent(); float slimeSlipperyServerRpc = Getf(ScaleType.Slipperyness); Net.Instance.SetSlimeSlipperyServerRpc(slimeSlipperyServerRpc); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "Update")] public static void Update(PlayerControllerB __instance) { if (Active && !((Object)(object)__instance == (Object)null) && !__instance.isPlayerDead && __instance.isInsideFactory && __instance.thisController.isGrounded) { __instance.slipperyFloor = SlippinessValue; } } } internal class Slimes : MEvent { public static Slimes Instance; public override string Name() { return "Slimes"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The ground is sticky", "It's very slow unless you wack it", "Don't get lost in the sauce", "It's mostly water and pain", "blob" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Hygrodere, new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.2f, 5f, 25f), new Scale(1f, 0.03f, 1f, 4f), new Scale(1f, 0.06f, 1f, 7f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f)) }; } public override void Execute() { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); ExecuteAllMonsterEvents(); } } internal class SmallDelivery : MEvent { public static SmallDelivery Instance; public override string Name() { return "SmallDelivery"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "The company has decided to give you a present.", "Small shipment for small jobs", "Congratz, you have been awarded." }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.MinItemAmount, new Scale(2f, 0.06f, 2f, 8f)); ScaleList.Add(ScaleType.MaxItemAmount, new Scale(3f, 0.09f, 3f, 12f)); ScaleList.Add(ScaleType.MinValue, new Scale(0f, 0f, 0f, 0f)); ScaleList.Add(ScaleType.MaxValue, new Scale(30f, 2.7f, 30f, 300f)); } public override void Execute() { Manager.DeliverRandomItems(Random.Range(Get(ScaleType.MinItemAmount), Get(ScaleType.MaxItemAmount) + 1), Get(ScaleType.MinValue), Get(ScaleType.MaxValue)); } } internal class SmallerMap : MEvent { public static SmallerMap Instance; public override string Name() { return "SmallerMap"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "This facility is smaller.", "Less time running around", "This facility is more compact" }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.FactorySize, new Scale(0.75f, 0f, 0.75f, 0.75f)); } public override void Execute() { SelectableLevel currentLevel = Manager.currentLevel; currentLevel.factorySizeMultiplier *= Getf(ScaleType.FactorySize); } } internal class SnareFleas : MEvent { public static SnareFleas Instance; public override string Name() { return "SnareFleas"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Ceiling campers!", "A delicacy", "The finest of creatures", "Look up", "Look down" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.SnareFlea, new Scale(10f, 0.4f, 10f, 50f), new Scale(2f, 0.08f, 2f, 10f), new Scale(1f, 0.05f, 1f, 6f), new Scale(2f, 0.08f, 2f, 10f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class Spiders : MEvent { public static Spiders Instance; public override string Name() { return "Spiders"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Your skin crawls...", "Not for those with arachnophobia", "Bring your hoover" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "Trees", "LeaflessTrees" }; EventsToSpawnWith = new List { "LeaflessBrownTrees" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.BunkerSpider, new Scale(10f, 0.4f, 10f, 50f), new Scale(4f, 0.134f, 4f, 12f), new Scale(1f, 0.04f, 1f, 5f), new Scale(2f, 0.05f, 2f, 7f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class SpikeTraps : MEvent { public static SpikeTraps Instance; public override string Name() { return "SpikeTraps"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Spikes!!!", "I recommend looking up", "Hydraulic press!" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinAmount, new Scale(3f, 0.09f, 3f, 12f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(4f, 0.12f, 4f, 16f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.SpikeRoofTrap]); } public override void Execute() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown SelectableLevel currentLevel = RoundManager.Instance.currentLevel; SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; SpawnableMapObject val = new SpawnableMapObject(); val.prefabToSpawn = Assets.GetObject(Assets.ObjectName.SpikeRoofTrap); val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); val.spawnFacingAwayFromWall = false; val.spawnFacingWall = true; val.spawnWithBackToWall = true; val.spawnWithBackFlushAgainstWall = true; val.requireDistanceBetweenSpawns = true; val.disallowSpawningNearEntrances = false; currentLevel.spawnableMapObjects = spawnableMapObjects.Add(val); } } internal class Stingray : MEvent { public static Stingray Instance; public override string Name() { return "Stingray"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Goo!", "The goo is coming for you!" }; ColorHex = "#FF0000"; Type = EventType.Bad; isBetaEvent = true; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Stingray, new Scale(7f, 1f, 7f, 12f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.44f, 1f, 2f), new Scale(4f, 0.2f, 4f, 9f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class StrongEnemies : MEvent { public static StrongEnemies Instance; public override string Name() { return "StrongEnemies"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Enemies here are a little more tougher than usual.", "Should take an extra wack or 2", "These monsters are drugged" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinHp, new Scale(1f, 0.03f, 1f, 4f)); ScaleList.Add(ScaleType.MaxHp, new Scale(2f, 0.04f, 2f, 6f)); } public override void Execute() { Manager.AddEnemyHp(Random.Range(Get(ScaleType.MinHp), Get(ScaleType.MaxHp) + 1)); } } internal class SussyPaintings : MEvent { public static SussyPaintings Instance; public override string Name() { return "SussyPaintings"; } public override void Initalize() { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "All the sussy paintings", "69" }; ColorHex = "#FFA500"; Type = EventType.Neutral; Aliases = new List { "Paintings", "Painting" }; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("FancyPainting"), 95)); EventsToRemove = new List { "RealityShift", "Pickles", "Dustpans" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); ScaleList.Add(ScaleType.MaxValue, new Scale(30f, 0.1f, 25f, 39f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class TeleportIn : MEvent { public static TeleportIn Instance; private float startTime; private bool teleportStarted; public override string Name() { return "TeleportIn"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Forced Entry", "Hope you find your way back...", "Hope you're not in a trapped room...", "Imagine getting stuck..." }; ColorHex = "#800000"; Type = EventType.VeryBad; } public override void Execute() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown startTime = Time.fixedTime; teleportStarted = false; TimeOfDay.Instance.onTimeSync.AddListener(new UnityAction(teleportTime)); } public override void OnShipLeave() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown TimeOfDay.Instance.onTimeSync.RemoveListener(new UnityAction(teleportTime)); teleportStarted = false; startTime = 0f; } public void teleportTime() { //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_00a1: 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) if (teleportStarted || !(Time.fixedTime - startTime > 19f)) { return; } Random random = new Random(); teleportStarted = true; GameObject[] allPlayerObjects = StartOfRound.Instance.allPlayerObjects; foreach (GameObject val in allPlayerObjects) { PlayerControllerB component = val.GetComponent(); if ((Object)(object)component != (Object)null && !component.isPlayerDead) { Vector3 position = RoundManager.Instance.insideAINodes[random.Next(RoundManager.Instance.insideAINodes.Length)].transform.position; Net.Instance.TeleportPlayerServerRPC(NetworkObjectReference.op_Implicit(val), position); } } } } internal class Thumpers : MEvent { public static Thumpers Instance; public override string Name() { return "Thumpers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "You need to run", "Drifter's", "Sharks!", "Legless" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Thumper, new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(1f, 0.03f, 1f, 4f), new Scale(1f, 0.05f, 1f, 6f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } [HarmonyPatch] internal class TimeChaos : MEvent { public static TimeChaos Instance; public static float timeMultiplier; public override string Name() { return "TimeChaos"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "MADE IN HEAVEN", "Time is very messed up!", "Look at the sky" }; ColorHex = "#CF9FFF"; Type = EventType.Insane; isSpecialEvent = true; Aliases = new List { "FastDay", "MadeInHeaven" }; EventsToRemove = new List { "VeryEarlyShip", "EarlyShip", "LateShip", "VeryLateShip", "Hell" }; ScaleList.Add(ScaleType.TimeSettings, new Scale(1.0001f, 1E-05f, 1.0001f, 1.001f)); } public override void Execute() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown Active = true; timeMultiplier = Getf(ScaleType.TimeSettings); GameObject val = new GameObject("TimeChaosEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; Manager.timeSpeedMultiplier = 1f; } public override void OnGameStart() { Active = false; } } internal class ToiletPaper : MEvent { public static ToiletPaper Instance; public override string Name() { return "ToiletPaper"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Rolls of low grade paper", "Toilet paper packages" }; ColorHex = "#e84343"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("ToiletPaperRolls"), 95)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "SussyPaintings", "Dustpans", "Clock", "ControlPad", "ZedDog", "PlasticCup" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Train : MEvent { public static Train Instance; public override string Name() { return "Train"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "I like trains", "Looks like train factory" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("ToyTrain"), 95)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "SussyPaintings", "Dustpans", "Clock" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class TransmuteScrapBig : MEvent { public static TransmuteScrapBig Instance; public override string Name() { return "TransmuteScrapBig"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Most scrap has transmuted into something big...", "Everything is heavy...", "Bring your carts!!!", "This is going to be a two-handed job" }; ColorHex = "#800000"; Type = EventType.VeryBad; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); ScaleList.Add(ScaleType.Percentage, new Scale(0.5f, 0.005f, 0.5f, 0.75f)); EventsToRemove = new List { "SID", "RealityShift" }; } public override bool AddEventIfOnly() { foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (!item.spawnableItem.twoHanded || Manager.transmuteScrap) { continue; } Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); SpawnableItemWithRarity chosenScrap = Helper.GetChosenScrap((SpawnableItemWithRarity ss) => ss.spawnableItem.twoHanded); if (chosenScrap != null) { chosenScrap.spawnableItem = Assets.GetItem(((Object)chosenScrap.spawnableItem).name); Manager.TransmuteScrap(Getf(ScaleType.Percentage), new SpawnableItemWithRarity(chosenScrap.spawnableItem, 100)); float num = (float)(chosenScrap.spawnableItem.minValue + chosenScrap.spawnableItem.maxValue) * 0.25f; if (num <= 0f) { num = 40f; } Manager.scrapAmountMultiplier *= Mathf.Clamp(Mathf.Log(Assets.averageScrapValueList[Manager.GetLevelIndex()] / num, 5f) + 1f, 1f, 2f); } } } internal class TransmuteScrapSmall : MEvent { public static TransmuteScrapSmall Instance; public override string Name() { return "TransmuteScrapSmall"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Most scrap has transmuted into something small...", "This is going to be a one-handed job", "It's all the light stuff" }; ColorHex = "#008000"; Type = EventType.Good; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); ScaleList.Add(ScaleType.Percentage, new Scale(0.5f, 0.008f, 0.5f, 0.9f)); EventsToRemove = new List { "SID", "RealityShift" }; } public override bool AddEventIfOnly() { foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (item.spawnableItem.twoHanded || Manager.transmuteScrap) { continue; } Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); SpawnableItemWithRarity chosenScrap = Helper.GetChosenScrap((SpawnableItemWithRarity ss) => !ss.spawnableItem.twoHanded); if (chosenScrap != null) { chosenScrap.spawnableItem = Assets.GetItem(((Object)chosenScrap.spawnableItem).name); Manager.TransmuteScrap(Getf(ScaleType.Percentage), new SpawnableItemWithRarity(chosenScrap.spawnableItem, 100)); float num = (float)(chosenScrap.spawnableItem.minValue + chosenScrap.spawnableItem.maxValue) * 0.25f; if (num <= 0f) { num = 40f; } Manager.scrapAmountMultiplier *= Mathf.Clamp(Mathf.Log(Assets.averageScrapValueList[Manager.GetLevelIndex()] / num, 5f) + 1f, 1f, 2f); } } } [HarmonyPatch] internal class TrapsFailure : MEvent { public static TrapsFailure Instance; public override string Name() { return "TrapsFailure"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Faulty Traps", "The traps are not an issue today", "If you have traps, do not worry today!" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "BerserkTurrets" }; } public override void Execute() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("TrapsFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { } [HarmonyPrefix] [HarmonyPatch(typeof(Landmine), "OnTriggerEnter")] public static bool InterruptLandmine() { if (Instance.Active) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(Landmine), "TriggerOtherMineDelayed")] public static bool InterruptLandmineOther() { if (Instance.Active) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(Landmine), "OnTriggerExit")] public static bool InterruptLandmineExit() { if (Instance.Active) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(Landmine), "Detonate")] public static bool InterruptLandmineAttack() { if (Instance.Active) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(Turret), "Update")] public static bool InterruptTurret() { if (Instance.Active) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(SpikeRoofTrap), "Update")] public static bool InterruptSpikeRoofTrap() { if (Instance.Active) { return false; } return true; } } internal class Trees : MEvent { public static Trees Instance; public override string Name() { return "Trees"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Trees", "More trees", "The trees look like trees" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "LeaflessBrownTrees", "LeaflessTrees" }; ScaleList.Add(ScaleType.MinDensity, new Scale(0.018f, 0f, 0.018f, 0.018f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.025f, 0f, 0.025f, 0.025f)); } public override void Execute() { if (!LeaflessTrees.Instance.Executed && !LeaflessBrownTrees.Instance.Executed) { Net.Instance.outsideObjectsToSpawn.Add(new Net.OutsideObjectsToSpawnMethod(Random.Range(Getf(ScaleType.MinDensity) * 0.5f, Getf(ScaleType.MaxDensity) * 0.5f), 8)); } } } internal class Turrets : MEvent { public static Turrets Instance; public override string Name() { return "Turrets"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Turrets!!", "Home defense systems", "Panic and scream", "+Turrets" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinAmount, new Scale(3f, 0.12f, 3f, 15f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(4f, 0.16f, 4f, 20f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Turret]); } public override void Execute() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0049: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown IndoorMapHazard val = new IndoorMapHazard(); val.hazardType = new IndoorMapHazardType { prefabToSpawn = Assets.GetObject(Assets.ObjectName.Turret), spawnFacingAwayFromWall = true, spawnFacingWall = false, spawnWithBackToWall = false, spawnWithBackFlushAgainstWall = false, requireDistanceBetweenSpawns = false, disallowSpawningNearEntrances = false }; val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); IndoorMapHazard val2 = val; EventManager.hazards.Add(val2); RoundManager.Instance.currentLevel.indoorMapHazards = CollectionExtensions.AddToArray(RoundManager.Instance.currentLevel.indoorMapHazards, val2); } } internal class TurretsEverywhere : MEvent { public static TurretsEverywhere Instance; public override string Name() { return "TurretsEverywhere"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Unsafe outside", "Outside is nothing but turrets" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "RealityShift", "NoMantitoil", "SafeOutside" }; EventsToSpawnWith = new List { "OutsideTurrets", "Trees", "Mantitoil" }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } } internal class VeryEarlyShip : MEvent { public static VeryEarlyShip Instance; public override string Name() { return "VeryEarlyShip"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "The ship has arrived at a very nice time.", "Earlier than usual!", "Before Sunrise!" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "LateShip", "EarlyShip", "VeryLateShip", "Hell" }; ScaleList.Add(ScaleType.TimeMin, new Scale(-480f, -0.55f, -480f, -240f)); ScaleList.Add(ScaleType.TimeMax, new Scale(-342f, -0.55f, -342f, -300f)); } public override void Execute() { Net.Instance.MoveTimeServerRpc(Random.Range(Getf(ScaleType.TimeMin), Getf(ScaleType.TimeMax))); } } internal class VeryLateShip : MEvent { public static VeryLateShip Instance; private string currentIngameWeather; private string currentSelectableLevel; public override string Name() { return "VeryLateShip"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Way behind schedule.", "Quitting Time!!", "We should probably leave!" }; ColorHex = "#800000"; Type = EventType.VeryBad; ScaleList.Add(ScaleType.TimeMin, new Scale(780f, 0f, 780f, 780f)); ScaleList.Add(ScaleType.TimeMax, new Scale(860f, 0f, 860f, 860f)); ScaleList.Add(ScaleType.TimeSettings, new Scale(0.13953489f, 0.13953489f, 0.13953489f, 0.13953489f)); EventsToRemove = new List { "VeryEarlyShip", "EarlyShip", "LateShip", "Hell", "MajoraMoon" }; } public override bool AddEventIfOnly() { currentIngameWeather = ((object)Unsafe.As(ref StartOfRound.Instance.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString(); currentSelectableLevel = ((object)Unsafe.As(ref Manager.currentLevel.currentWeather)/*cast due to .constrained prefix*/).ToString(); if (currentIngameWeather == "Majora Moon" || currentSelectableLevel == "Majora Moon") { if (Configuration.ExtraLogging.Value) { Log.LogInfo("Event not added due to Majora Moon weather."); } return false; } return true; } public override void Execute() { int num = (int)Random.Range(Getf(ScaleType.TimeMin), Getf(ScaleType.TimeMax)); Net.Instance.MoveTimeServerRpc(num, Getf(ScaleType.TimeSettings)); } } internal class Warzone : MEvent { public new static bool Active; public static Warzone Instance; public override string Name() { return "Warzone"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Landmines? Turrets? all of it", "DDay is here", "Enjoy getting bombarded" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "LeaflessBrownTrees", "LeaflessTrees" }; EventsToSpawnWith = new List { "Turrets", "Landmines", "OutsideTurrets", "OutsideLandmines", "Trees" }; } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Turret]) || RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == Assets.ObjectNameList[Assets.ObjectName.Landmine]); } public override void Execute() { Active = true; } public override void OnShipLeave() { Active = false; DDay.DestroyInstance(); } public override void OnGameStart() { Active = false; } } internal class WelcomeToTheFactory : MEvent { public static WelcomeToTheFactory Instance; public override string Name() { return "WelcomeToTheFactory"; } public override void Initalize() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "Welcome To The Factory!", "Its all metallic??" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToSpawnWith = new List { "HeavyRain" }; EventsToRemove = new List { "SID", "RealityShift" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.BigBolt), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.CashRegister), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.MetalSheet), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.TeaKettle), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.CookieMoldPan), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.StopSign), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.EggBeater), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.V_TypeEngine), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.LargeAxle), 10), new SpawnableItemWithRarity(Assets.GetItem(Assets.ItemName.SteeringWheel), 10)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Worms : MEvent { public static Worms Instance; public override string Name() { return "Worms"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Bug Breach Detected", "The ultimate fine dining experience", "Dont make out with those things" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "SnareFleas" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.EarthLeviathan, new Scale(2f, 0.08f, 2f, 10f), new Scale(33f, 0.66f, 33f, 100f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f)), new MonsterEvent(Assets.EnemyName.SnareFlea, new Scale(20f, 0.8f, 20f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(9f, 0.14f, 9f, 31f), new Scale(10f, 0.2f, 10f, 30f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override void Execute() { if (Configuration.enforceEscapeModChecks.Value && !Compatibility.StarLancereNemyEscapePresent) { Instance.monstersToSpawn[0].minInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].maxInside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[0].insideSpawnRarity = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[1].minOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[1].maxOutside = new Scale(0f, 0f, 0f, 0f); Instance.monstersToSpawn[1].outsideSpawnRarity = new Scale(0f, 0f, 0f, 0f); } ExecuteAllMonsterEvents(); } } internal class ZedDog : MEvent { public static ZedDog Instance; public override string Name() { return "ZedDog"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "Zed dog plushies", "Dogs... but harmless" }; ColorHex = "#008000"; Type = EventType.Good; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("Zeddog"), 95)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "SussyPaintings", "Dustpans", "Clock", "ControlPad" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class AllSlayers : MEvent { public static AllSlayers Instance; public override string Name() { return "AllSlayers"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Hope you like miniguns, because they are everywhere", "MantiSlayers and ToilSlayers.... good luck!" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "Mantitoil", "ToilSlayer", "MantiToilSlayer", "NoSlayers", "NoMantitoil" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Manticoil, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(5f, 0f, 5f, 5f), new Scale(10f, 0f, 10f, 10f)), new MonsterEvent(Assets.EnemyName.CoilHead, new Scale(30f, 1f, 30f, 90f), new Scale(10f, 0.34f, 10f, 30f), new Scale(1f, 0.034f, 1f, 3f), new Scale(2f, 0.034f, 1f, 4f), new Scale(1f, 1f, 1f, 1f), new Scale(2f, 2f, 2f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceMantiSlayerMaxSpawnCount = 10; Api.ForceMantiSlayerSpawns = true; Api.ForceToilSlayerSpawns = true; Api.ForceToilSlayerMaxSpawnCount = 25; Api.ForceToilHeadMaxSpawnCount = 0; } } } internal class BadDice : MEvent { public static BadDice Instance; public override string Name() { return "BadDice"; } public override void Initalize() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Bad Dice!!!!", "You wont make it big today", "Horrible luck is bestowed upon you!" }; ColorHex = "#800000"; Type = EventType.VeryBad; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("GamblerItem"), 80), new SpawnableItemWithRarity(Assets.GetItem("SacrificerItem"), 20)); EventsToRemove = new List { "SID", "RealityShift" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.emergencyDicePresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Baldi : MEvent { public static Baldi Instance; public override string Name() { return "Baldi"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "GET OUT WHILE YOU STILL CAN!!!", "Proximity Alert: Ruler Detected.", "SLAP!", "I HEAR MATH!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("Baldi", new Scale(100f, 0f, 100f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.BaldiPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Bellcrab : MEvent { public static Bellcrab Instance; public override string Name() { return "Bellcrab"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Bells.. but are they real?", "Do you trust it?", "Dont get pinched!" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "SID" }; monstersToSpawn = new List { new MonsterEvent("BellCrabAsset", new Scale(100f, 0f, 100f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.09f, 1f, 4f), new Scale(4f, 0.07f, 4f, 10f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.SurfacedPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Bertha : MEvent { public static Bertha Instance; public override string Name() { return "Bertha"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "What if you touch it?", "Squarepants", "Say goodbye to your quota", "It will go boom" }; ColorHex = "#800000"; Type = EventType.VeryBad; isBetaEvent = true; ScaleList.Add(ScaleType.MinDensity, new Scale(0.0025f, 0.0001f, 0.004f, 0.0215f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.0042f, 0.00148f, 0.0032f, 0.045f)); } public override bool AddEventIfOnly() { return Compatibility.SurfacedPresent; } public override void Execute() { Scale minDensity = ScaleList[ScaleType.MinDensity]; Scale maxDensity = ScaleList[ScaleType.MaxDensity]; GeneralCustomEvent.HazardEvent hazardEvent = new GeneralCustomEvent.HazardEvent("Bertha", minDensity, maxDensity); hazardEvent.Type = Type; DawnLibHandling.eventQueue.Enqueue(hazardEvent); } } internal class BloodMoon : MEvent { public static BloodMoon Instance; public override string Name() { return "BloodMoon"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "I would not be upset if you could not collect any scrap", "Avoid monsters at all costs", "Did you know that it is a Blood Moon?", "Somehow I think this is worse than Eclipsed", "Nowhere is gonna be safe", "All hail the blood moon!" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Hurricane", "Hallowed", "Forsaken", "SolarFlare", "Windy", "Gloomy", "Raining", "AllWeather", "MajoraMoon" }; } public override bool AddEventIfOnly() { return Compatibility.LegendWeathersPresent && Compatibility.WeatherRegistryPresent; } public override void Execute() { if (Compatibility.LegendWeathersPresent) { CustomWeather.SetCustomWeather("Blood Moon"); } } } internal class CityOfGold : MEvent { public static CityOfGold Instance; public override string Name() { return "CityOfGold"; } public override void Initalize() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Expected O, but got Unknown //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Expected O, but got Unknown //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Expected O, but got Unknown //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Expected O, but got Unknown //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Expected O, but got Unknown //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Everything is golden!!", "Gold rush!", "A stash of gold!" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "SID", "GoldenBars" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("GoldenEggbeaterLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldMugLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldJugLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("PurifiedMaskLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenBellLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenHornLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GolderBarLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("TalkativeGoldBarLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("JacobsLadderLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldRegisterLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldAxleLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("CuddlyGoldLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenGruntLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldNuggetGoldScrapShop"), 1), new SpawnableItemWithRarity(Assets.GetItem("TiltControlsLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenGlassLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("CookieGoldPanLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldSignLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldSpringLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldkeeperLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenFlaskLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldToyRobotLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenBootsLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldTypeEngineLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenGuardianLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("ComedyGoldLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldPuzzleLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldBoltLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("GoldenAirhornLCGoldScrapMod"), 1), new SpawnableItemWithRarity(Assets.GetItem("DuckOfGoldLCGoldScrapMod"), 1)); EventsToRemove = new List { "RealityShift" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.goldScrapPresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Cleaners : MEvent { public static Cleaners Instance; public override string Name() { return "Cleaners"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Pest control", "Smoke machines", "Covid free facility", "Cleaners!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("EnemyCleaningDrone", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(3f, 0.06f, 3f, 9f), new Scale(3f, 0.09f, 3f, 12f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.moonsweptPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Critters : MEvent { public static Critters Instance; public override string Name() { return "Critters"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "They Come In Numbers", "Big smiles", "They are super cute.. or not?!" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("KickinRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("HoppyRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("BobbyRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("PickyRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("BubbaRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("CraftyRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("CatnapRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 4f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("DogdayRuinedEnemyType", new Scale(45f, 3f, 45f, 90f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.CrittersPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Dice : MEvent { public static Dice Instance; public override string Name() { return "Dice"; } public override void Initalize() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Dice!!!!", "Did you know that 90% of gamblers quit just before they hit big?", "50/50", "Questionable luck" }; ColorHex = "#008000"; Type = EventType.Good; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("Saint"), 4), new SpawnableItemWithRarity(Assets.GetItem("Chronos"), 10), new SpawnableItemWithRarity(Assets.GetItem("RustyItem"), 45), new SpawnableItemWithRarity(Assets.GetItem("GamblerItem"), 25), new SpawnableItemWithRarity(Assets.GetItem("SacrificerItem"), 16)); EventsToRemove = new List { "SID", "RealityShift" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.emergencyDicePresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class DoorCircuitFailure : MEvent { public static DoorCircuitFailure Instance; public override string Name() { return "DoorCircuitFailure"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Door control circuit: FAILURE", "Door control circuit malfunction" }; ColorHex = "#FF0000"; Type = EventType.VeryBad; EventsToRemove = new List { "DoorOverdriveEv", "DoorFailure", "ShipCoreFailure" }; } public override bool AddEventIfOnly() { if (Compatibility.crowdControlPresent) { return false; } if (!Compatibility.crowdControlPresent) { return true; } return false; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("DoorCircuitFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class DoorFailure : MEvent { public static DoorFailure Instance; public override string Name() { return "DoorFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Door system: ERROR", "Door malfunction" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "DoorOverdriveEv", "DoorCircuitFailure" }; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("DoorFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class DoorOverdriveEv : MEvent { public static DoorOverdriveEv Instance; public override string Name() { return "DoorOverdriveEv"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Door system: OVERDRIVE", "Door overdrive" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "DoorFailure", "ShipCoreFailure" }; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("DoorOverdriveEvEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class Dweller : MEvent { public static Dweller Instance; public override string Name() { return "Dweller"; } public override void Initalize() { Instance = this; Weight = 1; Descriptions = new List { "Maneater... but outside, good luck", "Dont be scared" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("CaveDweller", new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } [HarmonyPatch] internal class FlashLightsFailure : MEvent { public static FlashLightsFailure Instance; public new static bool Active; public override string Name() { return "FlashLightsFailure"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "I think the batteries leaked", "Who broke the flashlights?" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown FlashlightsGoEmptyAtStart(); Net.Instance.SetFlashlightsServerRpc(active: true); GameObject val = new GameObject("FlashlightsFailureObject"); val.AddComponent(); } public override void OnShipLeave() { ChargeUpBatteries(); Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { } internal void FlashlightsGoEmptyAtStart() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown GameObject hangarShip = Assets.hangarShip; if ((Object)(object)hangarShip == (Object)null) { return; } GrabbableObject[] componentsInChildren = hangarShip.GetComponentsInChildren(); GrabbableObject[] array = componentsInChildren; foreach (GrabbableObject val in array) { if (!((Object)(object)val == (Object)null) && (!(val.itemProperties.itemName != "Flashlight") || !(val.itemProperties.itemName != "Pro-flashlight"))) { val.insertedBattery = new Battery(false, 0f); val.SyncBatteryServerRpc(0); } } GameObject cruiser = Assets.cruiser; if ((Object)(object)cruiser != (Object)null) { GrabbableObject[] componentsInChildren2 = cruiser.GetComponentsInChildren(); GrabbableObject[] array2 = componentsInChildren2; foreach (GrabbableObject val2 in array2) { if (!((Object)(object)val2 == (Object)null) && (!(val2.itemProperties.itemName != "Flashlight") || !(val2.itemProperties.itemName != "Pro-flashlight"))) { val2.insertedBattery = new Battery(true, 0f); val2.SyncBatteryServerRpc(0); } } } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } GrabbableObject[] itemSlots = localPlayerController.ItemSlots; foreach (GrabbableObject val3 in itemSlots) { if (!((Object)(object)val3 == (Object)null) && (!(val3.itemProperties.itemName != "Flashlight") || !(val3.itemProperties.itemName != "Pro-flashlight"))) { val3.insertedBattery = new Battery(true, 0f); val3.SyncBatteryServerRpc(0); } } } internal void ChargeUpBatteries() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown GameObject hangarShip = Assets.hangarShip; if ((Object)(object)hangarShip == (Object)null) { return; } GrabbableObject[] componentsInChildren = hangarShip.GetComponentsInChildren(); GrabbableObject[] array = componentsInChildren; foreach (GrabbableObject val in array) { if (!((Object)(object)val == (Object)null) && (!(val.itemProperties.itemName != "Flashlight") || !(val.itemProperties.itemName != "Pro-flashlight"))) { val.insertedBattery = new Battery(false, 1f); val.SyncBatteryServerRpc(100); } } GameObject cruiser = Assets.cruiser; if ((Object)(object)cruiser != (Object)null) { GrabbableObject[] componentsInChildren2 = cruiser.GetComponentsInChildren(); GrabbableObject[] array2 = componentsInChildren2; foreach (GrabbableObject val2 in array2) { if (!((Object)(object)val2 == (Object)null) && (!(val2.itemProperties.itemName != "Flashlight") || !(val2.itemProperties.itemName != "Pro-flashlight"))) { val2.insertedBattery = new Battery(false, 1f); val2.SyncBatteryServerRpc(100); } } } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } GrabbableObject[] itemSlots = localPlayerController.ItemSlots; foreach (GrabbableObject val3 in itemSlots) { if (!((Object)(object)val3 == (Object)null) && (!(val3.itemProperties.itemName != "Flashlight") || !(val3.itemProperties.itemName != "Pro-flashlight"))) { val3.insertedBattery = new Battery(false, 1f); val3.SyncBatteryServerRpc(100); } } } [HarmonyPrefix] [HarmonyPatch(typeof(ItemCharger), "ChargeItem")] public static bool InterruptChargeFlashlightItem(ItemCharger __instance) { if (Active) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController != (Object)null && (Object)(object)localPlayerController.currentlyHeldObjectServer != (Object)null) { GrabbableObject currentlyHeldObjectServer = GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer; if (currentlyHeldObjectServer.itemProperties.itemName == "Flashlight" || currentlyHeldObjectServer.itemProperties.itemName == "Pro-flashlight") { __instance.triggerScript.interactable = false; ((TMP_Text)HUDManager.Instance.globalNotificationText).text = "FLASHLIGHT CANNOT BE CHARGED!!!!"; HUDManager.Instance.globalNotificationAnimator.SetTrigger("TriggerNotif"); HUDManager.Instance.UIAudio.PlayOneShot(HUDManager.Instance.radiationWarningAudio, 1f); return false; } } } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(GrabbableObject), "GrabItem")] public static void FlashlightFailureItemGrab(GrabbableObject __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown if (Active && (__instance.itemProperties.itemName == "Flashlight" || __instance.itemProperties.itemName == "Pro-flashlight")) { __instance.insertedBattery = new Battery(false, 0f); __instance.SyncBatteryServerRpc(0); } } } internal class Football : MEvent { public static Football Instance; public override string Name() { return "Football"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Simon says...", "Just do as she says", "Football!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("Football", new Scale(5f, 0.2f, 5f, 25f), new Scale(2f, 0.08f, 2f, 10f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.footballPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Forsaken : MEvent { public static Forsaken Instance; public override string Name() { return "Forsaken"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "You will return changed" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "Hallowed", "Hurricane", "SolarFlare", "Windy", "Gloomy", "Raining", "AllWeather", "MajoraMoon" }; } public override bool AddEventIfOnly() { if (Compatibility.IsModPresent("mrov.WeatherRegistry") && CustomWeather.isWeatherPresent("Forsaken")) { return true; } return false; } public override void Execute() { if (Compatibility.IsModPresent("mrov.WeatherRegistry") && CustomWeather.isWeatherPresent("Forsaken")) { CustomWeather.SetCustomWeather("Forsaken"); } } } internal class Foxy : MEvent { public static Foxy Instance; public override string Name() { return "Foxy"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "YARHAR", "Five nights...?", "It will be a nightmare time" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("Foxy", new Scale(100f, 0f, 100f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.FoxyPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class GiantShowdown : MEvent { public static GiantShowdown Instance; public override string Name() { return "GiantShowdown"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Attack on titan!!", "Battle of giants", "Take your bets..." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("RedwoodTitanObj", new Scale(1f, 0f, 1f, 1f), new Scale(33f, 0.66f, 33f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0.0095f, 0f, 1f), new Scale(2f, 0.02f, 2f, 4f), new Scale(2f, 0.02f, 2f, 4f)), new MonsterEvent("DriftwoodMenaceObj", new Scale(1f, 0f, 1f, 1f), new Scale(33f, 0.66f, 33f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(4f, 0.04f, 4f, 8f), new Scale(4f, 0.04f, 4f, 8f)), new MonsterEvent(Assets.EnemyName.ForestKeeper, new Scale(1f, 0f, 1f, 1f), new Scale(33f, 0.66f, 33f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(4f, 0.04f, 4f, 8f), new Scale(4f, 0.04f, 4f, 8f)) }; EventsToRemove = new List { "GiantsOutside" }; } public override bool AddEventIfOnly() { return Compatibility.CodeRebirthPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Hallowed : MEvent { public static Hallowed Instance; public override string Name() { return "Hallowed"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "The spirit of Halloween is upon us", "Spooky vibes are everywhere", "Trick or treat!" }; ColorHex = "#FFA500"; Type = EventType.Bad; EventsToRemove = new List { "Hurricane", "Forsaken", "SolarFlare", "Windy", "Gloomy", "Raining", "AllWeather", "MajoraMoon" }; } public override bool AddEventIfOnly() { if (Compatibility.IsModPresent("mrov.WeatherRegistry") && CustomWeather.isWeatherPresent("Hallowed")) { return true; } return false; } public override void Execute() { if (Compatibility.IsModPresent("mrov.WeatherRegistry") && CustomWeather.isWeatherPresent("Hallowed")) { CustomWeather.SetCustomWeather("Hallowed"); } } } internal class Heatwave : MEvent { public static Heatwave Instance; public override string Name() { return "Heatwave"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The temperature is rising!", "A heatwave is coming!", "It's getting hot in here!" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "BloodMoon", "MajoraMoon", "SolarFlare", "MeteorShower", "Windy", "Gloomy", "Raining", "AllWeather" }; } public override bool AddEventIfOnly() { return Compatibility.LethalElementsPresent && Compatibility.WeatherRegistryPresent; } public override void Execute() { if (Compatibility.LethalElementsPresent) { CustomWeather.SetCustomWeather("Heatwave"); } } } internal class Herobrine : MEvent { public static Herobrine Instance; public override string Name() { return "Herobrine"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Herobrine has been removed from the game.", "What is that...", "The apparition is here to take your soul." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("Herobrine", new Scale(10f, 0.4f, 10f, 50f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.herobrinePresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class HotBarHassle : MEvent { public static HotBarHassle Instance; public override string Name() { return "HotBarHassle"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "What items do you prioritize?", "Smaller trips this time", "Guess you might not get everything" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "HotBarMania" }; } public override bool AddEventIfOnly() { return Compatibility.HotBarPlusPresent; } public override void Execute() { if (Compatibility.HotBarPlusPresent) { Net.Instance.ResizeHotbarRandomlySmallServerRpc(); } } public override void OnShipLeave() { if (Compatibility.HotBarPlusPresent) { Net.Instance.ResetHotbarServerRpc(); } } } internal class HotBarMania : MEvent { public static HotBarMania Instance; public override string Name() { return "HotBarMania"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "You should be able to leave earlier than expected", "Imagine less trips", "I can work with this!" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "HotBarHassle" }; } public override bool AddEventIfOnly() { return Compatibility.HotBarPlusPresent; } public override void Execute() { if (Compatibility.HotBarPlusPresent) { Net.Instance.ResizeHotbarRandomlyServerRpc(); } } public override void OnShipLeave() { if (Compatibility.HotBarPlusPresent) { Net.Instance.ResetHotbarServerRpc(); } } } internal class Hurricane : MEvent { public static Hurricane Instance; public override string Name() { return "Hurricane"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "The weather is very violent", "High winds and heavy rain", "This is not a fun time for the outdoors" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Hallowed", "Forsaken", "SolarFlare", "Windy", "Gloomy", "Raining", "AllWeather", "MajoraMoon" }; } public override bool AddEventIfOnly() { if (Compatibility.IsModPresent("mrov.WeatherRegistry") && CustomWeather.isWeatherPresent("Hurricane")) { return true; } return false; } public override void Execute() { if (Compatibility.IsModPresent("mrov.WeatherRegistry") && CustomWeather.isWeatherPresent("Hurricane")) { CustomWeather.SetCustomWeather("Hurricane"); } } } internal class ImmortalSnail : MEvent { public static ImmortalSnail Instance; public override string Name() { return "ImmortalSnail"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "It's very slow..", "Looks pretty innocent", "A moving thermonuclear bomb" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("ImmortalSnail.EnemyType", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.2f, 5f, 25f), new Scale(2f, 0.05f, 2f, 7f), new Scale(2f, 0.07f, 2f, 9f), new Scale(0f, 0.02f, 0f, 2f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.immortalSnailPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class ItemChargerFailure : MEvent { public static ItemChargerFailure Instance; public override string Name() { return "ItemChargerFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Charging station: OFFLINE", "Dont waste your batteries" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "FlashLightsFailure" }; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = false; GameObject val = new GameObject("ItemChargerFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class ItsPlaytime : MEvent { public static ItsPlaytime Instance; public override string Name() { return "ItsPlaytime"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Prepare yourself for the next chapter...", "You will regret this...", "The critters and the bigger critters" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "PlaytimeBig", "Critters" }; } public override bool AddEventIfOnly() { return Compatibility.PlaytimePresent && Compatibility.CrittersPresent; } } internal class JetpackFailure : MEvent { public static JetpackFailure Instance; public override string Name() { return "JetpackFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Out of jet fuel", "Warning! Jetpacks not permited in this area!" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("JetpackFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class LeafBoys : MEvent { public static LeafBoys Instance; public override string Name() { return "LeafBoys"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Unwanted attention", "The boys from the trees", "Imagine dogs and leafs" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToSpawnWith = new List { "Dogs" }; monstersToSpawn = new List { new MonsterEvent("LeafBoiEnemyType", new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(2f, 0.13f, 2f, 4f), new Scale(4f, 0.15f, 4f, 8f)) }; } public override bool AddEventIfOnly() { return Compatibility.BiodiversityPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class LeverFailure : MEvent { public static LeverFailure Instance; public override string Name() { return "LeverFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Ship hydraulics: OFFLINE", "Ship lever malfunction" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override bool AddEventIfOnly() { return !Compatibility.SuperEclipsePresent; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("LeverEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class LightEaterEnemy : MEvent { public static LightEaterEnemy Instance; public override string Name() { return "LightEaterEnemy"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Do you favor light?", "Imagine if you dont have light" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("LightEaterEnemy", new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.01f, 0f, 1f), new Scale(1f, 0.01f, 1f, 2f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.lighteaterPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Lockers : MEvent { public static Lockers Instance; public override string Name() { return "Lockers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Lockers", "They remind me of iron maidens", "The chance of you dying has increased" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("LockerEnemy", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(1f, 0.04f, 1f, 5f), new Scale(1f, 0.06f, 1f, 7f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.lockerPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class MajoraMoon : MEvent { public static MajoraMoon Instance; public override string Name() { return "MajoraMoon"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The moon falls", "It has a face on it", "Time is ticking" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Hurricane", "Hallowed", "Forsaken", "SolarFlare", "Windy", "Gloomy", "Raining", "AllWeather", "BloodMoon", "VeryLateShip", "Hell", "LateShip" }; } public override bool AddEventIfOnly() { return Compatibility.LegendWeathersPresent && Compatibility.WeatherRegistryPresent; } public override void Execute() { if (Compatibility.LegendWeathersPresent) { CustomWeather.SetCustomWeather("Majora Moon"); } } } internal class ManStalker : MEvent { public static ManStalker Instance; public override string Name() { return "ManStalker"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "It stalks", "Hope you are not caught", "Avoid at all costs..." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("menstalker_type", new Scale(100f, 0f, 100f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0.016f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.ManStalkerPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Mantitoil : MEvent { public static Mantitoil Instance; public override string Name() { return "Mantitoil"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Flying turrets!", "Did i just see a turret fly by?", "Air snipers", "MantiToils???" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Manticoil, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(8f, 0f, 8f, 8f), new Scale(10f, 0f, 10f, 10f)) }; EventsToRemove = new List { "NoMantitoil" }; ScaleList.Add(ScaleType.InsideEnemyRarity, new Scale(0f, 0f, 0f, 0f)); ScaleList.Add(ScaleType.MaxInsideEnemyCount, new Scale(0f, 0f, 0f, 0f)); } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceMantiToilSpawns = true; } } } internal class MantiToilSlayer : MEvent { public static MantiToilSlayer Instance; public override string Name() { return "MantiToilSlayer"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Flying miniguns", "MantiToils... but more advanced", "MantiSlayers!!!" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "Mantitoil", "ToilSlayer", "AllSlayers", "NoSlayers", "NoMantitoil" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Manticoil, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(7f, 0f, 7f, 7f), new Scale(10f, 0f, 10f, 10f)) }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceMantiSlayerMaxSpawnCount = 25; Api.ForceMantiSlayerSpawns = true; Api.ForceToilSlayerMaxSpawnCount = 0; Api.ForceToilHeadMaxSpawnCount = 0; } } } internal class ManualCameraFailure : MEvent { public static ManualCameraFailure Instance; public new static bool Active; public override string Name() { return "ManualCameraFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Monitoring system: ERROR", "The screens are broken" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Active = true; GameObject val = new GameObject("ManualCameraFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class Meltdown : MEvent { public static Meltdown Instance; private float meltdownTime; private bool meltdownStarted; public override string Name() { return "Meltdown"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Core Breach Detected", "Meltdown Imminent", "A tiny puff of smoke" }; ColorHex = "#800000"; Type = EventType.VeryBad; } public override bool AddEventIfOnly() { return Compatibility.FacilityMeltdownPresent; } public override void Execute() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown Random random = new Random(); meltdownTime = (float)random.Next(5, 100) / 100f; meltdownStarted = false; TimeOfDay.Instance.onTimeSync.AddListener(new UnityAction(MeltdownClock)); } public override void OnGameStart() { } private void MeltdownClock() { if (!meltdownStarted && TimeOfDay.Instance.normalizedTimeOfDay > meltdownTime) { meltdownStarted = true; MeltdownAPI.StartMeltdown("SoftDiamond.BrutalCompanyMinusExtraReborn"); } } } internal class MeteorShower : MEvent { public static MeteorShower Instance; public override string Name() { return "MeteorShower"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "A different kind of shower...", "More meteors?!", "What the.. Meteors..?" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "BloodMoon", "MajoraMoon", "SolarFlare", "Windy", "Gloomy", "Raining", "AllWeather" }; } public override bool AddEventIfOnly() { return Compatibility.CodeRebirthPresent && Compatibility.WeatherRegistryPresent; } public override void Execute() { if (Compatibility.CodeRebirthPresent) { CustomWeather.SetCustomWeather("Meteor Shower"); } } } internal class MoaiEnemy : MEvent { public static MoaiEnemy Instance; public override string Name() { return "MoaiEnemy"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Statues are on the move!", "The ancient guardians have awoken. Run.", "Prepare for a rocky reception" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("MoaiEnemy", new Scale(12f, 0.3f, 7f, 25f), new Scale(20f, 0.4f, 15f, 30f), new Scale(1f, 0.03f, 1f, 1f), new Scale(1f, 0.04f, 0f, 2f), new Scale(1f, 0.3f, 1f, 2f), new Scale(1f, 0.4f, 1f, 3f)), new MonsterEvent("MoaiBlue", new Scale(6f, 0.15f, 3f, 12f), new Scale(3f, 0.15f, 2.5f, 8f), new Scale(1f, 0.02f, 1f, 1f), new Scale(1f, 0.03f, 0f, 1f), new Scale(0.5f, 0.25f, 1f, 1f), new Scale(1f, 0.25f, 1f, 2f)), new MonsterEvent("MoaiRed", new Scale(14f, 0.4f, 9f, 25f), new Scale(10f, 0.3f, 7f, 18f), new Scale(1f, 0.03f, 1f, 1f), new Scale(1f, 0.05f, 1f, 2f), new Scale(0f, 0.35f, 1f, 1f), new Scale(2f, 0.4f, 2f, 2f)), new MonsterEvent("MoaiGreen", new Scale(5f, 0.15f, 3f, 10f), new Scale(2.5f, 0.1f, 2f, 6f), new Scale(1f, 0.02f, 1f, 1f), new Scale(1f, 0.03f, 0f, 1f), new Scale(1f, 0.25f, 1f, 1f), new Scale(1f, 0.25f, 1f, 1f)), new MonsterEvent("MoaiGold", new Scale(1.5f, 0.05f, 0.5f, 4f), new Scale(1f, 0.05f, 0.5f, 2.5f), new Scale(1f, 0.01f, 1f, 1f), new Scale(1f, 0.01f, 1f, 1f), new Scale(0f, 0.1f, 1f, 1f), new Scale(1f, 0.1f, 1f, 1f)), new MonsterEvent("MoaiPurple", new Scale(13f, 0.4f, 8f, 22f), new Scale(7f, 0.25f, 5f, 14f), new Scale(1f, 0.03f, 1f, 1f), new Scale(1f, 0.05f, 1f, 2f), new Scale(0.5f, 0.35f, 1f, 1f), new Scale(1f, 0.4f, 2f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.moaiEnemyPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class MobileTurrets : MEvent { public static MobileTurrets Instance; public override string Name() { return "MobileTurrets"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Turrets...", "Moving Turrets!", "Covid free facility", "Cleaners!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("EnemyMovingTurret", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(1f, 0.04f, 3f, 5f), new Scale(2f, 0.04f, 3f, 6f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.moonsweptPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class NeedyCats : MEvent { public static NeedyCats Instance; public override string Name() { return "NeedyCats"; } public override void Initalize() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "MEOW!", "Aw, its a kitty cat", "They need your help", "Protect them from the dogs" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; EventsToRemove = new List { "SID" }; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.1f, 0.02f, 0.1f, 0.15f), new SpawnableItemWithRarity(Assets.GetItem("CatItem"), 60), new SpawnableItemWithRarity(Assets.GetItem("CatFoodItem"), 40)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.004f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.NeedyCatsPresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class Nemo : MEvent { public static Nemo Instance; public override string Name() { return "Nemo"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Finding Nemo", "You found him" }; ColorHex = "#008000"; Type = EventType.Good; monstersToSpawn = new List { new MonsterEvent("NemoAsset", new Scale(0f, 0f, 0f, 0f), new Scale(100f, 0f, 100f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f)) }; } public override bool AddEventIfOnly() { return Compatibility.SurfacedPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class NoFiend : MEvent { public static NoFiend Instance; public override string Name() { return "NoFiend"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "NoFiend" }; Weight = 1; Descriptions = new List { "No Fiends", "No jumpscares... I think", "No thing", "Flashing is allowed on this moon!!!" }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists("TheFiend") && Compatibility.theFiendPresent; } public override void Execute() { Manager.RemoveSpawn("TheFiend"); } } internal class NoImmortalSnails : MEvent { public static NoImmortalSnails Instance; public override string Name() { return "NoImmortalSnails"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "RollingGiants" }; Weight = 1; Descriptions = new List { "No slow moving things", "No immortal snails", "No thermonuclear bombs here..." }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists("ImmortalSnail.EnemyType") && Compatibility.immortalSnailPresent; } public override void Execute() { Manager.RemoveSpawn("ImmortalSnail.EnemyType"); } } internal class NoLockers : MEvent { public static NoLockers Instance; public override string Name() { return "NoLockers"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "Lockers" }; Weight = 1; Descriptions = new List { "No iron maidens", "No lockers", "Your chances of surviving has slightly increased." }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists("LockerEnemy") && Compatibility.lockerPresent; } public override void Execute() { Manager.RemoveSpawn("LockerEnemy"); } } internal class NoMantitoil : MEvent { public static NoMantitoil Instance; public override string Name() { return "NoMantitoil"; } public override void Initalize() { Instance = this; Weight = 5; Descriptions = new List { "No flying turrets today", "You wont see any flying turrets today", "No air snipers", "NoMantiToils...phew..." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Mantitoil", "NoSlayers", "ToilSlayer" }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceMantiToilMaxSpawnCount = 0; } } } internal class NoMantiToilSlayer : MEvent { public static NoMantiToilSlayer Instance; public override string Name() { return "NoMantiToilSlayer"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "No flying Miniguns", "MantiSlayers not permited in this area", "The Manticoils cant hurt you today" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "Mantitoil", "ToilSlayer", "MantiToilSlayer", "NoToilSlayer" }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceMantiSlayerMaxSpawnCount = 0; Api.ForceMantiSlayerSpawns = false; Api.ForceToilSlayerMaxSpawnCount = 0; Api.ForceToilHeadMaxSpawnCount = 0; } } } internal class NoPeepers : MEvent { public static NoPeepers Instance; public static float oldSpawnChance = -1f; public override string Name() { return "NoPeepers"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "Peepers" }; Weight = 1; Descriptions = new List { "No weights", "The air feels light." }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Compatibility.peepersPresent; } public override void Execute() { oldSpawnChance = (float)Compatibility.peeperSpawnChance.GetValue(null); Compatibility.peeperSpawnChance.SetValue(null, -1f); } public override void OnGameStart() { if (Compatibility.peepersPresent) { Compatibility.peeperSpawnChance.SetValue(null, oldSpawnChance); } } public override void OnShipLeave() { if (Compatibility.peepersPresent) { Compatibility.peeperSpawnChance.SetValue(null, oldSpawnChance); } } } internal class NoShyGuy : MEvent { public static NoShyGuy Instance; public override string Name() { return "NoShyGuy"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "ShyGuy" }; Weight = 1; Descriptions = new List { "SCP-096 is contained.", "You can open your eyes" }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Manager.SpawnExists("ShyGuyDef") && Compatibility.scopophobiaPresent; } public override void Execute() { Manager.RemoveSpawn("ShyGuyDef"); } } internal class NoSlayers : MEvent { public static NoSlayers Instance; public override string Name() { return "NoSlayers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "No miniguns at all for today", "Unloaded Hangar corp. has removed all slayers in this area!" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "ToilSlayer", "MantiToilSlayer", "NoMantiToilSlayer", "NoToilSlayer", "AllSlayers" }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceMantiSlayerMaxSpawnCount = 0; Api.ForceMantiSlayerSpawns = false; Api.ForceToilSlayerSpawns = false; Api.ForceToilSlayerMaxSpawnCount = 0; Api.ForceToilHeadMaxSpawnCount = 0; } } } internal class NoToilSlayer : MEvent { public static NoToilSlayer Instance; public override string Name() { return "NoToilSlayer"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "No inside Miniguns today", "No ToilSlayers", "No ToilSlayers permited in this area" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "MantiToilSlayer", "ToilSlayer", "NoMantiToilSlayer", "AllSlayers", "NoSlayers" }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { Api.ForceToilSlayerMaxSpawnCount = 0; Api.ForceToilSlayerSpawns = false; Api.ForceMantiSlayerMaxSpawnCount = 0; Api.ForceToilHeadMaxSpawnCount = 0; } } } internal class NutSlayersMore : MEvent { public static NutSlayersMore Instance; public override string Name() { return "NutSlayersMore"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Warning: Multiple NutSlayers detected in the area!", "Oh...Oh my god..." }; ColorHex = "#000000"; Type = EventType.Insane; EventsToRemove = new List { "HeavyRain", "Raining", "Masked" }; monstersToSpawn = new List { new MonsterEvent(Assets.nutSlayer, new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(8f, 0f, 8f, 8f), new Scale(12f, 0f, 12f, 12f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); Manager.MultiplySpawnChance(RoundManager.Instance.currentLevel, 2f); Manager.scrapValueMultiplier *= 4.5f; } } internal class Peepers : MEvent { public static Peepers Instance; public override string Name() { return "Peepers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Weights!", "Group HUG!!!", "The air feels heavy...", "More annoying than cute" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("PeeperType", new Scale(10f, 0.4f, 10f, 50f), new Scale(0f, 0f, 0f, 0f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.09f, 4f, 12f), new Scale(3f, 0.12f, 3f, 15f), new Scale(4f, 0.16f, 4f, 20f)) }; } public override bool AddEventIfOnly() { return Compatibility.peepersPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class PhonesOut : MEvent { public static PhonesOut Instance; public new static bool Active; public override string Name() { return "PhonesOut"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Please leave a message after the beep..", "Bad reception", "Phone lines are down", "I think the phones are broken" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override bool AddEventIfOnly() { return Compatibility.LethalPhonesPresent; } public override void Execute() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Net.Instance.SetPhonesOutServerRpc(active: true); GameObject val = new GameObject("PhonesOutFailureObject"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } public override void OnLocalDisconnect() { } } internal class PlaytimeBig : MEvent { public static PlaytimeBig Instance; public override string Name() { return "PlaytimeBig"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Its gonna be a full house", "All the big ones came out..", "Which one will you see?" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("Miss Delight", new Scale(50f, 5f, 50f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0025f, 1f, 2f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("Boxy Boo", new Scale(2f, 7f, 10f, 60f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("Huggy Wuggy", new Scale(30f, 4f, 30f, 50f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("Dogday Monster", new Scale(36f, 8.2f, 36f, 80f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.017f, 1f, 2f), new Scale(1f, 0.0045f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.PlaytimePresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class RollingGiants : MEvent { public static RollingGiants Instance; public override string Name() { return "RollingGiants"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Rolling Giants!!", "It wants to touch...", "What even is this thing?????" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("RollingGiant_EnemyType", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(1f, 0.02f, 1f, 3f), new Scale(1f, 0.02f, 1f, 3f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.rollinggiantPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Roomba : MEvent { public static Roomba Instance; public override string Name() { return "Roomba"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Moving Landmines!!", "Facility hoovers", "Weapons of war", "These things are against the Geneva convention" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("Boomba", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(2f, 0.08f, 3f, 10f), new Scale(3f, 0.12f, 4f, 15f), new Scale(0f, 0.03f, 0f, 3f), new Scale(0f, 0.06f, 0f, 6f)) }; } public override bool AddEventIfOnly() { return Compatibility.lethalThingsPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class SCP682 : MEvent { public static SCP682 Instance; public override string Name() { return "SCP682"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "SCP682!", "The Hard-to-Destroy Reptile", "Avoid the reptile!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("SCP682ET", new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.13f, 1f, 2f), new Scale(2f, 0.06f, 3f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.SCP682Present; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class SCP939 : MEvent { public static SCP939 Instance; public override string Name() { return "SCP939"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "SCP939...", "Are you ready for them?", "The facility could not contain them..." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("SCP939", new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.13f, 1f, 2f), new Scale(2f, 0.06f, 4f, 4f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.SCP939Present; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Seamine : MEvent { public static Seamine Instance; public override string Name() { return "Seamine"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Imagine this with water", "Spongebob", "Ball with spikes", "It could go boom" }; ColorHex = "#FF0000"; Type = EventType.Bad; isBetaEvent = true; ScaleList.Add(ScaleType.MinDensity, new Scale(0.01f, 0.0004f, 0.016f, 0.086f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.0168f, 0.00592f, 0.0128f, 0.18f)); } public override bool AddEventIfOnly() { return Compatibility.SurfacedPresent; } public override void Execute() { Scale minAmount = ScaleList[ScaleType.MinDensity]; Scale maxAmount = ScaleList[ScaleType.MaxDensity]; GeneralCustomEvent.HazardEvent hazardEvent = new GeneralCustomEvent.HazardEvent("Seamine", minAmount, maxAmount, facingAwayFromWall: false, facingWall: false, backToWall: false, backFlushWithWall: false, requireDistanceBetween: true, disallowNearEntrances: true, allowInMineshaft: true); hazardEvent.Type = Type; DawnLibHandling.eventQueue.Enqueue(hazardEvent); } } internal class Shiba : MEvent { public static Shiba Instance; public override string Name() { return "Shiba"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Awww its so cute!", "Innocent?", "BONK!", "Comes with a bat", "Hope you like bats" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("ShibaEnemy", new Scale(60f, 0.43f, 60f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(2f, 0.2f, 2f, 4f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.ShibaPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class ShipCoreFailure : MEvent { public static ShipCoreFailure Instance; public override string Name() { return "ShipCoreFailure"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Ship core failure!", "This is bad, all ship systems are offline" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "DoorFailure", "ItemChargerFailure", "LeverFailure", "ManualCameraFailure", "TeleporterFailure", "TerminalFailure", "WalkieFailure", "ShipLightsFailure" }; } public override bool AddEventIfOnly() { return !Compatibility.SuperEclipsePresent; } } internal class ShockwaveDrones : MEvent { public static ShockwaveDrones Instance; public override string Name() { return "ShockwaveDrones"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Shockwave Drones", "Stay away", "Drones" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("DroneEnemy", new Scale(10f, 0.4f, 10f, 50f), new Scale(5f, 0.1f, 5f, 15f), new Scale(1f, 0.04f, 3f, 5f), new Scale(2f, 0.04f, 3f, 6f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.shockwaveDronesPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Shrimp : MEvent { public static Shrimp Instance; public override string Name() { return "Shrimp"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Shrimp", "Actual doggo", "You have to feed it..." }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent("ShrimpEnemy", new Scale(10f, 0.4f, 10f, 50f), new Scale(2f, 0.05f, 4f, 10f), new Scale(1f, 0.04f, 1f, 5f), new Scale(1f, 0.06f, 1f, 7f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.shrimpPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class ShyGuy : MEvent { public static ShyGuy Instance; public override string Name() { return "ShyGuy"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Object Class: Euclid", "All personnel, proceed with caution.", "Look at it, I dare you..." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("ShyGuyDef", new Scale(20f, 0.8f, 20f, 100f), new Scale(10f, 0.4f, 10f, 50f), new Scale(2f, 0.04f, 2f, 6f), new Scale(2f, 0.04f, 2f, 6f), new Scale(1f, 0.02f, 1f, 3f), new Scale(2f, 0.04f, 2f, 6f)) }; } public override bool AddEventIfOnly() { return Compatibility.scopophobiaPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class SirenHead : MEvent { public static SirenHead Instance; public override string Name() { return "SirenHead"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "God would like to speak with you...", "NINE. EIGHTEEN. ONE. CHILD. SEVENTEEN. REMOVE. VILE." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("SirenHead", new Scale(1f, 0f, 1f, 1f), new Scale(33f, 0.66f, 33f, 100f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 2f), new Scale(2f, 0.04f, 1f, 6f), new Scale(3f, 0.06f, 1f, 9f)) }; } public override bool AddEventIfOnly() { return Compatibility.sirenheadPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class SkullEnemy : MEvent { public static SkullEnemy Instance; public override string Name() { return "SkullEnemy"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "The skull chases you...", "Do what you will, but it follows..." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("SkullEnemy", new Scale(100f, 0f, 100f, 100f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0f, 1f, 1f), new Scale(1f, 0f, 1f, 1f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.SkullEnemyPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class SlenderMan : MEvent { public static SlenderMan Instance; public override string Name() { return "SlenderMan"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Childhood creepypasta", "Dont let it get close...", "You feel paranoid" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("SlendermanEnemy", new Scale(2f, 0.08f, 2f, 10f), new Scale(10f, 0.4f, 10f, 50f), new Scale(1f, 0.04f, 2f, 3f), new Scale(1f, 0.04f, 2f, 3f), new Scale(0f, 0.0075f, 0f, 1f), new Scale(0f, 0.02f, 0f, 1f)) }; } public override bool AddEventIfOnly() { return Compatibility.facelessStalekerPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class SolarFlare : MEvent { public static SolarFlare Instance; public override string Name() { return "SolarFlare"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Solar Flare Incoming!", "A massive solar flare is approaching!" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "Hurricane", "Hallowed", "Forsaken", "BloodMoon", "MajoraMoon", "Heatwave", "MeteorShower", "Windy", "Gloomy", "Raining", "AllWeather" }; } public override bool AddEventIfOnly() { return Compatibility.LethalElementsPresent && Compatibility.WeatherRegistryPresent; } public override void Execute() { if (Compatibility.LethalElementsPresent) { CustomWeather.SetCustomWeather("Solar Flare"); } } } internal class SoulDev : MEvent { public static SoulDev Instance; public override string Name() { return "SoulDev"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "When they said it could be worse.. this is that!", "You do not want to encounter this.", "It looks like a jester but without the box!" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("SoulDev", new Scale(1f, 0.05f, 0.3f, 3f), new Scale(1f, 0.05f, 0.3f, 3f), new Scale(1f, 0.01f, 0f, 1f), new Scale(1f, 0.01f, 1f, 2f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.soulDevPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } public class TakeyGokuBracken : MEvent { public static TakeyGokuBracken Instance; public override string Name() { return "TakeyGokuBracken"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Wait...thats not a plushie", "Thats scary", "TakeyGoku" }; ColorHex = "#FF0000"; Type = EventType.Bad; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.Bracken, new Scale(20f, 0.8f, 20f, 100f), new Scale(5f, 0.2f, 5f, 25f), new Scale(3f, 0.06f, 3f, 9f), new Scale(4f, 0.08f, 4f, 12f), new Scale(0f, 0.02f, 0f, 1f), new Scale(0f, 0.03f, 0f, 3f)) }; EventsToRemove = new List { "SID" }; } public override bool AddEventIfOnly() { return Compatibility.takeyGokuPresent & Compatibility.takeyGokuEssentialPresent & Compatibility.officialExternalModulePresent; } public override void Execute() { if (!(Compatibility.takeyPlushPresent & Compatibility.takeyGokuEssentialPresent & Compatibility.officialExternalModulePresent)) { Api.ForceTakeyGokuBrackenSpawns = true; Api.ForceTakeyGokuBrackenMaxSpawnCount = 25; ExecuteAllMonsterEvents(); } } } internal class TakeyGokuPlush : MEvent { public static TakeyGokuPlush Instance; public override string Name() { return "TakeyGokuPlush"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 1; Descriptions = new List { "TakeyGoku... but small", "TakeyGoku plushie" }; ColorHex = "#008000"; Type = EventType.Good; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("Smol Takey Goku"), 100)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "TakeyPlush", "SussyPaintings", "TakeyGokuPlushBig", "Dustpans", "Clock" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.takeyPlushPresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class TakeyGokuPlushBig : MEvent { public static TakeyGokuPlushBig Instance; public override string Name() { return "TakeyGokuPlushBig"; } public override void Initalize() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Weight = 1; Descriptions = new List { "TakeyGoku... but harmless", "Big plushie" }; ColorHex = "#A0DB8E"; Type = EventType.Neutral; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("Takey Goku"), 100)); EventsToRemove = new List { "SID", "RealityShift", "Pickles", "TakeyPlush", "SussyPaintings", "TakeyGokuPlush", "Dustpans", "Clock" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.takeyPlushPresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } public class TakeyPlush : MEvent { public static TakeyPlush Instance; public override string Name() { return "TakeyPlush"; } public override void Initalize() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown Instance = this; Weight = 1; Descriptions = new List { "TakeySit", "I know this guy...", "Streamer?" }; ColorHex = "#008000"; Type = EventType.Good; scrapTransmutationEvent = new ScrapTransmutationEvent(new Scale(0.5f, 0.008f, 0.5f, 0.9f), new SpawnableItemWithRarity(Assets.GetItem("TakeyPlush"), 100)); EventsToRemove = new List { "SID", "RealityShift", "Pickles" }; ScaleList.Add(ScaleType.ScrapAmount, new Scale(1f, 0.005f, 1f, 1.5f)); } public override bool AddEventIfOnly() { if (!Compatibility.takeyPlushPresent) { return false; } if (!Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } return false; } public override void Execute() { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } } internal class TargetingFailureEvent : MEvent { public static TargetingFailureEvent Instance; public override string Name() { return "TargetingFailureEvent"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Teleporter targeting system: ERROR", "Teleporter works.... but its not what it seems" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "TeleporterFailure", "ShipCoreFailure" }; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("TargetingFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class TeleporterFailure : MEvent { public static TeleporterFailure Instance; public override string Name() { return "TeleporterFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Teleportation system: ERROR", "Teleporter malfunction" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "TargetingFailureEvent" }; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("TeleporterFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class TeleporterTraps : MEvent { public static TeleporterTraps Instance; public override string Name() { return "TeleporterTraps"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Teleporter Traps!", "These will teleport enemies" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinAmount, new Scale(5f, 0.2f, 5f, 25f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(7f, 0.28f, 7f, 35f)); } public override bool AddEventIfOnly() { return RoundManager.Instance.currentLevel.spawnableMapObjects.ToList().Exists((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == "TeleporterTrap"); } public override void Execute() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown IndoorMapHazard val = new IndoorMapHazard(); val.hazardType = new IndoorMapHazardType { prefabToSpawn = Assets.GetObject("TeleporterTrap"), spawnFacingAwayFromWall = false, spawnFacingWall = false, spawnWithBackToWall = false, spawnWithBackFlushAgainstWall = false, requireDistanceBetweenSpawns = false, disallowSpawningNearEntrances = false }; val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); IndoorMapHazard val2 = val; EventManager.hazards.Add(val2); RoundManager.Instance.currentLevel.indoorMapHazards = CollectionExtensions.AddToArray(RoundManager.Instance.currentLevel.indoorMapHazards, val2); } } internal class TerminalFailure : MEvent { public static TerminalFailure Instance; public override string Name() { return "TerminalFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Terminal Error", "Terminal console: OFFLINE" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("TerminalFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class TheFiend : MEvent { public static TheFiend Instance; public override string Name() { return "TheFiend"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The fiend is inside the facility", "Comes with jumpscares", "Dont flash it..." }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("TheFiend", new Scale(8f, 0.4f, 8f, 32f), new Scale(1f, 0.034f, 1f, 3f), new Scale(1f, 0.034f, 1f, 3f), new Scale(1f, 0.034f, 1f, 3f), new Scale(0f, 0.022f, 0f, 1f), new Scale(0f, 0.034f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.theFiendPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class ToilHead : MEvent { public static ToilHead Instance; public override string Name() { return "ToilHead"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "These things are against the geneva convention.", "Toilheads!", "The coilheads have gotten a software upgrade.", "All the heads!", "You downloaded this mod, not me..." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Coilhead", "AntiCoilhead" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.CoilHead, new Scale(30f, 1f, 30f, 90f), new Scale(10f, 0.34f, 10f, 30f), new Scale(1f, 0.034f, 1f, 3f), new Scale(2f, 0.034f, 1f, 4f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent(Assets.antiCoilHead, new Scale(10f, 0.34f, 10f, 30f), new Scale(1f, 0.034f, 1f, 3f), new Scale(0f, 0.022f, 0f, 1f), new Scale(1f, 0.0167f, 1f, 2f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { Assets.antiCoilHead.enemyName = "Spring"; ExecuteAllMonsterEvents(); Api.ForceToilHeadSpawns = true; } } } internal class ToilSlayer : MEvent { public static ToilSlayer Instance; public override string Name() { return "ToilSlayer"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Inside miniguns", "Toilheads... but more advanced", "ToilSlayers!!!" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Coilhead", "AntiCoilhead", "ToilHead", "MantiToilSlayer", "NoToilSlayer", "NoMantitoil", "NoSlayers", "AllSlayers" }; monstersToSpawn = new List { new MonsterEvent(Assets.EnemyName.CoilHead, new Scale(30f, 1f, 30f, 90f), new Scale(10f, 0.34f, 10f, 30f), new Scale(1f, 0.034f, 1f, 3f), new Scale(2f, 0.034f, 1f, 4f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.toilheadPresent; } public override void Execute() { if (Compatibility.toilheadPresent) { ExecuteAllMonsterEvents(); Api.ForceToilSlayerMaxSpawnCount = 15; Api.ForceToilSlayerSpawns = true; Api.ForceMantiSlayerMaxSpawnCount = 0; Api.ForceToilHeadMaxSpawnCount = 0; } } } internal class Walkers : MEvent { public static Walkers Instance; public override string Name() { return "Walkers"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "The walker is inside the facility!", "I hope you bring an extra pair of undies", "You feel like you are going insane" }; ColorHex = "#800000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("WalkerType", new Scale(8f, 0.4f, 8f, 32f), new Scale(1f, 0.034f, 1f, 3f), new Scale(1f, 0.034f, 1f, 3f), new Scale(1f, 0.034f, 1f, 3f), new Scale(0f, 0.022f, 0f, 1f), new Scale(0f, 0.034f, 0f, 2f)) }; } public override bool AddEventIfOnly() { return Compatibility.diversityPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class WalkieFailure : MEvent { public static WalkieFailure Instance; public override string Name() { return "WalkieFailure"; } public override void Initalize() { Instance = this; Weight = 4; Descriptions = new List { "Radio system: OFFLINE", "Walkies are unusable" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override void Execute() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Active = true; GameObject val = new GameObject("WalkeFailureEvent"); val.AddComponent(); } public override void OnShipLeave() { Active = false; } public override void OnGameStart() { Active = false; } } internal class WelcomeToOoblterra : MEvent { public static WelcomeToOoblterra Instance; public override string Name() { return "WelcomeToOoblterra"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "Welcome to Ooblterra", "Its in the name... Ooblterra!", "Ooblterra is a place of horror and monsters" }; ColorHex = "#FF0000"; Type = EventType.VeryBad; monstersToSpawn = new List { new MonsterEvent("Wanderer", new Scale(0f, 0f, 0f, 0f), new Scale(8f, 0.35f, 8f, 10f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(3f, 0.73f, 1f, 3f), new Scale(3f, 0.61f, 3f, 5f)), new MonsterEvent("AdultWanderer", new Scale(0f, 0f, 0f, 0f), new Scale(8f, 0.35f, 8f, 10f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.73f, 1f, 2f), new Scale(2f, 0.61f, 2f, 2f)), new MonsterEvent("EyeSecurity", new Scale(8f, 0.31f, 0f, 10.5f), new Scale(0f, 0f, 0f, 0f), new Scale(2f, 0.35f, 2f, 4f), new Scale(4f, 0.21f, 4f, 6f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)), new MonsterEvent("Gallenarma ", new Scale(0.5f, 0.11f, 0f, 8.5f), new Scale(0f, 0f, 0f, 0f), new Scale(1f, 0.32f, 1f, 2f), new Scale(2f, 0.65f, 1f, 3f), new Scale(0f, 0f, 0f, 0f), new Scale(0f, 0f, 0f, 0f)) }; } public override bool AddEventIfOnly() { return Compatibility.OoblterraPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class Windy : MEvent { public static Windy Instance; public override string Name() { return "Windy"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Tornado Warning!", "A tornado is approaching!", "Seek shelter immediately!" }; ColorHex = "#FF0000"; Type = EventType.Bad; EventsToRemove = new List { "Hurricane", "Hallowed", "Forsaken", "BloodMoon", "MajoraMoon", "SolarFlare", "MeteorShower", "Gloomy", "Raining", "AllWeather" }; } public override bool AddEventIfOnly() { return Compatibility.CodeRebirthPresent && Compatibility.WeatherRegistryPresent; } public override void Execute() { if (Compatibility.CodeRebirthPresent) { CustomWeather.SetCustomWeather("Tornado"); } } } internal class YeetBomb : MEvent { public static YeetBomb Instance; public override string Name() { return "YeetBomb"; } public override void Initalize() { Instance = this; Weight = 2; Descriptions = new List { "You will get launched", "YEET", "Do you like to go Yeet" }; ColorHex = "#FF0000"; Type = EventType.Bad; ScaleList.Add(ScaleType.MinDensity, new Scale(0.01f, 0.0004f, 0.016f, 0.086f)); ScaleList.Add(ScaleType.MaxDensity, new Scale(0.0168f, 0.00592f, 0.0128f, 0.18f)); } public override bool AddEventIfOnly() { return Compatibility.VarietyPresent; } public override void Execute() { Manager.insideObjectsToSpawnOutside.Add(new Manager.ObjectInfo(Assets.GetObject("Yeetmine"), Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)))); } } } namespace BrutalCompanyMinus.Minus.CustomEvents { public class GeneralCustomEvent : MEvent { public class HazardEvent : MEvent { public bool isInside; public GameObject hazardObject; public Scale minDensity; public Scale maxDensity; public bool facingAwayFromWall; public bool facingWall; public bool backToWall; public bool backFlushWithWall; public bool requireDistanceBetween; public bool disallowNearEntrances; public bool allowInMineshaft; public HazardEvent(GameObject hazardObject, Scale minDensity, Scale maxDensity) { isInside = false; this.hazardObject = hazardObject; AssignSpawnParameters(minDensity, maxDensity); ScaleList.Add(ScaleType.MinDensity, minDensity); ScaleList.Add(ScaleType.MaxDensity, maxDensity); } public HazardEvent(Assets.ObjectName hazardName, Scale minDensity, Scale maxDensity) { isInside = false; hazardObject = Assets.GetObject(hazardName); AssignSpawnParameters(minDensity, maxDensity); ScaleList.Add(ScaleType.MinDensity, minDensity); ScaleList.Add(ScaleType.MaxDensity, maxDensity); } public HazardEvent(string hazardName, Scale minDensity, Scale maxDensity) { isInside = false; hazardObject = Assets.GetObject(hazardName); AssignSpawnParameters(minDensity, maxDensity); ScaleList.Add(ScaleType.MinDensity, minDensity); ScaleList.Add(ScaleType.MaxDensity, maxDensity); } public HazardEvent(GameObject hazardObject, Scale minAmount, Scale maxAmount, bool facingAwayFromWall, bool facingWall, bool backToWall, bool backFlushWithWall, bool requireDistanceBetween, bool disallowNearEntrances, bool allowInMineshaft) { isInside = true; this.hazardObject = hazardObject; AssignSpawnParameters(minAmount, maxAmount, facingAwayFromWall, facingWall, backToWall, backFlushWithWall, requireDistanceBetween, disallowNearEntrances, allowInMineshaft); ScaleList.Add(ScaleType.MinAmount, minAmount); ScaleList.Add(ScaleType.MaxAmount, maxAmount); } public HazardEvent(Assets.ObjectName hazardName, Scale minAmount, Scale maxAmount, bool facingAwayFromWall, bool facingWall, bool backToWall, bool backFlushWithWall, bool requireDistanceBetween, bool disallowNearEntrances, bool allowInMineshaft) { isInside = true; hazardObject = Assets.GetObject(hazardName); AssignSpawnParameters(minAmount, maxAmount, facingAwayFromWall, facingWall, backToWall, backFlushWithWall, requireDistanceBetween, disallowNearEntrances, allowInMineshaft); ScaleList.Add(ScaleType.MinAmount, minAmount); ScaleList.Add(ScaleType.MaxAmount, maxAmount); } public HazardEvent(string hazardName, Scale minAmount, Scale maxAmount, bool facingAwayFromWall, bool facingWall, bool backToWall, bool backFlushWithWall, bool requireDistanceBetween, bool disallowNearEntrances, bool allowInMineshaft) { isInside = true; hazardObject = Assets.GetObject(hazardName); AssignSpawnParameters(minAmount, maxAmount, facingAwayFromWall, facingWall, backToWall, backFlushWithWall, requireDistanceBetween, disallowNearEntrances, allowInMineshaft); ScaleList.Add(ScaleType.MinAmount, minAmount); ScaleList.Add(ScaleType.MaxAmount, maxAmount); } public HazardEvent() { } private void AssignSpawnParameters(Scale minDensity, Scale maxDensity) { this.minDensity = minDensity; this.maxDensity = maxDensity; } private void AssignSpawnParameters(Scale minAmount, Scale maxAmount, bool facingAwayFromWall, bool facingWall, bool backToWall, bool backFlushWithWall, bool requireDistanceBetween, bool disallowNearEntrances, bool allowInMineshaft) { minDensity = minAmount; maxDensity = maxAmount; this.facingWall = facingWall; this.facingAwayFromWall = facingAwayFromWall; this.backToWall = backToWall; this.backFlushWithWall = backFlushWithWall; this.requireDistanceBetween = requireDistanceBetween; this.disallowNearEntrances = disallowNearEntrances; this.allowInMineshaft = allowInMineshaft; } public new void Execute() { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown if ((Object)(object)hazardObject == (Object)null) { Log.LogError("A Hazard object data went null! Something either went wrong or you specified an incoorect name."); return; } bool flag = false; if (Compatibility.DawnLibPresent && (flag = DawnLibHandling.IsDawnManaged(((Object)hazardObject).name))) { DawnLibHandling.eventQueue.Enqueue(this); } Log.LogInfo($"DawnLib spawned for {((Object)hazardObject).name}: {flag}"); if (!flag) { if (isInside) { IndoorMapHazardType val = ScriptableObject.CreateInstance(); val.prefabToSpawn = hazardObject; val.spawnFacingAwayFromWall = facingAwayFromWall; val.spawnFacingWall = facingWall; val.spawnWithBackToWall = backToWall; val.spawnWithBackFlushAgainstWall = backFlushWithWall; val.requireDistanceBetweenSpawns = requireDistanceBetween; val.disallowSpawningNearEntrances = disallowNearEntrances; val.allowInMineshaft = allowInMineshaft; IndoorMapHazard val2 = new IndoorMapHazard(); val2.hazardType = val; val2.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); IndoorMapHazard val3 = val2; EventManager.hazards.Add(val3); RoundManager.Instance.currentLevel.indoorMapHazards = CollectionExtensions.AddToArray(RoundManager.Instance.currentLevel.indoorMapHazards, val3); } else { Manager.insideObjectsToSpawnOutside.Add(new Manager.ObjectInfo(hazardObject, Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)))); } } } } private string name = "0"; private CustomEventHandling.EventData? eventData; public List hazardEvents; public GeneralCustomEvent(string path) { eventData = CustomEventHandling.ReadFile(path); hazardEvents = new List(); } public override string Name() { return name; } public override void Initalize() { //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown Log.LogInfo("Running Custom Event Initialization"); if (eventData != null) { name = eventData.Name; Type = eventData.Type; Weight = eventData.Weight; ColorHex = eventData.Color; Descriptions = eventData.Descriptions; Enabled = eventData.Enabled; showTip = eventData.showTip; isWarning = eventData.isWarning; MoonMode = eventData.MoonMode; isSpecialEvent = eventData.isSpecialEvent; isBetaEvent = eventData.isBetaEvent; SanitizeName(); if (Descriptions.Count == 0) { Descriptions.Add("Please add a description to " + name + " event"); } if (eventData.Items != null) { Scale amount = CustomEventHandling.ArrayToScale(eventData.Items.TransmuteAmount); Scale value = CustomEventHandling.ArrayToScale(eventData.Items.ScrapAmount); Scale value2 = CustomEventHandling.ArrayToScale(eventData.Items.ScrapValue); List list = new List(); foreach (CustomEventHandling.ItemData item in eventData.Items.Items) { list.Add(new SpawnableItemWithRarity(Assets.GetItem(item.Name), item.Rarity)); } scrapTransmutationEvent = new ScrapTransmutationEvent(amount, list.ToArray()); ScaleList.Add(ScaleType.ScrapAmount, value); ScaleList.Add(ScaleType.ScrapValue, value2); } if (eventData.Enemies != null && eventData.Enemies.Count > 0) { foreach (CustomEventHandling.EnemyData enemy in eventData.Enemies) { Scale insideSpawnRarity = CustomEventHandling.ArrayToScale(enemy.InsideRarity); Scale outsideSpawnRarity = CustomEventHandling.ArrayToScale(enemy.OutsideRarity); Scale minInside = CustomEventHandling.ArrayToScale(enemy.MinInside); Scale maxInside = CustomEventHandling.ArrayToScale(enemy.MaxInside); Scale minOutside = CustomEventHandling.ArrayToScale(enemy.MinOutside); Scale maxOutside = CustomEventHandling.ArrayToScale(enemy.MaxOutside); monstersToSpawn.Add(new MonsterEvent(enemy.Name, insideSpawnRarity, outsideSpawnRarity, minInside, maxInside, minOutside, maxOutside)); } } if (eventData.Hazards != null && eventData.Hazards.Count > 0) { foreach (BaseHazardData hazard in eventData.Hazards) { if (hazard is OutsideHazardData) { OutsideHazardData outsideHazardData = (OutsideHazardData)hazard; Scale minDensity = CustomEventHandling.ArrayToScale(outsideHazardData.MinDensity); Scale maxDensity = CustomEventHandling.ArrayToScale(outsideHazardData.MaxDensity); hazardEvents.Add(new HazardEvent(hazard.PrefabName, minDensity, maxDensity)); } else if (hazard is InsideHazardData) { InsideHazardData insideHazardData = (InsideHazardData)hazard; Scale minAmount = CustomEventHandling.ArrayToScale(insideHazardData.MinSpawn); Scale maxAmount = CustomEventHandling.ArrayToScale(insideHazardData.MaxSpawn); hazardEvents.Add(new HazardEvent(hazard.PrefabName, minAmount, maxAmount, insideHazardData.SpawnOptions.FacingAwayFromWall, insideHazardData.SpawnOptions.FacingWall, insideHazardData.SpawnOptions.BackToWall, insideHazardData.SpawnOptions.BackFlushWithWall, insideHazardData.SpawnOptions.RequireDistanceBetween, insideHazardData.SpawnOptions.DisallowNearEntrances, insideHazardData.SpawnOptions.AllowInMineshaft)); } } } if (eventData.EventsToRemove != null && eventData.EventsToRemove.Count > 0) { EventsToRemove = eventData.EventsToRemove; } if (eventData.EventsToSpawnWith != null && eventData.EventsToSpawnWith.Count > 0) { EventsToSpawnWith = eventData.EventsToSpawnWith; } if (eventData.MoonBlacklist != null && eventData.MoonBlacklist.Count > 0) { Blacklist = eventData.MoonBlacklist; } if (eventData.MoonWhitelist != null && eventData.MoonWhitelist.Count > 0) { Whitelist = eventData.MoonWhitelist; } if (eventData.TipMessages != null && eventData.TipMessages.Count > 0) { TipMessages = eventData.TipMessages; } if (eventData.TipTitle != null && eventData.TipTitle.Count > 0) { TipTitle = eventData.TipTitle; } if (eventData.Aliases != null && eventData.Aliases.Count > 0) { Aliases = eventData.Aliases; } Log.LogInfo(name + " event initialized"); } else { Enabled = false; Log.LogInfo("No event data received. Check if your event files are valid JSON"); } } public override bool AddEventIfOnly() { if (eventData == null) { return false; } if (eventData.AddEventIfOnly != null && eventData.AddEventIfOnly.Count > 0) { foreach (string item in eventData.AddEventIfOnly) { Log.LogInfo($"{name} contains {item}: {Chainloader.PluginInfos.ContainsKey(item)}"); if (!Chainloader.PluginInfos.ContainsKey(item)) { return false; } } } if (eventData.Items != null) { if (Manager.transmuteScrap) { return false; } Manager.transmuteScrap = true; } return true; } public override void Execute() { ExecuteAllMonsterEvents(); if (eventData.Items != null) { Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); scrapTransmutationEvent.Execute(); } if (!string.IsNullOrWhiteSpace(eventData.Weather) && Compatibility.IsModPresent("mrov.WeatherRegistry")) { CustomWeather.SetCustomWeather(eventData.Weather); } foreach (HazardEvent hazardEvent in hazardEvents) { hazardEvent.Execute(); } } private void SanitizeName() { string text = name; name = name.Replace("\n", "").Replace("\t", "").Replace("\\", "") .Replace("\"", "") .Replace("'", "") .Replace("[", "") .Replace("]", "") .Replace(" ", ""); if (name != text) { Log.LogWarning(text + " has been renamed to " + name + " due to invalid characters"); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedINetworkSerializable(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_FixedString(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace BrutalCompanyMinus.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }