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.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.MonoBehaviours; using BrutalCompanyMinus.NetcodePatcher; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations.Rigging; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BrutalCompanyMinus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ed68f23e749905974aafe6506399c56c8fc9f0c2")] [assembly: AssemblyProduct("BrutalCompanyMinus")] [assembly: AssemblyTitle("BrutalCompanyMinus")] [assembly: AssemblyVersion("1.0.0.0")] [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; } } } 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 } 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 } 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, Exclipsed } 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" } }; 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" } }; 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.Exclipsed, "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 indoorMapHazards = 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"); [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void GenerateCustom() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown antiCoilHead = (EnemyType)customAssetBundle.LoadAsset("AntiCoilHead"); nutSlayer = (EnemyType)customAssetBundle.LoadAsset("NutSlayer"); kamikazieBug = (EnemyType)customAssetBundle.LoadAsset("KamikazieBug"); 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_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_008f: 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_00a2: 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() { using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BrutalCompanyMinus.Asset.bcm_assets")) { bundle = AssetBundle.LoadFromStream(stream); } using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("BrutalCompanyMinus.Asset.bcm_customassets")) { customAssetBundle = AssetBundle.LoadFromStream(stream2); } SceneManager.sceneLoaded += OnSceneLoaded; } 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 ((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 (!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 ((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 (!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(); List list3 = new List(); SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { if ((Object)(object)val == (Object)null) { continue; } if (val.spawnableMapObjects != null) { 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); } } } if (val.indoorMapHazards != null) { IndoorMapHazard[] array6 = val.indoorMapHazards; foreach (IndoorMapHazard obj2 in array6) { if (obj2 != null && !((Object)(object)obj2.hazardType.prefabToSpawn == (Object)null) && list2.FindIndex((IndoorMapHazard o) => ((Object)o.hazardType.prefabToSpawn).name == ((Object)obj2.hazardType.prefabToSpawn).name) < 0) { list2.Add(obj2); } } } SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val.spawnableOutsideObjects; foreach (SpawnableOutsideObjectWithRarity obj3 in spawnableOutsideObjects) { if (obj3 != null && !((Object)(object)obj3.spawnableObject == (Object)null) && !((Object)(object)obj3.spawnableObject.prefabToSpawn == (Object)null) && list3.FindIndex((SpawnableOutsideObjectWithRarity o) => ((Object)o.spawnableObject.prefabToSpawn).name == ((Object)obj3.spawnableObject.prefabToSpawn).name) < 0) { list3.Add(obj3); } } } Dictionary dictionary = new Dictionary(); foreach (IndoorMapHazard item2 in list2) { dictionary.Add(((Object)item2.hazardType.prefabToSpawn).name, item2.hazardType.prefabToSpawn); } foreach (SpawnableMapObject item3 in list) { if (!dictionary.ContainsKey(((Object)item3.prefabToSpawn).name)) { dictionary.Add(((Object)item3.prefabToSpawn).name, item3.prefabToSpawn); } } foreach (KeyValuePair item4 in dictionary) { ObjectList.Add(item4.Key, item4.Value); } foreach (SpawnableOutsideObjectWithRarity item5 in list3) { ObjectList.Add(((Object)item5.spawnableObject.prefabToSpawn).name, item5.spawnableObject.prefabToSpawn); } foreach (KeyValuePair @object in ObjectList) { bool flag3 = false; foreach (KeyValuePair objectName in ObjectNameList) { if (@object.Key == objectName.Value) { flag3 = true; break; } } if (!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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown 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 item4 in list) { num += (float)((item4.spawnableItem.minValue + item4.spawnableItem.maxValue) * item4.rarity); num2 += (float)item4.rarity; } if (num2 != 0f) { averageScrapValueList.Add(num / (num2 * 2f)); } else { averageScrapValueList.Add(80f); } AnimationCurve item = new AnimationCurve(val.enemySpawnChanceThroughoutDay.keys); AnimationCurve item2 = new AnimationCurve(val.outsideEnemySpawnChanceThroughDay.keys); AnimationCurve item3 = new AnimationCurve(val.daytimeEnemySpawnChanceThroughDay.keys); insideSpawnChanceCurves.Add(item); outsideSpawnChanceCurves.Add(item2); daytimeSpawnChanceCurves.Add(item3); insideMaxPowerCounts.Add(val.maxEnemyPowerCount); outsideMaxPowerCounts.Add(val.maxOutsideEnemyPowerCount); daytimeMaxPowerCounts.Add(val.maxDaytimeEnemyPowerCount); List list2 = new List(); SpawnableMapObject[] array = val.spawnableMapObjects; foreach (SpawnableMapObject original in array) { list2.Add(original.CreateCopy()); } spawnableMapObjects.Add(list2.ToArray()); List list3 = new List(); IndoorMapHazard[] array2 = val.indoorMapHazards; foreach (IndoorMapHazard original2 in array2) { list3.Add(original2.CreateCopy()); } indoorMapHazards.Add(list3.ToArray()); } generatedOrignalValuesList = true; } public static EnemyType GetEnemy(EnemyName name) { return GetEnemy(EnemyNameList[name]); } public static EnemyType GetEnemy(string name) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (EnemyList.TryGetValue(name, out EnemyType value)) { return value; } Log.LogWarning("GetEnemy(" + name + ") failed, returning an empty enemy type"); return new EnemyType { enemyName = name, name = name }; } public static EnemyType GetEnemyOrDefault(string name) { if (EnemyList.TryGetValue(name, out EnemyType value)) { return value; } 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) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (ItemList.TryGetValue(name, out Item value)) { return value; } Log.LogWarning("GetItem(" + name + ") failed, returning an empty item"); return new Item { itemName = name, name = name }; } public static GameObject GetObject(ObjectName name) { return GetObject(ObjectNameList[name]); } public static GameObject GetObject(string name) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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 { public NetworkList currentWeatherMultipliers; public NetworkList outsideObjectsToSpawn; public NetworkList currentWeatherEffects; public NetworkVariable textUI = new NetworkVariable(default(FixedString4096Bytes), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public bool receivedSyncedValues; public List objectsToSpawn = new List(); public List objectsToSpawnAmount = new List(); public List objectsToSpawnRadius = new List(); public List objectsToSpawnOffsets = new List(); private float currentIntervalTime; 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(); } private void Update() { //IL_00e7: 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_009b: 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) 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_00cd: 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; SetSyncedTextClientRpc(textUI.Value); } } } [ClientRpc] public void SetSyncedTextClientRpc(FixedString4096Bytes 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_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_00e7: 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(1209899646u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref value, default(ForFixedStrings)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1209899646u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; textUI.Value = value; } } } [ServerRpc(RequireOwnership = false)] public void GiveSeedServerRpc(int increment) { //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(2429182447u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, increment); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2429182447u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetSeedClientRpc(_seed + increment); } } } [ClientRpc] public void SetSeedClientRpc(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_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(1673350984u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1673350984u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; _seed = value; } } } [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++) { if (!((Object)(object)Manager.objectsToClear[i] != (Object)null)) { continue; } NetworkObject component = Manager.objectsToClear[i].GetComponent(); if ((Object)(object)component != (Object)null) { try { component.Despawn(true); } catch { } } else { try { Object.Destroy((Object)(object)Manager.objectsToClear[i]); } catch { } } } 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(RequireOwnership = false)] 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_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(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] public 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; } } } private void UpdateAtmosphere(FixedString128Bytes name, bool state) { //IL_0015: 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) 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)] public 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(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 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(); for (int i = 0; i < array.Length; i++) { array[i].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(); foreach (DoorLock val3 in array) { 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 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_00d5: Unknown result type (might be due to invalid IL or missing references) //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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_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_0146: 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_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_011b: 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_012d: 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_010d: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected I4, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)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; switch (weatherType - 1) { case 0: BrutalCompanyMinus.Minus.Handlers.AllWeather.raining = true; break; case 2: if (!((Object)(object)TimeOfDay.Instance.foggyWeather == (Object)null)) { LocalVolumetricFog val6 = Object.Instantiate(TimeOfDay.Instance.foggyWeather); Manager.objectsToClear.Add(((Component)val6).gameObject); val6.parameters.albedo = new Color(0.25f, 0.35f, 0.55f, 1f); val6.parameters.meanFreePath = random.Next((int)MathF.Max(4f, val3.weatherVariable), val3.weatherVariable2) * 5; val6.parameters.size.y = 255f; ((Component)val6).gameObject.SetActive(true); } break; case 3: { FloodWeather val5 = Object.Instantiate(Assets.flooded); Manager.objectsToClear.Add(((Component)val5).gameObject); BrutalCompanyMinus.Minus.Handlers.AllWeather.floodVariable1 = val3.weatherVariable; BrutalCompanyMinus.Minus.Handlers.AllWeather.floodVariable2 = val3.weatherVariable2; BrutalCompanyMinus.Minus.Handlers.AllWeather.spawnedFloodedWeather = val5; ((Component)val5).gameObject.SetActive(true); break; } case 1: { StormyWeather val4 = Object.Instantiate(Assets.stormy); Manager.objectsToClear.Add(((Component)val4).gameObject); BrutalCompanyMinus.Minus.Handlers.AllWeather.lightningVariable1 = val3.weatherVariable; BrutalCompanyMinus.Minus.Handlers.AllWeather.LightningVariable2 = val3.weatherVariable2; ((Component)val4).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_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_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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) 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, ((Component)component).transform.parent); 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_00e5: 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_00f7: 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) 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); val3.GetComponent().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; } } } [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] private static void InitalizeServerObject() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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] [HarmonyPatch(typeof(Terminal), "Start")] private static void SpawnServerObject() { if (Object.FindObjectOfType().IsServer) { Object.Instantiate(netObject).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(); } } 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); ((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 ((NetworkBehaviour)this).__registerRpc(1644092438u, new RpcReceiveHandler(__rpc_handler_1644092438), "GetSyncedTextServerRpc"); ((NetworkBehaviour)this).__registerRpc(1209899646u, new RpcReceiveHandler(__rpc_handler_1209899646), "SetSyncedTextClientRpc"); ((NetworkBehaviour)this).__registerRpc(2429182447u, new RpcReceiveHandler(__rpc_handler_2429182447), "GiveSeedServerRpc"); ((NetworkBehaviour)this).__registerRpc(1673350984u, new RpcReceiveHandler(__rpc_handler_1673350984), "SetSeedClientRpc"); ((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(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(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(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).__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_1209899646(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 syncedTextClientRpc = default(FixedString4096Bytes); ((FastBufferReader)(ref reader)).ReadValueSafe(ref syncedTextClientRpc, default(ForFixedStrings)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetSyncedTextClientRpc(syncedTextClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2429182447(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 increment = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref increment); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).GiveSeedServerRpc(increment); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1673350984(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 seedClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seedClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((Net)(object)target).SetSeedClientRpc(seedClientRpc); 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_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).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_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_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_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; } } protected internal override string __getTypeName() { return "Net"; } } public struct CurrentWeatherEffect : INetworkSerializable, IEquatable { public FixedString128Bytes name; public bool state; public CurrentWeatherEffect(FixedString128Bytes name, bool state) { //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) this.name = name; this.state = state; } public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_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_001b: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) 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); } } public struct OutsideObjectsToSpawn : INetworkSerializable, IEquatable { public float density; public int objectEnumID; public OutsideObjectsToSpawn(float density, int objectEnumID) { this.density = density; this.objectEnumID = objectEnumID; } public void NetworkSerialize(BufferSerializer serializer) where T : IReaderWriter { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_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_001b: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) 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(OutsideObjectsToSpawn other) { if (objectEnumID == other.objectEnumID) { return density == other.density; } return false; } } [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; public float showCaseEventTime = 45f; public float curretShowCaseEventTime; public bool keyPressEnabledTyping = true; public bool keyPressEnabledTerminal = true; public bool keyPressEnabledSettings = true; public Keyboard keyboard; public static bool canClearText = true; public static UI Instance { get; private set; } public static GameObject eventUIObject { get; set; } public unsafe void Start() { //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0368: 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(); }); Component[] componentsInChildren = eventUIObject.GetComponentsInChildren(true); foreach (Component val in componentsInChildren) { try { string name = ((Object)val).name; if (name == null) { continue; } switch (name.Length) { case 9: switch (name[0]) { case 'E': if (name == "EventText" && (Object)(object)panelText == (Object)null) { panelText = val.GetComponent(); } break; case 'S': if (name == "Scrollbar" && (Object)(object)panelScrollBar == (Object)null) { panelScrollBar = val.GetComponent(); } break; case 'D': if (name == "DownArrow" && (Object)(object)downArrow == (Object)null) { downArrow = val.GetComponent(); } break; } break; case 10: if (name == "EventPanel" && (Object)(object)panelBackground == (Object)null) { panelBackground = val.gameObject; } break; case 6: if (name == "Letter" && (Object)(object)letter == (Object)null) { letter = val.GetComponent(); key = Configuration.UIKey.Value.ToUpper(); ((TMP_Text)letter).text = key; } break; case 11: if (name == "LetterPanel" && (!Configuration.ShowUILetterBox.Value || !Configuration.EnableUI.Value)) { val.gameObject.SetActive(false); } break; case 13: if (name == "UpArrowPannel" && (Object)(object)upArrowPanel == (Object)null) { upArrowPanel = val.gameObject; } break; case 14: if (name == "DownArrowPanel" && (Object)(object)downArrowPanel == (Object)null) { downArrowPanel = val.gameObject; } break; case 7: if (name == "UpArrow" && (Object)(object)upArrow == (Object)null) { upArrow = val.GetComponent(); } break; case 8: case 12: break; } } catch { Log.LogError("Failed to capture EventUI component/s."); } } keyboard = Keyboard.current; if (keyboard != null && Configuration.EnableUI.Value) { keyControl = keyboard.FindKeyOnCurrentKeyboardLayout(key); downKeyControl = keyboard.downArrowKey; upKeyControl = keyboard.upArrowKey; keyboard.onTextInput += OnKeyboardInput; } Net.Instance.GetSyncedTextServerRpc(); ((TMP_Text)panelText).text = ((object)Net.Instance.textUI.Value/*cast due to .constrained prefix*/).ToString(); } private void Update() { //IL_011e: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (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) { if (((ButtonControl)downKeyControl).isPressed) { showCaseEvents = false; ((Graphic)downArrow).color = new Color(0f, 1f, 0f); Scrollbar obj2 = panelScrollBar; obj2.value -= Time.deltaTime * Configuration.scrollSpeed.Value; } else { ((Graphic)downArrow).color = new Color(0f, 0.6f, 0f); } if (((ButtonControl)upKeyControl).isPressed) { showCaseEvents = false; ((Graphic)upArrow).color = new Color(0f, 1f, 0f); Scrollbar obj3 = panelScrollBar; obj3.value += Time.deltaTime * Configuration.scrollSpeed.Value; } else { ((Graphic)upArrow).color = new Color(0f, 0.6f, 0f); } } } public static void SpawnObject() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //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) 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_0147: Unknown result type (might be due to invalid IL or missing references) string text = "
Events:
"; 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 += "

Other:"; text = text + $"
-Scrap Value: x{num:F2}" + $"
-Scrap Amount: x{RoundManager.Instance.scrapAmountMultiplier * Manager.scrapAmountMultiplier:F2}" + $"
-Factory Size: x{RoundManager.Instance.currentLevel.factorySizeMultiplier:F2}" + $"
-Spawn Chance: x{Manager.spawnChanceMultiplier:F2}" + $"
-Spawn Cap: x{Manager.spawncapMultipler:F2}" + "
-Bonus enemy hp: " + 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) { if (!(value < 0f)) { return "+"; } return ""; } [ServerRpc(RequireOwnership = false)] private static void ClearTextServerRpc() { try { ClearText(); } catch { } } public static void ClearText() { //IL_0107: 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) if (Configuration.DisplayExtraPropertiesAfterShipLeaves.Value) { string text = ""; Manager.ComputeDifficultyValues(); if (!Configuration.useCustomWeights.Value) { EventManager.UpdateAllEventWeights(); text = text + "
EventType Chances:
-VeryBad: " + Helper.GetPercentage(EventManager.eventTypeRarities[0]) + "
-Bad: " + Helper.GetPercentage(EventManager.eventTypeRarities[1]) + "
-Neutral: " + Helper.GetPercentage(EventManager.eventTypeRarities[2]) + "
-Good: " + Helper.GetPercentage(EventManager.eventTypeRarities[3]) + "
-VeryGood: " + Helper.GetPercentage(EventManager.eventTypeRarities[4]) + "
-Remove: " + Helper.GetPercentage(EventManager.eventTypeRarities[5]) + "
"; } text += GetDifficultyText(); Net.Instance.textUI.Value = new FixedString4096Bytes(text); } else { Net.Instance.textUI.Value = new FixedString4096Bytes(" "); } } private static string GetDifficultyText() { string text = "
Difficulty: " + Helper.GetDifficultyText() + $"
-Difficulty: {Manager.difficulty:F1}"; if (Configuration.scaleByDaysPassed.Value) { text += $"
-Day: {plusMinusExclusive(Manager.daysDifficulty)}{Manager.daysDifficulty:F1}"; } if (Configuration.scaleByQuota.Value) { text += $"
-Quota: {plusMinusExclusive(Manager.quotaDifficulty)}{Manager.quotaDifficulty:F1}"; } if (Configuration.scaleByScrapInShip.Value) { text += $"
-Ship Scrap: {plusMinusExclusive(Manager.scrapInShipDifficulty)}{Manager.scrapInShipDifficulty:F1}"; } if (Configuration.scaleByMoonGrade.Value) { text += string.Format("
-Moon risk: {1}{2:F1}", Helper.GetDifficultyColorHex(Manager.moonGradeDifficulty, Configuration.gradeAdditives["S+++"]), plusMinusExclusive(Manager.moonGradeDifficulty), Manager.moonGradeDifficulty); } if (Configuration.scaleByWeather.Value) { text += $"
-Weather: {plusMinusExclusive(Manager.weatherDifficulty)}{Manager.weatherDifficulty:F1}"; } return text; } public void OnKeyboardInput(char input) { 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_0016: 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_006d: 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); ((Graphic)letter).color = new Color(0f, state ? 1f : 0.6f, 0f); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OnPlayerConnectedClientRpc")] [HarmonyPatch(typeof(StartOfRound), "ArriveAtLevel")] private static void OnChangeLevelPostfix(ref StartOfRound __instance) { ExecuteOnChangeLevel(__instance); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "SetShipReadyToLand")] private static void OnChangeLevelPrefix(ref StartOfRound __instance) { ExecuteOnChangeLevel(__instance); } private static void ExecuteOnChangeLevel(StartOfRound instance) { if (!NetworkManager.Singleton.IsServer || !canClearText) { return; } try { ClearText(); } catch { ((MonoBehaviour)instance).StartCoroutine(ClearAfterDelay()); } } private static IEnumerator ClearAfterDelay() { yield return (object)new WaitForSeconds(0.2f); try { ClearText(); } catch { } } [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) { try { Instance.keyPressEnabledTerminal = !___terminalInUse; } catch { } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "Update")] public static void OnPlayerControllerBUpdate(ref QuickMenuManager ___quickMenuManager) { try { Instance.keyPressEnabledSettings = !___quickMenuManager.isMenuOpen; } catch { } } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "Update")] public static void OnUpdate(ref PlayerControllerB ___localPlayer) { try { Instance.keyPressEnabledTyping = !___localPlayer.isTypingChat; } catch { } } } [HarmonyPatch] internal 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 lcOfficePresent; 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 lockerPresent; internal static bool theGiantSpecimensPresent; internal static bool mimicsPresent; internal static bool footballPresent; internal static bool emergencyDicePresent; internal static bool goldScrapPresent; internal static bool moonsweptPresent; internal static bool shockwaveDronesPresent; internal static bool facelessStalekerPresent; internal static FieldInfo peeperSpawnChance; internal static NetworkVariable[] mimicNetworkSpawnChances; [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("x753.Mimics"); if (assembly3 != null) { Log.LogInfo("Found mimicsMod, Will attempt to grab spawn rate network variables"); Type type3 = assembly3.GetType("Mimics.MimicNetworker"); Type type4 = assembly3.GetType("Mimics.Mimics"); if (type3 != null && type4 != null) { mimicNetworkSpawnChances = new NetworkVariable[6]; for (int i = 0; i < 5; i++) { mimicNetworkSpawnChances[i] = (NetworkVariable)type3.GetField("SpawnWeight" + i, BindingFlags.Static | BindingFlags.Public).GetValue(null); } mimicNetworkSpawnChances[5] = (NetworkVariable)type3.GetField("SpawnWeightMax", BindingFlags.Static | BindingFlags.Public).GetValue(null); bool flag = false; NetworkVariable[] array = mimicNetworkSpawnChances; for (int j = 0; j < array.Length; j++) { if (array[j] == null) { flag = true; break; } } FieldInfo field2 = type4.GetField("SpawnRates", BindingFlags.Static | BindingFlags.Public); if (field2 != null && !flag) { Log.LogInfo("Found spawn rate network variables, Mimics and noMimics events will now appear."); BrutalCompanyMinus.Minus.Handlers.Mimics.originalSpawnRateValues = (int[])field2.GetValue(null); mimicsPresent = true; EventManager.moddedEvents.Add(new BrutalCompanyMinus.Minus.Events.Mimics()); EventManager.moddedEvents.Add(new NoMimics()); } } } 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.", new Roomba(), new TeleporterTraps()); diversityPresent = IsModPresent("Chaos.Diversity", "Walker event will now occur.", new Walkers()); scopophobiaPresent = IsModPresent("Scopophobia", "Shy Guy and NoShyGuy event will now occur.", new ShyGuy(), new NoShyGuy()); lcOfficePresent = IsModPresent("Piggy.LCOffice", "Shrimp event will now occur.", new Shrimp()); herobrinePresent = IsModPresent("Kittenji.HerobrineMod", "Herobrine event will now occur.", new Herobrine()); sirenheadPresent = IsModPresent("Ccode.SirenHead", "SirenHead event will now occur.", new SirenHead()); rollinggiantPresent = IsModPresent("nomnomab.rollinggiant", "RollingGiant and NoRollingGiant event will now occur.", new RollingGiants()); theFiendPresent = IsModPresent("com.RuthlessCompany", "TheFiend and NoFiend event will now occur.", new TheFiend(), new NoFiend()); immortalSnailPresent = IsModPresent("ImmortalSnail", "ImmortalSnail and NoImmortalSnail event will now occur.", new ImmortalSnail(), new NoImmortalSnails()); lockerPresent = IsModPresent("com.zealsprince.locker", "Locker and NoLocker event will now occur.", new Lockers(), new NoLockers()); theGiantSpecimensPresent = IsModPresent("TheGiantSpecimens", "GiantShowdown event will now occur.", new GiantShowdown()); footballPresent = IsModPresent("Kittenji.FootballEntity", "Football event will now occur.", new Football()); emergencyDicePresent = IsModPresent("Theronguard.EmergencyDice", "BadDice and Dice events will now occur.", new BadDice(), new Dice()); goldScrapPresent = IsModPresent("LCGoldScrapMod", "CityOfGold event will now occur", new CityOfGold()); moonsweptPresent = IsModPresent("MoonsweptTeam.Moonswept", "Cleaner and MobileTurrets events will now occur", new Cleaners(), new MobileTurrets()); shockwaveDronesPresent = IsModPresent("droneenemy", "Shockwave Drones event will now occur", new ShockwaveDrones()); facelessStalekerPresent = IsModPresent("sparble.slendermanmod", "SlenderMan event will now occur", new SlenderMan()); } private static Assembly GetAssembly(string name) { if (Chainloader.PluginInfos.ContainsKey(name)) { return ((object)Chainloader.PluginInfos[name].Instance).GetType().Assembly; } return null; } private static bool IsModPresent(string name, string logMessage, params MEvent[] associatedEvents) { bool num = Chainloader.PluginInfos.ContainsKey(name); if (num) { EventManager.moddedEvents.AddRange(associatedEvents); Log.LogInfo(name + " is present. " + logMessage); } return num; } } [HarmonyPatch] public class Configuration { 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 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> eventEnables = new List>(); public static List> eventsToRemove = new List>(); public static List> eventsToSpawnWith = 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 ConfigEntry goodEventIncrementMultiplier; public static ConfigEntry badEventIncrementMultiplier; public static float[] weightsForExtraEvents; public static MEvent.Scale[] eventTypeScales = new MEvent.Scale[6]; 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 ignoreMaxCap; public static ConfigEntry difficultyMaxCap; public static ConfigEntry scaleByDaysPassed; public static ConfigEntry scaleByScrapInShip; public static ConfigEntry scaleByMoonGrade; public static ConfigEntry scaleByWeather; public static ConfigEntry scaleByQuota; 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 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 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 nutSlayerLives; public static ConfigEntry nutSlayerHp; public static ConfigEntry nutSlayerMovementSpeed; public static ConfigEntry nutSlayerImmortal; public static ConfigEntry slayerShotgunMinValue; public static ConfigEntry slayerShotgunMaxValue; 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"; internal static bool Initalized = false; private static string header = "All Enemies"; 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); showEventsInChat = difficultyConfig.Bind("_Event Settings", "Will Minus display events in chat?", false, (ConfigDescription)null); eventTypeScales = new MEvent.Scale[6] { 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", "Remove event scale", "15, -0.05, 10, 15", "These events remove something " + scaleDescription).Value) }; 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."); 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 } }; 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); goodEventIncrementMultiplier = difficultyConfig.Bind("Difficulty", "Global multiplier for increment value on good and veryGood eventTypes.", 1f, (ConfigDescription)null); badEventIncrementMultiplier = difficultyConfig.Bind("Difficulty", "Global multiplier for increment value on bad and veryBad eventTypes.", 1f, (ConfigDescription)null); 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); 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.1f, 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", "Toggle UI Key", "K", (ConfigDescription)null); NormaliseScrapValueDisplay = uiConfig.Bind("UI Options", "Normlize 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."); int value = customEventConfig.Bind("_Temp Custom Monster Event Count", "How many events to generate in config?", 3, "This is temporary for the time being.").Value; for (int i = 0; i < value; i++) { MEvent mEvent = new CustomMonsterEvent(); mEvent.Initalize(); EventManager.customEvents.Add(mEvent); } RegisterEvents(eventConfig, EventManager.vanillaEvents); RegisterEvents(moddedEventConfig, EventManager.moddedEvents); RegisterEvents(customEventConfig, EventManager.customEvents); foreach (EventManager.CustomEvents customEvents in EventManager.customEventsList) { foreach (MEvent @event in customEvents.events) { @event.Initalize(); } RegisterEvents(customEvents.configFile, customEvents.events); EventManager.customEvents.AddRange(customEvents.events); } EventManager.customEventsList.Clear(); 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.disableSpikeTrapsWeight = eventConfig.Bind("FacilityGhost", "Disable spiketraps weight?", 5, "Whenever the ghost makes a decision, what is the weight to attempt to disable the spiketraps?").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; BrutalCompanyMinus.Minus.Handlers.Mimics.spawnRateScales[0] = Helper.getScale(moddedEventConfig.Bind("Mimics", "Zero Mimics Scale", "0, 0, 0, 0", "Weight Scale of zero mimics spawning " + scaleDescription).Value); BrutalCompanyMinus.Minus.Handlers.Mimics.spawnRateScales[1] = Helper.getScale(moddedEventConfig.Bind("Mimics", "One Mimic Scale", "0, 0, 0, 0", "Weight Scale of one mimic spawning " + scaleDescription).Value); BrutalCompanyMinus.Minus.Handlers.Mimics.spawnRateScales[2] = Helper.getScale(moddedEventConfig.Bind("Mimics", "Two Mimics Scale", "0, 0, 0, 0", "Weight Scale of two mimics spawning " + scaleDescription).Value); BrutalCompanyMinus.Minus.Handlers.Mimics.spawnRateScales[3] = Helper.getScale(moddedEventConfig.Bind("Mimics", "Three Mimics Scale", "80.0, -1.25, 5.0, 80.0", "Weight Scale of three mimics spawning " + scaleDescription).Value); BrutalCompanyMinus.Minus.Handlers.Mimics.spawnRateScales[4] = Helper.getScale(moddedEventConfig.Bind("Mimics", "Four Mimics Scale", "40.0, -0.5, 10.0, 40.0", "Weight Scale of four mimics spawning " + scaleDescription).Value); BrutalCompanyMinus.Minus.Handlers.Mimics.spawnRateScales[5] = Helper.getScale(moddedEventConfig.Bind("Mimics", "Maximum Mimics Scale", "10.0, 0.84, 10.0, 60.0", "Weight Scale of maximum mimics spawning " + scaleDescription).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_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Expected O, but got Unknown foreach (MEvent event2 in events) { eventWeights.Add(toConfig.Bind(event2.Name(), "Custom Weight", event2.Weight, "If you want to use custom weights change 'Use custom weights'? setting in '__Event Settings' to true.")); eventDescriptions.Add(Helper.ListToDescriptions(toConfig.Bind(event2.Name(), "Descriptions", Helper.StringsToList(event2.Descriptions, "|"), "Seperated by |").Value)); eventColorHexes.Add(toConfig.Bind(event2.Name(), "Color Hex", event2.ColorHex, (ConfigDescription)null)); eventTypes.Add(toConfig.Bind(event2.Name(), "Event Type", event2.Type, (ConfigDescription)null)); eventEnables.Add(toConfig.Bind(event2.Name(), "Event Enabled?", event2.Enabled, "Setting this to false will stop the event from occuring.")); Dictionary dictionary = new Dictionary(); foreach (KeyValuePair scale5 in event2.ScaleList) { dictionary.Add(scale5.Key, Helper.getScale(toConfig.Bind(event2.Name(), scale5.Key.ToString(), Helper.GetStringFromScale(scale5.Value), MEvent.ScaleInfoList[scale5.Key] + " " + scaleDescription).Value)); } eventScales.Add(dictionary); eventsToRemove.Add(Helper.ListToStrings(toConfig.Bind(event2.Name(), "Events To Remove", Helper.StringsToList(event2.EventsToRemove, ", "), "Will prevent said event(s) from occuring.").Value)); eventsToSpawnWith.Add(Helper.ListToStrings(toConfig.Bind(event2.Name(), "Events To Spawn With", Helper.StringsToList(event2.EventsToSpawnWith, ", "), "Will spawn said events(s).").Value)); List list = new List(); for (int k = 0; k < event2.monsterEvents.Count; k++) { list.Add(new MEvent.MonsterEvent(toConfig.Bind(event2.Name(), $"Enemy {k} Name", ((Object)event2.monsterEvents[k].enemy).name, "Inputting an invalid enemy name will cause it to return an empty enemyType").Value, Helper.getScale(toConfig.Bind(event2.Name(), $"{((Object)event2.monsterEvents[k].enemy).name} {MEvent.ScaleType.InsideEnemyRarity}", Helper.GetStringFromScale(event2.monsterEvents[k].insideSpawnRarity), MEvent.ScaleInfoList[MEvent.ScaleType.InsideEnemyRarity] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(event2.Name(), $"{((Object)event2.monsterEvents[k].enemy).name} {MEvent.ScaleType.OutsideEnemyRarity}", Helper.GetStringFromScale(event2.monsterEvents[k].outsideSpawnRarity), MEvent.ScaleInfoList[MEvent.ScaleType.OutsideEnemyRarity] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(event2.Name(), $"{((Object)event2.monsterEvents[k].enemy).name} {MEvent.ScaleType.MinInsideEnemy}", Helper.GetStringFromScale(event2.monsterEvents[k].minInside), MEvent.ScaleInfoList[MEvent.ScaleType.MinInsideEnemy] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(event2.Name(), $"{((Object)event2.monsterEvents[k].enemy).name} {MEvent.ScaleType.MaxInsideEnemy}", Helper.GetStringFromScale(event2.monsterEvents[k].maxInside), MEvent.ScaleInfoList[MEvent.ScaleType.MaxInsideEnemy] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(event2.Name(), $"{((Object)event2.monsterEvents[k].enemy).name} {MEvent.ScaleType.MinOutsideEnemy}", Helper.GetStringFromScale(event2.monsterEvents[k].minOutside), MEvent.ScaleInfoList[MEvent.ScaleType.MinOutsideEnemy] + " " + scaleDescription).Value), Helper.getScale(toConfig.Bind(event2.Name(), $"{((Object)event2.monsterEvents[k].enemy).name} {MEvent.ScaleType.MaxOutsideEnemy}", Helper.GetStringFromScale(event2.monsterEvents[k].maxOutside), MEvent.ScaleInfoList[MEvent.ScaleType.MaxOutsideEnemy] + " " + scaleDescription).Value))); } monsterEvents.Add(list); MEvent.Scale amount = new MEvent.Scale(0f, 0f, 0f, 0f); if (event2.scrapTransmutationEvent.items.Length != 0) { amount = Helper.getScale(toConfig.Bind(event2.Name(), "Percentage", Helper.GetStringFromScale(event2.scrapTransmutationEvent.amount), MEvent.ScaleInfoList[MEvent.ScaleType.Percentage] + " " + scaleDescription).Value); } SpawnableItemWithRarity[] array = (SpawnableItemWithRarity[])(object)new SpawnableItemWithRarity[event2.scrapTransmutationEvent.items.Length]; for (int l = 0; l < event2.scrapTransmutationEvent.items.Length; l++) { array[l] = new SpawnableItemWithRarity(Assets.GetItem(toConfig.Bind(event2.Name(), $"Scrap {l} name", ((Object)event2.scrapTransmutationEvent.items[l].spawnableItem).name, "Inputting an invalid scrap name will cause it to return an empty item").Value), toConfig.Bind(event2.Name(), ((Object)event2.scrapTransmutationEvent.items[l].spawnableItem).name + " Rarity", event2.scrapTransmutationEvent.items[l].rarity, (ConfigDescription)null).Value); } transmutationEvents.Add(new MEvent.ScrapTransmutationEvent(amount, array)); } } unsafe static Weather createWeatherSettings(Weather weather) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) string text = "(" + ((object)(*(LevelWeatherType*)(&weather.weatherType))/*cast due to .constrained prefix*/).ToString() + ") Weather multipliers"; float value2 = weatherConfig.Bind(text, "Scrap Value Multiplier", weather.scrapValueMultiplier, "Multiply Scrap value for " + ((object)(*(LevelWeatherType*)(&weather.weatherType))/*cast due to .constrained prefix*/).ToString()).Value; float value3 = weatherConfig.Bind(text, "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, value2, value3); } } 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].Enabled = eventEnables[i].Value; EventManager.events[i].EventsToRemove = eventsToRemove[i]; EventManager.events[i].EventsToSpawnWith = eventsToSpawnWith[i]; EventManager.events[i].monsterEvents = 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.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.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(); customEventConfig.Save(); allEnemiesConfig.Save(); levelPropertiesConfig.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_0043: 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; } public static T[] Add(this T[] toObjects, T newObject) { T[] array = new T[toObjects.Length + 1]; for (int i = 0; i < toObjects.Length; i++) { array[i] = toObjects[i]; } array[toObjects.Length] = newObject; return array; } 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 Vector3 GetRandomNavMeshPositionInBox(Vector3 pos, float minRadius, float maxRadius) { //IL_0056: 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_0079: 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_00af: 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_0092: 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) 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_001a: 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_002b: 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_0035: 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_004c: 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_007e: 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_008c: 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_00c9: 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) 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_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) 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 SpawnableMapObject CreateCopy(this SpawnableMapObject original) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_001d: 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_0035: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0057: 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_0070: Expected O, but got Unknown return new SpawnableMapObject { requireDistanceBetweenSpawns = original.requireDistanceBetweenSpawns, disallowSpawningNearEntrances = original.disallowSpawningNearEntrances, spawnFacingAwayFromWall = original.spawnFacingAwayFromWall, spawnFacingWall = original.spawnFacingWall, prefabToSpawn = original.prefabToSpawn, numberToSpawn = new AnimationCurve(original.numberToSpawn.keys), spawnWithBackToWall = original.spawnWithBackToWall, spawnWithBackFlushAgainstWall = original.spawnWithBackFlushAgainstWall }; } internal static IndoorMapHazard CreateCopy(this IndoorMapHazard original) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_001e: Expected O, but got Unknown return new IndoorMapHazard { hazardType = original.hazardType, numberToSpawn = original.numberToSpawn }; } internal static AnimationCurve MultiplyKeyframes(AnimationCurve curve, float multiplier) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown Keyframe[] keys = curve.keys; for (int i = 0; i < keys.Length; i++) { if (((Keyframe)(ref keys[i])).value > 0f) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).value = ((Keyframe)(ref reference)).value * multiplier; ref Keyframe reference2 = ref keys[i]; ((Keyframe)(ref reference2)).inTangent = ((Keyframe)(ref reference2)).inTangent * multiplier; ref Keyframe reference3 = ref keys[i]; ((Keyframe)(ref reference3)).outTangent = ((Keyframe)(ref reference3)).outTangent * multiplier; } } return new AnimationCurve(keys); } internal static AnimationCurve AddKeyframes(AnimationCurve curve, float value) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown Keyframe[] keys = curve.keys; for (int i = 0; i < keys.Length; i++) { if (((Keyframe)(ref keys[i])).value > 0f) { ref Keyframe reference = ref keys[i]; ((Keyframe)(ref reference)).value = ((Keyframe)(ref reference)).value + value; ref Keyframe reference2 = ref keys[i]; ((Keyframe)(ref reference2)).inTangent = ((Keyframe)(ref reference2)).inTangent + value; ref Keyframe reference3 = ref keys[i]; ((Keyframe)(ref reference3)).outTangent = ((Keyframe)(ref reference3)).outTangent + value; } } return new AnimationCurve(keys); } internal static IList ComputeConvexHull(List points, bool sortInPlace = false) { //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_00f5: 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_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_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_0080: 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_0054: 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_00b6: 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_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_00c5: 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_00c9: 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_00a2: 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.x > b.x) ? 1 : (-1)) : a.y.CompareTo(b.y)); 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; } private static Vector2 Sub(this Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //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) return a - b; } private static float Cross(this Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) 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.*/)] [HarmonyPatch] [BepInPlugin("Drinkable.BrutalCompanyMinus", "BrutalCompanyMinus", "0.13.21")] internal class Plugin : BaseUnityPlugin { private const string GUID = "Drinkable.BrutalCompanyMinus"; private const string NAME = "BrutalCompanyMinus"; private const string VERSION = "0.13.21"; private static readonly Harmony harmony = new Harmony("Drinkable.BrutalCompanyMinus"); private void Awake() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown Log.Initalize(((BaseUnityPlugin)this).Logger); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } Assets.Load(); Configuration.uiConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\UI_Settings.cfg", true); Configuration.difficultyConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\Difficulty_Settings.cfg", true); Configuration.eventConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\VanillaEvents.cfg", true); Configuration.weatherConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\Weather_Settings.cfg", true); Configuration.customAssetsConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\Enemy_Scrap_Weights_Settings.cfg", true); Configuration.moddedEventConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\ModdedEvents.cfg", true); Configuration.customEventConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\CustomEvents.cfg", true); Configuration.allEnemiesConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\AllEnemies.cfg", true); Configuration.levelPropertiesConfig = new ConfigFile(Paths.ConfigPath + "\\BrutalCompanyMinus\\LevelProperties.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; harmony.PatchAll(); harmony.PatchAll(typeof(GrabObjectTranspiler)); Log.LogInfo("BrutalCompanyMinus 0.13.21 is done patching."); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "BrutalCompanyMinus"; public const string PLUGIN_NAME = "BrutalCompanyMinus"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace BrutalCompanyMinus.Minus { [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 BigBonus(), new ScrapGalore(), new GoldenBars(), new BigDelivery(), new PlentyOutsideScrap(), new BlackFriday(), new BrutalCompanyMinus.Minus.Events.SafeOutside(), 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 Nothing(), new Locusts(), new Birds(), new Trees(), new LeaflessBrownTrees(), new LeaflessTrees(), new Raining(), new Gloomy(), new HeavyRain(), new HoardingBugs(), new Bees(), 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 Nutcracker(), new Arachnophobia(), new Bracken(), new Coilhead(), new BaboonHorde(), new Dogs(), new Jester(), new LittleGirl(), new AntiCoilhead(), new CheapProduce(), new TransmuteScrapBig(), new Warzone(), new BugHorde(), new ForestGiant(), new InsideBees(), new NutSlayer(), new BrutalCompanyMinus.Minus.Events.Hell(), new BrutalCompanyMinus.Minus.Events.AllWeather(), new Worms(), new OldBirds(), 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 NoSpikeTraps() }; internal static List moddedEvents = new List(); 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 customEventsList = 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 void AddEvents(params MEvent[] mEvents) { customEventsList.Add(new CustomEvents(Configuration.customEventConfig, mEvents.ToList())); } public static void AddEvents(ConfigFile toConfig, params MEvent[] mEvents) { customEventsList.Add(new CustomEvents(toConfig, mEvents.ToList())); } 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(); 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); foreach (MEvent forcedEvent in forcedEvents) { list2.RemoveAll((MEvent x) => x.Name() == forcedEvent.Name()); foreach (string item in forcedEvent.EventsToRemove) { _ = item; list2.RemoveAll((MEvent x) => x.Name() == forcedEvent.Name()); } } int num2; for (num2 = 0; num2 < num; num2++) { MEvent newEvent = RandomWeightedEvent(list2, random); if (!newEvent.AddEventIfOnly()) { num2--; list2.RemoveAll((MEvent x) => x.Name() == newEvent.Name()); } else { list.Add(newEvent); list2.RemoveAll((MEvent x) => x.Name() == newEvent.Name()); int num3 = 0; foreach (string eventToRemove in newEvent.EventsToRemove) { list2.RemoveAll((MEvent x) => x.Name() == eventToRemove); num3 += list.RemoveAll((MEvent x) => x.Name() == eventToRemove); } foreach (string eventToSpawnWith in newEvent.EventsToSpawnWith) { list2.RemoveAll((MEvent x) => x.Name() == eventToSpawnWith); num3 += list.RemoveAll((MEvent x) => x.Name() == eventToSpawnWith); } num2 -= num3; } } List list3 = new List(); for (int num4 = 0; num4 < list.Count; num4++) { foreach (string eventToSpawnWith2 in list[num4].EventsToSpawnWith) { if (list3.FindIndex((MEvent x) => x.Name() == eventToSpawnWith2) == -1) { list3.Add(MEvent.GetEvent(eventToSpawnWith2)); } } } foreach (MEvent e in disabledEvents) { int num5 = list3.FindIndex((MEvent x) => x.Name() == e.Name()); if (num5 != -1) { list3.RemoveAt(num5); } } 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(); } } } 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()"); 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 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")] private static void ModifyLevel(ref SelectableLevel newLevel) { //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_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: 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.ClearGameObjectsClientRpc(); 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) { Manager.scrapValueMultiplier *= currentWeatherMultiplier.scrapValueMultiplier; Manager.scrapAmountMultiplier *= currentWeatherMultiplier.scrapAmountMultiplier; } } LevelProperties valueOrDefault = Configuration.levelProperties.GetValueOrDefault(newLevel.levelID); if (valueOrDefault != null) { Manager.scrapValueMultiplier *= valueOrDefault.GetScrapValueMultiplier(); Manager.scrapAmountMultiplier *= valueOrDefault.GetScrapAmountMultiplier(); } 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); if (!Configuration.useCustomWeights.Value) { UpdateAllEventWeights(); } List additionalEvents = new List(); List list = ChooseEvents(out additionalEvents); foreach (MEvent item in list) { Log.LogInfo("Event chosen: " + item.Name()); } foreach (MEvent item2 in additionalEvents) { Log.LogInfo("Additional events: " + item2.Name()); } ApplyEvents(list); ApplyEvents(additionalEvents); foreach (MEvent forcedEvent in forcedEvents) { forcedEvent.Execute(); foreach (string item3 in forcedEvent.EventsToSpawnWith) { MEvent.GetEvent(item3).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); } } RoundManager.Instance.currentLevel.maxEnemyPowerCount = (int)((float)(RoundManager.Instance.currentLevel.maxEnemyPowerCount + Manager.bonusMaxInsidePowerCount) * Manager.spawncapMultipler); RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount = (int)((float)(RoundManager.Instance.currentLevel.maxOutsideEnemyPowerCount + Manager.bonusMaxOutsidePowerCount) * Manager.spawncapMultipler); 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 + ", currentLevel.factorySizeMultiplier:" + Manager.currentLevel.factorySizeMultiplier + "]"); 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"); keys = newLevel.outsideEnemySpawnChanceThroughDay.keys; for (int i = 0; i < keys.Length; i++) { Keyframe val2 = keys[i]; Log.LogInfo($"Time:{((Keyframe)(ref val2)).time} + $Value:{((Keyframe)(ref val2)).value}"); } Log.LogInfo("Daytime Spawn Curve"); keys = newLevel.daytimeEnemySpawnChanceThroughDay.keys; for (int i = 0; i < keys.Length; i++) { Keyframe val3 = keys[i]; Log.LogInfo($"Time:{((Keyframe)(ref val3)).time} + $Value:{((Keyframe)(ref val3)).value}"); } } } 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_007e: 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) 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_0076: 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_0084: 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_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_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_00d7: 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_00b4: 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_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_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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0180: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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); if ((Object)(object)val3.GetComponent() != (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_008a: 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_0094: 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"); enemiesToSpawnOutside.Clear(); 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 obj = Object.Instantiate(enemiesToSpawnOutside[i].obj, Helper.GetSafePosition(outsideNodes, spawnDenialNodes, 20f, seed++), Quaternion.Euler(Vector3.zero)); EnemyAI component = obj.GetComponent(); list.Add(component); RoundManager.Instance.SpawnedEnemies.Add(component); obj.gameObject.GetComponentInChildren().Spawn(true); } } enemiesToSpawnOutside.Clear(); return list; } public static List DoSpawnInsideEnemies() { //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_006b: 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_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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_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) 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 obj = Object.Instantiate(enemiesToSpawnInside[i].obj, position, val); obj.GetComponentInChildren().Spawn(true); EnemyAI component = obj.GetComponent(); list.Add(component); RoundManager.Instance.SpawnedEnemies.Add(component); } } enemiesToSpawnInside.Clear(); return list; } public static ScrapSpawnInfo DoSpawnScrapOutside(int Amount) { //IL_009d: 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_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_00c8: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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 obj = Object.Instantiate(scrapToSpawn[i].spawnPrefab, randomNavMeshPositionInBoxPredictable, Quaternion.identity, instance.spawnedScrapContainer); GrabbableObject component = obj.GetComponent(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; list.Add((int)((float)Random.Range(scrapToSpawn[i].minValue, scrapToSpawn[i].maxValue + 1) * instance.scrapValueMultiplier * scrapValueMultiplier)); component.scrapValue = list[list.Count - 1]; NetworkObject component2 = obj.GetComponent(); component2.Spawn(false); list2.Add(NetworkObjectReference.op_Implicit(component2)); } return new ScrapSpawnInfo(list2.ToArray(), list.ToArray()); } public static ScrapSpawnInfo DoSpawnScrapInside(int Amount) { //IL_023c: 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_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0397: 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 obj = Object.Instantiate(ScrapToSpawn[i].spawnPrefab, val2, Quaternion.identity, instance.spawnedScrapContainer); GrabbableObject component = obj.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; NetworkObject component2 = obj.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; } } public class HazardSpawnSettings { public AnimationCurve numberToSpawn; public bool spawnFacingAwayFromWall; public bool spawnFacingWall; public bool spawnWithBackToWall; public bool spawnWithBackFlushAgainstWall; public bool requireDistanceBetweenSpawns; public bool disallowSpawningNearEntrances; public bool allowInMineshaft; } 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 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 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; internal 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; internal 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 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); } 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_015c: 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; } difficulty = Mathf.Clamp(difficulty, 0f, Configuration.difficultyMaxCap.Value); } internal static float GetScrapInShip() { return StartOfRound.Instance.GetValueOfAllScrap(true, false); } internal static void SampleMap() { //IL_0026: 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_0041: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0191: 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_0091: 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_00a1: 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_01eb: 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_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_021e: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_013e: 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) 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); outsideAINodes = GameObject.FindGameObjectsWithTag(terrainTag); foreach (GameObject val9 in outsideAINodes) { 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown 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); } 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 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 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 { 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."); } } 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 bool HazardSpawnExists(Assets.ObjectName name) { return DoHazardSpawnExists(Assets.ObjectNameList[name]); } private static bool DoHazardSpawnExists(string name) { try { if (RoundManager.Instance.currentLevel.spawnableMapObjects.Any((SpawnableMapObject x) => ((Object)x.prefabToSpawn).name == name)) { return true; } } catch { Log.LogError("Failed to try to find " + name + " in spawnableMapObjects"); } try { if (RoundManager.Instance.currentLevel.indoorMapHazards.Any((IndoorMapHazard x) => ((Object)x.hazardType.prefabToSpawn).name == name)) { return true; } } catch { Log.LogError("Failed to try to find " + name + " in indoorMapHazards"); } return false; } public static void RemoveHazardSpawn(Assets.ObjectName name) { DoRemoveHazardSpawn(Assets.ObjectNameList[name]); } private static void DoRemoveHazardSpawn(string Name) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown AnimationCurve numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 0f) }); try { SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { if (((Object)val.prefabToSpawn).name == Name) { val.numberToSpawn = numberToSpawn; } } } catch { Log.LogError("Failed to try and set " + Name + " animation curve to 0 in spawnableMapObjects"); } try { IndoorMapHazard[] indoorMapHazards = RoundManager.Instance.currentLevel.indoorMapHazards; foreach (IndoorMapHazard val2 in indoorMapHazards) { if (((Object)val2.hazardType.prefabToSpawn).name == Name) { val2.numberToSpawn = numberToSpawn; } } } catch { Log.LogError("Failed to try and set " + Name + " animation curve to 0 in indoorMapHazards"); } } public static void AddHazardSpawn(Assets.ObjectName name, HazardSpawnSettings hazardSettings) { DoAddHazardSpawn(Assets.ObjectNameList[name], hazardSettings); } private static void DoAddHazardSpawn(string Name, HazardSpawnSettings hazardSettings) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0042: 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_0066: 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: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown RoundManager.Instance.currentLevel.spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects.Add(new SpawnableMapObject { prefabToSpawn = Assets.GetObject(Name), numberToSpawn = hazardSettings.numberToSpawn, spawnFacingAwayFromWall = hazardSettings.spawnFacingAwayFromWall, spawnFacingWall = hazardSettings.spawnFacingWall, spawnWithBackToWall = hazardSettings.spawnWithBackToWall, spawnWithBackFlushAgainstWall = hazardSettings.spawnWithBackFlushAgainstWall, requireDistanceBetweenSpawns = hazardSettings.requireDistanceBetweenSpawns, disallowSpawningNearEntrances = hazardSettings.disallowSpawningNearEntrances }); IndoorMapHazard val = new IndoorMapHazard(); IndoorMapHazardType val2 = ScriptableObject.CreateInstance(); val2.prefabToSpawn = Assets.GetObject(Name); val2.spawnFacingAwayFromWall = hazardSettings.spawnFacingAwayFromWall; val2.spawnFacingWall = hazardSettings.spawnFacingWall; val2.spawnWithBackToWall = hazardSettings.spawnWithBackToWall; val2.spawnWithBackFlushAgainstWall = hazardSettings.spawnWithBackFlushAgainstWall; val2.requireDistanceBetweenSpawns = hazardSettings.requireDistanceBetweenSpawns; val2.disallowSpawningNearEntrances = hazardSettings.disallowSpawningNearEntrances; val2.allowInMineshaft = hazardSettings.allowInMineshaft; val.hazardType = val2; val.numberToSpawn = hazardSettings.numberToSpawn; RoundManager.Instance.currentLevel.indoorMapHazards = RoundManager.Instance.currentLevel.indoorMapHazards.Add(val); } public static void MultiplySpawnChance(SelectableLevel currentLevel, float by) { spawnChanceMultiplier *= by; currentLevel.enemySpawnChanceThroughoutDay = Helper.MultiplyKeyframes(currentLevel.enemySpawnChanceThroughoutDay, by); currentLevel.outsideEnemySpawnChanceThroughDay = Helper.MultiplyKeyframes(currentLevel.outsideEnemySpawnChanceThroughDay, by); currentLevel.daytimeEnemySpawnChanceThroughDay = Helper.MultiplyKeyframes(currentLevel.daytimeEnemySpawnChanceThroughDay, by); } internal static void AddInsideSpawnChance(SelectableLevel currentLevel, float value) { currentLevel.enemySpawnChanceThroughoutDay = Helper.AddKeyframes(currentLevel.enemySpawnChanceThroughoutDay, value); } internal static void AddOutsideSpawnChance(SelectableLevel currentLevel, float value) { currentLevel.outsideEnemySpawnChanceThroughDay = Helper.AddKeyframes(currentLevel.outsideEnemySpawnChanceThroughDay, value); } public static void PayCredits(int amount) { if (amount != 0) { Terminal obj = currentTerminal; obj.groupCredits += amount; 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; } } public static void ExecuteOnShipLeave() { moveTime = false; moveTimeAmount = 0f; timeSpeedMultiplier = 1f; TimeOfDay instance = TimeOfDay.Instance; instance.globalTimeSpeedMultiplier *= inverseTimeSpeedMultiplier; inverseTimeSpeedMultiplier = 1f; } [HarmonyPrefix] [HarmonyPatch(typeof(TimeOfDay), "Start")] private static void OnTimeOfDayStart() { inverseTimeSpeedMultiplier = 1f; } [HarmonyPostfix] [HarmonyPriority(800)] [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] private static void ObjectSpawnHandling() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) SampleMap(); Net.Instance.GiveSeedServerRpc(1); Spawn.randomSeedValue = StartOfRound.Instance.randomMapSeed + 2 + Net.Instance._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); Spawn.randomSeedValue = StartOfRound.Instance.randomMapSeed + 2 + Net.Instance._seed; foreach (OutsideObjectsToSpawn item in Net.Instance.outsideObjectsToSpawn) { Spawn.OutsideObjects(Assets.GetObject((Assets.ObjectName)item.objectEnumID), new Vector3(0f, -1f, 0f), item.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 { VeryBad, Bad, Neutral, Good, VeryGood, 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 } 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 num = scale.Increment; if (Type == EventType.VeryBad || Type == EventType.Bad) { num = scale.Increment * Configuration.badEventIncrementMultiplier.Value; } if (Type == EventType.VeryGood || Type == EventType.Good) { num = scale.Increment * Configuration.goodEventIncrementMultiplier.Value; } return Mathf.Clamp(scale.Base + num * Manager.difficulty, scale.MinCap, Configuration.ignoreMaxCap.Value ? 1E+11f : 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); } private 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 Dictionary ScaleList = new Dictionary(); public List EventsToRemove = new List(); public List EventsToSpawnWith = new List(); internal bool Executed; public List monsterEvents = 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 garunteed to spawn outside." }, { ScaleType.MaxOutsideEnemy, "Maximum amount of enemies garunteed to spawn outside." }, { ScaleType.MinInsideEnemy, "Minimum amount of enemies garunteed to spawn inside." }, { ScaleType.MaxInsideEnemy, "Maximum amount of enemies garunteed 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." } }; 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 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 monsterEvent in monsterEvents) { monsterEvent.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(); } } public struct Weather : INetworkSerializable, IEquatable { public LevelWeatherType weatherType; public float scrapValueMultiplier; public float scrapAmountMultiplier; public Weather(LevelWeatherType weatherType, float scrapValueMultiplier, float scrapAmountMultiplier) { //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) this.weatherType = weatherType; this.scrapValueMultiplier = scrapValueMultiplier; this.scrapAmountMultiplier = scrapAmountMultiplier; } public static Weather operator *(Weather left, Weather right) { //IL_0001: 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_0056: 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_0066: 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_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_0092: 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_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_001b: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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) 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_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) return weatherType == other.weatherType; } public static NetworkList InitalizeWeatherMultipliers(NetworkList currentWeatherMultipliers) { currentWeatherMultipliers.Add(Configuration.noneMultiplier); currentWeatherMultipliers.Add(Configuration.dustCloudMultiplier); currentWeatherMultipliers.Add(Configuration.rainyMultiplier); currentWeatherMultipliers.Add(Configuration.stormyMultiplier); currentWeatherMultipliers.Add(Configuration.foggyMultiplier); currentWeatherMultipliers.Add(Configuration.floodedMultiplier); currentWeatherMultipliers.Add(Configuration.eclipsedMultiplier); return currentWeatherMultipliers; } public static NetworkList RandomizeWeatherMultipliers(NetworkList currentWeatherMultipliers) { //IL_0034: 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_0058: 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_007f: 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; switch (val - -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_0160: 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) 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_0057: 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_008f: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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 { public class AntiCoilHeadAI : EnemyAI { public AISearchRoutine searchForPlayers; private float checkLineOfSightInterval; private bool hasEnteredChaseMode; private bool stoppingMovement; private bool hasStopped; public AnimationStopPoints animStopPoints; private float currentChaseSpeed = 14.5f; private float currentAnimSpeed = 1f; private PlayerControllerB previousTarget; private bool wasOwnerLastFrame; private float stopAndGoMinimumInterval; private float timeSinceHittingPlayer; public AudioClip[] springNoises; public Collider mainCollider; public override void DoAIInterval() { //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_0083: 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_00a3: 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_00bf: 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) ((EnemyAI)this).DoAIInterval(); if (StartOfRound.Instance.allPlayersDead || base.isEnemyDead) { return; } switch (base.currentBehaviourStateIndex) { case 0: { if (!((NetworkBehaviour)this).IsServer) { ((EnemyAI)this).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); break; } for (int i = 0; i < 4; i++) { if (((EnemyAI)this).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false, true) && !Physics.Linecast(((Component)this).transform.position + Vector3.up * 0.5f, ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position) < 30f) { ((EnemyAI)this).SwitchToBehaviourState(1); return; } } base.agent.speed = 6f; if (!searchForPlayers.inProgress) { base.movingTowardsTargetPlayer = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers); } break; } case 1: if (searchForPlayers.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayers, true); } if (((EnemyAI)this).TargetClosestPlayer(1.5f, false, 70f, false, false, true)) { if ((Object)(object)previousTarget != (Object)(object)base.targetPlayer) { previousTarget = base.targetPlayer; ((EnemyAI)this).ChangeOwnershipOfEnemy(base.targetPlayer.actualClientId); } base.movingTowardsTargetPlayer = true; } else { ((EnemyAI)this).SwitchToBehaviourState(0); ((EnemyAI)this).ChangeOwnershipOfEnemy(StartOfRound.Instance.allPlayerScripts[0].actualClientId); } break; } } public override void Update() { //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_00e5: 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_00f4: 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_012e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (base.isEnemyDead) { return; } if (timeSinceHittingPlayer >= 0f) { timeSinceHittingPlayer -= Time.deltaTime; } int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if (currentBehaviourStateIndex == 0 || currentBehaviourStateIndex != 1) { return; } if (((NetworkBehaviour)this).IsOwner) { if (stopAndGoMinimumInterval > 0f) { stopAndGoMinimumInterval -= Time.deltaTime; } if (!wasOwnerLastFrame) { wasOwnerLastFrame = true; if (!stoppingMovement && timeSinceHittingPlayer < 0.12f) { base.agent.speed = currentChaseSpeed; } else { base.agent.speed = 0f; } } bool flag = true; for (int i = 0; i < 4; i++) { if (((EnemyAI)this).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false, true) && StartOfRound.Instance.allPlayerScripts[i].HasLineOfSightToPosition(((Component)this).transform.position + Vector3.up * 1.6f, 68f, 60, -1f, -1) && Vector3.Distance(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, base.eye.position) > 0.3f) { flag = false; } } 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) { return; } if (!hasStopped) { hasStopped = true; if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)this).transform.position, 70f, 25, -1f, -1)) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position); if (num < 4f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.9f, true); } else if (num < 9f) { 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.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position) > 0.25f) { mainCollider.isTrigger = false; } base.creatureAnimator.SetFloat("walkSpeed", 0f); currentAnimSpeed = 0f; if (((NetworkBehaviour)this).IsOwner) { base.agent.speed = 0f; } } else { 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.speed = Mathf.Lerp(base.agent.speed, currentChaseSpeed, 4.5f * Time.deltaTime); } } } [ServerRpc] 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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)((NetworkBehaviour)this).__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(2817700276u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2817700276u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAnimationStopClientRpc(); } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2307802674u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2307802674u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stoppingMovement = true; } } } [ServerRpc] 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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)((NetworkBehaviour)this).__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(1927665513u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1927665513u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetAnimationGoClientRpc(); } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2701346570u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2701346570u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stoppingMovement = false; } } } public override void OnCollideWithPlayer(Collider other) { //IL_004f: 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) ((EnemyAI)this).OnCollideWithPlayer(other); if (!stoppingMovement && base.currentBehaviourStateIndex == 1 && !(timeSinceHittingPlayer >= 0f)) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { timeSinceHittingPlayer = 0.2f; component.DamagePlayer(90, true, true, (CauseOfDeath)6, 2, false, default(Vector3)); component.JumpToFearLevel(1f, true); } } } public 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_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_0076: 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_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 { 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_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_0076: 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_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 { 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_0007: 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_001e: 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_0007: 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_001c: 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_002b: 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) 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; 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); public void Start() { //IL_0061: 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) 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" })); } public void Update() { //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_013e: 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_0164: 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_018d: 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_019b: 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_01a3: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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) if (!Warzone.Active || !((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } if (currentTime > 0f) { currentTime -= Time.deltaTime; } else { 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++; Random random = new Random(seed); for (int i = 0; (float)i < (float)fireAmount * fireAmountMultiplier; i++) { int num = 0; if (num < 4) { random = new Random(seed++); Vector3 val = Manager.outsideObjectSpawnNodes[random.Next(Manager.outsideObjectSpawnNodes.Count)]; val += new Vector3((float)random.Next(-75, 75), 0f, (float)random.Next(-75, 75)); Vector3 val2 = val + new Vector3((float)random.Next(-100, 100), (float)random.Next(500, 800), (float)random.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_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_002c: 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_0025: 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 { ((Component)instance.transform).GetComponent().Despawn(true); } catch { Log.LogError("Failed to destroy network objects."); } } [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(); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "openingDoorsSequence")] private static void OnGameStart() { Active = true; Instance.spawnCycles.Clear(); foreach (SpawnCycle spawnCycle in Instance.spawnCycles) { spawnCycle.Reset(); } allEnemiesCycle.Reset(); allAllEnemiesCycle.Reset(); } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "LoadNewLevel")] private static void OnLoadNewLevel() { 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] [HarmonyPatch(typeof(Landmine))] public class GrabbableLandmine : GrabbableObject, IHittable { private bool mineActivated = true; public bool hasExploded; public ParticleSystem explosionParticle; public Animator mineAnimator; public AudioSource mineAudio; public AudioSource mineFarAudio; public AudioSource mineTickSource; public AudioClip mineDetonate; public AudioClip mineTrigger; public AudioClip mineDetonateFar; public AudioClip mineDeactivate; public AudioClip minePress; private bool sendingExplosionRPC; private RaycastHit hit; private RoundManager roundManager; private float pressMineDebounceTimer; public bool localPlayerOnMine; public bool mineGrabbed; public bool onBlowUpSchedule; public float countDown; public float dropSafetyTime; private static int seed; [HarmonyPrefix] [HarmonyPatch("Start")] private static void onLandmineStart(ref Landmine __instance) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)RoundManager.Instance).IsHost) { if (GrabbableLandmines.Active) { ((MonoBehaviour)__instance).StartCoroutine(destroySelfAndReplace(__instance)); return; } seed++; Random random = new Random(seed); Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)__instance).NetworkObject), random.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); } } private static IEnumerator destroySelfAndReplace(Landmine __instance) { float num = GrabbableLandmines.Instance.Getf(MEvent.ScaleType.Rarity); seed++; Random random = new Random(StartOfRound.Instance.randomMapSeed + seed); if (random.NextDouble() <= (double)num) { NetworkObject component = Object.Instantiate(Assets.grabbableLandmine.spawnPrefab, ((Component)__instance).transform.position, Quaternion.identity).GetComponent(); component.Spawn(false); Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)__instance).NetworkObject), random.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); Net.Instance.SyncScrapValueServerRpc(NetworkObjectReference.op_Implicit(component), (int)((float)Random.Range(Assets.grabbableLandmine.minValue, Assets.grabbableLandmine.maxValue + 1) * RoundManager.Instance.scrapValueMultiplier)); yield return (object)new WaitForSeconds(5f); try { ((Component)((Component)__instance).transform.parent).gameObject.GetComponent().Despawn(true); } catch { Log.LogError("Failed to despawn Landmine network object."); } } } public override void Start() { ((MonoBehaviour)this).StartCoroutine(StartIdleAnimation()); ((GrabbableObject)this).Start(); dropSafetyTime = 2f; mineGrabbed = true; } 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; } if (localPlayerOnMine && GameNetworkManager.Instance.localPlayerController.teleportedLastFrame) { localPlayerOnMine = false; TriggerMineOnLocalClientByExiting(); } ((GrabbableObject)this).Update(); } private void OnGrab() { mineGrabbed = true; onBlowUpSchedule = true; dropSafetyTime = 6f; countDown = 6f; playMineTickSourceServerRpc(toggle: true); } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2093032180u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2093032180u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnGrabClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1876802964u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1876802964u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnGrab(); } } } private void OnDisacrd() { mineGrabbed = true; onBlowUpSchedule = false; dropSafetyTime = 1.5f; countDown = 0f; playMineTickSourceServerRpc(toggle: false); } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3834327495u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3834327495u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnDiscardClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2155830483u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2155830483u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; OnDisacrd(); } } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); OnGrab(); OnGrabServerRpc(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); OnDisacrd(); OnDiscardServerRpc(); } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); OnGrab(); OnGrabServerRpc(); } public override void DiscardItemFromEnemy() { ((GrabbableObject)this).DiscardItemFromEnemy(); OnDisacrd(); OnDiscardServerRpc(); } [ServerRpc(RequireOwnership = false)] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1401067709u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1401067709u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; playMineTickSourceClientRpc(toggle); } } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(506371000u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref toggle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 506371000u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((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); } } [ServerRpc(RequireOwnership = false)] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1230610249u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1230610249u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleMineClientRpc(enable); } } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(67361316u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 67361316u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleMineEnabledLocalClient(enable); } } } public void ToggleMineEnabledLocalClient(bool enabled) { if (mineActivated != enabled) { mineActivated = enabled; if (!enabled) { mineAudio.PlayOneShot(mineDeactivate); WalkieTalkie.TransmitOneShotAudio(mineAudio, mineDeactivate, 1f); } } } private IEnumerator StartIdleAnimation() { roundManager = Object.FindObjectOfType(); 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 OnTriggerEnter(Collider other) { if (hasExploded || pressMineDebounceTimer > 0f || mineGrabbed || GrabbableLandmines.LandmineDisabled || dropSafetyTime > 0f) { return; } Debug.Log((object)string.Format("Trigger entered mine: {0}; {1}; {2}", ((Component)other).tag, ((Component)other).CompareTag("Player") || ((Component)other).CompareTag("PlayerBody"), ((Component)other).CompareTag("PhysicsProp") || ((Component)other).tag.StartsWith("PlayerRagdoll"))); if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("PlayerBody")) { localPlayerOnMine = true; pressMineDebounceTimer = 0.5f; PressMineServerRpc(); } else { if (!((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(); } } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1995327364u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1995327364u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PressMineClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(173368889u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 173368889u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; pressMineDebounceTimer = 0.5f; mineAudio.PlayOneShot(minePress); WalkieTalkie.TransmitOneShotAudio(mineAudio, minePress, 1f); } } } private void OnTriggerExit(Collider other) { if (hasExploded || !mineActivated || mineGrabbed || GrabbableLandmines.LandmineDisabled || dropSafetyTime > 0f) { return; } Debug.Log((object)("Object leaving mine trigger, gameobject name: " + ((Object)((Component)other).gameObject).name)); Debug.Log((object)string.Format("Trigger exited mine: {0}; ({1} / {2}) {3}; {4}", ((Component)other).tag, ((Object)((Component)other).gameObject).name, ((Object)((Component)other).transform).name, ((Component)other).CompareTag("Player") || ((Component)other).CompareTag("PlayerBody"), ((Component)other).CompareTag("PhysicsProp") || ((Component)other).tag.StartsWith("PlayerRagdoll"))); if (((Component)other).CompareTag("Player") || ((Component)other).CompareTag("PlayerBody")) { localPlayerOnMine = false; TriggerMineOnLocalClientByExiting(); } else { if (!((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(); } } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1510907801u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1510907801u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExplodeMineClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3821524699u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3821524699u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (sendingExplosionRPC) { sendingExplosionRPC = false; } else { SetOffMineAnimation(); } } } public void SetOffMineAnimation() { if (!(dropSafetyTime > 0f) && !mineGrabbed) { hasExploded = true; mineAnimator.SetTrigger("detonate"); mineAudio.PlayOneShot(mineTrigger, 1f); } } private IEnumerator TriggerOtherMineDelayed(GrabbableLandmine mine) { if (!mine.hasExploded) { mine.mineAudio.pitch = Random.Range(0.75f, 1.07f); mine.hasExploded = true; yield return (object)new WaitForSeconds(0.2f); mine.SetOffMineAnimation(); } } public void Detonate() { //IL_004c: 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_0056: 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); SpawnExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: false, 5.7f, 6.4f); if (NetworkManager.Singleton.IsServer) { ((MonoBehaviour)this).StartCoroutine(DestroyObject()); } } } private IEnumerator DestroyObject() { yield return (object)new WaitForSeconds(5f); ((Component)this).gameObject.GetComponent().Despawn(true); } public static void SpawnExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, float killRange = 1f, float damageRange = 1f) { //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_0017: 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_0089: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_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_02d8: 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_0146: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0161: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_01a0: 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_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Spawning explosion at pos: {explosionPosition}"); if (spawnExplosionEffect) { Object.Instantiate(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), RoundManager.Instance.mapPropsContainer.transform).SetActive(true); } float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Collider[] array = Physics.OverlapSphere(explosionPosition, 6f, 2621448, (QueryTriggerInteraction)2); PlayerControllerB val = null; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1)) { continue; } if (((Component)array[i]).gameObject.layer == 3) { val = ((Component)array[i]).gameObject.GetComponent(); if ((Object)(object)val != (Object)null && ((NetworkBehaviour)val).IsOwner) { if (num2 < killRange) { Vector3 val2 = (((Component)val.gameplayCamera).transform.position - explosionPosition) * 80f / Vector3.Distance(((Component)val.gameplayCamera).transform.position, explosionPosition); val.KillPlayer(val2, true, (CauseOfDeath)3, 0, default(Vector3), false); } else if (num2 < damageRange) { val.DamagePlayer(50, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } } else if (((Component)array[i]).gameObject.layer == 21) { GrabbableLandmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f) { Debug.Log((object)"Setting off other mine"); ((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren)); } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f) { componentInChildren2.mainScript.HitEnemyOnLocalClient(6, default(Vector3), (PlayerControllerB)null, false, -1); } } } int num3 = ~LayerMask.GetMask(new string[1] { "Room" }); num3 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num3); for (int j = 0; j < array.Length; j++) { Rigidbody component = ((Component)array[j]).GetComponent(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(70f, explosionPosition, 10f); } } } public bool MineHasLineOfSight(Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return !Physics.Linecast(((Component)this).transform.position, pos, ref hit, 256); } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { 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 ((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_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] [HarmonyPatch(typeof(Turret))] public class GrabbableTurret : GrabbableObject { public Transform turretTransform; private static int seed; [HarmonyPrefix] [HarmonyPatch("Start")] private static void onTurretStart(ref Turret __instance) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)RoundManager.Instance).IsHost) { if (GrabbableTurrets.Active && ((Component)__instance).tag != "PhysicsProp") { ((MonoBehaviour)__instance).StartCoroutine(destroySelfAndReplace(__instance)); return; } seed++; Random random = new Random(seed); Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)__instance).NetworkObject), random.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); } } private static IEnumerator destroySelfAndReplace(Turret __instance) { float num = GrabbableTurrets.Instance.Getf(MEvent.ScaleType.Rarity); seed++; Random random = new Random(StartOfRound.Instance.randomMapSeed + seed); if (random.NextDouble() <= (double)num) { NetworkObject component = Object.Instantiate(Assets.grabbableTurret.spawnPrefab, RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(((Component)__instance).transform.position, 30f, RoundManager.Instance.navHit, random, -1, 1f), ((Component)__instance).transform.rotation).GetComponent(); component.Spawn(false); Net.Instance.GenerateAndSyncTerminalCodeServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)__instance).NetworkObject), random.Next(RoundManager.Instance.possibleCodesForBigDoors.Length)); Net.Instance.SyncScrapValueServerRpc(NetworkObjectReference.op_Implicit(component), (int)((float)Random.Range(Assets.grabbableTurret.minValue, Assets.grabbableTurret.maxValue + 1) * RoundManager.Instance.scrapValueMultiplier)); yield return (object)new WaitForSeconds(5f); try { ((Component)((Component)__instance).transform.parent).gameObject.GetComponent().Despawn(true); } catch { Log.LogError("Failed to despawn Turret network object."); } } } public override void Start() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Start(); ((MonoBehaviour)this).StartCoroutine(UpdateTransform(11f, new Vector3(0f, (float)Random.Range(0, 360), 0f))); } public IEnumerator UpdateTransform(float time, Vector3 rotation) { //IL_0015: 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) yield return (object)new WaitForSeconds(time); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { syncRotationServerRpc(rotation); } } [ServerRpc(RequireOwnership = false)] 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_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_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_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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3881441083u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref eulerAngle); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3881441083u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; syncRotationClientRpc(eulerAngle); } } } [ClientRpc] 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_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_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_00da: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2773635139u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref eulerAngle); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2773635139u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((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 ((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_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; public AISearchRoutine searchForPlayer; [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; public HoarderBugItem heldItem; [Header("Animations")] [Space(5f)] private Vector3 agentLocalVelocity; private Vector3 previousPosition; private float velX; private float velZ; public Transform turnCompass; private float armsHoldLayerWeight; [Space(5f)] public Transform animationContainer; public Transform grabTarget; public MultiAimConstraint headLookRig; public Transform headLookTarget; [Header("Special behaviour states")] private float annoyanceMeter; public bool watchingPlayerNearPosition; public PlayerControllerB watchingPlayer; public Transform lookTarget; 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; private float noticePlayerTimer; public PlayerControllerB angryAtPlayer; private bool inChase; [Header("Audios")] public AudioClip[] chitterSFX; [Header("Audios")] public AudioClip[] angryScreechSFX; public AudioClip angryVoiceSFX; public AudioClip bugFlySFX; public AudioClip hitPlayerSFX; private float timeSinceHittingPlayer; private float timeSinceLookingTowardsNoise; private float detectPlayersInterval; private bool inReturnToNestMode; public AudioSource explosionAudio; public AudioSource tickingAudio; public Light bugLight; public Transform mainTransform; private bool onBlowUpSequence; private bool blownUp; public override void Start() { ((EnemyAI)this).Start(); heldItem = null; RefreshGrabbableObjectsInMapList(); if (Compatibility.yippeeModCompatibilityMode && Compatibility.yippeeNewSFX != null) { chitterSFX = Compatibility.yippeeNewSFX; } } public static void RefreshGrabbableObjectsInMapList() { 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); } } } private bool GrabTargetItemIfClose() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetItem != (Object)null && heldItem == null && Vector3.Distance(((Component)this).transform.position, ((Component)targetItem).transform.position) < 0.75f) { 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_0055: 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_0066: 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_0019: 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_0031: 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) 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); } [ServerRpc] 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: 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_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_00cf: 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)((NetworkBehaviour)this).__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(3108316121u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newNestPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3108316121u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncNestPositionClientRpc(newNestPosition); } } [ClientRpc] 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_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_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_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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1265518284u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref newNestPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1265518284u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; nestPosition = newNestPosition; } } } public override void DoAIInterval() { //IL_0033: 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_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_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0300: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } if (!choseNestPosition) { choseNestPosition = true; ChooseNestPosition(); return; } if (HasLineOfSightToPositionCopy(nestPosition, 60f, 40, 0.5f)) { for (int i = 0; i < HoarderBugItems.Count; i++) { if (HoarderBugItems[i].itemGrabbableObject.isHeld && HoarderBugItems[i].itemNestPosition == nestPosition) { HoarderBugItems[i].status = (HoarderBugItemStatus)1; } } } HoarderBugItem val = CheckLineOfSightForItem((HoarderBugItemStatus)1, 60f, 30, 3f); if (val != null && !val.itemGrabbableObject.isHeld) { val.status = (HoarderBugItemStatus)2; if (!grabbableObjectsInMap.Contains(((Component)val.itemGrabbableObject).gameObject)) { grabbableObjectsInMap.Add(((Component)val.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 val3 = ((EnemyAI)this).CheckLineOfSight(grabbableObjectsInMap, 60f, 40, 5f, (Transform)null, (int[])null); if (Object.op_Implicit((Object)(object)val3)) { GrabbableObject component = val3.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (!component.isHeld || (Random.Range(0, 100) < 4 && !component.isPocketed))) { SetGoTowardsTargetObject(val3); } } break; } case 1: ExitChaseMode(); if (!inReturnToNestMode) { inReturnToNestMode = true; SetReturningToNest(); Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Abandoned current search and returning to nest empty-handed")); } GrabTargetItemIfClose(); if (waitingAtNest) { if (heldItem != null) { DropItemAndCallDropRPC(((Component)heldItem.itemGrabbableObject).GetComponent()); } else { GameObject val2 = ((EnemyAI)this).CheckLineOfSight(grabbableObjectsInMap, 60f, 40, 5f, (Transform)null, (int[])null); if (Object.op_Implicit((Object)(object)val2) && Vector3.Distance(base.eye.position, val2.transform.position) < 6f) { targetItem = val2.GetComponent(); if ((Object)(object)targetItem != (Object)null && !targetItem.isHeld) { waitingAtNest = false; ((EnemyAI)this).SwitchToBehaviourState(0); break; } } } if (waitingAtNestTimer <= 0f && !watchingPlayerNearPosition) { waitingAtNest = false; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(0); } } else if (Vector3.Distance(((Component)this).transform.position, nestPosition) < 0.75f) { waitingAtNest = true; waitingAtNestTimer = 15f; } break; case 2: inReturnToNestMode = false; angryTimer = 10f; 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); Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Lost player in chase; beginning search where the player was last seen")); } break; } if ((Object)(object)base.targetPlayer == (Object)null) { Debug.LogError((object)"TargetPlayer is null even though bug is in chase; setting targetPlayer to watchingPlayer"); if ((Object)(object)watchingPlayer != (Object)null) { base.targetPlayer = watchingPlayer; } } if (searchForPlayer.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayer, true); Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Found player during chase; stopping search coroutine and moving after target player")); } base.movingTowardsTargetPlayer = true; break; case 3: break; } } private void SetGoTowardsTargetObject(GameObject foundObject) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).SetDestinationToPosition(foundObject.transform.position, true) && grabbableObjectsInMap.Contains(foundObject)) { Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Setting target object and going towards it.")); targetItem = foundObject.GetComponent(); ((EnemyAI)this).StopSearch(searchForItems, false); } else { targetItem = null; Debug.Log((object)(((Object)((Component)this).gameObject).name + ": i found an object but cannot reach it (or it has been taken by another bug): " + ((Object)foundObject).name)); } } 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 SetReturningToNest() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).SetDestinationToPosition(nestPosition, true)) { targetItem = null; ((EnemyAI)this).StopSearch(searchForItems, false); } else { Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Return to nest was called, but nest is not accessible! Abandoning and choosing a new nest position.")); ChooseNestPosition(); } } private void LateUpdate() { if (!base.inSpecialAnimation && !base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { if (detectPlayersInterval <= 0f) { detectPlayersInterval = 0.2f; DetectAndLookAtPlayers(); } else { detectPlayersInterval -= Time.deltaTime; } AnimateLooking(); CalculateAnimationDirection(); SetArmLayerWeight(); } } private void SetArmLayerWeight() { 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 void CalculateAnimationDirection(float maxSpeed = 1f) { //IL_000d: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) 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, 0f - maxSpeed, maxSpeed)); velZ = Mathf.Lerp(velZ, agentLocalVelocity.z, 10f * Time.deltaTime); base.creatureAnimator.SetFloat("VelocityZ", Mathf.Clamp(velZ, 0f - maxSpeed, maxSpeed)); previousPosition = ((Component)this).transform.position; } private void AnimateLooking() { //IL_0024: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_00b4: 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_00cf: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_01bd: Unknown result type (might be due to invalid IL or missing references) 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); return; } lookTarget.position = positionOfInterest; } 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 num = Vector3.Angle(((Component)this).transform.forward, lookTarget.position - ((Component)this).transform.position); if (num > 22f) { ((RigConstraint>)(object)headLookRig).weight = Mathf.Lerp(((RigConstraint>)(object)headLookRig).weight, 1f * (Mathf.Abs(num - 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); } private void DetectAndLookAtPlayers() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: 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_0143: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_01ed: Unknown result type (might be due to invalid IL or missing references) 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 = 500f; 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.Distance(((Component)allPlayersInLineOfSight[i]).transform.position, val); if (num2 < num) { num = num2; watchingPlayer = allPlayersInLineOfSight[i]; } } float num3 = Vector3.Distance(((Component)allPlayersInLineOfSight[i]).transform.position, nestPosition); if (HoarderBugItems.Count > 0) { if ((num3 < 4f || (inChase && num3 < 8f)) && angryTimer < 3.25f) { angryAtPlayer = allPlayersInLineOfSight[i]; watchingPlayer = allPlayersInLineOfSight[i]; angryTimer = 3.25f; break; } if (!isAngry && base.currentBehaviourStateIndex == 0 && num3 < 8f && ((Object)(object)targetItem == (Object)null || Vector3.Distance(((Component)targetItem).transform.position, ((Component)this).transform.position) > 7.5f) && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).SwitchToBehaviourState(1); } } if (base.currentBehaviourStateIndex != 2 && Vector3.Distance(((Component)this).transform.position, ((Component)allPlayersInLineOfSight[i]).transform.position) < 2.5f) { annoyanceMeter += 0.2f; if (annoyanceMeter > 2.5f) { angryAtPlayer = allPlayersInLineOfSight[i]; watchingPlayer = allPlayersInLineOfSight[i]; angryTimer = 3.25f; } } } watchingPlayerNearPosition = num < 6f; if ((Object)(object)watchingPlayer != (Object)(object)val2) { RoundManager.PlayRandomClip(base.creatureVoice, chitterSFX, true, 1f, 0, 1000); } if (!((NetworkBehaviour)this).IsOwner) { return; } if (base.currentBehaviourStateIndex != 2) { if (IsHoarderBugAngry()) { lostPlayerInChase = false; base.targetPlayer = watchingPlayer; doBlowupServerRpc(); ((EnemyAI)this).SwitchToBehaviourState(2); } } else { base.targetPlayer = watchingPlayer; if (lostPlayerInChase) { lostPlayerInChase = false; } } return; } timeSinceSeeingAPlayer += 0.2f; watchingPlayerNearPosition = false; if (base.currentBehaviourStateIndex != 2) { if (timeSinceSeeingAPlayer > 1.5f) { watchingPlayer = null; } return; } if (timeSinceSeeingAPlayer > 1.25f) { watchingPlayer = null; } if (((NetworkBehaviour)this).IsOwner && timeSinceSeeingAPlayer > 2.5f) { lostPlayerInChase = true; } } private bool IsHoarderBugAngry() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: 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; } base.creatureAnimator.SetBool("stunned", base.stunNormalizedTimer > 0f); bool flag = IsHoarderBugAngry(); if (!isAngry && flag) { isAngry = true; base.creatureVoice.clip = angryVoiceSFX; base.creatureVoice.Play(); } switch (base.currentBehaviourStateIndex) { case 0: base.addPlayerVelocityToDestination = 0f; if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } else { base.agent.speed = 6f; } waitingAtNest = false; break; case 1: 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) { angryTimer = 10f; 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 (Vector3.Distance(((Component)this).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 10f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.5f, true); } if (((NetworkBehaviour)this).IsOwner) { doBlowupServerRpc(); } } base.addPlayerVelocityToDestination = 2f; if (!((NetworkBehaviour)this).IsOwner) { break; } if (!IsHoarderBugAngry()) { HoarderBugItem val = CheckLineOfSightForItem((HoarderBugItemStatus)2, 60f, 12, 3f); if (val != null && !val.itemGrabbableObject.isHeld) { ((EnemyAI)this).SwitchToBehaviourState(0); SetGoTowardsTargetObject(((Component)val.itemGrabbableObject).gameObject); } else { ((EnemyAI)this).SwitchToBehaviourState(1); } ExitChaseMode(); 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_0001: 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_0030: 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_00a6: 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_008c: 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.Distance(noisePosition, nestPosition); if (((NetworkBehaviour)this).IsOwner && HoarderBugItems.Count > 0 && !isAngry && base.currentBehaviourStateIndex == 0 && num < 15f && ((Object)(object)targetItem == (Object)null || Vector3.Distance(((Component)targetItem).transform.position, ((Component)this).transform.position) > 4.5f)) { ((EnemyAI)this).SwitchToBehaviourState(1); } positionOfInterest = noisePosition; lookingAtPositionOfInterest = true; } } private void DropItemAndCallDropRPC(NetworkObject dropItemNetworkObject, bool droppedInNest = true) { //IL_0012: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) 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); } [ServerRpc] 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 //IL_014a: 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_0151: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //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)((NetworkBehaviour)this).__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(1137852752u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref targetFloorPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref droppedInNest, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1137852752u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropItemClientRpc(objectRef, targetFloorPosition, droppedInNest); } } [ClientRpc] 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_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_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_00bf: 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_0117: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(589164110u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref targetFloorPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref droppedInNest, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 589164110u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject item = default(NetworkObject); if (((NetworkObjectReference)(ref objectRef)).TryGet(ref item, (NetworkManager)null)) { DropItem(item, targetFloorPosition, droppedInNest); } else { Debug.LogError((object)(((Object)((Component)this).gameObject).name + ": Failed to get network object from network object reference (Drop item RPC)")); } } } [ServerRpc] 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_00dd: 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)((NetworkBehaviour)this).__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(3677165395u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3677165395u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabItemClientRpc(objectRef); } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1025828854u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref objectRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1025828854u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((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); } else { Debug.LogError((object)(((Object)((Component)this).gameObject).name + ": Failed to get network object from network object reference (Grab item RPC)")); } } } private void DropItem(NetworkObject item, Vector3 targetFloorPosition, bool droppingInNest = true) { //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_007a: 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_0091: Unknown result type (might be due to invalid IL or missing references) if (sendingGrabOrDropRPC) { sendingGrabOrDropRPC = false; return; } if (heldItem == null) { Debug.LogError((object)"Hoarder bug: my held item is null when attempting to drop it!!"); return; } 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0095: 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_009c: Unknown result type (might be due to invalid IL or missing references) if (sendingGrabOrDropRPC) { sendingGrabOrDropRPC = false; return; } if (heldItem != null) { Debug.Log((object)(((Object)((Component)this).gameObject).name + ": Trying to grab another item (" + ((Object)((Component)item).gameObject).name + ") while hands are already full with item (" + ((Object)((Component)heldItem.itemGrabbableObject).gameObject).name + "). Dropping the currently held one.")); DropItem(((Component)heldItem.itemGrabbableObject).GetComponent(), heldItem.itemGrabbableObject.GetItemFloorPosition(default(Vector3))); } targetItem = 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_0045: 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) ((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(); } } } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4268145293u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4268145293u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HitPlayerClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3201014421u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3201014421u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; 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); Debug.Log((object)"HA"); if (!base.isEnemyDead) { Debug.Log((object)"HB"); base.creatureAnimator.SetTrigger("damage"); angryAtPlayer = playerWhoHit; angryTimer += 18f; Debug.Log((object)"HC"); base.enemyHP -= force; if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } } public override void KillEnemy(bool destroy = false) { if (searchForItems.inProgress) { ((EnemyAI)this).StopSearch(searchForItems, true); } if (searchForPlayer.inProgress) { ((EnemyAI)this).StopSearch(searchForPlayer, true); } ((EnemyAI)this).KillEnemy(false); DisableBlowupServerRpc(); base.agent.speed = 0f; base.creatureVoice.Stop(); base.creatureSFX.Stop(); if (heldItem != null) { DropItemAndCallDropRPC(((Component)heldItem.itemGrabbableObject).GetComponent(), droppedInNest: false); } } public HoarderBugItem CheckLineOfSightForItem(HoarderBugItemStatus searchForItemsOfStatus = (HoarderBugItemStatus)(-1), float width = 45f, int range = 60, float proximityAwareness = -1f) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 //IL_00a3: 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_00af: 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_0083: 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_00c6: 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_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_00de: 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_00f2: 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) for (int i = 0; i < HoarderBugItems.Count; i++) { if (HoarderBugItems[i] == null || (Object)(object)HoarderBugItems[i].itemGrabbableObject == (Object)null) { HoarderBugItems.RemoveAt(i); i--; } else { if (!HoarderBugItems[i].itemGrabbableObject.grabbableToEnemies || HoarderBugItems[i].itemGrabbableObject.isHeld || ((int)searchForItemsOfStatus != -1 && HoarderBugItems[i].status != searchForItemsOfStatus)) { continue; } Vector3 position = ((Component)HoarderBugItems[i].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 || Vector3.Distance(((Component)this).transform.position, position) < proximityAwareness) { Debug.Log((object)"SEEING PLAYER"); return HoarderBugItems[i]; } } } } return null; } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3967474852u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3967474852u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)RoundManager.Instance).IsHost) { doBlowupClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1792094030u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1792094030u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; blowupSequence(); } } } public void blowupSequence() { if (!onBlowUpSequence) { onBlowUpSequence = true; tickingAudio.Play(); ((MonoBehaviour)this).StartCoroutine(FlicketLights(0.2f, 0.15f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(1.2f, 0.15f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(2.2f, 0.15f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(3.2f, 0.15f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.2f, 0.15f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.36f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.46f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.59f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.71f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.84f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(4.96f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.09f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.21f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.34f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.45f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.56f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.7f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(FlicketLights(5.81f, 0.5f)); ((MonoBehaviour)this).StartCoroutine(BlowUpAt(6f)); } } 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); } public IEnumerator BlowUpAt(float timeStamp) { yield return (object)new WaitForSeconds(timeStamp); ((Component)bugLight).gameObject.SetActive(false); BlowUpServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)this).NetworkObject)); } [ServerRpc(RequireOwnership = false)] 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(4115349172u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 4115349172u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DisableBlowupClientRpc(); } } } [ClientRpc] 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3999830196u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3999830196u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DisableBlowup(); } } } public void DisableBlowup() { ((Component)bugLight).gameObject.SetActive(false); tickingAudio.Stop(); ((MonoBehaviour)this).StopAllCoroutines(); } [ServerRpc] public void BlowUpServerRpc(NetworkObjectReference self) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_00dd: 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)((NetworkBehaviour)this).__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(354502995u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref self, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 354502995u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BlowUpClientRpc(self); } } [ClientRpc] public void BlowUpClientRpc(NetworkObjectReference self) { //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_0114: Unknown result type (might be due to invalid IL or missing references) //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2988700547u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref self, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2988700547u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = null; ((NetworkObjectReference)(ref self)).TryGet(ref val3, (NetworkManager)null); if (!((Object)(object)val3 == (Object)null) && (Object)(object)((Component)val3).GetComponent() != (Object)null && !blownUp) { Landmine.SpawnExplosion(mainTransform.position + Vector3.up, true, 3f, 6f, 50, 0f, (GameObject)null, false); blownUp = true; } } } public bool HasLineOfSightToPositionCopy(Vector3 pos, float width = 45f, int range = 60, float proximityAwareness = -1f) { //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_0039: 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_0050: 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_005c: 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_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_0081: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.eye == (Object)null) { _ = ((Component)this).transform; } else { _ = base.eye; } if (Vector3.Distance(base.eye.position, pos) < (float)range && !Physics.Linecast(base.eye.position, pos, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { Vector3 val = pos - base.eye.position; if (Vector3.Angle(base.eye.forward, val) < width || Vector3.Distance(((Component)this).transform.position, pos) < proximityAwareness) { return true; } } return false; } 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 ((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"); ((NetworkBehaviour)this).__registerRpc(354502995u, new RpcReceiveHandler(__rpc_handler_354502995), "BlowUpServerRpc"); ((NetworkBehaviour)this).__registerRpc(2988700547u, new RpcReceiveHandler(__rpc_handler_2988700547), "BlowUpClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3108316121(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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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 { 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_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_00a4: 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_00b9: 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_00c8: 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_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!"); } return; } 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_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_0091: 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_00ab: 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 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; } } private static void __rpc_handler_354502995(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_0091: 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_00ab: 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 self = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref self, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).BlowUpServerRpc(self); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2988700547(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 self = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref self, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((KamikazieBugAI)(object)target).BlowUpClientRpc(self); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "KamikazieBugAI"; } } public class NutSlayerAI : EnemyAI { private int previousBehaviourState = -1; private int previousBehaviourStateAIInterval = -1; public static float timeAtNextInspection; private bool inspectingLocalPlayer; private float localPlayerTurnDistance; private bool isInspecting; private bool hasGun; private int randomSeedNumber; public GameObject gunPrefab; public SlayerShotgun gun; public Transform gunPoint; private NetworkObjectReference gunObjectRef; public AISearchRoutine patrol; public AISearchRoutine attackSearch; public Transform torsoContainer; public float currentTorsoRotation; public int targetTorsoDegrees; public float torsoTurnSpeed = 6f; public AudioSource torsoTurnAudio; public AudioSource longRangeAudio; public AudioClip[] torsoFinishTurningClips; public AudioClip aimSFX; public AudioClip kickSFX; public GameObject shotgunShellPrefab; private bool torsoTurning; private Random NutcrackerRandom; private int timesDoingInspection; private Coroutine inspectionCoroutine; public int lastPlayerSeenMoving; private float timeSinceSeeingTarget; private float timeSinceInspecting; private float timeSinceFiringGun; private bool aimingGun; private bool reloadingGun; private Vector3 lastSeenPlayerPos; private RaycastHit rayHit; private Coroutine gunCoroutine; private bool isLeaderScript; private Vector3 positionLastCheck; private Vector3 strafePosition; private bool reachedStrafePosition; private bool lostPlayerInChase; private float timeSinceHittingPlayer; private Coroutine waitToFireGunCoroutine; private float walkCheckInterval; private int setShotgunScrapValue; private int timesSeeingSamePlayer; private int previousPlayerSeenWhenAiming; private float speedWhileAiming; private float speedWhileMoving = 9.5f; private float widthSearch = 45f; private int rangeSearch = 30; private Transform target; private List aiBlackList = new List(); private bool isFiring; private int setHp = 5; private int Lives = 4; private bool Immortal; public override void Start() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); lastPlayerSeenMoving = 0; if (((NetworkBehaviour)this).IsServer) { InitializeNutcrackerValuesServerRpc(); if (base.enemyType.numberSpawned <= 1) { isLeaderScript = true; } } rayHit = default(RaycastHit); setHp = Configuration.nutSlayerHp.Value; Lives = Configuration.nutSlayerLives.Value; Immortal = Configuration.nutSlayerImmortal.Value; base.enemyType.canDie = !Immortal; base.enemyHP = setHp; } [ServerRpc] 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_011d: 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_012c: 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_0198: 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_00c2: 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)((NetworkBehaviour)this).__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(1891166366u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1891166366u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(gunPrefab, ((Component)this).transform.position + Vector3.up * 0.5f, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); val3.GetComponent().Spawn(false); setShotgunScrapValue = Random.Range(Configuration.slayerShotgunMinValue.Value, Configuration.slayerShotgunMaxValue.Value + 1); GrabGun(val3); randomSeedNumber = Random.Range(0, 10000); InitializeNutcrackerValuesClientRpc(randomSeedNumber, NetworkObjectReference.op_Implicit(val3.GetComponent()), setShotgunScrapValue); } } [ClientRpc] public void InitializeNutcrackerValuesClientRpc(int randomSeed, 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2026217664u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, randomSeed); ((FastBufferWriter)(ref val)).WriteValueSafe(ref gunObject, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, setShotgunValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2026217664u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; setShotgunScrapValue = setShotgunValue; randomSeedNumber = randomSeed; 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; gun.shellsLoaded = 2; ((GrabbableObject)gun).GrabItemFromEnemy((EnemyAI)(object)this); } private void DropGun(Vector3 dropPosition) { 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; } private void SpawnShotgunShells() { //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_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_0031: 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_0056: 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_0060: 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 (((NetworkBehaviour)this).IsOwner) { for (int i = 0; i < 2; i++) { Vector3 val = ((Component)this).transform.position + Vector3.up * 0.6f; val += new Vector3(Random.Range(-0.8f, 0.8f), 0f, Random.Range(-0.8f, 0.8f)); GameObject obj = Object.Instantiate(shotgunShellPrefab, val, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); obj.GetComponent().fallTime = 0f; obj.GetComponent().Spawn(false); } } } [ServerRpc] 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_0114: 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_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_00cf: 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)((NetworkBehaviour)this).__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(414091688u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref dropPosition); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 414091688u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropGunClientRpc(dropPosition); } } [ClientRpc] 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_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_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_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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1357508234u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref dropPosition); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1357508234u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropGun(dropPosition); } } } public override void DoAIInterval() { //IL_007a: 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_013a: 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_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_022a: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0313: 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_032b: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: 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_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: 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_01d2: 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) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || base.stunNormalizedTimer > 0f || (Object)(object)gun == (Object)null) { 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.DebugEnemy) { for (int i = 1; i < base.path1.corners.Length; i++) { Debug.DrawLine(base.path1.corners[i - 1], base.path1.corners[i], Color.red, base.AIIntervalTime); } } 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.Distance(((Component)this).transform.position, strafePosition) < 2f) { reachedStrafePosition = true; } } else { if (!lostPlayerInChase) { lostPlayerInChase = true; SetLostPlayerInChaseServerRpc(lostPlayer: true); } if (!attackSearch.inProgress) { ((EnemyAI)this).StartSearch(strafePosition, attackSearch); } } break; } } [ServerRpc(RequireOwnership = false)] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3029536429u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lostPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3029536429u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetLostPlayerInChaseClientRpc(lostPlayer); } } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1309004243u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lostPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1309004243u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; lostPlayerInChase = lostPlayer; if (!lostPlayer) { timeSinceSeeingTarget = 0f; } } } private bool GrabGunIfNotHolding() { if ((Object)(object)gun != (Object)null) { return true; } NetworkObject val = default(NetworkObject); if (((NetworkObjectReference)(ref gunObjectRef)).TryGet(ref val, (NetworkManager)null)) { gun = ((Component)val).gameObject.GetComponent(); GrabGun(((Component)gun).gameObject); } return (Object)(object)gun != (Object)null; } public void TurnTorsoToTargetDegrees() { //IL_0040: 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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) 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; } private void StartInspectionTurn() { if (!isInspecting && !base.isEnemyDead) { timesDoingInspection++; if (inspectionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(inspectionCoroutine); } inspectionCoroutine = ((MonoBehaviour)this).StartCoroutine(InspectionTurn()); } } private IEnumerator InspectionTurn() { yield return (object)new WaitForSeconds(0.75f); isInspecting = true; NutcrackerRandom = new Random(randomSeedNumber + timesDoingInspection); int degrees = 0; int turnTime = 1; for (int i = 0; i < 8; i++) { degrees = Mathf.Min(degrees + NutcrackerRandom.Next(45, 95), 360); if (Physics.Raycast(base.eye.position, base.eye.forward, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { turnTime = 1; } else { int num = ((!((float)turnTime > 2f)) ? 4 : (turnTime / 3)); turnTime = NutcrackerRandom.Next(1, Mathf.Max(num, 3)); } targetTorsoDegrees = degrees; torsoTurnSpeed = NutcrackerRandom.Next(275, 855) / turnTime; yield return (object)new WaitForSeconds((float)turnTime); if (degrees >= 360) { break; } } if (((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).SwitchToBehaviourState(0); } } public void StopInspection() { if (isInspecting) { isInspecting = false; } if (inspectionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(inspectionCoroutine); } } [ServerRpc(RequireOwnership = false)] 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00f6: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2375979427u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enterAttackFromPatrolMode, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2375979427u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SeeMovingThreatClientRpc(position, enterAttackFromPatrolMode, playerId); } } } [ClientRpc] 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_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00f6: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1812034362u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enterAttackFromPatrolMode, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1812034362u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchTargetTo(position, playerId); ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } } } private void GlobalNutcrackerClock() { if (isLeaderScript && Time.realtimeSinceStartup - timeAtNextInspection > 2f) { timeAtNextInspection = Time.realtimeSinceStartup + Random.Range(6f, 15f); } } public override void Update() { //IL_005b: 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_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_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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); TurnTorsoToTargetDegrees(); if (base.isEnemyDead) { StopInspection(); return; } GlobalNutcrackerClock(); if (!base.isEnemyDead && !GrabGunIfNotHolding()) { return; } if (walkCheckInterval <= 0f) { walkCheckInterval = 0.1f; Animator creatureAnimator = base.creatureAnimator; Vector3 val = ((Component)this).transform.position - positionLastCheck; creatureAnimator.SetBool("IsWalking", ((Vector3)(ref val)).sqrMagnitude > 0.001f); positionLastCheck = ((Component)this).transform.position; } else { walkCheckInterval -= Time.deltaTime; } if (base.stunNormalizedTimer >= 0f) { base.agent.speed = 0f; return; } timeSinceSeeingTarget += Time.deltaTime; timeSinceInspecting += 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; isInspecting = false; lostPlayerInChase = false; base.creatureVoice.Stop(); } base.agent.speed = speedWhileMoving; targetTorsoDegrees = 0; torsoTurnSpeed = 525f; if (CheckLineOfSightForTarget(widthSearch, rangeSearch, 1)) { if (IsLocalPlayerMoving()) { 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]); } StopInspection(); previousBehaviourState = base.currentBehaviourStateIndex; } if (((NetworkBehaviour)this).IsOwner) { if (reloadingGun || aimingGun || (timeSinceFiringGun < 1.2f && timeSinceSeeingTarget < 0.5f) || timeSinceHittingPlayer < 1f) { if (aimingGun && !reloadingGun) { base.agent.speed = speedWhileAiming; } else { base.agent.speed = 0f; } } else { base.agent.speed = 7f; } } if (((NetworkBehaviour)this).IsOwner && timeSinceFiringGun > 0.75f && gun.shellsLoaded <= 0 && !reloadingGun && !aimingGun) { reloadingGun = true; ReloadGunServerRpc(); } if (lostPlayerInChase) { targetTorsoDegrees = 0; } else { SetTargetDegreesToPosition(lastSeenPlayerPos); } if (HasLineOfSightToPositionCopy(target.position, widthSearch, rangeSearch, 1f)) { timeSinceSeeingTarget = 0f; lastSeenPlayerPos = target.position; } if (!CheckLineOfSightForTarget(70f, 12, 1)) { break; } if (CheckLineOfSightForTarget(widthSearch, 12, 1) && timeSinceSeeingTarget < 3f) { SetTargetDegreesToPosition(target.position); TurnTorsoToTargetDegrees(); if (timeSinceFiringGun > ((GrabbableObject)gun).useCooldown && !reloadingGun && !aimingGun && timeSinceHittingPlayer > 1f) { timeSinceFiringGun = 0f; base.agent.speed = 0f; AimGunServerRpc(((Component)this).transform.position); } if (lostPlayerInChase) { lostPlayerInChase = false; SetLostPlayerInChaseServerRpc(lostPlayer: false); } timeSinceSeeingTarget = 0f; lastSeenPlayerPos = target.position; } else if (IsLocalPlayerMoving()) { bool flag = (int)GameNetworkManager.Instance.localPlayerController.playerClientId == lastPlayerSeenMoving; if (flag) { timeSinceSeeingTarget = 0f; } if (Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[lastPlayerSeenMoving]).transform.position) - Vector3.Distance(((Component)this).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) > 3f || (timeSinceSeeingTarget > 3f && !flag)) { lastPlayerSeenMoving = (int)GameNetworkManager.Instance.localPlayerController.playerClientId; SwitchTargetServerRpc(Vector3.zero, (int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } break; } } [ServerRpc] public void ReloadGunServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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)((NetworkBehaviour)this).__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(304019818u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 304019818u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (aimingGun) { reloadingGun = false; } else { ReloadGunClientRpc(); } } } [ClientRpc] public void ReloadGunClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(663905464u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 663905464u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopAimingGun(); gun.shellsLoaded = 2; gunCoroutine = ((MonoBehaviour)this).StartCoroutine(ReloadGun()); } } } private IEnumerator ReloadGun() { reloadingGun = true; base.creatureSFX.PlayOneShot(base.enemyType.audioClips[2]); base.creatureAnimator.SetBool("Reloading", true); yield return (object)new WaitForSeconds(0.32f); gun.gunAnimator.SetBool("Reloading", true); yield return (object)new WaitForSeconds(0.92f); gun.gunAnimator.SetBool("Reloading", false); base.creatureAnimator.SetBool("Reloading", false); yield return (object)new WaitForSeconds(0.5f); reloadingGun = false; } private void StopReloading() { reloadingGun = false; gun.gunAnimator.SetBool("Reloading", false); base.creatureAnimator.SetBool("Reloading", false); if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } } [ServerRpc(RequireOwnership = false)] public void AimGunServerRpc(Vector3 enemyPos) { //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_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_00ff: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2690841730u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemyPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2690841730u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (gun.shellsLoaded <= 0) { aimingGun = false; ReloadGunClientRpc(); } else if (!reloadingGun) { aimingGun = true; AimGunClientRpc(enemyPos); } } } [ClientRpc] public void AimGunClientRpc(Vector3 enemyPos) { //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_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_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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(996895810u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enemyPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 996895810u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StopReloading(); gunCoroutine = ((MonoBehaviour)this).StartCoroutine(AimGun(enemyPos)); } } } private IEnumerator AimGun(Vector3 enemyPos) { //IL_000e: 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) aimingGun = true; if (lastPlayerSeenMoving == previousPlayerSeenWhenAiming) { timesSeeingSamePlayer++; } else { previousPlayerSeenWhenAiming = lastPlayerSeenMoving; timesSeeingSamePlayer = 0; } longRangeAudio.PlayOneShot(aimSFX); speedWhileAiming = speedWhileMoving * 0.35f; base.inSpecialAnimation = true; base.serverPosition = enemyPos; if (base.enemyHP <= 1) { yield return (object)new WaitForSeconds(0.9f); } else if (gun.shellsLoaded == 1) { yield return (object)new WaitForSeconds(1.3f); } else { yield return (object)new WaitForSeconds(0.9f); } yield return (object)new WaitForEndOfFrame(); if (((NetworkBehaviour)this).IsOwner && !isFiring) { FireGunServerRpc(); } 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); } [ServerRpc] public void FireGunServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_0107: 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_00c2: 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)((NetworkBehaviour)this).__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(664988742u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 664988742u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.stunNormalizedTimer <= 0f) { FireGunClientRpc(); } else { ((MonoBehaviour)this).StartCoroutine(waitToFireGun()); } } } [ClientRpc] public void FireGunClientRpc() { //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_00d3: 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_00f3: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_0135: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(738202313u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 738202313u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; float x = gun.shotgunRayPoint.forward.x; Vector3 val3 = target.position - gun.shotgunRayPoint.position; Vector3 gunForward = default(Vector3); ((Vector3)(ref gunForward))..ctor(x, ((Vector3)(ref val3)).normalized.y, gun.shotgunRayPoint.forward.z); FireGun(gun.shotgunRayPoint.position, gunForward); } } } private IEnumerator waitToFireGun() { yield return (object)new WaitUntil((Func)(() => base.stunNormalizedTimer <= 0f)); yield return (object)new WaitForSeconds(0.5f); FireGunClientRpc(); } private void StopAimingGun() { base.inSpecialAnimation = false; aimingGun = false; if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } } private void FireGun(Vector3 gunPosition, Vector3 gunForward) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //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_002a: 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) isFiring = true; fire(gunPosition, gunForward); ((MonoBehaviour)this).StartCoroutine(fireAfterDelay(0.35f, gunPosition, gunForward)); ((MonoBehaviour)this).StartCoroutine(fireAfterDelay(0.7f, gunPosition, gunForward)); isFiring = false; } private IEnumerator fireAfterDelay(float time, Vector3 gunPosition, Vector3 gunForward) { //IL_0015: 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_001c: 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) yield return (object)new WaitForSeconds(time); ((GrabbableObject)gun).currentUseCooldown = -1f; fire(gunPosition, gunForward); } private void fire(Vector3 gunPosition, Vector3 gunForward) { //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) 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(gunPosition, gunForward); } } [ServerRpc(RequireOwnership = false)] 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_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_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 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1627560924u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1627560924u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchTargetClientRpc(position, playerId); } } } [ClientRpc] 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_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_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 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(447869165u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 447869165u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchTargetTo(position, playerId); } } } private void SwitchTargetTo(Vector3 position, int playerId = -1) { //IL_003f: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (playerId != -1) { lastPlayerSeenMoving = playerId; timeSinceSeeingTarget = 0f; lastSeenPlayerPos = ((Component)StartOfRound.Instance.allPlayerScripts[playerId]).transform.position; } else { timeSinceSeeingTarget = 0f; lastSeenPlayerPos = position; } } public bool CheckLineOfSightForTarget(float width = 45f, int range = 60, int proximityAwareness = -1) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f2: 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_00f8: 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_0104: 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_0112: 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) //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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position; if (Vector3.Distance(position, base.eye.position) < (float)range && !Physics.Linecast(base.eye.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { Vector3 val = position - base.eye.position; if (Vector3.Angle(base.eye.forward, val) < width || (proximityAwareness != -1 && Vector3.Distance(base.eye.position, position) < (float)proximityAwareness)) { 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) { position = ((Component)spawnedEnemy).transform.position; Vector3 val2 = position - base.eye.position; if (Vector3.Distance(position, base.eye.position) < (float)range && !Physics.Linecast(base.eye.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && (Vector3.Angle(base.eye.forward, val2) < width || (proximityAwareness != -1 && Vector3.Distance(base.eye.position, position) < (float)proximityAwareness))) { target = ((Component)spawnedEnemy).transform; return true; } } } return false; } private bool IsLocalPlayerMoving() { //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) localPlayerTurnDistance += StartOfRound.Instance.playerLookMagnitudeThisFrame; if (localPlayerTurnDistance > 0.1f && Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, ((Component)this).transform.position) < 10f) { 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, reloadingGun || aimingGun, false); if ((Object)(object)val != (Object)null) { timeSinceHittingPlayer = 0f; LegKickPlayerServerRpc((int)val.playerClientId); } } } [ServerRpc(RequireOwnership = false)] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3545391484u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3545391484u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LegKickPlayerClientRpc(playerId); } } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2431147278u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2431147278u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LegKickPlayer(playerId); } } } private void LegKickPlayer(int playerId) { //IL_0028: 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_0061: 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_008a: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_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_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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0147: Unknown result type (might be due to invalid IL or missing references) timeSinceHittingPlayer = 0f; PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerId]; RoundManager.Instance.tempTransform.position = ((Component)this).transform.position; RoundManager.Instance.tempTransform.LookAt(((Component)val).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 val2 = Vector3.Normalize((((Component)val).transform.position + Vector3.up * 0.75f - ((Component)this).transform.position) * 100f) * 25f; val.KillPlayer(val2, 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_0079: Unknown result type (might be due to invalid IL or missing references) if (Immortal) { return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, -1); if (!base.isEnemyDead) { if (isInspecting || 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); } } } [ServerRpc(RequireOwnership = false)] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(320575105u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 320575105u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetLivesClientRpc(value); } } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2777929231u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2777929231u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Lives = value; base.enemyHP = setHp; } } } public override void KillEnemy(bool destroy = false) { //IL_006e: 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) { ((EnemyAI)this).KillEnemy(destroy); targetTorsoDegrees = 0; StopInspection(); StopReloading(); if (((NetworkBehaviour)this).IsOwner) { DropGunServerRpc(gunPoint.position); ((MonoBehaviour)this).StartCoroutine(spawnShotgunShellsOnDelay()); } base.creatureVoice.Stop(); torsoTurnAudio.Stop(); } } private IEnumerator spawnShotgunShellsOnDelay() { yield return (object)new WaitForSeconds(1.2f); SpawnShotgunShells(); } public bool HasLineOfSightToPositionCopy(Vector3 pos, float width = 45f, int range = 60, float proximityAwareness = -1f) { //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_0039: 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_0050: 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_005c: 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_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_0081: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.eye == (Object)null) { _ = ((Component)this).transform; } else { _ = base.eye; } if (Vector3.Distance(base.eye.position, pos) < (float)range && !Physics.Linecast(base.eye.position, pos, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { Vector3 val = pos - base.eye.position; if (Vector3.Angle(base.eye.forward, val) < width || Vector3.Distance(((Component)this).transform.position, pos) < proximityAwareness) { return true; } } return false; } 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 //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 ((NetworkBehaviour)this).__registerRpc(1891166366u, new RpcReceiveHandler(__rpc_handler_1891166366), "InitializeNutcrackerValuesServerRpc"); ((NetworkBehaviour)this).__registerRpc(2026217664u, new RpcReceiveHandler(__rpc_handler_2026217664), "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(304019818u, new RpcReceiveHandler(__rpc_handler_304019818), "ReloadGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(663905464u, new RpcReceiveHandler(__rpc_handler_663905464), "ReloadGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(2690841730u, new RpcReceiveHandler(__rpc_handler_2690841730), "AimGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(996895810u, new RpcReceiveHandler(__rpc_handler_996895810), "AimGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(664988742u, new RpcReceiveHandler(__rpc_handler_664988742), "FireGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(738202313u, new RpcReceiveHandler(__rpc_handler_738202313), "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_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_0076: 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_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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).InitializeNutcrackerValuesServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2026217664(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: 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) { int randomSeed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomSeed); 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(randomSeed, gunObject, setShotgunValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_414091688(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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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 { 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_304019818(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_0076: 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_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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).ReloadGunServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_663905464(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).ReloadGunClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2690841730(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 enemyPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).AimGunServerRpc(enemyPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_996895810(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 enemyPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).AimGunClientRpc(enemyPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_664988742(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_0076: 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_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 { target.__rpc_exec_stage = (__RpcExecStage)1; ((NutSlayerAI)(object)target).FireGunServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_738202313(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).FireGunClientRpc(); 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_0025: 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_006e: 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_0083: 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; } [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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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); } } 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_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_00c3: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_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_0114: 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_017c: 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_019e: 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_0133: 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_013a: 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_015d: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: 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_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0313: 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_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0346: 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_0351: 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_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: 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_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: 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) //IL_0207: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_028d: 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_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: 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(outsideNodes.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 int gunCompatibleAmmoID = 1410; public bool isReloading; public int shellsLoaded; public Animator gunAnimator; public AudioSource gunAudio; public AudioSource gunShootAudio; public AudioSource gunBulletsRicochetAudio; private Coroutine gunCoroutine; public AudioClip[] gunShootSFX; public AudioClip gunReloadSFX; public AudioClip gunReloadFinishSFX; public AudioClip noAmmoSFX; public AudioClip gunSafetySFX; public AudioClip switchSafetyOnSFX; public AudioClip switchSafetyOffSFX; public bool safetyOn; private float misfireTimer = 30f; private bool hasHitGroundWithSafetyOff = true; private int ammoSlotToUse = -1; private bool localClientSendingShootGunRPC; private PlayerControllerB previousPlayerHeldBy; public ParticleSystem gunShootParticle; public Transform shotgunRayPoint; public MeshRenderer shotgunShellLeft; public MeshRenderer shotgunShellRight; public MeshRenderer shotgunShellInHand; public Transform shotgunShellInHandTransform; private RaycastHit[] enemyColliders; private EnemyAI heldByEnemy; public override void Start() { ((GrabbableObject)this).Start(); misfireTimer = 10f; hasHitGroundWithSafetyOff = true; } public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return shellsLoaded; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); safetyOn = false; shellsLoaded = saveData; } public override void Update() { ((GrabbableObject)this).Update(); if (!((NetworkBehaviour)this).IsOwner || shellsLoaded <= 0 || isReloading || (Object)(object)heldByEnemy != (Object)null || base.isPocketed) { return; } if (base.hasHitGround && !safetyOn && !hasHitGroundWithSafetyOff && !base.isHeld) { if (Random.Range(0, 100) < 5) { ShootGunAndSync(heldByPlayer: false); } hasHitGroundWithSafetyOff = true; } else if (!safetyOn && 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 if (!safetyOn) { 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 (!isReloading) { if (shellsLoaded == 0) { StartReloadGun(); } else if (((NetworkBehaviour)this).IsOwner) { ShootGunAndSync(heldByPlayer: true); } } } public void ShootGunAndSync(bool heldByPlayer) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) Vector3 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; } Debug.Log((object)"Calling shoot gun...."); ShootGun(shotgunPosition, forward); Debug.Log((object)"Calling shoot gun and sync"); localClientSendingShootGunRPC = true; ShootGunServerRpc(shotgunPosition, forward); } [ServerRpc(RequireOwnership = false)] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(61960284u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref shotgunPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref shotgunForward); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 61960284u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShootGunClientRpc(shotgunPosition, shotgunForward); } } } [ClientRpc] 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_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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(391005339u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref shotgunPosition); ((FastBufferWriter)(ref val)).WriteValueSafe(ref shotgunForward); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 391005339u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShootGun(shotgunPosition, shotgunForward); } } } private static float ClampAngle(float ang, float min, float max) { float num = Mathf.DeltaAngle(ang, min); float num2 = Mathf.DeltaAngle(ang, max); if (num <= 0f && num2 >= 0f) { return ang; } if (!(Mathf.Abs(num) < Mathf.Abs(num2))) { return max; } return min; } public void ShootGun(Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_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) //IL_0103: 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_0109: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_024e: 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_023a: 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_030b: 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_0356: Unknown result type (might be due to invalid IL or missing references) Log.LogInfo($"SlayerShotun shot at {shotgunPosition}, towards {shotgunForward}"); isReloading = false; bool flag = false; if (base.isHeld && (Object)(object)base.playerHeldBy != (Object)null && (Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { base.playerHeldBy.playerBodyAnimator.SetTrigger("ShootShotgun"); flag = true; } RoundManager.PlayRandomClip(gunShootAudio, gunShootSFX, true, 1f, 1840, 1000); WalkieTalkie.TransmitOneShotAudio(gunShootAudio, gunShootSFX[0], 1f); gunShootParticle.Play(true); shellsLoaded = 2; PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return; } float num = Vector3.Distance(((Component)localPlayerController).transform.position, ((Component)shotgunRayPoint).transform.position); bool flag2 = false; int num2 = 0; float num3 = 0f; Vector3 val = localPlayerController.playerCollider.ClosestPoint(shotgunPosition); if (!flag && !Physics.Linecast(shotgunPosition, val, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && Vector3.Angle(shotgunForward, val - shotgunPosition) < 30f) { flag2 = true; } if (num < 5f) { num3 = 0.8f; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); num2 = 100; } if (num < 15f) { num3 = 0.5f; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); num2 = 100; } else if (num < 23f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); num2 = 40; } else if (num < 30f) { 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 (flag2) { Debug.Log((object)$"Dealing {num2} damage to player"); localPlayerController.DamagePlayer(num2, true, true, (CauseOfDeath)7, 0, false, shotgunRayPoint.forward * 30f); } RaycastHit[] array = Physics.SphereCastAll(shotgunPosition, 5f, shotgunForward, 15f, 524288, (QueryTriggerInteraction)2); Log.LogInfo($"Enemies hit: {array.Length}"); IHittable val4 = default(IHittable); for (int i = 0; i < array.Length; i++) { Log.LogInfo("Raycasting enemy"); if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref array[i])).transform).GetComponent())) { EnemyAI mainScript = ((Component)((RaycastHit)(ref array[i])).transform).GetComponent().mainScript; if ((Object)(object)heldByEnemy != (Object)null && (Object)(object)heldByEnemy == (Object)(object)mainScript) { Log.LogInfo("Shotgun is held by enemy, skipping entry"); } else if (((Component)((RaycastHit)(ref array[i])).transform).TryGetComponent(ref val4)) { float num4 = Vector3.Distance(shotgunPosition, ((RaycastHit)(ref array[i])).point); int num5 = ((num4 < 3.7f) ? 5 : ((!(num4 < 6f)) ? 2 : 3)); Log.LogInfo($"Hit enemy, hitDamage: {num5}"); val4.Hit(num5, shotgunForward, base.playerHeldBy, true, -1); } else { Log.LogInfo("Could not get hittable script from collider, transform: " + ((Object)((RaycastHit)(ref array[i])).transform).name); Log.LogInfo("collider: " + ((Object)((RaycastHit)(ref array[i])).collider).name); } } } } private IEnumerator delayedEarsRinging(float effectSeverity) { yield return (object)new WaitForSeconds(0.6f); SoundManager.Instance.earsRingingTimer = effectSeverity; } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if ((Object)(object)base.playerHeldBy == (Object)null) { return; } Debug.Log((object)$"r/l activate: {right}"); if (!right) { if (safetyOn) { safetyOn = false; gunAudio.PlayOneShot(switchSafetyOffSFX); WalkieTalkie.TransmitOneShotAudio(gunAudio, switchSafetyOffSFX, 1f); SetSafetyControlTip(); } else { safetyOn = false; gunAudio.PlayOneShot(switchSafetyOffSFX); WalkieTalkie.TransmitOneShotAudio(gunAudio, switchSafetyOffSFX, 1f); SetSafetyControlTip(); } base.playerHeldBy.playerBodyAnimator.SetTrigger("SwitchGunSafety"); } else if (!isReloading && shellsLoaded < 2) { StartReloadGun(); } } public override void SetControlTipsForItem() { string[] toolTips = base.itemProperties.toolTips; if (toolTips.Length <= 2) { Debug.LogError((object)"Shotgun control tips array length is too short to set tips!"); return; } if (safetyOn) { toolTips[2] = "No safety"; } else { toolTips[2] = "No safety"; } HUDManager.Instance.ChangeControlTipMultiple(toolTips, true, base.itemProperties); } private void SetSafetyControlTip() { string text = ((!safetyOn) ? "No safety" : "No safety"); if (((NetworkBehaviour)this).IsOwner) { HUDManager.Instance.ChangeControlTip(3, text, false); } } private void StartReloadGun() { if (ReloadedGun()) { if (((NetworkBehaviour)this).IsOwner) { if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } gunCoroutine = ((MonoBehaviour)this).StartCoroutine(reloadGunAnimation()); } } else { gunAudio.PlayOneShot(noAmmoSFX); } } [ServerRpc] public void ReloadGunEffectsServerRpc(bool start = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00dd: 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)((NetworkBehaviour)this).__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(1485861874u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref start, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1485861874u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ReloadGunEffectsClientRpc(start); } } [ClientRpc] public void ReloadGunEffectsClientRpc(bool start = true) { //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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(122673521u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref start, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 122673521u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (start) { gunAudio.PlayOneShot(gunReloadSFX); WalkieTalkie.TransmitOneShotAudio(gunAudio, gunReloadSFX, 1f); gunAnimator.SetBool("Reloading", true); isReloading = true; } else { shellsLoaded = Mathf.Clamp(shellsLoaded + 1, 0, 2); gunAudio.PlayOneShot(gunReloadFinishSFX); gunAnimator.SetBool("Reloading", false); isReloading = false; } } } private IEnumerator reloadGunAnimation() { isReloading = true; if (shellsLoaded <= 0) { base.playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", true); ((Renderer)shotgunShellLeft).enabled = false; ((Renderer)shotgunShellRight).enabled = false; } else { base.playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", true); ((Renderer)shotgunShellRight).enabled = false; } yield return (object)new WaitForSeconds(0.15f); gunAudio.PlayOneShot(gunReloadSFX); gunAnimator.SetBool("Reloading", true); ReloadGunEffectsServerRpc(); yield return (object)new WaitForSeconds(0.45f); ((Renderer)shotgunShellInHand).enabled = true; shotgunShellInHandTransform.SetParent(base.playerHeldBy.leftHandItemTarget); shotgunShellInHandTransform.localPosition = new Vector3(-0.0555f, 0.1469f, -0.0655f); shotgunShellInHandTransform.localEulerAngles = new Vector3(-1.956f, 143.856f, -16.427f); yield return (object)new WaitForSeconds(0.45f); base.playerHeldBy.DestroyItemInSlotAndSync(ammoSlotToUse); ammoSlotToUse = -1; shellsLoaded = Mathf.Clamp(shellsLoaded + 1, 0, 2); ((Renderer)shotgunShellLeft).enabled = true; if (shellsLoaded == 2) { ((Renderer)shotgunShellRight).enabled = true; } ((Renderer)shotgunShellInHand).enabled = false; shotgunShellInHandTransform.SetParent(((Component)this).transform); yield return (object)new WaitForSeconds(0.25f); gunAudio.PlayOneShot(gunReloadFinishSFX); gunAnimator.SetBool("Reloading", false); base.playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", false); base.playerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", false); isReloading = false; ReloadGunEffectsServerRpc(start: false); } private bool ReloadedGun() { int num = FindAmmoInInventory(); if (num == -1) { Debug.Log((object)"not reloading"); return false; } Debug.Log((object)"reloading!"); ammoSlotToUse = num; return true; } private int FindAmmoInInventory() { for (int i = 0; i < base.playerHeldBy.ItemSlots.Length; i++) { if (!((Object)(object)base.playerHeldBy.ItemSlots[i] == (Object)null)) { GrabbableObject obj = base.playerHeldBy.ItemSlots[i]; GunAmmo val = (GunAmmo)(object)((obj is GunAmmo) ? obj : null); Debug.Log((object)$"Ammo null in slot #{i}?: {(Object)(object)val == (Object)null}"); if ((Object)(object)val != (Object)null) { Debug.Log((object)$"Ammo in slot #{i} id: {val.ammoType}"); } if ((Object)(object)val != (Object)null && val.ammoType == gunCompatibleAmmoID) { return i; } } } return -1; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); StopUsingGun(); } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); StopUsingGun(); } private void StopUsingGun() { previousPlayerHeldBy.equippedUsableItemQE = false; if (isReloading) { if (gunCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(gunCoroutine); } gunAnimator.SetBool("Reloading", false); gunAudio.Stop(); if ((Object)(object)previousPlayerHeldBy != (Object)null) { previousPlayerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun", false); previousPlayerHeldBy.playerBodyAnimator.SetBool("ReloadShotgun2", false); } ((Renderer)shotgunShellInHand).enabled = false; shotgunShellInHandTransform.SetParent(((Component)this).transform); isReloading = 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 //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(61960284u, new RpcReceiveHandler(__rpc_handler_61960284), "ShootGunServerRpc"); ((NetworkBehaviour)this).__registerRpc(391005339u, new RpcReceiveHandler(__rpc_handler_391005339), "ShootGunClientRpc"); ((NetworkBehaviour)this).__registerRpc(1485861874u, new RpcReceiveHandler(__rpc_handler_1485861874), "ReloadGunEffectsServerRpc"); ((NetworkBehaviour)this).__registerRpc(122673521u, new RpcReceiveHandler(__rpc_handler_122673521), "ReloadGunEffectsClientRpc"); ((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; } } private static void __rpc_handler_1485861874(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_0091: 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_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 { bool start = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref start, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SlayerShotgun)(object)target).ReloadGunEffectsServerRpc(start); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_122673521(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 start = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref start, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SlayerShotgun)(object)target).ReloadGunEffectsClientRpc(start); 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); } } } } namespace BrutalCompanyMinus.Minus.Handlers { [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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_003d: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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 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] 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_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Invalid comparison between Unknown and I4 //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Invalid comparison between Unknown and I4 //IL_03af: 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; for (int i = 0; i < array7.Length; i++) { array7[i].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[] array2 = Object.FindObjectsOfType(); foreach (Turret turret in array2) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableTurret(turret)); } } break; } case 7: { Log.LogInfo("Facility ghost attempts to disable landmines"); Landmine[] array4 = Object.FindObjectsOfType(); foreach (Landmine landmine in array4) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableLandmine(landmine)); } } GrabbableLandmine[] array5 = Object.FindObjectsOfType(); foreach (GrabbableLandmine grabbableLandmine in array5) { if (Convert.ToBoolean(rng.Next(2))) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisableGrabbableLandmine(grabbableLandmine)); } } break; } case 8: { Log.LogInfo("Facility ghost attempts to disable spiketraps"); SpikeRoofTrap[] array3 = Object.FindObjectsOfType(); foreach (SpikeRoofTrap trap in array3) { 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(); foreach (Turret val in array2) { 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); } } 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); } } [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); } } [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(QuickMenuManager), "LeaveGameConfirm")] private static void OnQuitLobby() { if ((Object)(object)GameNetworkManager.Instance != (Object)null && !HUDManager.Instance.retrievingSteamLeaderboard && Net.Instance.receivedSyncedValues) { ExcecuteOnShipLeave(); } } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] public static void OnShipLeave() { ExcecuteOnShipLeave(); } public static void ExcecuteOnShipLeave() { EventManager.ExecuteOnShipLeave(); EventManager.currentEvents.Clear(); Manager.ExecuteOnShipLeave(); Net.Instance.ClearGameObjectsClientRpc(); 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); } public static void ResetValues(StartOfRound __instance) { //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown 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."); List list = new List(); SpawnableMapObject[] array = Assets.spawnableMapObjects[levelIndex]; foreach (SpawnableMapObject original in array) { list.Add(original.CreateCopy()); } __instance.currentLevel.spawnableMapObjects = list.ToArray(); List list2 = new List(); IndoorMapHazard[] array2 = Assets.indoorMapHazards[levelIndex]; foreach (IndoorMapHazard original2 in array2) { list2.Add(original2.CreateCopy()); } __instance.currentLevel.indoorMapHazards = list2.ToArray(); __instance.currentLevel.enemySpawnChanceThroughoutDay.ClearKeys(); __instance.currentLevel.outsideEnemySpawnChanceThroughDay.ClearKeys(); __instance.currentLevel.daytimeEnemySpawnChanceThroughDay.ClearKeys(); __instance.currentLevel.enemySpawnChanceThroughoutDay = new AnimationCurve(Assets.insideSpawnChanceCurves[levelIndex].keys); __instance.currentLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve(Assets.outsideSpawnChanceCurves[levelIndex].keys); __instance.currentLevel.daytimeEnemySpawnChanceThroughDay = new AnimationCurve(Assets.daytimeSpawnChanceCurves[levelIndex].keys); GrabbableLandmines.LandmineDisabled = false; foreach (MEvent @event in EventManager.events) { @event.Executed = false; } 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(); Manager.enemiesToSpawnInside.Clear(); Manager.enemiesToSpawnOutside.Clear(); } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "waitForScrapToSpawnToSync")] public static void OnwaitForScrapToSpawnToSync(ref NetworkObjectReference[] spawnedScrap, ref int[] scrapValues) { //IL_00ea: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: 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_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_0429: 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++) { scrapValues[i] = (int)((float)scrapValues[i] * Manager.scrapValueMultiplier); } 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."); for (int num3 = spawnedScrap.Length - 1; num3 >= spawnedScrap.Length - num2; num3--) { NetworkObject val = null; ((NetworkObjectReference)(ref spawnedScrap[num3])).TryGet(ref val, (NetworkManager)null); if ((Object)(object)val != (Object)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(); 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); 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)) { list3.Add(((Component)val2).transform.position); val2.Despawn(true); } } 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 num6 = 0; num6 < num5; num6++) { SpawnableItemWithRarity val3 = Manager.ScrapToTransmuteTo[RoundManager.Instance.GetRandomWeightedIndexList(list6, (Random)null)]; GameObject obj = Object.Instantiate(val3.spawnableItem.spawnPrefab, Vector3.zero, Quaternion.identity); GrabbableObject component = obj.GetComponent(); NetworkObject component2 = obj.GetComponent(); if ((Object)(object)component == (Object)null) { Log.LogError("chosenItem grabbableObject is null, skipping entry."); continue; } if ((Object)(object)component2 == (Object)null) { Log.LogError("chosenItem networkObject is null, skipping entry,"); continue; } ((Component)component).transform.position = list3[num6]; ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; int num7 = (int)((float)Random.Range(val3.spawnableItem.minValue, val3.spawnableItem.maxValue + 1) * RoundManager.Instance.scrapValueMultiplier * Manager.scrapValueMultiplier); list5.Add(num7); component.scrapValue = num7; component2.Spawn(false); list4.Add(NetworkObjectReference.op_Implicit(component2)); } spawnedScrap = list4.ToArray(); scrapValues = list5.ToArray(); } } internal class Mimics { public static MEvent.Scale[] spawnRateScales = new MEvent.Scale[6]; public static int[] originalSpawnRateValues = new int[6] { 100, 0, 0, 0, 0, 0 }; public static void MoreMimics() { if (Compatibility.mimicsPresent) { for (int i = 0; i < 6; i++) { Compatibility.mimicNetworkSpawnChances[i].Value = Clamp(spawnRateScales[i].Compute(MEvent.EventType.Bad)); } } } public static void NoMimics() { if (Compatibility.mimicsPresent) { Compatibility.mimicNetworkSpawnChances[0].Value = 100; for (int i = 1; i < 6; i++) { Compatibility.mimicNetworkSpawnChances[i].Value = 0; } } } public static void Reset() { if (Compatibility.mimicsPresent) { for (int i = 0; i < 6; i++) { Compatibility.mimicNetworkSpawnChances[i].Value = originalSpawnRateValues[i]; } } } private static int Clamp(int value) { return Mathf.Clamp(value, 0, 100); } } [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_0026: 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_0130: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!BrutalCompanyMinus.Minus.Events.RealityShift.Active || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || !Physics.Raycast(new Ray(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward), ref val, __instance.grabDistance, 832) || ((Component)((RaycastHit)(ref val)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref val)).collider).tag == "PhysicsProp") || __instance.twoHanded || __instance.sinkingValue > 0.73f) { return; } GrabbableObject component = ((Component)((RaycastHit)(ref val)).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_005b: 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_006f: 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) if (BrutalCompanyMinus.Minus.Events.RealityShift.Active && NetworkManager.Singleton.IsServer && !((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).transform == (Object)null) && new Random(Net.Instance._seed++).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); } } } [HarmonyPatch(typeof(HoarderBugAI), "DoAIInterval")] [HarmonyPrefix] public static void CleanItemList() { if (!BrutalCompanyMinus.Minus.Events.RealityShift.Active) { return; } List hoarderBugItems = HoarderBugAI.HoarderBugItems; if (hoarderBugItems == null || hoarderBugItems.Count == 0) { return; } bool flag = false; for (int i = 0; i < hoarderBugItems.Count; i++) { if (hoarderBugItems[i] == null || (Object)(object)hoarderBugItems[i].itemGrabbableObject == (Object)null) { flag = true; break; } } if (flag) { hoarderBugItems.RemoveAll((HoarderBugItem item) => item == null || (Object)(object)item.itemGrabbableObject == (Object)null); } } public static IEnumerator GrabShiftedObject(PlayerControllerB instance) { yield return (object)new WaitUntil((Func)(() => shiftedObjects.Count > 0)); NetworkObject val = null; NetworkObjectReference val2 = shiftedObjects[0]; if (!((NetworkObjectReference)(ref val2)).TryGet(ref val, (NetworkManager)null)) { Log.LogError("Null network object in GrabShiftedObject()"); yield break; } GrabbableObject component = ((Component)val).GetComponent(); currentlyGrabbingObject.SetValue(instance, component); component.InteractItem(); if (component.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, component }); instance.isGrabbingObjectAnimation = true; ((Behaviour)instance.cursorIcon).enabled = false; ((TMP_Text)instance.cursorTip).text = ""; instance.twoHanded = component.itemProperties.twoHanded; instance.carryWeight += Mathf.Clamp(component.itemProperties.weight - 1f, 0f, 10f); if (component.itemProperties.grabAnimationTime > 0f) { instance.grabObjectAnimationTime = component.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] { shiftedObjects[0] }); } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "GrabObjectClientRpc")] public static void OnGrabObjectClientRpc() { 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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.LogInfo("Patched Section PlayerControllerB.BeginGrabObject()"); for (int num2 = 0; num2 < num + 4; num2++) { string text = ""; string text2 = ""; foreach (Label label in list[num2].labels) { _ = label; text += list[num2].labels; } if (num2 == num || num2 == num + 1) { text2 = "-> "; } Log.LogInfo($"{text2}{num2}: {list[num2].opcode}, {list[num2].operand}, {text}"); } 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_003b: 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) 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 component = ((Component)ai).GetComponent(); if ((Object)(object)component != (Object)null) { component.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; } BrutalCompanyMinus.Minus.Events.ShipmentFees 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); } } [HarmonyPatch] public class TerminalCommands { public class MCommand { public string command; 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", 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 (arguments.Length == 0) { Respond("MEVENT command is missing argument(s)."); } else { string text = ""; foreach (string text2 in arguments) { bool flag = false; foreach (MEvent @event in EventManager.events) { if (text2.ToUpper() == @event.Name().ToUpper()) { 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", shortinfo = "Clears the forced event list.", info = "MCLEAR\n Clears the forced event list from MEVENT.", execute = delegate { 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", 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) { Respond(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat("To display extra information about a particular event, use\nMEVENTS [Name]\n\n" + "[Very Good] events:\n", Helper.StringsToList(EventManager.allVeryGood.Select((MEvent n) => n.Name()).ToList(), ", ")), "\n\n[Good] events:\n"), Helper.StringsToList(EventManager.allGood.Select((MEvent n) => n.Name()).ToList(), ", ")), "\n\n[Neutral] events:\n"), Helper.StringsToList(EventManager.allNeutral.Select((MEvent n) => n.Name()).ToList(), ", ")), "\n\n[Bad] events:\n"), Helper.StringsToList(EventManager.allBad.Select((MEvent n) => n.Name()).ToList(), ", ")), "\n\n[VeryBad] events:\n"), Helper.StringsToList(EventManager.allVeryBad.Select((MEvent n) => n.Name()).ToList(), ", ")), "\n\n[Remove] events:\n"), Helper.StringsToList(EventManager.allRemove.Select((MEvent n) => n.Name()).ToList(), ", "))); } else { bool flag = false; foreach (MEvent event2 in EventManager.events) { if (event2.Name().ToUpper() == arguments[0].ToUpper()) { flag = true; string text = "[" + event2.Name() + "]:\n\n"; text += $"[ColorHex]: {event2.ColorHex}\n[Weight]: {event2.Weight}\n[Type]: {event2.Type}\n\n"; text = text + "[Descriptions]: " + Helper.StringsToList(event2.Descriptions, "|") + "\n\n"; text = text + "[EventsToRemove]: " + Helper.StringsToList(event2.EventsToRemove, ", ") + "\n\n"; text = text + "[EventsToSpawnWith]: " + Helper.StringsToList(event2.EventsToSpawnWith, ", ") + "\n\n"; text += "[ScaleList]: \n"; foreach (KeyValuePair scale in event2.ScaleList) { text = text + ScaleTypePadded(scale.Key) + " " + Helper.GetStringFromScale(scale.Value) + "\n"; } text += "\n[MonsterEvents]:\n"; foreach (MEvent.MonsterEvent monsterEvent in event2.monsterEvents) { text = text + "\n" + ((Object)monsterEvent.enemy).name + "\n"; text = text + ScaleTypePadded(MEvent.ScaleType.InsideEnemyRarity) + Helper.GetStringFromScale(monsterEvent.insideSpawnRarity) + "\n"; text = text + ScaleTypePadded(MEvent.ScaleType.OutsideEnemyRarity) + Helper.GetStringFromScale(monsterEvent.outsideSpawnRarity) + "\n"; text = text + ScaleTypePadded(MEvent.ScaleType.MinInsideEnemy) + Helper.GetStringFromScale(monsterEvent.minInside) + "\n"; text = text + ScaleTypePadded(MEvent.ScaleType.MaxInsideEnemy) + Helper.GetStringFromScale(monsterEvent.maxInside) + "\n"; text = text + ScaleTypePadded(MEvent.ScaleType.MinOutsideEnemy) + Helper.GetStringFromScale(monsterEvent.minOutside) + "\n"; text = text + ScaleTypePadded(MEvent.ScaleType.MaxOutsideEnemy) + Helper.GetStringFromScale(monsterEvent.maxOutside) + "\n"; } text += "\n[TransmutationEvent]:\n"; SpawnableItemWithRarity[] items = event2.scrapTransmutationEvent.items; foreach (SpawnableItemWithRarity val in items) { text += $"[Item]: {((Object)val.spawnableItem).name.PadRight(18)} [Rarity]: {val.rarity}\n"; } Respond(text); break; } } if (!flag) { Respond("Failed to find event " + arguments[0] + " in events list."); } } } }, new MCommand { command = "MPAY", 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 (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", 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", 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", 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_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_024d: 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_0451: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: 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_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: 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_0a4d: Unknown result type (might be due to invalid IL or missing references) //IL_0ab6: Unknown result type (might be due to invalid IL or missing references) //IL_0abb: Unknown result type (might be due to invalid IL or missing references) //IL_0b24: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: 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[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val2 in levels) { 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 k = 0; k < keys.Length; k++) { Keyframe val6 = keys[k]; text2 += $"\n Time: {((Keyframe)(ref val6)).time}, Value: {((Keyframe)(ref val6)).value}"; } } } } if (val2.indoorMapHazards != null) { text2 += "\nIndoor Map Hazards:"; IndoorMapHazard[] indoorMapHazards = val2.indoorMapHazards; foreach (IndoorMapHazard val7 in indoorMapHazards) { text2 += $"\n Prefab Name: {((Object)val7.hazardType.prefabToSpawn).name}\n Spawn Facing Away From Wall: {val7.hazardType.spawnFacingAwayFromWall}, \n Spawn Facing Wall: {val7.hazardType.spawnFacingWall}\n Spawn With Back To Wall: {val7.hazardType.spawnWithBackToWall}\n Spawn With Back Flush Against Wall: {val7.hazardType.spawnWithBackFlushAgainstWall}\n Require Distance Between Spawns: {val7.hazardType.requireDistanceBetweenSpawns}\n Disallow Spawning Near Entrances: {val7.hazardType.disallowSpawningNearEntrances}\n Allow In Mineshaft: {val7.hazardType.allowInMineshaft}"; if (val7.numberToSpawn != null) { text2 += "\n Number To Spawn:"; Keyframe[] keys = val7.numberToSpawn.keys; for (int k = 0; k < keys.Length; k++) { Keyframe val8 = keys[k]; text2 += $"\n Time: {((Keyframe)(ref val8)).time}, Value: {((Keyframe)(ref val8)).value}"; } } } } if (val2.spawnableOutsideObjects != null) { text2 += "\nSpawnable Outside Objects:"; SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = val2.spawnableOutsideObjects; foreach (SpawnableOutsideObjectWithRarity val9 in spawnableOutsideObjects) { SpawnableOutsideObject spawnableObject = val9.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 (val9.randomAmount != null) { text2 += "\n Random Amount:"; Keyframe[] keys = val9.randomAmount.keys; for (int k = 0; k < keys.Length; k++) { Keyframe val10 = keys[k]; text2 += $"\n Time: {((Keyframe)(ref val10)).time}, Value: {((Keyframe)(ref val10)).value}"; } } } } if (val2.spawnableScrap != null) { text2 += "\nSpawnable Scrap:"; foreach (SpawnableItemWithRarity item in val2.spawnableScrap) { if (item != null && !((Object)(object)item.spawnableItem == (Object)null)) { text2 += $"\n Name: {((Object)item.spawnableItem).name}, Rarity: {item.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[] keys = val2.enemySpawnChanceThroughoutDay.keys; for (int j = 0; j < keys.Length; j++) { Keyframe val11 = keys[j]; text2 += $"\n Time: {((Keyframe)(ref val11)).time}, Value: {((Keyframe)(ref val11)).value}"; } } text2 += "\nOutside Enemy Spawn Chance Throughout Day:"; if (val2.outsideEnemySpawnChanceThroughDay != null) { Keyframe[] keys = val2.outsideEnemySpawnChanceThroughDay.keys; for (int j = 0; j < keys.Length; j++) { Keyframe val12 = keys[j]; text2 += $"\n Time: {((Keyframe)(ref val12)).time}, Value: {((Keyframe)(ref val12)).value}"; } } text2 += "\nDaytime Enemy Spawn Chance Throughout Day:"; if (val2.daytimeEnemySpawnChanceThroughDay != null) { Keyframe[] keys = val2.daytimeEnemySpawnChanceThroughDay.keys; for (int j = 0; j < keys.Length; j++) { Keyframe val13 = keys[j]; text2 += $"\n Time: {((Keyframe)(ref val13)).time}, Value: {((Keyframe)(ref val13)).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; } } } } } }; 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 (!NetworkManager.Singleton.IsServer) { return; } 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]; string[] subArray = array[1..]; foreach (MCommand mCommand in mCommands) { if (!(mCommand.command.ToLower() != text2)) { mCommand.execute(subArray); } } if (!Utility.IsNullOrWhiteSpace(response)) { __result = ScriptableObject.CreateInstance(); __result.displayText = response + "\n\n"; __result.clearPreviousText = _clearPreviousText; response = ""; } } } [HarmonyPatch] [HarmonyPatch(typeof(EnemyAI))] 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; } } [HarmonyPostfix] [HarmonyPatch("Start")] public static void onStart(EnemyAI __instance) { ((MonoBehaviour)__instance).StartCoroutine(UpdateHP(__instance)); } 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.Events { [HarmonyPatch] internal class AllWeather : MEvent { public 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() { if (RoundManager.Instance.currentLevel.randomWeathers != null) { return RoundManager.Instance.currentLevel.randomWeathers.Length >= 3; } return false; } public override void Execute() { //IL_0079: 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_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_0096: 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_00b2: 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; switch (weatherType - 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.Exclipsed, state: true); break; } } } } public override void OnShipLeave() { Net.Instance.SetAllWeatherActiveServerRpc(state: false); } public override void OnGameStart() { Active = 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" }; monsterEvents = 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 Zeeker's added a flamethrower." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "Trees", "LeaflessBrownTrees", "Spiders" }; EventsToSpawnWith = new List { "LeaflessTrees" }; monsterEvents = 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; monsterEvents = 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 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" }; ColorHex = "#FF0000"; Type = EventType.Bad; monsterEvents = 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)); } } 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 { "It's bird migration season.", "Birb", "Do these things have feathers?", "You can shoot these." }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; monsterEvents = 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 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; 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 won't win this staring competition!" }; ColorHex = "#800000"; Type = EventType.VeryBad; monsterEvents = 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() { 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 { "There's 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" }; monsterEvents = 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() { 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; monsterEvents = 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() { ExecuteAllMonsterEvents(); } } internal class CheapProduce : MEvent { public static CheapProduce Instance; public override string Name() { return "CheapProduce"; } 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 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 its consciousness for about 4 to 5 seconds?" }; ColorHex = "#800000"; Type = EventType.VeryBad; monsterEvents = 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() { ExecuteAllMonsterEvents(); } } internal class Dentures : MEvent { public static Dentures Instance; public override string Name() { return "Dentures"; } public override void Initalize() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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 { "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; monsterEvents = 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() { ExecuteAllMonsterEvents(); } } 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" }; ScaleList.Add(ScaleType.MinAmount, new Scale(-45f, -0.55f, -100f, -45f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(-60f, -0.55f, -100f, -60f)); } public override void Execute() { Net.Instance.MoveTimeServerRpc(Random.Range(Getf(ScaleType.MinAmount), Getf(ScaleType.MaxAmount))); } } internal class FacilityGhost : MEvent { public 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 weigh a little more.", "These might take your head off.", "Flower snakes!" }; ColorHex = "#FF0000"; Type = EventType.Bad; monsterEvents = 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() { ExecuteAllMonsterEvents(); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.DaytimeEnemies, Assets.EnemyName.FlowerSnake, Get(ScaleType.DaytimeEnemyRarity)); } } 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're hearing stomping inside the facility." }; ColorHex = "#800000"; Type = EventType.VeryBad; monsterEvents = 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 void Execute() { 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 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 doors open...", "Every burglars' dream", "Experience true exploration!", "You won't 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 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_000a: 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_0010: 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_0028: Expected I4, but got Unknown LevelWeatherType currentWeather = RoundManager.Instance.currentLevel.currentWeather; return (currentWeather - 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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" }; 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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" }; 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 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 Manager.HazardSpawnExists(Assets.ObjectName.Landmine); } public override void Execute() { //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_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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown Active = true; LandmineDisabled = false; Manager.HazardSpawnSettings hazardSpawnSettings = new Manager.HazardSpawnSettings(); hazardSpawnSettings.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); hazardSpawnSettings.spawnFacingWall = false; hazardSpawnSettings.spawnFacingAwayFromWall = false; hazardSpawnSettings.spawnWithBackToWall = false; hazardSpawnSettings.spawnWithBackFlushAgainstWall = false; hazardSpawnSettings.requireDistanceBetweenSpawns = false; hazardSpawnSettings.disallowSpawningNearEntrances = false; hazardSpawnSettings.allowInMineshaft = true; Manager.HazardSpawnSettings hazardSettings = hazardSpawnSettings; Manager.AddHazardSpawn(Assets.ObjectName.Landmine, hazardSettings); } public override void OnShipLeave() { Active = false; LandmineDisabled = true; GrabbableLandmine[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { TerminalAccessibleObject componentInChildren = ((Component)array[i]).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Behaviour)componentInChildren).enabled = false; } } } public override void OnGameStart() { Active = false; LandmineDisabled = false; } } internal class GrabbableTurrets : MEvent { public 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 against 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 Manager.HazardSpawnExists(Assets.ObjectName.Turret); } public override void Execute() { //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_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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown Active = true; Manager.HazardSpawnSettings hazardSpawnSettings = new Manager.HazardSpawnSettings(); hazardSpawnSettings.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); hazardSpawnSettings.spawnFacingWall = false; hazardSpawnSettings.spawnFacingAwayFromWall = true; hazardSpawnSettings.spawnWithBackToWall = false; hazardSpawnSettings.spawnWithBackFlushAgainstWall = false; hazardSpawnSettings.requireDistanceBetweenSpawns = false; hazardSpawnSettings.disallowSpawningNearEntrances = false; hazardSpawnSettings.allowInMineshaft = true; Manager.HazardSpawnSettings hazardSettings = hazardSpawnSettings; Manager.AddHazardSpawn(Assets.ObjectName.Turret, hazardSettings); } public override void OnShipLeave() { Active = false; GrabbableTurret[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { TerminalAccessibleObject componentInChildren = ((Component)array[i]).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Behaviour)componentInChildren).enabled = 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 { "I'd 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 static bool Active; public static bool SpawnCycle; 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 = "#280000"; Type = EventType.VeryBad; EventsToRemove = new List { "Trees", "LeaflessBrownTrees", "Gloomy", "Raining", "HeavyRain", "Warzone", "EarlyShip", "LateShip" }; EventsToSpawnWith = new List { "LeaflessTrees", "FacilityGhost", "Spiders", "Thumpers", "Landmines" }; monsterEvents = 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)); 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_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_0032: 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_0046: Expected O, but got Unknown //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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown 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); Net.Instance.MoveTimeServerRpc(860f, 0.13953489f); Manager.SetAtmosphere("bloodyrain", state: true); Manager.SetAtmosphere(Assets.AtmosphereNameList[Assets.AtmosphereName.Exclipsed], 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" }; monsterEvents = 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 void Execute() { ExecuteAllMonsterEvents(); } } internal class HolidaySeason : MEvent { public static HolidaySeason Instance; public override string Name() { return "HolidaySeason"; } public override void Initalize() { //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown Instance = this; Weight = 3; Descriptions = new List { "It's the holiday season!", "All the holidays!", "Easter, Halloween, and Christmas all in one day." }; ColorHex = "#FF0000"; Type = EventType.Bad; monsterEvents = 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 { "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 OutsideObjectsToSpawn(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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //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 { "Honk!", "Clown fiesta", "Horns" }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "RealityShift" }; 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" }; monsterEvents = 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, monsterEvents[0].insideSpawnRarity.Compute(Type)); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.OutsideEnemies, enemy, monsterEvents[0].outsideSpawnRarity.Compute(Type)); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.DaytimeEnemies, enemy, Get(ScaleType.DaytimeEnemyRarity)); Manager.Spawn.InsideEnemies(enemy, Random.Range(monsterEvents[0].minInside.Compute(Type), monsterEvents[0].maxInside.Compute(Type) + 1), 30f); Manager.Spawn.OutsideEnemies(enemy, Random.Range(monsterEvents[0].minOutside.Compute(Type), monsterEvents[0].maxOutside.Compute(Type) + 1)); } } 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.", "This isn't funny.", "Freeee birdd", "I could go for some hamburgers right about now." }; ColorHex = "#800000"; Type = EventType.VeryBad; monsterEvents = 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() { 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'd 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; EventsToSpawnWith = new List { "ScarceOutsideScrap" }; monsterEvents = 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() { ExecuteAllMonsterEvents(); } } 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)); } public override bool AddEventIfOnly() { return Manager.HazardSpawnExists(Assets.ObjectName.Landmine); } public override void Execute() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown Manager.HazardSpawnSettings hazardSpawnSettings = new Manager.HazardSpawnSettings(); hazardSpawnSettings.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); hazardSpawnSettings.spawnFacingWall = false; hazardSpawnSettings.spawnFacingAwayFromWall = false; hazardSpawnSettings.spawnWithBackToWall = false; hazardSpawnSettings.spawnWithBackFlushAgainstWall = false; hazardSpawnSettings.requireDistanceBetweenSpawns = false; hazardSpawnSettings.disallowSpawningNearEntrances = false; hazardSpawnSettings.allowInMineshaft = true; Manager.HazardSpawnSettings hazardSettings = hazardSpawnSettings; Manager.AddHazardSpawn(Assets.ObjectName.Landmine, hazardSettings); } } internal class LateShip : MEvent { public static LateShip Instance; 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; ScaleList.Add(ScaleType.MinAmount, new Scale(50f, 1f, 50f, 150f)); ScaleList.Add(ScaleType.MaxAmount, new Scale(60f, 1.2f, 60f, 180f)); } public override void Execute() { Net.Instance.MoveTimeServerRpc(Random.Range(Getf(ScaleType.MinAmount), Getf(ScaleType.MaxAmount))); } } internal class LeaflessBrownTrees : MEvent { public static LeaflessBrownTrees Instance; public override string Name() { return "LeaflessBrownTrees"; } public override void Initalize() { Instance = this; Weight = 8; 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 OutsideObjectsToSpawn(Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)), 4)); } } } internal class LeaflessTrees : MEvent { public static LeaflessTrees Instance; public override string Name() { return "LeaflessTrees"; } public override void Initalize() { Instance = this; Weight = 8; 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 OutsideObjectsToSpawn(Random.Range(Getf(ScaleType.MinDensity) * 0.5f, Getf(ScaleType.MaxDensity) * 0.5f), 9)); Net.Instance.outsideObjectsToSpawn.Add(new OutsideObjectsToSpawn(Random.Range(Getf(ScaleType.MinDensity) * 0.5f, Getf(ScaleType.MaxDensity) * 0.5f), 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; monsterEvents = 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 pleasant." }; ColorHex = "#FF0000"; Type = EventType.Bad; monsterEvents = 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() { ExecuteAllMonsterEvents(); } } 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; monsterEvents = 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; monsterEvents = 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 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() { if (!Manager.SpawnExists(Assets.EnemyName.Manticoil)) { return Manager.SpawnExists(Assets.EnemyName.FlowerSnake); } return true; } 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 chiropractors", "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() { if (!Manager.SpawnExists(Assets.EnemyName.EyelessDog) && !Manager.SpawnExists("ShrimpEnemy")) { return Manager.SpawnExists("Football"); } return true; } 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() { if (!Manager.SpawnExists(Assets.EnemyName.GhostGirl) && !Manager.SpawnExists("WalkerType") && !Manager.SpawnExists("Herobrine")) { return Manager.SpawnExists("Football"); } return true; } 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 creatures with an IQ of a plant here, I hope." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "ForestGiant", "Hell", "SirenHead", "RollingGiants" }; } public override bool AddEventIfOnly() { if (!Manager.SpawnExists(Assets.EnemyName.ForestKeeper) && !Manager.SpawnExists("PinkGiantObj") && !Manager.SpawnExists("RollingGiant_EnemyType") && !Manager.SpawnExists("RollingGiant_EnemyType_Outside") && !Manager.SpawnExists("RollingGiant_EnemyType_Outside_Daytime")) { return Manager.SpawnExists("SirenHead"); } return true; } 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? :(", "Not yippee." }; 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 jackboxes", "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.", "Don't expect mines!" }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Landmines", "OutsideLandmines", "Warzone", "GrabbableLandmines", "Hell", "Roomba" }; } public override bool AddEventIfOnly() { if (!Manager.HazardSpawnExists(Assets.ObjectName.Landmine)) { return Manager.SpawnExists("Boomba"); } return true; } public override void Execute() { Manager.RemoveHazardSpawn(Assets.ObjectName.Landmine); 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 won't 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 Manager.HazardSpawnExists(Assets.ObjectName.SpikeRoofTrap); } public override void Execute() { Manager.RemoveHazardSpawn(Assets.ObjectName.SpikeRoofTrap); } } 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--", "Literally 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 drifting", "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); } } 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 GLaDOS's tyranny." }; ColorHex = "#008000"; Type = EventType.Remove; EventsToRemove = new List { "Turrets", "OutsideTurrets", "Warzone", "GrabbableTurrets", "Hell", "MobileTurrets" }; } public override bool AddEventIfOnly() { return Manager.HazardSpawnExists(Assets.ObjectName.Turret); } public override void Execute() { Manager.RemoveHazardSpawn(Assets.ObjectName.Turret); Manager.RemoveSpawn("WalkerTurret"); } } 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 has spreadshot!", "You better bring your codpiece.", "Try moving, I dare you..." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "Turrets" }; monsterEvents = 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 Nutslayer 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" }; monsterEvents = 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.ScrapValue, new Scale(2f, 0.0075f, 2f, 2.75f)); ScaleList.Add(ScaleType.ScrapAmount, new Scale(1.25f, 0.0075f, 1.25f, 2f)); 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.scrapValueMultiplier *= Getf(ScaleType.ScrapValue); Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); 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 lightning kill them?" }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToSpawnWith = new List { "Landmines", "OutsideLandmines" }; monsterEvents = 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() { 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 had also set up its own booby traps outside.", "Watch your step, outside." }; 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Tastes salty...", "Reminds me of grandma.", "Was this facility a cellar?", "Smells like vinegar." }; ColorHex = "#008000"; Type = EventType.Good; EventsToRemove = new List { "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 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 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...", "Bring your raincoat for this one" }; ColorHex = "#FFFFFF"; Type = EventType.Neutral; } public override bool AddEventIfOnly() { //IL_000a: 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_0010: 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_0028: Expected I4, but got Unknown LevelWeatherType currentWeather = RoundManager.Instance.currentLevel.currentWeather; return (currentWeather - 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 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 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 { "The outdoors is safe!", "It's unusally quiet outside.", "You might find bees outside, but that's about it.", "You can hear your own footsteps 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 ShipmentFees : MEvent { public 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 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; monsterEvents = 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() { 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.", "Congrats, 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; monsterEvents = 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() { 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" }; monsterEvents = 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() { 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 Manager.HazardSpawnExists(Assets.ObjectName.SpikeRoofTrap); } public override void Execute() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown Manager.HazardSpawnSettings hazardSpawnSettings = new Manager.HazardSpawnSettings(); hazardSpawnSettings.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); hazardSpawnSettings.spawnFacingWall = true; hazardSpawnSettings.spawnFacingAwayFromWall = true; hazardSpawnSettings.spawnWithBackToWall = true; hazardSpawnSettings.spawnWithBackFlushAgainstWall = true; hazardSpawnSettings.requireDistanceBetweenSpawns = true; hazardSpawnSettings.disallowSpawningNearEntrances = false; hazardSpawnSettings.allowInMineshaft = true; Manager.HazardSpawnSettings hazardSettings = hazardSpawnSettings; Manager.AddHazardSpawn(Assets.ObjectName.SpikeRoofTrap, hazardSettings); } } 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 tougher than usual.", "Should take an extra wack or two.", "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 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.", "Drifters!", "Sharks!", "Skipped leg day, but doubled arm day." }; ColorHex = "#FF0000"; Type = EventType.Bad; monsterEvents = 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() { ExecuteAllMonsterEvents(); } } 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 { "RealityShift" }; } public override bool AddEventIfOnly() { foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (item.spawnableItem.twoHanded && !Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } } return false; } public override void Execute() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); List list = new List(); foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (item.spawnableItem.twoHanded) { list.Add(item); } } SpawnableItemWithRarity val = list[Random.Range(0, list.Count)]; val.spawnableItem = Assets.GetItem(((Object)val.spawnableItem).name); Manager.TransmuteScrap(Getf(ScaleType.Percentage), new SpawnableItemWithRarity(val.spawnableItem, 100)); float num = (float)(val.spawnableItem.minValue + val.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 { "RealityShift" }; } public override bool AddEventIfOnly() { foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (!item.spawnableItem.twoHanded && !Manager.transmuteScrap) { Manager.transmuteScrap = true; return true; } } return false; } public override void Execute() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown Manager.scrapAmountMultiplier *= Getf(ScaleType.ScrapAmount); List list = new List(); foreach (SpawnableItemWithRarity item in RoundManager.Instance.currentLevel.spawnableScrap) { if (!item.spawnableItem.twoHanded) { list.Add(item); } } SpawnableItemWithRarity val = list[Random.Range(0, list.Count)]; val.spawnableItem = Assets.GetItem(((Object)val.spawnableItem).name); Manager.TransmuteScrap(Getf(ScaleType.Percentage), new SpawnableItemWithRarity(val.spawnableItem, 100)); float num = (float)(val.spawnableItem.minValue + val.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 Trees : MEvent { public static Trees Instance; public override string Name() { return "Trees"; } public override void Initalize() { Instance = this; Weight = 8; 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 OutsideObjectsToSpawn(Random.Range(Getf(ScaleType.MinDensity), Getf(ScaleType.MaxDensity)), 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 Manager.HazardSpawnExists(Assets.ObjectName.Turret); } public override void Execute() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown Manager.HazardSpawnSettings hazardSpawnSettings = new Manager.HazardSpawnSettings(); hazardSpawnSettings.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)Get(ScaleType.MinAmount)), new Keyframe(1f, (float)Get(ScaleType.MaxAmount)) }); hazardSpawnSettings.spawnFacingWall = false; hazardSpawnSettings.spawnFacingAwayFromWall = true; hazardSpawnSettings.spawnWithBackToWall = false; hazardSpawnSettings.spawnWithBackFlushAgainstWall = false; hazardSpawnSettings.requireDistanceBetweenSpawns = false; hazardSpawnSettings.disallowSpawningNearEntrances = false; hazardSpawnSettings.allowInMineshaft = true; Manager.HazardSpawnSettings hazardSettings = hazardSpawnSettings; Manager.AddHazardSpawn(Assets.ObjectName.Turret, hazardSettings); } } internal class Warzone : MEvent { public 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() { if (!Manager.HazardSpawnExists(Assets.ObjectName.Turret)) { return Manager.HazardSpawnExists(Assets.ObjectName.Landmine); } return true; } public override void Execute() { Active = true; } public override void OnShipLeave() { Active = false; DDay.DestroyInstance(); } public override void OnGameStart() { Active = false; } } 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!", "Larva the size of a bus." }; ColorHex = "#800000"; Type = EventType.VeryBad; EventsToRemove = new List { "SnareFleas" }; monsterEvents = 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(10f, 0.4f, 10f, 50f), new Scale(7f, 0.14f, 7f, 21f), new Scale(10f, 0.2f, 10f, 30f), new Scale(3f, 0.06f, 3f, 9f), new Scale(5f, 0.1f, 5f, 15f)) }; } public override void Execute() { ExecuteAllMonsterEvents(); } } internal class BadDice : MEvent { public static BadDice Instance; public override string Name() { return "BadDice"; } public override void Initalize() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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("MysteryDiceItem"), 80), new SpawnableItemWithRarity(Assets.GetItem("Sacrificer"), 20)); EventsToRemove = new List { "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 CityOfGold : MEvent { public static CityOfGold Instance; public override string Name() { return "CityOfGold"; } public override void Initalize() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00a2: 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_00bb: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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 //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Expected O, but got Unknown //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Expected O, but got Unknown Instance = this; Weight = 2; Descriptions = new List { "Everything is golden!!", "Gold rush!", "The nigerian princes stash!" }; ColorHex = "#00FF00"; Type = EventType.VeryGood; EventsToRemove = new List { "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; monsterEvents = new List { new MonsterEvent("Cleaner", 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 Dice : MEvent { public static Dice Instance; public override string Name() { return "Dice"; } public override void Initalize() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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("Rusty"), 45), new SpawnableItemWithRarity(Assets.GetItem("MysteryDiceItem"), 25), new SpawnableItemWithRarity(Assets.GetItem("Sacrificer"), 16)); EventsToRemove = new List { "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 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; monsterEvents = 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.lcOfficePresent; } 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; monsterEvents = new List { new MonsterEvent("PinkGiantObj", 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("DriftwoodGiantObj", 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)) }; } public override bool AddEventIfOnly() { return Compatibility.theGiantSpecimensPresent; } public override void Execute() { ExecuteAllMonsterEvents(); } } 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; monsterEvents = 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 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; monsterEvents = 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 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; monsterEvents = 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 Mimics : MEvent { public static Mimics Instance; public override string Name() { return "Mimics"; } public override void Initalize() { Instance = this; Weight = 3; Descriptions = new List { "Mimics!", "The fire exit's are suspicous", "Dont be hasty!" }; ColorHex = "#FF0000"; Type = EventType.Bad; } public override bool AddEventIfOnly() { return Compatibility.mimicsPresent; } public override void Execute() { BrutalCompanyMinus.Minus.Handlers.Mimics.MoreMimics(); } public override void OnShipLeave() { BrutalCompanyMinus.Minus.Handlers.Mimics.Reset(); } public override void OnGameStart() { BrutalCompanyMinus.Minus.Handlers.Mimics.Reset(); } } 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; monsterEvents = new List { new MonsterEvent("WalkerTurret", 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 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() { if (Manager.SpawnExists("TheFiend")) { return Compatibility.theFiendPresent; } return false; } 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() { if (Manager.SpawnExists("ImmortalSnail.EnemyType")) { return Compatibility.immortalSnailPresent; } return false; } 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() { if (Manager.SpawnExists("LockerEnemy")) { return Compatibility.lockerPresent; } return false; } public override void Execute() { Manager.RemoveSpawn("LockerEnemy"); } } internal class NoMimics : MEvent { public static NoMimics Instance; public override string Name() { return "NoMimics"; } public override void Initalize() { Instance = this; EventsToRemove = new List { "Hell", "ShyGuy" }; Weight = 1; Descriptions = new List { "The fire exit's are safe", "No Mimics!" }; ColorHex = "#008000"; Type = EventType.Remove; } public override bool AddEventIfOnly() { return Compatibility.mimicsPresent; } public override void Execute() { BrutalCompanyMinus.Minus.Handlers.Mimics.NoMimics(); } public override void OnShipLeave() { BrutalCompanyMinus.Minus.Handlers.Mimics.Reset(); } public override void OnGameStart() { BrutalCompanyMinus.Minus.Handlers.Mimics.Reset(); } } 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() { if (Manager.SpawnExists("ShyGuyDef")) { return Compatibility.scopophobiaPresent; } return false; } public override void Execute() { Manager.RemoveSpawn("ShyGuyDef"); } } 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; monsterEvents = 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 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; monsterEvents = 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; monsterEvents = 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 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; monsterEvents = 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; monsterEvents = 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.lcOfficePresent; } 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; monsterEvents = 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; monsterEvents = 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 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; monsterEvents = 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 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown SelectableLevel currentLevel = RoundManager.Instance.currentLevel; SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; SpawnableMapObject val = new SpawnableMapObject(); val.prefabToSpawn = Assets.GetObject("TeleporterTrap"); 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 = false; val.spawnWithBackToWall = false; val.spawnWithBackFlushAgainstWall = false; val.requireDistanceBetweenSpawns = false; val.disallowSpawningNearEntrances = false; currentLevel.spawnableMapObjects = spawnableMapObjects.Add(val); } } 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; monsterEvents = 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.scopophobiaPresent; } 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" }; monsterEvents = 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 false; } public override void Execute() { } } 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; monsterEvents = 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(); } } } namespace BrutalCompanyMinus.Minus.CustomEvents { internal class CustomMonsterEvent : MEvent { public static int CustomMonsterEventCount; private string name = "0"; public ConfigEntry enemyName; public override string Name() { return name; } public override void Initalize() { name = $"CustomMonsterEvent{CustomMonsterEventCount}"; CustomMonsterEventCount++; enemyName = Configuration.customEventConfig.Bind(Name(), "Enemy Name", "", "To find out what string to use type menemies into the terminal."); Enabled = false; Weight = 0; Descriptions = new List { "Descriptions..." }; ColorHex = "#FF0000"; Type = EventType.Neutral; ScaleList.Add(ScaleType.InsideEnemyRarity, new Scale(30f, 0.5f, 30f, 80f)); ScaleList.Add(ScaleType.OutsideEnemyRarity, new Scale(30f, 0.5f, 30f, 80f)); ScaleList.Add(ScaleType.MinInsideEnemy, new Scale(1f, 0.05f, 1f, 5f)); ScaleList.Add(ScaleType.MaxInsideEnemy, new Scale(2f, 0.1f, 2f, 5f)); ScaleList.Add(ScaleType.MinOutsideEnemy, new Scale(1f, 0.04f, 1f, 2f)); ScaleList.Add(ScaleType.MaxOutsideEnemy, new Scale(2f, 0.08f, 2f, 5f)); } public override void Execute() { EnemyType enemy = Assets.GetEnemy(enemyName.Value); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.Enemies, enemy, Get(ScaleType.InsideEnemyRarity)); Manager.AddEnemyToPoolWithRarity(ref RoundManager.Instance.currentLevel.OutsideEnemies, enemy, Get(ScaleType.OutsideEnemyRarity)); Manager.Spawn.OutsideEnemies(enemy, Random.Range(Get(ScaleType.MinOutsideEnemy), Get(ScaleType.MaxOutsideEnemy) + 1)); Manager.Spawn.InsideEnemies(enemy, Random.Range(Get(ScaleType.MinInsideEnemy), Get(ScaleType.MaxInsideEnemy) + 1)); } } } 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(); } } } namespace BrutalCompanyMinus.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }