Decompiled source of ChillaxScraps v1.5.6
ChillaxScraps/ChillaxScraps.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using ChillaxScraps.CustomEffects; using ChillaxScraps.NetcodePatcher; using ChillaxScraps.Utils; using CodeRebirth.src.Content.Enemies; using DigitalRuby.ThunderAndLightning; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using PremiumScraps; using ShipInventory.Helpers; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.UI; using WeatherRegistry; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("PremiumScraps")] [assembly: AssemblyCompany("ChillaxScraps")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+eed73a3ed8cada6e072a469617e1281fc75b3225")] [assembly: AssemblyProduct("ChillaxScraps")] [assembly: AssemblyTitle("ChillaxScraps")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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 ChillaxScraps { internal class Config { public bool StarlancerAIFix = false; public bool WeatherRegistery = false; public readonly List<ulong> unluckyPlayersID = new List<ulong>(); public readonly List<(int, int)> scrapValues = new List<(int, int)>(); public readonly ConfigEntry<int> masterSwordDmg; public readonly ConfigEntry<bool> evilBoink; public readonly ConfigEntry<bool> deathnoteRechargeOrbit; public readonly ConfigEntry<int> freddyInvisibilityChance; public readonly ConfigEntry<bool> ocarinaUniqueSongs; public readonly ConfigEntry<bool> ocarinaRestrictUsage; public readonly List<ConfigEntry<int>> entries = new List<ConfigEntry<int>>(); public readonly List<ConfigEntry<string>> values = new List<ConfigEntry<string>>(); public Config(ConfigFile cfg, List<Scrap> scraps) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown cfg.SaveOnConfigSet = false; masterSwordDmg = cfg.Bind<int>("Items", "Master Sword damage", 4, "Only the chosen hero can grab this sword, so it's supposed to be strong."); evilBoink = cfg.Bind<bool>("Items", "Evil Boink", false, "Activate this to turn Boink into an evil bird, can have negative consequences."); deathnoteRechargeOrbit = cfg.Bind<bool>("Items", "Death Note recharge in orbit", false, "Allows the Death Note to automatically enter the recharge state when in orbit, if it's not already recharging."); freddyInvisibilityChance = cfg.Bind<int>("Items", "Freddy bad effect chance", 70, new ConfigDescription("Chance in % of Freddy Fazbear starting the invisibility phase when spawning inside the facility (do some bad things).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); ocarinaUniqueSongs = cfg.Bind<bool>("Items", "Ocarina unique songs", false, "Activate this if you want every connected player to have a randomly selected Ocarina song assigned to them."); ocarinaRestrictUsage = cfg.Bind<bool>("Items", "Ocarina restrict usage", true, "Restrict the usage of Ocarina songs effects to 1, 2 or more times per moons. Setting this to false allows infinite usage of the songs effects but it's recommanded to not change this as it will be unbalanced."); foreach (Scrap scrap in scraps) { entries.Add(cfg.Bind<int>("Spawn chance", scrap.asset.Split("/")[0], scrap.rarity, (ConfigDescription)null)); values.Add(cfg.Bind<string>("Values", scrap.asset.Split("/")[0], "", "Min,max value of the item, follow the format 200,300 or empty for default.\nIn-game value will be randomized between these numbers and divided by 2.5.")); } cfg.Save(); cfg.SaveOnConfigSet = true; } public void SetupCustomConfigs() { if (Chainloader.PluginInfos.ContainsKey("AudioKnight.StarlancerAIFix")) { StarlancerAIFix = true; } if (Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry")) { WeatherRegistery = true; } foreach (ConfigEntry<string> value in values) { if (value.Value == "") { scrapValues.Add((-1, -1)); continue; } string[] array = (from s in value.Value.Split(',') select s.Trim()).ToArray(); int result; int result2; if (array.Count() != 2) { scrapValues.Add((-1, -1)); } else if (!int.TryParse(array[0], out result) || !int.TryParse(array[1], out result2)) { scrapValues.Add((-1, -1)); } else if (result > result2) { scrapValues.Add((-1, -1)); } else { scrapValues.Add((result, result2)); } } } public void SetupUnluckyPlayersConfig() { if (Plugin.config == null || Plugin.config.unluckyPlayersID == null) { return; } foreach (ulong item in Plugin.config.unluckyPlayersID) { unluckyPlayersID.Add(item); } } } [BepInPlugin("zigzag.chillaxscraps", "ChillaxScraps", "1.5.6")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string GUID = "zigzag.chillaxscraps"; private const string NAME = "ChillaxScraps"; private const string VERSION = "1.5.6"; public static Plugin instance; public static List<AudioClip> audioClips = new List<AudioClip>(); public static List<GameObject> gameObjects = new List<GameObject>(); private readonly Harmony harmony = new Harmony("zigzag.chillaxscraps"); internal static Config config { get; private set; } = null; private void HarmonyPatchAll() { harmony.CreateClassProcessor(typeof(GetEnemies), true).Patch(); harmony.CreateClassProcessor(typeof(TotemItemPlayerControllerBPatch), true).Patch(); harmony.CreateClassProcessor(typeof(EnemyAIPatch), true).Patch(); if (Chainloader.PluginInfos.ContainsKey("ShipInventory")) { ShipInventoryConditions.Setup(Chainloader.PluginInfos.GetValueOrDefault("ShipInventory").Metadata); } } private void LoadItemBehaviour(Item item, int behaviourId) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown GrabbableObject val; switch (behaviourId) { default: return; case 1: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<DeathNote>(); break; case 2: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Boink>(); break; case 3: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Food>(); break; case 4: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<UnoReverse>(); break; case 5: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<EmergencyMeeting>(); break; case 6: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<SuperSneakers>(); break; case 7: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<MasterSword>(); SetupScript.Copy((Shovel)val, item); break; case 8: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Ocarina>(); SetupScript.Copy((NoisemakerProp)val, item); break; case 9: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<TotemOfUndying>(); break; case 10: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<DanceNote>(); break; case 11: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Nokia>(); SetupScript.Copy((WalkieTalkie)val, item); break; case 12: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Freddy>(); break; case 13: val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<UnoReverseDX>(); break; } val.grabbable = true; val.isInFactory = true; val.grabbableToEnemies = true; val.itemProperties = item; } private void Awake() { instance = this; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "chillaxscraps"); AssetBundle val = AssetBundle.LoadFromFile(text); string text2 = "Assets/Data/"; string[] array = new string[7] { "DeathNote/DeathNoteCanvas.prefab", "EmergencyMeeting/EmergencyMeetingCanvas.prefab", "Ocarina/ElegyOfEmptiness.prefab", "DanceNote/DanceNoteCanvas.prefab", "DanceNote/WarningCanvas.prefab", "DanceNote/Glow.prefab", "DanceNote/GlowBoom.prefab" }; string[] array2 = new string[52] { "Page_Turn_Sound_Effect.wav", "Death_Note_Heart_Attack_Sound_Effect.wav", "Boink.wav", "EatSFX.wav", "uno-reverse-biaatch.wav", "emergencymeeting.wav", "sneakers-activate.wav", "sneakers-deactivate.wav", "OOT_Fanfare_Item.wav", "undying.wav", "OOT_Warp_Song_In.wav", "OOT_Warp_Song_Out.wav", "OOT_Secret.wav", "OOT_SpiritualStone_Appear.wav", "OOT_Warp_Respawn_In.wav", "OOT_YoungEpona_Neigh.wav", "Epona_Breath.wav", "Epona_KillPlayer.wav", "OOT_YoungEpona_Walk.wav", "OOT_Epona_Walk.wav", "OOT_Epona_Hooves.wav", "Epona_growl.wav", "Epona_Lunge.wav", "giant-spawn.wav", "giant-eating.wav", "MM_ClockTower_Bell.wav", "MM_Wizrobe_Appear.wav", "MM_GaleWarp_Out.wav", "MM_Goron_Ohhh.wav", "OOT_Biggoron_Ohh.wav", "OOT_Goron_Oop.wav", "OOT_Goron_Ohrr.wav", "MM_Goron_Oh.wav", "New_Wave_Bossa_Nova_by_The_Indigo-gos.wav", "MM_Warp.wav", "ChargeItem.ogg", "DeathNoteL.wav", "DanceNoteBassPractice.wav", "DanceNote1-Ching.wav", "DanceNote2-Giorno.wav", "DanceNote3-Nyan.wav", "DanceNote4-Spectre.wav", "DanceNote5-Gucci.wav", "DanceNote6-Heyyeya.wav", "nokia1.wav", "nokia2.wav", "nokia1-far.wav", "nokia2-far.wav", "toy.wav", "at_door.wav", "Freddy_Fazbear.wav", "OOT_Song_Correct.wav" }; string[] array3 = array; foreach (string text3 in array3) { gameObjects.Add(val.LoadAsset<GameObject>(text2 + text3)); } string[] array4 = array2; foreach (string text4 in array4) { audioClips.Add(val.LoadAsset<AudioClip>(text2 + "_audio/" + text4)); } List<Scrap> list = new List<Scrap> { new Scrap("DeathNote/DeathNoteItem.asset", 6, 1), new Scrap("Boink/BoinkItem.asset", 11, 2), new Scrap("Eevee/EeveeItem.asset", 10), new Scrap("CupNoodle/CupNoodleItem.asset", 12, 3), new Scrap("Moai/MoaiItem.asset", 9), new Scrap("UnoReverseCard/UnoReverseCardItem.asset", 10, 4), new Scrap("FroggyChair/FroggyChairItem.asset", 10), new Scrap("EmergencyMeeting/EmergencyMeetingItem.asset", 6, 5), new Scrap("SuperSneakers/SuperSneakersItem.asset", 10, 6), new Scrap("MasterSword/MasterSwordItem.asset", 8, 7), new Scrap("Ocarina/OcarinaItem.asset", 10, 8), new Scrap("TotemOfUndying/TotemOfUndyingItem.asset", 7, 9), new Scrap("DanceNote/DanceNoteItem.asset", 6, 10), new Scrap("Nokia/NokiaItem.asset", 12, 11), new Scrap("FreddyFazbear/FreddyFazbearItem.asset", 8, 12), new Scrap("UnoReverseCardDX/UnoReverseCardDXItem.asset", 7, 13) }; int index = 0; config = new Config(((BaseUnityPlugin)this).Config, list); config.SetupCustomConfigs(); if (Chainloader.PluginInfos.ContainsKey("zigzag.premiumscraps") && new Version("2.0.11").CompareTo(Chainloader.PluginInfos.GetValueOrDefault("zigzag.premiumscraps").Metadata.Version) <= 0) { config.SetupUnluckyPlayersConfig(); } SetupScript.Network(); foreach (Scrap item in list) { Item val2 = val.LoadAsset<Item>(text2 + item.asset); if (config.scrapValues[index].Item1 != -1) { val2.minValue = config.scrapValues[index].Item1; val2.maxValue = config.scrapValues[index].Item2; } if (item.behaviourId != 0) { LoadItemBehaviour(val2, item.behaviourId); } NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Utilities.FixMixerGroups(val2.spawnPrefab); Items.RegisterScrap(val2, config.entries[index++].Value, (LevelTypes)(-1)); } HarmonyPatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ChillaxScraps is loaded !"); } } } namespace ChillaxScraps.Utils { public class Scrap { public string asset; public int rarity; public int behaviourId; public Scrap(string asset, int rarity, int behaviourId = 0) { this.asset = asset; this.rarity = rarity; this.behaviourId = behaviourId; } } public class NetworkReference { public NetworkObjectReference netObjectRef; public int value; public NetworkReference(NetworkObjectReference netObjectRef, int value) { //IL_0009: 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) this.netObjectRef = netObjectRef; this.value = value; } } public class SetupScript { public static void Network() { IEnumerable<Type> enumerable; try { enumerable = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { enumerable = ex.Types.Where((Type t) => t != null); } foreach (Type item in enumerable) { MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array = methods; foreach (MethodInfo methodInfo in array) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } public static void Copy(NoisemakerProp target, Item item) { NoisemakerProp component = item.spawnPrefab.GetComponent<NoisemakerProp>(); ((GrabbableObject)target).useCooldown = ((GrabbableObject)component).useCooldown; target.noiseAudio = component.noiseAudio; target.noiseAudioFar = component.noiseAudioFar; target.noiseSFX = (AudioClip[])(object)new AudioClip[component.noiseSFX.Length]; for (int i = 0; i < component.noiseSFX.Length; i++) { target.noiseSFX[i] = component.noiseSFX[i]; } target.noiseSFXFar = (AudioClip[])(object)new AudioClip[component.noiseSFXFar.Length]; for (int j = 0; j < component.noiseSFXFar.Length; j++) { target.noiseSFXFar[j] = component.noiseSFXFar[j]; } target.noiseRange = component.noiseRange; target.maxLoudness = component.maxLoudness; target.minLoudness = component.minLoudness; target.minPitch = component.minPitch; target.maxPitch = component.maxPitch; target.triggerAnimator = component.triggerAnimator; Object.Destroy((Object)(object)component); } public static void Copy(Shovel target, Item item) { Shovel component = item.spawnPrefab.GetComponent<Shovel>(); target.shovelHitForce = component.shovelHitForce; target.reelUp = component.reelUp; target.swing = component.swing; target.hitSFX = (AudioClip[])(object)new AudioClip[component.hitSFX.Length]; for (int i = 0; i < component.hitSFX.Length; i++) { target.hitSFX[i] = component.hitSFX[i]; } target.shovelAudio = component.shovelAudio; Object.Destroy((Object)(object)component); } public static void Copy(SoccerBallProp target, Item item) { SoccerBallProp component = item.spawnPrefab.GetComponent<SoccerBallProp>(); target.ballHitUpwardAmount = component.ballHitUpwardAmount; target.grenadeFallCurve = component.grenadeFallCurve; target.grenadeVerticalFallCurve = component.grenadeVerticalFallCurve; target.soccerBallVerticalOffset = component.soccerBallVerticalOffset; target.grenadeVerticalFallCurveNoBounce = component.grenadeVerticalFallCurveNoBounce; target.hitBallSFX = (AudioClip[])(object)new AudioClip[component.hitBallSFX.Length]; for (int i = 0; i < component.hitBallSFX.Length; i++) { target.hitBallSFX[i] = component.hitBallSFX[i]; } target.ballHitFloorSFX = (AudioClip[])(object)new AudioClip[component.ballHitFloorSFX.Length]; for (int j = 0; j < component.ballHitFloorSFX.Length; j++) { target.ballHitFloorSFX[j] = component.ballHitFloorSFX[j]; } target.soccerBallAudio = component.soccerBallAudio; target.ballCollider = component.ballCollider; GrabbableObjectPhysicsTrigger componentInChildren = item.spawnPrefab.GetComponentInChildren<GrabbableObjectPhysicsTrigger>(); componentInChildren.itemScript = (GrabbableObject)(object)target; Object.Destroy((Object)(object)component); } public static void Copy(WalkieTalkie target, Item item) { WalkieTalkie component = item.spawnPrefab.GetComponent<WalkieTalkie>(); ((GrabbableObject)target).insertedBattery = ((GrabbableObject)component).insertedBattery; ((GrabbableObject)target).insertedBattery.charge = ((GrabbableObject)component).insertedBattery.charge; ((GrabbableObject)target).mainObjectRenderer = ((GrabbableObject)component).mainObjectRenderer; target.thisAudio = component.thisAudio; target.stopTransmissionSFX = (AudioClip[])(object)new AudioClip[component.stopTransmissionSFX.Length]; for (int i = 0; i < component.stopTransmissionSFX.Length; i++) { target.stopTransmissionSFX[i] = component.stopTransmissionSFX[i]; } target.startTransmissionSFX = (AudioClip[])(object)new AudioClip[component.startTransmissionSFX.Length]; for (int j = 0; j < component.startTransmissionSFX.Length; j++) { target.startTransmissionSFX[j] = component.startTransmissionSFX[j]; } target.switchWalkieTalkiePowerOff = component.switchWalkieTalkiePowerOff; target.switchWalkieTalkiePowerOn = component.switchWalkieTalkiePowerOn; target.talkingOnWalkieTalkieNotHeldSFX = component.talkingOnWalkieTalkieNotHeldSFX; target.playerDieOnWalkieTalkieSFX = component.playerDieOnWalkieTalkieSFX; target.onMaterial = component.onMaterial; target.offMaterial = component.offMaterial; target.walkieTalkieLight = component.walkieTalkieLight; target.target = component.target; target.recordingRange = component.recordingRange; target.maxVolume = component.maxVolume; target.collidersInRange = (Collider[])(object)new Collider[component.collidersInRange.Length]; target.wallAudio = component.wallAudio; target.wallAudios = (AudioClip[])(object)new AudioClip[component.wallAudios.Length]; for (int k = 0; k < component.wallAudios.Length; k++) { target.wallAudios[k] = component.wallAudios[k]; } Object.Destroy((Object)(object)component); } } internal class Effects { public enum DeathAnimation { Normal, NoHead1, Spring, Haunted, Mask1, Mask2, Fire, CutInHalf, NoHead2 } public static int NbOfPlayers() { return StartOfRound.Instance.connectedPlayersAmount + 1; } public static bool IsUnlucky(ulong playerId) { if (Plugin.config.unluckyPlayersID.Count == 0) { return false; } return Plugin.config.unluckyPlayersID.Find((ulong id) => id == playerId) != 0; } public static List<PlayerControllerB> GetPlayers(bool includeDead = false, bool excludeOutsideFactory = false) { List<PlayerControllerB> list = StartOfRound.Instance.allPlayerScripts.ToList(); List<PlayerControllerB> list2 = new List<PlayerControllerB>(list); foreach (PlayerControllerB item in list) { if (!((NetworkBehaviour)item).IsSpawned || !item.isPlayerControlled || (!includeDead && item.isPlayerDead) || (excludeOutsideFactory && !item.isInsideFactory)) { list2.Remove(item); } } return list2; } public static List<EnemyAI> GetEnemies(bool includeDead = false, bool includeCanDie = false, bool excludeDaytime = false) { List<EnemyAI> list = Object.FindObjectsOfType<EnemyAI>().ToList(); List<EnemyAI> list2 = new List<EnemyAI>(list); if (includeDead) { return list2; } foreach (EnemyAI item in list) { if (!((NetworkBehaviour)item).IsSpawned || item.isEnemyDead || (!includeCanDie && !item.enemyType.canDie) || (excludeDaytime && item.enemyType.isDaytimeEnemy)) { list2.Remove(item); } } return list2; } public static void Damage(PlayerControllerB player, int damageNb, CauseOfDeath cause = 0, int animation = 0, bool criticalBlood = true) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) damageNb = ((player.health > 100 && damageNb == 100) ? 900 : damageNb); if (criticalBlood && player.health - damageNb <= 20) { player.bleedingHeavily = true; } player.DamagePlayer(damageNb, true, true, cause, animation, false, default(Vector3)); } public static IEnumerator DamageHost(PlayerControllerB player, int damageNb, CauseOfDeath cause = 0, int animation = 0, bool criticalBlood = true) { //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 WaitForEndOfFrame(); Damage(player, damageNb, cause, animation, criticalBlood); } public static void Heal(ulong playerID, int health) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; val.health = ((val.health > 100) ? val.health : health); val.criticallyInjured = false; val.bleedingHeavily = false; val.playerBodyAnimator.SetBool("Limp", false); } public static void Teleportation(PlayerControllerB player, Vector3 position) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) player.averageVelocity = 0f; player.velocityLastFrame = Vector3.zero; player.TeleportPlayer(position, true, 0f, false, true); player.beamOutParticle.Play(); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } public static void SetPosFlags(ulong playerID, bool ship = false, bool exterior = false, bool interior = false) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID]; if (ship) { val.isInElevator = true; val.isInHangarShipRoom = true; val.isInsideFactory = false; } if (exterior) { val.isInElevator = false; val.isInHangarShipRoom = false; val.isInsideFactory = false; } if (interior) { val.isInElevator = false; val.isInHangarShipRoom = false; val.isInsideFactory = true; } GrabbableObject[] itemSlots = val.ItemSlots; foreach (GrabbableObject val2 in itemSlots) { if ((Object)(object)val2 != (Object)null) { val2.isInFactory = val.isInsideFactory; val2.isInElevator = val.isInElevator; val2.isInShipRoom = val.isInHangarShipRoom; } } if (GameNetworkManager.Instance.localPlayerController.playerClientId == val.playerClientId) { if (val.isInsideFactory) { TimeOfDay.Instance.DisableAllWeather(false); } else { ActivateWeatherEffect((LevelWeatherType)0); } } } public static bool IsPlayerFacingObject<T>(PlayerControllerB player, out T obj, float distance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Ray(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward), ref val, distance, 2816)) { obj = ((Component)((RaycastHit)(ref val)).transform).GetComponent<T>(); if (obj != null) { return true; } } obj = default(T); return false; } public static bool IsPlayerNearObject<T>(PlayerControllerB player, out T obj, float distance) where T : Component { //IL_0013: 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) T[] array = Object.FindObjectsByType<T>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { if (Vector3.Distance(((Component)player).transform.position, ((Component)array[i]).transform.position) <= distance) { obj = array[i]; return true; } } obj = default(T); return false; } public static Vector3 GetClosestAINodePosition(GameObject[] nodes, Vector3 position) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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_0034: Unknown result type (might be due to invalid IL or missing references) return nodes.OrderBy((GameObject x) => Vector3.Distance(position, x.transform.position)).ToArray()[0].transform.position; } public static void Knockback(Vector3 position, float range, int damage = 0, float physicsForce = 30f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Landmine.SpawnExplosion(position, false, 0f, range, damage, physicsForce, (GameObject)null, false); } public static void DropItem(Vector3 placingPosition = default(Vector3)) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) GameNetworkManager.Instance.localPlayerController.DiscardHeldObject(true, (NetworkObject)null, placingPosition, true); } public static void Audio(int audioID, float volume) { RoundManager.PlayRandomClip(HUDManager.Instance.UIAudio, (AudioClip[])(object)new AudioClip[1] { Plugin.audioClips[audioID] }, false, volume, 0, 1000); } public static void Audio(int audioID, Vector3 startPosition, float localVolume, float clientVolume, PlayerControllerB player) { //IL_0066: 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_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) if ((Object)(object)player != (Object)null && GameNetworkManager.Instance.localPlayerController.playerClientId == player.playerClientId) { Audio(audioID, localVolume); } else if ((Object)(object)player != (Object)null) { player.itemAudio.PlayOneShot(Plugin.audioClips[audioID], clientVolume); } else { AudioSource.PlayClipAtPoint(Plugin.audioClips[audioID], startPosition + Vector3.up * 2f, clientVolume); } } public static void Audio3D(int audioID, Vector3 position, float volume = 1f, float distance = 20f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: 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_002f: Expected O, but got Unknown GameObject val = new GameObject("One shot audio"); val.transform.position = position; AudioSource val2 = (AudioSource)val.AddComponent(typeof(AudioSource)); val2.spatialBlend = 1f; val2.rolloffMode = (AudioRolloffMode)1; val2.minDistance = 0f; val2.maxDistance = distance; val2.PlayOneShot(Plugin.audioClips[audioID], volume); Object.Destroy((Object)(object)val, Plugin.audioClips[audioID].length * ((Time.timeScale < 0.01f) ? 0.01f : Time.timeScale)); } public static IEnumerator FadeOutAudio(AudioSource source, float time) { yield return (object)new WaitForEndOfFrame(); float volume = source.volume; while (source.volume > 0f) { source.volume -= volume * Time.deltaTime / time; yield return null; } source.Stop(); source.volume = volume; } public static void Message(string title, string bottom, bool warning = false) { HUDManager.Instance.DisplayTip(title, bottom, warning, false, "LC_Tip1"); } public static void ChangeWeather(LevelWeatherType weather) { //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_001c: 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_0064: Unknown result type (might be due to invalid IL or missing references) LevelWeatherType currentWeather = StartOfRound.Instance.currentLevel.currentWeather; StartOfRound.Instance.currentLevel.currentWeather = weather; if (Plugin.config.WeatherRegistery) { ChangeWeatherWR(weather); return; } RoundManager.Instance.SetToCurrentLevelWeather(); TimeOfDay.Instance.SetWeatherBasedOnVariables(); if (!GameNetworkManager.Instance.localPlayerController.isInsideFactory) { ActivateWeatherEffect(currentWeather); } } public static void ActivateWeatherEffect(LevelWeatherType originalWeather = 0) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Invalid comparison between Unknown and I4 for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++) { WeatherEffect val = TimeOfDay.Instance.effects[i]; bool flag = (val.effectEnabled = (int)StartOfRound.Instance.currentLevel.currentWeather == i); if ((Object)(object)val.effectPermanentObject != (Object)null) { val.effectPermanentObject.SetActive(flag); } if ((Object)(object)val.effectObject != (Object)null) { val.effectObject.SetActive(flag); } if ((Object)(object)TimeOfDay.Instance.sunAnimator != (Object)null) { if (flag && !string.IsNullOrEmpty(val.sunAnimatorBool)) { TimeOfDay.Instance.sunAnimator.SetBool(val.sunAnimatorBool, true); continue; } TimeOfDay.Instance.sunAnimator.Rebind(); TimeOfDay.Instance.sunAnimator.Update(0f); } } if ((int)originalWeather == 4) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.isUnderwater = false; localPlayerController.sourcesCausingSinking = Mathf.Clamp(localPlayerController.sourcesCausingSinking - 1, 0, 100); localPlayerController.isMovementHindered = Mathf.Clamp(localPlayerController.isMovementHindered - 1, 0, 100); localPlayerController.hinderedMultiplier = 1f; } } public static void ChangeWeatherWR(LevelWeatherType weather) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost) { WeatherController.SetWeatherEffects(weather); } } public static NetworkObjectReference Spawn(SpawnableEnemyWithRarity enemy, Vector3 position, float yRot = 0f) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0054: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(enemy.enemyType.enemyPrefab, position, Quaternion.Euler(new Vector3(0f, yRot, 0f))); val.GetComponentInChildren<NetworkObject>().Spawn(true); RoundManager.Instance.SpawnedEnemies.Add(val.GetComponent<EnemyAI>()); return new NetworkObjectReference(val); } public static void SpawnMaskedOfPlayer(ulong playerId, Vector3 position) { //IL_001a: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); bool flag = ((Component)component).transform.position.y < -80f; NetworkObjectReference val = RoundManager.Instance.SpawnEnemyGameObject(position, ((Component)component).transform.eulerAngles.y, -1, ChillaxScraps.Utils.GetEnemies.Masked.enemyType); NetworkObject val2 = default(NetworkObject); if (((NetworkObjectReference)(ref val)).TryGet(ref val2, (NetworkManager)null)) { MaskedPlayerEnemy component2 = ((Component)val2).GetComponent<MaskedPlayerEnemy>(); component2.SetSuit(component.currentSuitID); component2.mimickingPlayer = component; ((EnemyAI)component2).SetEnemyOutside(!flag); component2.CreateMimicClientRpc(val, flag, (int)playerId); } } public static void Spawn(SpawnableMapObject trap, Vector3 position, float yRot = 0f) { //IL_0007: 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) GameObject val = Object.Instantiate<GameObject>(trap.prefabToSpawn, position, Quaternion.Euler(new Vector3(0f, yRot, 0f)), RoundManager.Instance.mapPropsContainer.transform); val.GetComponent<NetworkObject>().Spawn(true); } public static SpawnableItemWithRarity GetScrap(string scrapName) { string scrapName2 = scrapName; return ((IEnumerable<SpawnableItemWithRarity>)RoundManager.Instance.currentLevel.spawnableScrap).FirstOrDefault((Func<SpawnableItemWithRarity, bool>)((SpawnableItemWithRarity i) => ((Object)i.spawnableItem).name.Equals(scrapName2))); } public static NetworkReference Spawn(SpawnableItemWithRarity scrap, Vector3 position) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_00cd: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)RoundManager.Instance.spawnedScrapContainer == (Object)null) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer); GameObject val2 = Object.Instantiate<GameObject>(scrap.spawnableItem.spawnPrefab, position + Vector3.up * 0.25f, Quaternion.identity, val); GrabbableObject component = val2.GetComponent<GrabbableObject>(); ((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation); component.fallTime = 0f; component.scrapValue = (int)((float)Random.Range(scrap.spawnableItem.minValue, scrap.spawnableItem.maxValue) * RoundManager.Instance.scrapValueMultiplier); ((NetworkBehaviour)component).NetworkObject.Spawn(false); component.FallToGround(true); return new NetworkReference(NetworkObjectReference.op_Implicit(val2.GetComponent<NetworkObject>()), component.scrapValue); } public static IEnumerator SyncScrap(NetworkReference reference) { yield return (object)new WaitForSeconds(3f); RoundManager.Instance.SyncScrapValuesClientRpc((NetworkObjectReference[])(object)new NetworkObjectReference[1] { reference.netObjectRef }, new int[1] { reference.value }); } public static void SpawnLightningBolt(Vector3 strikePosition, bool damage = true, bool redirectInside = true) { //IL_0027: 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_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_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_0065: 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_0067: 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_0114: 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_0148: 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_0153: 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_0097: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(StartOfRound.Instance.randomMapSeed); random.Next(-32, 32); random.Next(-32, 32); Vector3 val = strikePosition + Vector3.up * 160f + new Vector3((float)random.Next(-32, 32), 0f, (float)random.Next(-32, 32)); RaycastHit val2 = default(RaycastHit); if (redirectInside && Physics.Linecast(val, strikePosition + Vector3.up * 0.5f, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { RaycastHit val3 = default(RaycastHit); if (!Physics.Raycast(val, strikePosition - val, ref val3, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { return; } strikePosition = ((RaycastHit)(ref val3)).point; } StormyWeather val4 = Object.FindObjectOfType<StormyWeather>(true); LightningBoltPrefabScript val5 = Object.Instantiate<LightningBoltPrefabScript>(val4.targetedThunder); ((Behaviour)val5).enabled = true; ((LightningBoltScript)val5).Camera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; ((LightningBoltPrefabScriptBase)val5).AutomaticModeSeconds = 0.2f; val5.Source.transform.position = val; val5.Destination.transform.position = strikePosition; ((LightningBoltPrefabScriptBase)val5).CreateLightningBoltsNow(); AudioSource val6 = Object.Instantiate<AudioSource>(val4.targetedStrikeAudio); ((Component)val6).transform.position = strikePosition + Vector3.up * 0.5f; ((Behaviour)val6).enabled = true; if (damage) { Landmine.SpawnExplosion(strikePosition + Vector3.up * 0.25f, false, 2.4f, 5f, 50, 0f, (GameObject)null, false); } val4.PlayThunderEffects(strikePosition, val6); } } [HarmonyPatch(typeof(Terminal))] internal class GetEnemies { public static SpawnableEnemyWithRarity Masked; public static SpawnableEnemyWithRarity HoardingBug; public static SpawnableEnemyWithRarity SnareFlea; public static SpawnableEnemyWithRarity Jester; public static SpawnableEnemyWithRarity Bracken; public static SpawnableEnemyWithRarity Thumper; public static SpawnableEnemyWithRarity CoilHead; public static SpawnableEnemyWithRarity CircuitBees; public static SpawnableEnemyWithRarity EarthLeviathan; public static SpawnableEnemyWithRarity BunkerSpider; public static SpawnableEnemyWithRarity ForestKeeper; public static SpawnableEnemyWithRarity GhostGirl; public static SpawnableEnemyWithRarity TulipSnake; public static SpawnableEnemyWithRarity EyelessDog; public static SpawnableEnemyWithRarity Maneater; public static SpawnableEnemyWithRarity Nutcracker; public static SpawnableEnemyWithRarity Barber; public static SpawnableEnemyWithRarity Butler; public static SpawnableEnemyWithRarity OldBird; public static SpawnableEnemyWithRarity ShyGuy; public static SpawnableEnemyWithRarity RedwoodTitan; public static SpawnableEnemyWithRarity RedwoodGiant; public static SpawnableEnemyWithRarity Locker; public static SpawnableEnemyWithRarity Bruce; public static SpawnableEnemyWithRarity BaboonHawk; public static SpawnableEnemyWithRarity Tornado; public static SpawnableMapObject Landmine; public static SpawnableMapObject Turret; public static SpawnableMapObject SpikeTrap; public static SpawnableMapObject Seamine; public static SpawnableMapObject BigBertha; [HarmonyPatch("Start")] [HarmonyPostfix] public static void GetEnemy(Terminal __instance) { SelectableLevel[] moonsCatalogueList = __instance.moonsCatalogueList; foreach (SelectableLevel val in moonsCatalogueList) { foreach (SpawnableEnemyWithRarity enemy in val.Enemies) { if (enemy.enemyType.enemyName == "Masked" && Masked == null) { Masked = enemy; } else if (enemy.enemyType.enemyName == "Hoarding bug" && HoardingBug == null) { HoardingBug = enemy; } else if (enemy.enemyType.enemyName == "Centipede" && SnareFlea == null) { SnareFlea = enemy; } else if (enemy.enemyType.enemyName == "Jester" && Jester == null) { Jester = enemy; } else if (enemy.enemyType.enemyName == "Flowerman" && Bracken == null) { Bracken = enemy; } else if (enemy.enemyType.enemyName == "Crawler" && Thumper == null) { Thumper = enemy; } else if (enemy.enemyType.enemyName == "Spring" && CoilHead == null) { CoilHead = enemy; } else if (enemy.enemyType.enemyName == "Bunker Spider" && BunkerSpider == null) { BunkerSpider = enemy; } else if (enemy.enemyType.enemyName == "Girl" && GhostGirl == null) { GhostGirl = enemy; } else if (enemy.enemyType.enemyName == "Maneater" && Maneater == null) { Maneater = enemy; } else if (enemy.enemyType.enemyName == "Nutcracker" && Nutcracker == null) { Nutcracker = enemy; } else if (enemy.enemyType.enemyName == "Clay Surgeon" && Barber == null) { Barber = enemy; } else if (enemy.enemyType.enemyName == "Butler" && Butler == null) { Butler = enemy; } else if (enemy.enemyType.enemyName == "Shy guy" && ShyGuy == null) { ShyGuy = enemy; } else if (enemy.enemyType.enemyName == "Locker" && Locker == null) { Locker = enemy; } } foreach (SpawnableEnemyWithRarity daytimeEnemy in val.DaytimeEnemies) { if (daytimeEnemy.enemyType.enemyName == "Red Locust Bees" && CircuitBees == null) { CircuitBees = daytimeEnemy; } else if (daytimeEnemy.enemyType.enemyName == "Tulip Snake" && TulipSnake == null) { TulipSnake = daytimeEnemy; } } foreach (SpawnableEnemyWithRarity outsideEnemy in val.OutsideEnemies) { if (outsideEnemy.enemyType.enemyName == "Earth Leviathan" && EarthLeviathan == null) { EarthLeviathan = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "ForestGiant" && ForestKeeper == null) { ForestKeeper = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "MouthDog" && EyelessDog == null) { EyelessDog = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "RadMech" && OldBird == null) { OldBird = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "Redwood Titan" && RedwoodTitan == null) { RedwoodTitan = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "RedWoodGiant" && RedwoodGiant == null) { RedwoodGiant = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "Bruce" && Bruce == null) { Bruce = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "Baboon hawk" && BaboonHawk == null) { BaboonHawk = outsideEnemy; } else if (outsideEnemy.enemyType.enemyName == "Tornado" && Tornado == null) { Tornado = outsideEnemy; } } SpawnableMapObject[] spawnableMapObjects = val.spawnableMapObjects; foreach (SpawnableMapObject val2 in spawnableMapObjects) { if (((Object)val2.prefabToSpawn).name == "Landmine" && Landmine == null) { Landmine = val2; } else if (((Object)val2.prefabToSpawn).name == "TurretContainer" && Turret == null) { Turret = val2; } else if (((Object)val2.prefabToSpawn).name == "SpikeRoofTrapHazard" && SpikeTrap == null) { SpikeTrap = val2; } else if (((Object)val2.prefabToSpawn).name == "Seamine" && Seamine == null) { Seamine = val2; } else if (((Object)val2.prefabToSpawn).name == "Bertha" && BigBertha == null) { BigBertha = val2; } } } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class TotemItemPlayerControllerBPatch { [HarmonyPrefix] [HarmonyPatch("DamagePlayer")] public static void DamagePlayerTotemPrePatch(PlayerControllerB __instance, int damageNumber) { if (__instance.health - damageNumber <= 0) { TotemOfUndying.TrySavePlayer(__instance); } } [HarmonyPrefix] [HarmonyPatch("KillPlayer")] public static void KillPlayerTotemPrePatch(PlayerControllerB __instance) { TotemOfUndying.TrySavePlayer(__instance); } [HarmonyPostfix] [HarmonyPatch("DamagePlayer")] public static void DamagePlayerTotemPostPatch(PlayerControllerB __instance, int damageNumber) { if (__instance.health - damageNumber <= 0) { TotemOfUndying.TryDestroyItem(__instance); } } [HarmonyPostfix] [HarmonyPatch("KillPlayer")] public static void KillPlayerTotemPostPatch(PlayerControllerB __instance) { TotemOfUndying.TryDestroyItem(__instance); } } [HarmonyPatch(typeof(EnemyAI))] internal class EnemyAIPatch { [HarmonyPrefix] [HarmonyPatch("UseNestSpawnObject")] public static void UseNestSpawnObjectPatch(EnemyAI __instance, ref EnemyAINestSpawnObject nestSpawnObject) { //IL_0052: 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) if (!Ocarina.WakeOldBirdFlag || !((Object)(object)__instance.enemyType == (Object)(object)GetEnemies.OldBird.enemyType)) { return; } EnemyAINestSpawnObject[] array = Object.FindObjectsByType<EnemyAINestSpawnObject>((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].enemyType == (Object)(object)GetEnemies.OldBird.enemyType && ((Component)array[i]).transform.position == Ocarina.WakeOldBirdPosition) { nestSpawnObject = array[i]; } } Ocarina.WakeOldBirdFlag = false; } } internal class ShipInventoryConditions { public static void Setup(BepInPlugin inventoryMetadata) { if (new Version("1.2.2").CompareTo(inventoryMetadata.Version) <= 0) { InteractionHelper.AddCondition((Func<PlayerControllerB, bool>)ChillaxScrapsCondition, "[Item not allowed]", false); } } private static bool ChillaxScrapsCondition(PlayerControllerB player) { GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer; if (((((Object)currentlyHeldObjectServer.itemProperties).name == "DeathNoteItem" || ((Object)currentlyHeldObjectServer.itemProperties).name == "DanceNoteItem") && currentlyHeldObjectServer is DarkBook) || (((Object)currentlyHeldObjectServer.itemProperties).name == "MasterSwordItem" && currentlyHeldObjectServer is MasterSword) || (((Object)currentlyHeldObjectServer.itemProperties).name == "NokiaItem" && currentlyHeldObjectServer is Nokia) || (((Object)currentlyHeldObjectServer.itemProperties).name == "OcarinaItem" && currentlyHeldObjectServer is Ocarina ocarina && (ocarina.isPlaying || !StartOfRound.Instance.inShipPhase)) || (((Object)currentlyHeldObjectServer.itemProperties).name == "TotemOfUndyingItem" && currentlyHeldObjectServer is TotemOfUndying totemOfUndying && totemOfUndying.used) || (((Object)currentlyHeldObjectServer.itemProperties).name == "UnoReverseCardDXItem" && currentlyHeldObjectServer is UnoReverseDX unoReverseDX && !unoReverseDX.canBeUsed)) { return false; } return true; } } } namespace ChillaxScraps.CustomEffects { internal class Boink : PhysicsProp { public bool isActive = false; public float elapsedTime = 0f; public Vector3 force; public Boink() { ((GrabbableObject)this).useCooldown = 2f; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((GrabbableObject)this).insertedBattery != null) { ((GrabbableObject)this).insertedBattery.charge = 1f; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0058: 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) ((GrabbableObject)this).ItemActivate(used, buttonDown); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && ((GrabbableObject)this).insertedBattery != null && ((GrabbableObject)this).insertedBattery.charge > 0f) { Vector3 val = GetDirection() + Vector3.up; BoinkServerRpc(((Vector3)(ref val)).normalized * 500f, 0.5f, 2, ((Component)((GrabbableObject)this).playerHeldBy).transform.position, 0.8f, 0.55f); } } public override void Update() { //IL_0042: 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_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) ((GrabbableObject)this).Update(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && isActive) { elapsedTime -= Time.deltaTime; ((GrabbableObject)this).playerHeldBy.externalForces = Vector3.Lerp(((GrabbableObject)this).playerHeldBy.externalForces, force, Time.deltaTime * 5f); if (elapsedTime < 0f) { isActive = false; } } } private Vector3 GetDirection() { //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_0027: 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_0051: 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_00b5: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_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_007f: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.config.evilBoink.Value) { return -((Component)this).transform.forward; } int num = Random.Range(0, 10); if (num <= 7) { return -((Component)this).transform.forward; } if (num == 8) { if (Random.Range(0, 2) == 0) { return -((Component)this).transform.right; } return ((Component)this).transform.right; } if (Random.Range(0, 2) == 0) { return ((Component)this).transform.forward; } return -((Component)this).transform.forward; } [ServerRpc(RequireOwnership = false)] private void BoinkServerRpc(Vector3 force, float duration, int audioID, Vector3 clientPosition, float hostVolume, float clientVolume = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_00bf: 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_00da: 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_00f4: 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_0138: 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 val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2418218142u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref duration, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, audioID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2418218142u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { BoinkClientRpc(force, duration, audioID, clientPosition, hostVolume, (clientVolume == 0f) ? hostVolume : clientVolume); } } } [ClientRpc] private void BoinkClientRpc(Vector3 force, float duration, int audioID, Vector3 clientPosition, float hostVolume, float clientVolume) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_00bf: 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_00da: 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_00f4: 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_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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2019346981u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref duration, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, audioID); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2019346981u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { this.force = force; elapsedTime = duration; isActive = true; } Effects.Audio(audioID, clientPosition, hostVolume, clientVolume, ((GrabbableObject)this).playerHeldBy); } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Boink() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2418218142u, new RpcReceiveHandler(__rpc_handler_2418218142)); NetworkManager.__rpc_func_table.Add(2019346981u, new RpcReceiveHandler(__rpc_handler_2019346981)); } private static void __rpc_handler_2418218142(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_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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b8: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 val = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val); float duration = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref duration, default(ForPrimitives)); int audioID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audioID); Vector3 clientPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition); float hostVolume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives)); float clientVolume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Boink)(object)target).BoinkServerRpc(val, duration, audioID, clientPosition, hostVolume, clientVolume); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2019346981(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_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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b8: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 val = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val); float duration = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref duration, default(ForPrimitives)); int audioID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audioID); Vector3 clientPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition); float hostVolume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives)); float clientVolume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((Boink)(object)target).BoinkClientRpc(val, duration, audioID, clientPosition, hostVolume, clientVolume); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Boink"; } } internal class DanceNote : DarkBook { public bool danceActivated = false; public float transitionTime = 3.5f; public float danceTime = 6f; public int usage = 0; public readonly GameObject warningPrefab; public readonly GameObject glowPrefab; public readonly GameObject glowboomPrefab; public int[] musicClips = new int[6] { 38, 39, 40, 41, 42, 43 }; private GameObject? glowObj; public DanceNote() { ((GrabbableObject)this).useCooldown = 2f; canKillEnemies = false; punishInOrbit = false; usageOnServerMax = musicClips.Length; rechargeTimeMin = 90f; rechargeTimeMax = 120f; musicToPlayID = 37; canvasPrefab = Plugin.gameObjects[3]; warningPrefab = Plugin.gameObjects[4]; glowPrefab = Plugin.gameObjects[5]; glowboomPrefab = Plugin.gameObjects[6]; } private void ShuffleMusic() { Random rnd = new Random(); musicClips = (from i in musicClips select (i, rnd.Next()) into tuple orderby tuple.Item2 select tuple.i).ToArray(); } public override void OnNetworkSpawn() { base.OnNetworkSpawn(); if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { ShuffleMusic(); } else { SyncDanceNoteServerRpc(); } } public override void ResetDeathNote() { base.ResetDeathNote(); usage = 0; danceActivated = false; if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer) { ShuffleMusic(); } } public override void ItemActivate(bool used, bool buttonDown = true) { if (!danceActivated) { base.ItemActivate(used, buttonDown); } } public override void ActivateDeathNote(GameObject objectToKill) { bool flag = true; CloseDeathNote(); PlayerControllerB val = default(PlayerControllerB); if (((Component)objectToKill.transform).TryGetComponent<PlayerControllerB>(ref val) && (Object)(object)val != (Object)null && !val.isPlayerDead && ((NetworkBehaviour)val).IsSpawned && val.isPlayerControlled) { StartDancingServerRpc(val.playerClientId, ((NetworkBehaviour)val).OwnerClientId, usage); } else { flag = false; } if (flag) { UpdateUsageServerRpc(); UsedServerRpc(); } } [ServerRpc(RequireOwnership = false)] private void UpdateUsageServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2057626749u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2057626749u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { UpdateUsageClientRpc(); } } } [ClientRpc] private void UpdateUsageClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1198034891u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1198034891u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { usage++; if (usage >= musicClips.Length) { canUseDeathNote = false; SetControlTips(); } } } [ServerRpc(RequireOwnership = false)] private void StartDancingServerRpc(ulong playerId, ulong clientId, int musicID) { //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_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_0106: 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) //IL_010c: 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_0120: 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 val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3396234143u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, clientId); BytePacker.WriteValueBitPacked(val2, musicID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3396234143u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); val3.Send = new ClientRpcSendParams { TargetClientIds = new ulong[1] { clientId } }; ClientRpcParams clientRpcParams = val3; StartMusicClientRpc(playerId, musicClips[musicID]); StartDancingClientRpc(playerId, clientRpcParams); } } } [ClientRpc] private void StartMusicClientRpc(ulong playerId, int realMusicID) { //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_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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3289818117u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); BytePacker.WriteValueBitPacked(val2, realMusicID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3289818117u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); danceActivated = true; if (component.itemAudio.isPlaying) { component.itemAudio.Stop(); } component.itemAudio.PlayOneShot(Plugin.audioClips[realMusicID], 1.2f); glowObj = Object.Instantiate<GameObject>(glowPrefab, ((Component)component).transform.position + Vector3.up, Quaternion.identity, ((Component)component).transform); Object.Destroy((Object)(object)glowObj.gameObject, transitionTime + danceTime + 0.1f); } } [ClientRpc] private void StartDancingClientRpc(ulong playerId, ClientRpcParams clientRpcParams = default(ClientRpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(64684118u, clientRpcParams, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 64684118u, clientRpcParams, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); ((MonoBehaviour)this).StartCoroutine(DanceOrDie(component)); } } } private IEnumerator DanceOrDie(PlayerControllerB player) { GameObject warning = Object.Instantiate<GameObject>(warningPrefab); Object.Destroy((Object)(object)warning, transitionTime + 0.5f); yield return (object)new WaitForSeconds(transitionTime); float actualTime = 0f; while (!((Object)(object)player == (Object)null) && !player.isPlayerDead && !(actualTime >= danceTime)) { if (!player.performingEmote || player.playerBodyAnimator.GetInteger("emoteNumber") == 2) { while (player.isGrabbingObjectAnimation) { yield return (object)new WaitForEndOfFrame(); } KillInAreaDanceNoteServerRpc(player.playerClientId, ((Component)player).transform.position); break; } if (actualTime + 0.1f >= danceTime) { Effects.Audio(51, 0.8f); } yield return (object)new WaitForSeconds(0.1f); actualTime += 0.1f; } EndDanceServerRpc(); } [ServerRpc(RequireOwnership = false)] private void KillInAreaDanceNoteServerRpc(ulong playerId, 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_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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1338751637u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1338751637u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { KillInAreaDanceNoteClientRpc(playerId, position); } } } [ClientRpc] private void KillInAreaDanceNoteClientRpc(ulong playerId, 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_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_0096: 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_012c: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2838246837u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2838246837u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); if (component.itemAudio.isPlaying) { component.itemAudio.Stop(); } if ((Object)(object)glowObj != (Object)null) { Object.Destroy((Object)(object)glowObj.gameObject); } Object.Instantiate<GameObject>(glowboomPrefab, position, Quaternion.identity); Landmine.SpawnExplosion(position + Vector3.up * 0.25f, false, 3f, 6f, 60, 5f, (GameObject)null, false); } } [ServerRpc(RequireOwnership = false)] private void SyncDanceNoteServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3477741945u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3477741945u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SyncDanceNoteClientRpc(danceActivated, usage); } } } [ClientRpc] private void SyncDanceNoteClientRpc(bool danceFlag, int usageNb) { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3050142109u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref danceFlag, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, usageNb); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3050142109u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { danceActivated = danceFlag; usage = usageNb; if (usage >= musicClips.Length) { canUseDeathNote = false; } } } [ServerRpc(RequireOwnership = false)] private void EndDanceServerRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(201801836u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 201801836u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { EndDanceClientRpc(); } } } [ClientRpc] private void EndDanceClientRpc() { //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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4217778424u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4217778424u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { danceActivated = false; } } } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_DanceNote() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2057626749u, new RpcReceiveHandler(__rpc_handler_2057626749)); NetworkManager.__rpc_func_table.Add(1198034891u, new RpcReceiveHandler(__rpc_handler_1198034891)); NetworkManager.__rpc_func_table.Add(3396234143u, new RpcReceiveHandler(__rpc_handler_3396234143)); NetworkManager.__rpc_func_table.Add(3289818117u, new RpcReceiveHandler(__rpc_handler_3289818117)); NetworkManager.__rpc_func_table.Add(64684118u, new RpcReceiveHandler(__rpc_handler_64684118)); NetworkManager.__rpc_func_table.Add(1338751637u, new RpcReceiveHandler(__rpc_handler_1338751637)); NetworkManager.__rpc_func_table.Add(2838246837u, new RpcReceiveHandler(__rpc_handler_2838246837)); NetworkManager.__rpc_func_table.Add(3477741945u, new RpcReceiveHandler(__rpc_handler_3477741945)); NetworkManager.__rpc_func_table.Add(3050142109u, new RpcReceiveHandler(__rpc_handler_3050142109)); NetworkManager.__rpc_func_table.Add(201801836u, new RpcReceiveHandler(__rpc_handler_201801836)); NetworkManager.__rpc_func_table.Add(4217778424u, new RpcReceiveHandler(__rpc_handler_4217778424)); } private static void __rpc_handler_2057626749(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; ((DanceNote)(object)target).UpdateUsageServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1198034891(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)2; ((DanceNote)(object)target).UpdateUsageClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3396234143(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) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); int musicID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref musicID); target.__rpc_exec_stage = (__RpcExecStage)1; ((DanceNote)(object)target).StartDancingServerRpc(playerId, clientId, musicID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3289818117(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) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); int realMusicID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref realMusicID); target.__rpc_exec_stage = (__RpcExecStage)2; ((DanceNote)(object)target).StartMusicClientRpc(playerId, realMusicID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_64684118(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); ClientRpcParams client = rpcParams.Client; target.__rpc_exec_stage = (__RpcExecStage)2; ((DanceNote)(object)target).StartDancingClientRpc(playerId, client); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1338751637(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_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) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((DanceNote)(object)target).KillInAreaDanceNoteServerRpc(playerId, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2838246837(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_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) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)2; ((DanceNote)(object)target).KillInAreaDanceNoteClientRpc(playerId, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3477741945(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; ((DanceNote)(object)target).SyncDanceNoteServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3050142109(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool danceFlag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref danceFlag, default(ForPrimitives)); int usageNb = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref usageNb); target.__rpc_exec_stage = (__RpcExecStage)2; ((DanceNote)(object)target).SyncDanceNoteClientRpc(danceFlag, usageNb); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_201801836(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 refe