using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LCWildCardMod.Config; using LCWildCardMod.Items; using LCWildCardMod.NetcodePatcher; using LCWildCardMod.Patches; using LCWildCardMod.Utils; using LethalCompanyInputUtils.Api; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Steamworks; using TMPro; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.Audio; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("LethalCompanyInputUtils")] [assembly: IgnoresAccessChecksTo("LethalLib")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace LCWildCardMod { [BepInPlugin("deB.WildCard", "WILDCARD Stuff", "2.0.6")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class WildCardMod : BaseUnityPlugin { public const string ModGUID = "deB.WildCard"; public const string ModName = "WILDCARD Stuff"; public const string ModVersion = "2.0.6"; private static ReadOnlyDictionary publicHarmonies = null; private static ReadOnlyCollection publicScrapList = null; private static ReadOnlyCollection publicSkinList = null; private static ReadOnlyCollection publicMapObjectList = null; private static readonly Dictionary harmonies = new Dictionary(); internal static readonly List scrapList = new List(); internal static readonly List skinList = new List(); internal static readonly List mapObjectList = new List(); private bool initialized = false; internal ManualLogSource Log => ((BaseUnityPlugin)this).Logger; internal static Dictionary Harmonies => harmonies; public static KeyBinds KeyBinds { get; private set; } public static WildCardMod Instance { get; private set; } public static WildCardConfig ModConfig { get; private set; } public static ReadOnlyDictionary HarmonyTypes { get { if (publicHarmonies == null) { publicHarmonies = new ReadOnlyDictionary(new Dictionary(Harmonies.Select((KeyValuePair x) => new KeyValuePair(x.Key, x.Value.Item2)))); } return publicHarmonies; } } public static ReadOnlyCollection ScrapList { get { if (publicScrapList == null) { publicScrapList = new ReadOnlyCollection(scrapList); } return publicScrapList; } } public static ReadOnlyCollection SkinList { get { if (publicSkinList == null) { publicSkinList = new ReadOnlyCollection(skinList); } return publicSkinList; } } public static ReadOnlyCollection MapObjectList { get { if (publicMapObjectList == null) { publicMapObjectList = new ReadOnlyCollection(mapObjectList); } return publicMapObjectList; } } private void Awake() { Instance = this; KeyBinds = new KeyBinds(); InitializeMethods(); try { LoadFromBundle(); } catch (Exception ex) { Log.LogError((object)"WILDCARD Stuff Failed to Load!"); Log.LogError((object)ex); return; } if (AssetUpdate()) { Log.LogInfo((object)"WILDCARD Stuff Successfully Loaded"); initialized = true; } } internal bool AssetUpdate(AssetType toUpdate = AssetType.All) { bool result = true; try { InitializeAssets(toUpdate); HandleHarmony(toUpdate); } catch (Exception ex) { if (initialized) { Log.LogWarning((object)"WILDCARD Stuff Failed to Update Assets!"); Log.LogWarning((object)ex); } else { Log.LogError((object)"WILDCARD Stuff Failed to Load!"); Log.LogError((object)ex); } result = false; } return result; } private void InitializeMethods() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); for (int j = 0; j < methods.Length; j++) { object[] customAttributes = methods[j].GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methods[j].Invoke(null, null); } } } } private void LoadFromBundle() { AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "wildcardmod")); string[] allAssetNames = val.GetAllAssetNames(); for (int i = 0; i < allAssetNames.Length; i++) { switch (allAssetNames[i].Substring(0, allAssetNames[i].LastIndexOf('/'))) { case "assets/my creations/scrap items": scrapList.Add(val.LoadAsset(allAssetNames[i])); break; case "assets/my creations/skins": skinList.Add(val.LoadAsset(allAssetNames[i])); break; case "assets/my creations/map objects": mapObjectList.Add(val.LoadAsset(allAssetNames[i])); break; default: Log.LogWarning((object)("\"" + allAssetNames[i] + "\" is not a known asset path, skipping.")); break; } } } private void ModifyPrefab(GameObject toModify) { toModify.GetComponentInChildren()?.Initialize(); NetworkPrefabs.RegisterNetworkPrefab(toModify); } private void InitializeAssets(AssetType toUpdate) { if (!initialized) { ModConfig = new WildCardConfig(((BaseUnityPlugin)this).Config, scrapList, skinList, mapObjectList); } ModConfig.ResetReadonlyDicts(); bool flag = toUpdate == AssetType.All; if (flag || toUpdate.HasFlag(AssetType.Scrap)) { InitializeScraps(); } if (flag || toUpdate.HasFlag(AssetType.Skin)) { InitializeSkins(); } if (flag || toUpdate.HasFlag(AssetType.MapObject)) { InitializeMapObjects(); } } private void InitializeScraps() { //IL_01c0: Unknown result type (might be due to invalid IL or missing references) publicScrapList = null; for (int i = 0; i < scrapList.Count; i++) { WildCardItem item = scrapList[i]; string itemName = ((Item)item).itemName; bool enabled = item.enabled; item.enabled = ModConfig.ScrapEnabled[itemName]; if (!item.enabled) { if (enabled) { if (ILifeSaver.IsLifeSaver(((Item)item).spawnPrefab, out var lifeSaver)) { ILifeSaver.AllLifeSavers.Remove(lifeSaver.GetType().Name); } Items.RemoveScrapFromLevels((Item)(object)item, (LevelTypes)(-1), (string[])null); Items.scrapItems.Remove(((IEnumerable)Items.scrapItems).FirstOrDefault((Func)((ScrapItem x) => (Object)(object)x.origItem == (Object)(object)item))); Log.LogInfo((object)("\"" + itemName + "\" scrap was disabled!")); } } else { if (enabled) { continue; } if (ILifeSaver.IsLifeSaver(((Item)item).spawnPrefab, out var lifeSaver2)) { ILifeSaver.AllLifeSavers.Add(lifeSaver2.GetType().Name, new List()); } Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); string[] array = ModConfig.ScrapSpawnWeights[itemName].Split(","); for (int num = 0; num < array.Length; num++) { string[] array2 = array[num].Split(':'); if (array2.Length == 2 && int.TryParse(array2[1], out var result)) { string text = array2[0]; if (Enum.TryParse(text, out LevelTypes result2)) { dictionary.Add(result2, result); } else { dictionary2.Add(text, result); } } } ModifyPrefab(((Item)item).spawnPrefab); Items.RegisterScrap((Item)(object)item, dictionary, dictionary2); Log.LogDebug((object)("\"" + itemName + "\" scrap was enabled!")); } } } private void InitializeSkins() { publicSkinList = null; for (int i = 0; i < skinList.Count; i++) { WildCardSkin wildCardSkin = skinList[i]; string skinName = wildCardSkin.skinName; bool enabled = wildCardSkin.enabled; wildCardSkin.enabled = ModConfig.SkinEnabled[skinName]; if (!wildCardSkin.enabled) { if (enabled) { Log.LogInfo((object)("\"" + skinName + "\" skin was disabled!")); } } else if (!enabled) { Log.LogDebug((object)("\"" + skinName + "\" skin was enabled!")); } } } private void InitializeMapObjects() { publicMapObjectList = null; WildCardProp oldMapObjectScrap = default(WildCardProp); WildCardProp mapObjectScrap = default(WildCardProp); for (int i = 0; i < mapObjectList.Count; i++) { WildCardMapObject mapObject = mapObjectList[i]; string mapObjectName = mapObject.mapObjectName; bool enabled = mapObject.enabled; if (mapObject.autoHandle) { bool enabled2 = true; if (mapObject.configBools != null) { for (int j = 0; j < mapObject.configBools.Length; j++) { if ((ModConfig.ScrapEnabled.TryGetValue(mapObject.configBools[j], out var value) || ModConfig.SkinEnabled.TryGetValue(mapObject.configBools[j], out value) || ModConfig.MapObjectEnabled.TryGetValue(mapObject.configBools[j], out value)) && !value) { enabled2 = false; break; } } } mapObject.enabled = enabled2; } else { mapObject.enabled = ModConfig.MapObjectEnabled.TryGetValue(mapObjectName, out var value2) && value2; } if (!mapObject.enabled) { if (!enabled) { continue; } WildUtils.RemoveMapObject((IndoorMapHazardType)(object)mapObject, (LevelTypes)(-1)); MapObjects.mapObjects.Remove(((IEnumerable)MapObjects.mapObjects).FirstOrDefault((Func)((RegisteredMapObject x) => (Object)(object)x.indoorMapHazardType == (Object)(object)mapObject))); if (((IndoorMapHazardType)mapObject).prefabToSpawn.TryGetComponent(ref oldMapObjectScrap)) { Items.plainItems.Remove(((IEnumerable)Items.plainItems).FirstOrDefault((Func)((PlainItem x) => (Object)(object)x.item == (Object)(object)((GrabbableObject)oldMapObjectScrap).itemProperties))); } Log.LogInfo((object)("\"" + mapObjectName + "\" map object was disabled!")); } else if (!enabled) { ModifyPrefab(((IndoorMapHazardType)mapObject).prefabToSpawn); if (((IndoorMapHazardType)mapObject).prefabToSpawn.TryGetComponent(ref mapObjectScrap) && Items.plainItems.Find((PlainItem x) => (Object)(object)x.item == (Object)(object)((GrabbableObject)mapObjectScrap).itemProperties) == null) { ModifyPrefab(((GrabbableObject)mapObjectScrap).itemProperties.spawnPrefab); Items.RegisterItem(((GrabbableObject)mapObjectScrap).itemProperties); } WildUtils.RegisterMapObject((IndoorMapHazardType)(object)mapObject, (LevelTypes)(-1), mapObject.GetCurveFunc()); Log.LogDebug((object)("\"" + mapObjectName + "\" map object was enabled!")); } } } private void HandleHarmony(AssetType toUpdate) { publicHarmonies = null; bool flag = toUpdate == AssetType.All; if (flag) { HarmonyHelper.TogglePatches("deB.WildCard", true, typeof(NecessaryPatches)); } if (flag || toUpdate.HasFlag(AssetType.Scrap)) { HarmonyHelper.TogglePatches("deB.WildCard.cojiro", ModConfig.ScrapEnabled.TryGetValue("Cojiro", out var value) && value, typeof(CojiroPatches)); HarmonyHelper.TogglePatches("deB.WildCard.save", ILifeSaver.AnyEnabled, typeof(SavePatches)); HarmonyHelper.TogglePatches("deB.WildCard.grace", ILifeSaver.AnyEnabled, typeof(EnemyAIGraceSavePatch)); } if (flag || toUpdate.HasFlag(AssetType.Skin)) { HarmonyHelper.TogglePatches("deB.WildCard.skins", WildCardSkin.AnyEnabled, typeof(SkinsPatches)); } HarmonyHelper.TogglePatches("deB.WildCard.debug", ModConfig.Debug, typeof(DebugPatches)); } } } namespace LCWildCardMod.Utils { [CreateAssetMenu(menuName = "WildCard/Item", order = 1)] public class WildCardItem : Item { [Space(3f)] [Header("WildCardItem")] [Space(3f)] public bool defaultEnabled = true; public string defaultRarities = string.Empty; public bool usesButton = false; public bool enemyCanActivate = false; public bool enemyCanUseButton = false; public bool syncEnemyButton = false; internal bool enabled = false; } [CreateAssetMenu(menuName = "WildCard/Skin", order = 2)] public class WildCardSkin : ScriptableObject { public SkinType type; public string skinName; public string target; public bool skinEnabled; public int skinChance; public Mesh newMesh; public Material newMaterial; public AudioClip[] newAudioClips; public RuntimeAnimatorController newAnimationController; internal bool enabled = false; private static ManualLogSource Log => WildCardMod.Instance.Log; internal static bool AnyEnabled => WildCardMod.skinList.Any((WildCardSkin x) => x.enabled); internal static void SetSkin(EnemyAI enemy) { WildCardSkin randomSkin = GetRandomSkin(enemy.enemyType.enemyName, SkinType.Enemy); if (!((Object)(object)randomSkin == (Object)null)) { string text = randomSkin.target; string text2 = text; if (text2 == "Earth Leviathan") { Log.LogDebug((object)("Skin \"" + randomSkin.skinName + "\" is being applied!")); Transform val = ((Component)enemy).transform.Find("MeshContainer"); SkinnedMeshRenderer component = ((Component)val.Find("Renderer")).GetComponent(); component.sharedMesh = randomSkin.newMesh; ((Renderer)component).sharedMaterial = randomSkin.newMaterial; ((Component)val.Find("Armature").Find("Bone").Find("Bone.001") .Find("Bone.003") .Find("Bone.002") .Find("ScanNode")).GetComponent().headerText = randomSkin.skinName; SandWormAI component2 = ((Component)((Component)enemy).transform).GetComponent(); component2.ambientRumbleSFX[0] = randomSkin.newAudioClips[0]; component2.ambientRumbleSFX[1] = randomSkin.newAudioClips[0]; component2.ambientRumbleSFX[2] = randomSkin.newAudioClips[0]; AudioSource creatureSFX = ((EnemyAI)component2).creatureSFX; creatureSFX.volume *= 1.5f; component2.roarSFX[0] = randomSkin.newAudioClips[1]; component2.roarSFX[1] = randomSkin.newAudioClips[2]; } else { Log.LogError((object)("\"" + randomSkin.skinName + "\" did not match any known enemy type!")); } } } internal static void SetSkin(GrabbableObject item) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) WildCardSkin randomSkin = GetRandomSkin(item.itemProperties.itemName, SkinType.Item); if (!((Object)(object)randomSkin == (Object)null)) { string text = randomSkin.target; string text2 = text; if (text2 == "Clown horn") { Log.LogDebug((object)("Skin \"" + randomSkin.skinName + "\" is being applied!")); Item val = Object.Instantiate(item.itemProperties); val.itemName = randomSkin.skinName; val.isConductiveMetal = false; val.grabSFX = randomSkin.newAudioClips[0]; val.dropSFX = randomSkin.newAudioClips[1]; val.toolTips[0] = "Squeeze : [LMB]"; val.positionOffset = new Vector3(0.05f, 0.15f, -0.05f); item.useCooldown = 0.5f; MeshFilter component = val.spawnPrefab.GetComponent(); component.mesh = randomSkin.newMesh; component.sharedMesh = randomSkin.newMesh; MeshFilter component2 = ((Component)((Component)item).transform).GetComponent(); component2.mesh = randomSkin.newMesh; component2.sharedMesh = randomSkin.newMesh; MeshRenderer component3 = ((Component)((Component)item).transform).GetComponent(); ((Renderer)component3).material = randomSkin.newMaterial; ((Renderer)component3).sharedMaterial = randomSkin.newMaterial; ((Component)((Component)item).transform.Find("ScanNode")).GetComponent().headerText = randomSkin.skinName; Animator val2 = ((Component)item).gameObject.AddComponent(); val2.runtimeAnimatorController = randomSkin.newAnimationController; ((Component)((Component)item).transform).GetComponent().triggerAnimator = val2; item.itemProperties = val; } else { Log.LogError((object)("\"" + randomSkin.skinName + "\" did not match any known item!")); } } } private static WildCardSkin GetRandomSkin(string target, SkinType type) { Random random = new Random(StartOfRound.Instance.randomMapSeed + 69); int num = 0; int num2 = 0; List list = new List(); for (int i = 0; i < WildCardMod.skinList.Count; i++) { WildCardSkin wildCardSkin = WildCardMod.skinList[i]; if (wildCardSkin.enabled && wildCardSkin.type == type && !(wildCardSkin.target != target)) { list.Add(wildCardSkin); } } if (list.Count == 0) { return null; } for (int j = 0; j < list.Count; j++) { WildCardSkin wildCardSkin2 = list[j]; string text = wildCardSkin2.skinName; int num3 = WildCardMod.ModConfig.SkinApplyChance[text]; if (num3 <= 0) { Log.LogDebug((object)("Skin \"" + text + "\" was disabled!")); list.RemoveAt(j); j--; } else { Log.LogDebug((object)("Adding skin \"" + text + "\"'s chance weight!")); num2 += num3; num += 100 - num3; } } float num4 = (float)random.NextDouble(); Log.LogDebug((object)"Rolling to see if a skin will be applied!"); float num5 = 1f / (float)num; float num6 = 1f / (float)num2; if ((float)num * (num5 + num6) >= num4) { return null; } for (int num7 = list.Count - 1; num7 > 1; num7--) { int num8 = random.Next(num7 + 1); List list2 = list; int index = num7; int index2 = num8; WildCardSkin value = list[num8]; WildCardSkin value2 = list[num7]; list2[index] = value; list[index2] = value2; } for (int k = 0; k < list.Count; k++) { WildCardSkin wildCardSkin3 = list[k]; string text2 = wildCardSkin3.skinName; Log.LogDebug((object)("Rolling to see if \"" + text2 + "\" is selected!")); if ((float)WildCardMod.ModConfig.SkinApplyChance[text2] * num6 >= num4) { Log.LogDebug((object)("Skin \"" + text2 + "\" was selected!")); return wildCardSkin3; } } return null; } } [CreateAssetMenu(menuName = "WildCard/MapObject", order = 3)] public class WildCardMapObject : IndoorMapHazardType { public string mapObjectName; public List> levelCurves; public bool autoHandle; public string[] configBools; internal bool enabled = false; public Func GetCurveFunc() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown AnimationCurve curve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), new Keyframe(1f, 2f) }); if (levelCurves != null && (autoHandle || WildCardMod.ModConfig.DefaultMapObjectCurve[mapObjectName])) { return delegate(SelectableLevel val) { for (int i = 0; i < levelCurves.Count; i++) { SelectablePair selectablePair = levelCurves[i]; string id = selectablePair.id; if (!(id != ((Object)val).name)) { curve = selectablePair.selectable; break; } } return curve; }; } if (WildCardMod.ModConfig.MapObjectMinMax.TryGetValue(mapObjectName, out var value)) { int x = ((Vector2Int)(ref value)).x; int y = ((Vector2Int)(ref value)).y; ((Keyframe)(ref curve.keys[0])).value = x; ((Keyframe)(ref curve.keys[1])).value = (float)(x + y) * 0.5f; ((Keyframe)(ref curve.keys[2])).value = y; } return (SelectableLevel val) => curve; } } [Serializable] public class SelectLights : Selectable { [SerializeField] public bool enableOnSpawn = true; [SerializeField] public bool disableWhilePocketed = true; public SelectLights(int id, params Light[] arrayItems) : base(id, arrayItems) { } public override void Initialize(IWildCardBase wildCardBase) { base.Initialize(wildCardBase); Set(((Component)wildCardBase.Transform).GetComponentsInChildren()); } public void EnableAll(bool networked = true) { for (int i = 0; i < base.Count; i++) { Enable(i, networked: false); } if (networked) { base.Base.SetLightEnabledNetworked(base.Id, enable: true); } } public void Enable(int index, bool networked = true) { if (InRange(index)) { SetEnabled(index, enable: true); if (networked) { base.Base.SetLightEnabledNetworked(base.Id, enable: true, index); } } } public void DisableAll(bool networked = true) { for (int i = 0; i < base.Count; i++) { Disable(i, networked: false); } if (networked) { base.Base.SetLightEnabledNetworked(base.Id, enable: false); } } public void Disable(int index, bool networked = true) { if (InRange(index)) { SetEnabled(index, enable: false); if (networked) { base.Base.SetLightEnabledNetworked(base.Id, enable: false, index); } } } private void SetEnabled(int index, bool enable) { if (InRange(index)) { ((Behaviour)base[index]).enabled = enable; } } } [Serializable] public class SelectRenderers : SelectableWithTextures { [SerializeField] public bool applyOnAwake = false; [SerializeField] public List meshes = null; [SerializeField] public bool enabled = true; [SerializeField] public ShadowCastingMode shadowMode = (ShadowCastingMode)1; [SerializeField] public MotionVectorGenerationMode motionMode = (MotionVectorGenerationMode)0; public SelectRenderers(int id, params Renderer[] arrayItems) : base(id, arrayItems) { }//IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) public override void Initialize(IWildCardBase wildCardBase) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_002b: Unknown result type (might be due to invalid IL or missing references) base.Initialize(wildCardBase); for (int i = 0; i < base.Count; i++) { Renderer val = base[i]; if ((int)val.motionVectorGenerationMode == 1) { val.motionVectorGenerationMode = motionMode; } } } public override void SetMaterialsTexture(int itemIndex, int textureIndex) { if (InRange(itemIndex) && InRangeTextures(textureIndex)) { int num = base[itemIndex].materials.Length; for (int i = 0; i < num; i++) { SetMaterialTexture(itemIndex, i, textureIndex); } } } public override void SetMaterialTexture(int itemIndex, int materialIndex, int textureIndex) { if (InRange(itemIndex) && InRangeTextures(textureIndex)) { Material[] materials = base[itemIndex].materials; if (materialIndex >= 0 && materialIndex < materials.Length) { materials[materialIndex].mainTexture = GetTexture(textureIndex); } } } public void AllApplyAll() { for (int i = 0; i < base.Count; i++) { ApplyAll(i); } } public void ApplyAll(int index) { if (InRange(index)) { ApplySettings(index); } } public void AllApplySettings() { for (int i = 0; i < base.Count; i++) { ApplySettings(i); } } public void ApplySettings(int index) { //IL_0029: 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) if (InRange(index)) { Renderer val = base[index]; val.enabled = enabled; val.shadowCastingMode = shadowMode; val.motionVectorGenerationMode = motionMode; } } public void AllApplyMeshes(int index) { if (InRangeMeshes(index)) { for (int i = 0; i < base.Count; i++) { ApplyMesh(i, index); } } } public void ApplyMesh(int index, int meshIndex) { Renderer val = base[index]; Mesh sharedMesh = meshes[meshIndex]; Renderer val2 = val; Renderer val3 = val2; MeshRenderer val4 = (MeshRenderer)(object)((val3 is MeshRenderer) ? val3 : null); if (val4 == null) { SkinnedMeshRenderer val5 = (SkinnedMeshRenderer)(object)((val3 is SkinnedMeshRenderer) ? val3 : null); if (val5 != null) { val5.sharedMesh = sharedMesh; } } else { ((Component)val4).GetComponent().sharedMesh = sharedMesh; } } public void AddMeshes(params Mesh[] newMeshes) { foreach (Mesh item in newMeshes) { if (!meshes.Contains(item)) { meshes.Add(item); } } } public void SetMeshes(params Mesh[] newMeshes) { meshes = newMeshes.ToList(); } public void SetMesh(int index, Mesh newMesh) { if (InRangeMeshes(index)) { meshes[index] = newMesh; } } public void RemoveMeshes(params Mesh[] toRemoveMeshes) { for (int i = 0; i < toRemoveMeshes.Length; i++) { meshes.Remove(toRemoveMeshes[i]); } } public void RemoveMeshes(int start, int count) { if (InRangeMeshes(start) && InRangeMeshes(start + count) && count > 0) { meshes.RemoveRange(start, count); } } public void RemoveMesh(int index) { if (InRangeMeshes(index)) { RemoveMeshes(index, 1); } } public void ClearMeshes() { SetMeshes(); } public bool InRangeMeshes(int index) { return index >= 0 && index < meshes.Count; } public int IndexOfMesh(Mesh mesh) { return meshes.IndexOf(mesh); } public void SetColours(float multiplier) { for (int i = 0; i < base.Count; i++) { SetColour(i, multiplier); } } public void SetColour(int index, float multiplier) { if (InRange(index)) { int num = base[index].materials.Length; for (int i = 0; i < num; i++) { SetColourMaterial(index, i, multiplier); } } } public void SetColourMaterial(int index, int materialIndex, float multiplier) { //IL_003a: 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) if (InRange(index)) { Material[] materials = base[index].materials; if (materialIndex >= 0 && materialIndex < materials.Length) { Material obj = materials[materialIndex]; obj.color *= multiplier; } } } public void SetColours(Color color, bool multiply = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < base.Count; i++) { SetColour(i, color, multiply); } } public void SetColour(int index, Color color, bool multiply = false) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { int num = base[index].materials.Length; for (int i = 0; i < num; i++) { SetColourMaterial(index, i, color, multiply); } } } public void SetColourMaterial(int index, int materialIndex, Color color, bool multiply = false) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (!InRange(index)) { return; } Material[] materials = base[index].materials; if (materialIndex >= 0 && materialIndex < materials.Length) { if (multiply) { Material obj = materials[materialIndex]; obj.color *= color; } else { materials[materialIndex].color = color; } } } public void SetOffsets(Vector2 offset) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < base.Count; i++) { SetOffset(i, offset); } } public void SetOffset(int index, Vector2 offset) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { int num = base[index].materials.Length; for (int i = 0; i < num; i++) { SetOffsetMaterial(index, i, offset); } } } public void SetOffsetMaterial(int index, int materialIndex, Vector2 offset) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { Material[] materials = base[index].materials; if (materialIndex >= 0 && materialIndex < materials.Length) { materials[materialIndex].mainTextureOffset = offset; } } } } [Serializable] public class SelectParticles : SelectableWithTextures { [SerializeField] public bool applyOnAwake = false; [SerializeField] public bool playOnAwake = false; [SerializeField] public bool looping = true; [SerializeField] public bool useGravity = true; [Min(0f)] [SerializeField] public float duration = 1f; [Min(0f)] [SerializeField] public float simulationSpeed = 1f; [Min(0f)] [SerializeField] public float minLife = 1f; [Min(0f)] [SerializeField] public float maxLife = 1f; [SerializeField] public float minGravity = 0f; [SerializeField] public float maxGravity = 0f; [Min(0f)] [SerializeField] public float minSize = 0.05f; [Min(0f)] [SerializeField] public float maxSize = 0.05f; [Range(-180f, 180f)] [SerializeField] public float minRotation = 0f; [Range(-180f, 180f)] [SerializeField] public float maxRotation = 0f; [Range(0f, 1f)] [SerializeField] public float flipAmount = 0f; [Min(1f)] [SerializeField] public int maxParticles = 5; [Min(0f)] [SerializeField] public float minTimeRate = 0f; [Min(0f)] [SerializeField] public float maxTimeRate = 0f; [Min(0f)] [SerializeField] public float minDistanceRate = 0f; [Min(0f)] [SerializeField] public float maxDistanceRate = 0f; [SerializeField] public List bursts = new List(); public SelectParticles(int id, params ParticleSystem[] systems) : base(id, systems.Select((ParticleSystem x) => Particles.Create(x)).ToArray()) { } public override void SetMaterialsTexture(int itemIndex, int textureIndex) { if (InRange(itemIndex) && InRangeTextures(textureIndex)) { int num = ((Renderer)base[itemIndex].Renderer).materials.Length; for (int i = 0; i < num; i++) { SetMaterialTexture(itemIndex, i, textureIndex); } } } public override void SetMaterialTexture(int itemIndex, int materialIndex, int textureIndex) { if (InRange(itemIndex) && InRangeTextures(textureIndex)) { Material[] materials = ((Renderer)base[itemIndex].Renderer).materials; if (materialIndex >= 0 && materialIndex < materials.Length) { materials[materialIndex].mainTexture = GetTexture(textureIndex); } } } public void AllApplyAll() { for (int i = 0; i < base.Count; i++) { ApplyAll(i); } } public void ApplyAll(int index) { if (InRange(index)) { ApplySize(index); ApplyGravity(index); ApplyLifetime(index); ApplyRotation(index); ApplyEmission(index); } } public void SetColours(float multiplier) { for (int i = 0; i < base.Count; i++) { SetColour(i, multiplier); } } public void SetColour(int index, float multiplier) { if (InRange(index)) { int num = ((Renderer)base[index].Renderer).materials.Length; for (int i = 0; i < num; i++) { SetColourMaterial(index, i, multiplier); } } } public void SetColourMaterial(int index, int materialIndex, float multiplier) { //IL_003f: 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) if (InRange(index)) { Material[] materials = ((Renderer)base[index].Renderer).materials; if (materialIndex >= 0 && materialIndex < materials.Length) { Material obj = materials[materialIndex]; obj.color *= multiplier; } } } public void SetColours(Color color, bool multiply = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < base.Count; i++) { SetColour(i, color, multiply); } } public void SetColour(int index, Color color, bool multiply = false) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { int num = ((Renderer)base[index].Renderer).materials.Length; for (int i = 0; i < num; i++) { SetColourMaterial(index, i, color, multiply); } } } public void SetColourMaterial(int index, int materialIndex, Color color, bool multiply = false) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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) if (!InRange(index)) { return; } Material[] materials = ((Renderer)base[index].Renderer).materials; if (materialIndex >= 0 && materialIndex < materials.Length) { if (multiply) { Material obj = materials[materialIndex]; obj.color *= color; } else { materials[materialIndex].color = color; } } } public void AllApplyEmission(bool replace, params BurstIntermediary[] newBursts) { if (replace) { SetBursts(newBursts); } else { AddBursts(newBursts); } AllApplyEmission(); } public void AllApplyEmission() { for (int i = 0; i < base.Count; i++) { ApplyEmission(i); } } public void ApplyEmission(int index, bool replace, params BurstIntermediary[] newBursts) { if (InRange(index)) { if (replace) { SetBursts(newBursts); } else { AddBursts(newBursts); } ApplyEmission(index); } } public void ApplyEmission(int index) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { ParticleSystem system = base[index].System; MainModule main = system.main; ((MainModule)(ref main)).maxParticles = maxParticles; EmissionModule emission = system.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; MinMaxCurve rateOverDistance = ((EmissionModule)(ref emission)).rateOverDistance; if (Mathf.Approximately(minTimeRate, maxTimeRate)) { ((MinMaxCurve)(ref rateOverTime)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref rateOverTime)).constant = minTimeRate; ((EmissionModule)(ref emission)).rateOverTimeMultiplier = 1f; } else { ((MinMaxCurve)(ref rateOverTime)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref rateOverTime)).constantMin = minTimeRate; ((MinMaxCurve)(ref rateOverTime)).constantMax = maxTimeRate; } if (Mathf.Approximately(minDistanceRate, maxDistanceRate)) { ((MinMaxCurve)(ref rateOverDistance)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref rateOverDistance)).constant = minDistanceRate; ((EmissionModule)(ref emission)).rateOverDistanceMultiplier = 1f; } else { ((MinMaxCurve)(ref rateOverDistance)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref rateOverDistance)).constantMin = minDistanceRate; ((MinMaxCurve)(ref rateOverDistance)).constantMax = maxDistanceRate; } ((EmissionModule)(ref emission)).rateOverTime = rateOverTime; ((EmissionModule)(ref emission)).rateOverDistance = rateOverDistance; Burst[] array = (Burst[])(object)new Burst[bursts.Count]; for (int i = 0; i < bursts.Count; i++) { array[i] = WildUtils.CreateBurst(bursts[i]); } ((EmissionModule)(ref emission)).SetBursts(array); } } public void AddBursts(params BurstIntermediary[] newBursts) { foreach (BurstIntermediary item in newBursts) { if (!bursts.Contains(item)) { bursts.Add(item); } } } public void SetBursts(params BurstIntermediary[] newBursts) { bursts = newBursts.ToList(); } public void SetBurst(int index, BurstIntermediary newBurst) { if (InRangeBursts(index)) { bursts[index] = newBurst; } } public void ReplaceBurst(int index, BurstIntermediary newBurst) { if (InRangeBursts(index)) { bursts[index] = newBurst; } } public void RemoveBursts(params BurstIntermediary[] toRemoveBursts) { for (int i = 0; i < toRemoveBursts.Length; i++) { bursts.Remove(toRemoveBursts[i]); } } public void RemoveBursts(int start, int count) { if (InRangeBursts(start) && InRangeBursts(start + count) && count > 0) { bursts.RemoveRange(start, count); } } public void RemoveBurst(int index) { if (InRangeBursts(index)) { RemoveBursts(index, 1); } } public void ClearBursts() { SetBursts(); } public void AllApplyTiming() { for (int i = 0; i < base.Count; i++) { ApplyTiming(i); } } public void ApplyTiming(int index) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { MainModule main = base[index].System.main; ((MainModule)(ref main)).loop = looping; ((MainModule)(ref main)).duration = duration; ((MainModule)(ref main)).simulationSpeed = simulationSpeed; } } public void AllApplyRotation() { for (int i = 0; i < base.Count; i++) { ApplyRotation(i); } } public void ApplyRotation(int index) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { MainModule main = base[index].System.main; MinMaxCurve startRotation = ((MainModule)(ref main)).startRotation; if (Mathf.Approximately(minRotation, maxRotation)) { ((MinMaxCurve)(ref startRotation)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref startRotation)).constant = minRotation; ((MainModule)(ref main)).startRotationMultiplier = 1f; } else { ((MinMaxCurve)(ref startRotation)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref startRotation)).constantMin = minRotation; ((MinMaxCurve)(ref startRotation)).constantMax = maxRotation; } ((MainModule)(ref main)).flipRotation = flipAmount; ((MainModule)(ref main)).startRotation = startRotation; } } public void AllApplyLifetime() { for (int i = 0; i < base.Count; i++) { ApplyLifetime(i); } } public void ApplyLifetime(int index) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { MainModule main = base[index].System.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; if (Mathf.Approximately(minLife, maxLife)) { ((MinMaxCurve)(ref startLifetime)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref startLifetime)).constant = minLife; ((MainModule)(ref main)).startLifetimeMultiplier = 1f; } else { ((MinMaxCurve)(ref startLifetime)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref startLifetime)).constantMin = minLife; ((MinMaxCurve)(ref startLifetime)).constantMax = maxLife; } ((MainModule)(ref main)).startLifetime = startLifetime; } } public void AllApplyGravity() { for (int i = 0; i < base.Count; i++) { ApplyGravity(i); } } public void ApplyGravity(int index) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { MainModule main = base[index].System.main; MinMaxCurve gravityModifier = ((MainModule)(ref main)).gravityModifier; float num = minGravity; float constantMax = maxGravity; if (!useGravity) { num = 0f; constantMax = 0f; } if (Mathf.Approximately(minGravity, maxGravity)) { ((MinMaxCurve)(ref gravityModifier)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref gravityModifier)).constant = num; ((MainModule)(ref main)).gravityModifierMultiplier = 1f; } else { ((MinMaxCurve)(ref gravityModifier)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref gravityModifier)).constantMin = num; ((MinMaxCurve)(ref gravityModifier)).constantMax = constantMax; } ((MainModule)(ref main)).gravityModifier = gravityModifier; } } public void AllApplySize() { for (int i = 0; i < base.Count; i++) { ApplySize(i); } } public void ApplySize(int index) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (InRange(index)) { MainModule main = base[index].System.main; MinMaxCurve startSize = ((MainModule)(ref main)).startSize; if (Mathf.Approximately(minSize, maxSize)) { ((MinMaxCurve)(ref startSize)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref startSize)).constant = minSize; ((MainModule)(ref main)).startSizeMultiplier = 1f; } else { ((MinMaxCurve)(ref startSize)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref startSize)).constantMin = minSize; ((MinMaxCurve)(ref startSize)).constantMax = maxSize; } ((MainModule)(ref main)).startSize = startSize; } } public void PlayAll(bool restart = false, bool networked = true) { for (int i = 0; i < base.Count; i++) { Play(i, restart, networked: false); } if (networked) { base.Base.PlayParticlesNetworked(base.Id, restart); } } public void Play(int index, bool restart = false, bool networked = true) { if (InRange(index)) { ParticleSystem system = base[index].System; if (restart) { system.Stop(); } system.Play(); if (networked) { base.Base.PlayParticlesNetworked(base.Id, restart, index); } } } public void StopAll(bool clear, bool networked = true) { for (int i = 0; i < base.Count; i++) { Stop(i, clear, networked: false); } if (networked) { base.Base.StopParticlesNetworked(base.Id, clear); } } public void Stop(int index, bool clear, bool networked = true) { if (InRange(index)) { Particles particles = base[index]; particles.System.Stop(); if (clear) { particles.System.Clear(); } if (networked) { base.Base.StopParticlesNetworked(base.Id, clear, index); } } } public void PauseAll(bool networked = true) { for (int i = 0; i < base.Count; i++) { Pause(i, networked: false); } if (networked) { base.Base.PauseParticlesNetworked(base.Id); } } public void Pause(int index, bool networked = true) { if (InRange(index)) { base[index].System.Pause(); if (networked) { base.Base.PauseParticlesNetworked(base.Id, index); } } } public void ClearAll(bool networked = true) { for (int i = 0; i < base.Count; i++) { Clear(i, networked: false); } if (networked) { base.Base.ClearParticlesNetworked(base.Id); } } public void Clear(int index, bool networked = true) { if (InRange(index)) { base[index].System.Clear(); if (networked) { base.Base.ClearParticlesNetworked(base.Id, index); } } } public void EmitAll(int count, bool networked = true) { for (int i = 0; i < base.Count; i++) { Emit(i, count, networked: false); } if (networked) { base.Base.EmitParticlesNetworked(base.Id, count); } } public void Emit(int index, int count, bool networked = true) { if (InRange(index)) { base[index].System.Emit(count); if (networked) { base.Base.EmitParticlesNetworked(base.Id, count, index); } } } public bool AnyAlive() { for (int i = 0; i < base.Count; i++) { if (base[i].System.IsAlive()) { return true; } } return false; } public bool InRangeBursts(int index) { return index >= 0 && index < bursts.Count; } public int IndexOfBurst(BurstIntermediary burst) { return bursts.IndexOf(burst); } } [Serializable] public class SelectAnimationParameters : SelectRepeater { public SelectAnimationParameters(int id, AnimationHandler animationHandler) : base(id, animationHandler.Base.Random) { SetAnimator(animationHandler); } public SelectAnimationParameters(int id, NetworkAnimator networkAnimator) : this(id, AnimationHandler.Create(networkAnimator)) { } public void SetAllValues(RepeatingAnimation.RandomAnimationType? type = null, params float?[] toChange) { for (int i = 0; i < base.Count; i++) { SetValues(i, type, toChange); } } public void SetValues(int index, RepeatingAnimation.RandomAnimationType? type = null, params float?[] toChange) { if (InRange(index)) { base[index].SetValues(type, toChange); } } public void UpdateAllValues(params float?[] toChange) { for (int i = 0; i < base.Count; i++) { UpdateValues(i, toChange); } } public void UpdateValues(int index, params float?[] toChange) { if (InRange(index)) { base[index].UpdateValues(toChange); } } public void DoAllAnimations(float? overrideValue = null) { for (int i = 0; i < base.Count; i++) { DoAnimation(i, overrideValue); } } public void DoAnimation(int index, float? overrideValue = null) { if (InRange(index)) { base[index].DoAnimation(overrideValue); } } public void SetAnimator(AnimationHandler animator) { for (int i = 0; i < base.Count; i++) { base[i].SetAnimator(animator); } } } [Serializable] public abstract class SelectRepeater : Selectable where T : Repeater { [SerializeField] public bool playOnSpawn = false; [SerializeField] public bool clientsTick = false; public SelectRepeater(int id, Random random) : base(id, Array.Empty()) { SetRandom(random); } public void TickAll() { for (int i = 0; i < base.Count; i++) { Tick(i); } } public void Tick(int index) { if (InRange(index)) { base[index].Tick(); } } public void PauseAll() { for (int i = 0; i < base.Count; i++) { Pause(i); } } public void Pause(int index) { if (InRange(index)) { base[index].Pause(); } } public void ResumeAll() { for (int i = 0; i < base.Count; i++) { Resume(i); } } public void Resume(int index) { if (InRange(index)) { base[index].Resume(); } } public void SetFunctionAll(Func waitFor) { for (int i = 0; i < base.Count; i++) { SetFunction(i, waitFor); } } public void SetFunction(int index, Func waitFor) { if (InRange(index)) { base[index].LoopWaitsFor = waitFor; } } public void PlayAll(bool resetTimer) { for (int i = 0; i < base.Count; i++) { Play(i, resetTimer); } } public void Play(int index, bool resetTimer) { if (InRange(index)) { Repeater repeater = base[index]; if (resetTimer) { repeater.ResetTimer(); } repeater.TimerTrigger(); } } public void PlayAll(Func resetIf) { if (resetIf == null) { resetIf = (Repeater x) => false; } for (int num = 0; num < base.Count; num++) { Play(num, resetIf); } } public void Play(int index, Func resetIf) { if (!InRange(index)) { return; } Repeater repeater = base[index]; if (resetIf == null) { resetIf = (Repeater x) => false; } if (resetIf(repeater)) { repeater.ResetTimer(); } repeater.TimerTrigger(); } public void SetAllTimers(float? newMin = null, float? newMax = null, bool oneTime = false) { for (int i = 0; i < base.Count; i++) { SetTimer(i, newMin, newMax, oneTime); } } public void SetTimer(int index, float? newMin = null, float? newMax = null, bool oneTime = false) { if (InRange(index)) { base[index].SetTimer(newMin, newMax, oneTime); } } public void ResetAllTimers(bool undoOneTime = true) { for (int i = 0; i < base.Count; i++) { ResetTimer(i, undoOneTime); } } public void ResetTimer(int index, bool undoOneTime = true) { if (InRange(index)) { base[index].ResetTimer(undoOneTime); } } public void SetRandom(Random random) { for (int i = 0; i < base.Count; i++) { base[i].SetRandom(random); } } } [Serializable] public class SelectAudioClips : Selectable { [SerializeField] public bool playOnSpawn = false; [SerializeField] private bool hudAudio = false; [SerializeField] private Transform audioParent = null; [SerializeField] private AnimationCurve customCurve = null; [SerializeField] private bool looping = false; [SerializeField] private bool clientsLoop = false; [SerializeField] private bool seamlessLoop = false; [Min(0f)] [SerializeField] private float minLoop = 0.5f; [Min(0f)] [SerializeField] private float maxLoop = 5f; [Min(0f)] [SerializeField] private float volumeMultiplier = 1f; [Min(0f)] [SerializeField] private float minVolume = 0.8f; [Min(0f)] [SerializeField] private float maxVolume = 1.2f; [Min(0f)] [SerializeField] private float pitchMultiplier = 1f; [Min(0f)] [SerializeField] private float minPitch = 0.75f; [Min(0f)] [SerializeField] private float maxPitch = 1.25f; [Min(0f)] [SerializeField] private float doppler = 1f; [Range(0f, 360f)] [SerializeField] private float spread = 0f; [SerializeField] public bool doWalkie = false; [SerializeField] public bool doAudible = false; [SerializeField] private bool audibleLoop = false; [SerializeField] private float minAudible = 2f; [SerializeField] private float maxAudible = 5f; [SerializeField] public bool trackTimesNearby = false; [Min(0f)] [SerializeField] private float audibleRange = 25f; [SerializeField] private bool doFar = false; [SerializeField] private bool vanillaOcclusion = false; [HideInInspector] [SerializeField] private AudioSource source = null; [HideInInspector] [SerializeField] private AudioSource farSource = null; [HideInInspector] [SerializeField] private bool loopCurrent = false; [HideInInspector] [SerializeField] private Vector2Int minMaxLoopRound; [HideInInspector] [SerializeField] private Vector2Int minMaxAudibleRound; [HideInInspector] [SerializeField] private float inverseVolumeMultiplier; [HideInInspector] [SerializeField] private Vector2Int minMaxVolumeRound; [HideInInspector] [SerializeField] private float inversePitchMultiplier; [HideInInspector] [SerializeField] private Vector2Int minMaxPitchRound; private float loopTime = 0f; private float audibleTime = 0f; private int timesNearby = 0; private Vector3 lastPlayedPosition = default(Vector3); private AudioClip lastClip = null; public bool HUDAudio => hudAudio; public bool Loops => looping && (clientsLoop || base.Base.IsServer); public float CloseRange { get { if (hudAudio) { return 0f; } return audibleRange; } private set { if (!hudAudio) { source.maxDistance = value; audibleRange = value; if (FarNoise) { FarRange = value * 3f; } } } } public float FarRange { get { if (hudAudio || (Object)(object)farSource == (Object)null) { return 0f; } return farSource.maxDistance; } private set { if (!hudAudio && !((Object)(object)farSource == (Object)null)) { farSource.maxDistance = value; } } } public bool IsPlaying => (source.isPlaying && IndexOf(source.clip) != -1) || ((Object)(object)farSource != (Object)null && farSource.isPlaying && IndexOf(farSource.clip) != -1); public int TimesNearby { get { if (hudAudio) { return 0; } return timesNearby; } private set { if (!hudAudio) { timesNearby = value; } } } public Vector3 LastPosition { get { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return lastPlayedPosition; } private set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) lastPlayedPosition = value; } } public AudioClip LastClip { get { if ((Object)(object)lastClip == (Object)null) { if (IsPlaying) { lastClip = source.clip; } else { lastClip = Random(); } } return lastClip; } private set { lastClip = value; } } internal float ClipTime { get { return (float)source.timeSamples / (float)lastClip.frequency / source.clip.length; } set { source.time = value * source.clip.length; if (doFar && !((Object)(object)farSource != (Object)null)) { farSource.time = value * farSource.clip.length; } } } internal bool FarNoise { get { if (!doFar || (Object)(object)farSource == (Object)null || !((Behaviour)farSource).enabled) { return false; } if ((Object)(object)GameNetworkManager.Instance == (Object)null) { return doFar; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; return localPlayerController.isInsideFactory || (localPlayerController.spectatedPlayerScript?.isInsideFactory ?? false); } set { if (doFar && !((Object)(object)farSource == (Object)null)) { ((Behaviour)farSource).enabled = value; } } } public SelectAudioClips(int id, params AudioClip[] clips) : base(id, clips) { }//IL_0122: Unknown result type (might be due to invalid IL or missing references) public override void Initialize(IWildCardBase wildCardBase) { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown loopCurrent = looping && !seamlessLoop; SetLoop(looping, minLoop, maxLoop); SetAudibleLoop(audibleLoop, minAudible, maxAudible); SetVolume(volumeMultiplier, minVolume, maxVolume); SetPitch(pitchMultiplier, minPitch, maxPitch); if (!hudAudio) { if ((Object)(object)audioParent == (Object)null) { audioParent = wildCardBase.Transform; } GameObject val = new GameObject($"{((Object)audioParent).name}_Audio_{base.Id}"); val.transform.SetParent(audioParent); val.transform.localPosition = Vector3.zero; source = val.AddComponent(); source.playOnAwake = false; source.spatialBlend = 1f; source.rolloffMode = (AudioRolloffMode)2; Set3DSettings(doppler, spread, customCurve); if (vanillaOcclusion) { ((Component)source).gameObject.AddComponent(); } else if (doFar) { GameObject val2 = new GameObject($"{((Object)audioParent).name}_FarAudio_{base.Id}"); val2.transform.SetParent(audioParent); val2.transform.localPosition = Vector3.zero; farSource = val2.AddComponent(); farSource.playOnAwake = false; farSource.spatialBlend = 1f; farSource.rolloffMode = (AudioRolloffMode)2; farSource.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0.2222f, 0f), new Keyframe(0.333f, 0.2f), new Keyframe(1f, 0f) })); farSource.spread = 75f; AudioReverbFilter val3 = val2.AddComponent(); val3.dryLevel = -5000f; val3.room = 0f; val3.roomHF = -3000f; val3.roomLF = -500f; val3.decayTime = 5f; val3.decayHFRatio = 2f; val3.reflectionsLevel = 0f; val3.reflectionsDelay = 0f; val3.reverbLevel = 1500f; val3.reverbDelay = 0f; val3.hfReference = 2000f; val3.lfReference = 500f; val3.diffusion = 100f; val3.density = 100f; } CloseRange = audibleRange; } } public void HUDOverride() { source = HUDManager.Instance.UIAudio; } public void SetMixer(AudioMixerGroup group) { if (!((Object)(object)source == (Object)null)) { source.outputAudioMixerGroup = group; if (!((Object)(object)farSource == (Object)null)) { farSource.outputAudioMixerGroup = group; } } } public void LoopTick() { if (loopCurrent) { if (loopTime > 0f) { loopTime -= Time.deltaTime; } else if (!IsPlaying) { float num = minLoop; if (!Mathf.Approximately(minLoop, maxLoop)) { num = (float)base.Base.Random.Next(((Vector2Int)(ref minMaxLoopRound)).x, ((Vector2Int)(ref minMaxLoopRound)).y) * 0.01f; } loopTime = num; if (base.Count == 1) { RepeatClip(oneShot: false, !clientsLoop); } else { PlayRandomClip(oneShot: false, !clientsLoop); } } } if (hudAudio) { return; } if (!FarNoise) { FarRange = 0f; } else if (FarRange <= 0f) { FarRange = CloseRange * 3f; } if (audibleLoop) { if (audibleTime > 0f) { audibleTime -= Time.deltaTime; } else if (IsPlaying) { audibleTime = (float)base.Base.Random.Next(((Vector2Int)(ref minMaxAudibleRound)).x, ((Vector2Int)(ref minMaxAudibleRound)).y) * 0.01f; DogNoise(0.5f, 1f, !clientsLoop); } } } public void SetLoop(bool loop, float? loopMin = null, float? loopMax = null) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (loopMin.HasValue) { minLoop = loopMin.Value; } if (loopMax.HasValue) { maxLoop = loopMax.Value; } minLoop = Mathf.Clamp(minLoop, 0f, maxLoop); maxLoop = Mathf.Clamp(maxLoop, minLoop, maxLoop); minMaxLoopRound = new Vector2Int(Mathf.RoundToInt(minLoop * 100f), Mathf.RoundToInt(maxLoop * 100f) + 1); if (seamlessLoop) { if ((Object)(object)source != (Object)null) { source.loop = loop; if (FarNoise) { farSource.loop = loop; } } } else { looping = loop; } } public void SetVolume(float? multiplier = null, float? volMin = null, float? volMax = null) { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (multiplier.HasValue) { if ((Object)(object)source != (Object)null && IsPlaying) { AudioSource obj = source; obj.volume *= multiplier.Value * inverseVolumeMultiplier; if (FarNoise) { AudioSource obj2 = farSource; obj2.volume *= multiplier.Value * inverseVolumeMultiplier; } } volumeMultiplier = multiplier.Value; inverseVolumeMultiplier = 1f / volumeMultiplier; } if (volMin.HasValue) { minVolume = volMin.Value; } if (volMax.HasValue) { maxVolume = volMax.Value; } minVolume = Mathf.Clamp(minVolume, 0f, maxVolume); maxVolume = Mathf.Clamp(maxVolume, minVolume, maxVolume); minMaxVolumeRound = new Vector2Int(Mathf.RoundToInt(minVolume * 100f), Mathf.RoundToInt(maxVolume * 100f) + 1); } public void SetPitch(float? multiplier = null, float? pitchMin = null, float? pitchMax = null) { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (multiplier.HasValue) { if ((Object)(object)source != (Object)null && IsPlaying) { AudioSource obj = source; obj.pitch *= multiplier.Value * inversePitchMultiplier; if (FarNoise) { AudioSource obj2 = farSource; obj2.pitch *= multiplier.Value * inversePitchMultiplier; } } pitchMultiplier = multiplier.Value; inversePitchMultiplier = 1f / pitchMultiplier; } if (pitchMin.HasValue) { minPitch = pitchMin.Value; } if (pitchMax.HasValue) { maxPitch = pitchMax.Value; } minPitch = Mathf.Clamp(minPitch, 0f, maxPitch); maxPitch = Mathf.Clamp(maxPitch, minPitch, maxPitch); minMaxPitchRound = new Vector2Int(Mathf.RoundToInt(minPitch * 100f), Mathf.RoundToInt(maxPitch * 100f) + 1); } public void SetAudibleLoop(bool loop, float? audibleMin = null, float? audibleMax = null) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) audibleLoop = loop; if (audibleMin.HasValue) { minAudible = audibleMin.Value; } if (audibleMax.HasValue) { maxAudible = audibleMax.Value; } minAudible = Mathf.Clamp(minAudible, 0f, maxAudible); maxAudible = Mathf.Clamp(maxAudible, minAudible, maxAudible); minMaxAudibleRound = new Vector2Int(Mathf.RoundToInt(minAudible * 100f), Mathf.RoundToInt(maxAudible * 100f) + 1); } public void Set3DSettings(float? newDoppler = null, float? newSpread = null, AnimationCurve newCurve = null) { if (newDoppler.HasValue) { source.dopplerLevel = newDoppler.Value; doppler = newDoppler.Value; } if (newSpread.HasValue) { source.spread = newSpread.Value; spread = newSpread.Value; } if (newCurve != null && newCurve.keys.Length > 1) { source.SetCustomCurve((AudioSourceCurveType)0, newCurve); customCurve = newCurve; } } public bool PlayRandomOneshot(bool networked = true) { return PlayRandomClip(oneShot: true, networked); } public bool PlayRandomClip(bool oneShot = false, bool networked = true) { return PlayClip(RandomIndex(), oneShot, networked); } public bool PlayOneshot(int index, bool networked = true) { if (!InRange(index)) { return false; } return PlayOneshot(base[index], networked); } public bool PlayOneshot(AudioClip clip, bool networked = true) { return PlayClip(clip, oneShot: true, networked); } public bool PlayClip(int index, bool oneShot = false, bool networked = true, float? volumeOverride = null, float? pitchOverride = null) { if (!InRange(index)) { return false; } return PlayClip(base[index], oneShot, networked, volumeOverride, pitchOverride); } public bool PlayClip(AudioClip clip, bool oneShot = false, bool networked = true, float? volumeOverride = null, float? pitchOverride = null) { //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null || (Object)(object)clip == (Object)null) { return false; } float num = volumeMultiplier; num = ((!volumeOverride.HasValue) ? (num * ((float)base.Base.Random.Next(((Vector2Int)(ref minMaxVolumeRound)).x, ((Vector2Int)(ref minMaxVolumeRound)).y) * 0.01f)) : volumeOverride.Value); if (num <= 0f) { return false; } LastClip = clip; float num2 = pitchMultiplier; num2 = ((!pitchOverride.HasValue) ? (num2 * ((float)base.Base.Random.Next(((Vector2Int)(ref minMaxPitchRound)).x, ((Vector2Int)(ref minMaxPitchRound)).y) * 0.01f)) : pitchOverride.Value); source.pitch = num2; source.loop = seamlessLoop; bool farNoise = FarNoise; if (farNoise) { farSource.pitch = num2; farSource.loop = seamlessLoop; } if (!seamlessLoop) { loopCurrent = Loops; } if (oneShot) { source.PlayOneShot(clip, num); if (farNoise) { farSource.PlayOneShot(clip, num); } } else { source.volume = num; source.clip = clip; source.Play(); if (farNoise) { farSource.volume = num; farSource.clip = clip; farSource.Play(); } } if (hudAudio) { return true; } if (networked) { base.Base.PlayClipNetworked(base.Id, IndexOf(clip), oneShot, num, num2); } if (trackTimesNearby) { TimesNearby++; if (Vector3.Distance(LastPosition, base.Base.Transform.position) > 2f) { TimesNearby = 0; } } else { TimesNearby = 0; } LastPosition = base.Base.Transform.position; if (doWalkie) { WalkieTalkie.TransmitOneShotAudio(source, clip, num); } if (!doAudible || CloseRange <= 0f) { return true; } DogNoise(num * 0.5f, num2, networked); return true; } public void DogNoise(float volume, float pitch, bool networked = true) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if (base.Base is WildCardProp { isHeld: not false } wildCardProp && volume >= 0.3f) { wildCardProp.LastPlayerHeldBy.timeSinceMakingLoudNoise = 0f; flag = ((GrabbableObject)wildCardProp).isInElevator && StartOfRound.Instance.hangarDoorsClosed; } RoundManager.Instance.PlayAudibleNoise(LastPosition, CloseRange * Mathf.Max(0.5f, volume) * (1f + Mathf.Abs(pitch - 1f) * 0.5f), volume, TimesNearby, flag, 0); if (networked) { base.Base.DogNoiseNetworked(base.Id, volume, pitch); } } public void RepeatClip(bool oneShot = false, bool networked = true) { Stop(networked: false); PlayClip(LastClip, oneShot); if (networked) { base.Base.RepeatClipNetworked(base.Id, oneShot); } } public void Stop(bool networked = true) { if (Loops) { loopCurrent = false; } AudioSource obj = source; if (obj != null) { obj.Stop(true); } AudioSource obj2 = farSource; if (obj2 != null) { obj2.Stop(true); } if (networked) { base.Base.StopAudioNetworked(base.Id); } } public void SetPaused(bool pause, bool networked = true) { if (pause) { if (Loops) { loopCurrent = false; } AudioSource obj = source; if (obj != null) { obj.Pause(); } AudioSource obj2 = farSource; if (obj2 != null) { obj2.Pause(); } } else { if (Loops) { loopCurrent = true; } AudioSource obj3 = source; if (obj3 != null) { obj3.UnPause(); } AudioSource obj4 = farSource; if (obj4 != null) { obj4.UnPause(); } } if (networked) { base.Base.PauseAudioNetworked(base.Id, pause); } } public void SetMute(bool mute, bool networked = true) { if (mute) { Mute(); } else { Unmute(); } if (networked) { base.Base.MuteAudioNetworked(base.Id, mute); } } public void Mute() { if ((Object)(object)source != (Object)null) { source.mute = true; } if ((Object)(object)farSource != (Object)null) { farSource.mute = true; } } public void Unmute() { if ((Object)(object)source != (Object)null) { source.mute = false; } if ((Object)(object)farSource != (Object)null) { farSource.mute = false; } } } [Serializable] public class SelectModelVariants : SelectableWithWeights { [SerializeField] private Transform targetTransform = null; [SerializeField] private bool targetIsParent = false; [SerializeField] private string baseName = string.Empty; [SerializeField] private bool instantiateVariant = false; [SerializeField] public bool randomOnSpawn = false; [SerializeField] private bool perClient = false; [Min(0f)] [SerializeField] private int baseWeight = 0; private int currentVariant = -1; public int VariantIndex { get { return currentVariant; } set { if (InRange(value) || value == -1) { Switch(value, !perClient); } } } public GameObject Variant { get { GameObject val = null; if (InRange(currentVariant)) { val = base[currentVariant].option; } return val ?? ((Component)targetTransform).gameObject; } } public SelectModelVariants(int id, params WeightedOption[] arrayItems) : base(id, arrayItems) { } public override void Initialize(IWildCardBase wildCardBase) { if ((Object)(object)targetTransform == (Object)null) { targetTransform = base.Base.Transform; targetIsParent = true; } if (baseWeight > 0) { Insert(0, new WeightedOption(baseName, ((Component)targetTransform).gameObject, baseWeight)); currentVariant = 0; base.Base.Name = baseName; } base.Initialize(wildCardBase); } public bool Switch(int index, bool networked) { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) bool flag = false; try { if (currentVariant == index) { return flag; } if (!InRange(index)) { if (!targetIsParent) { if (InRange(currentVariant)) { base[currentVariant].option.SetActive(false); } ((Component)targetTransform).gameObject.SetActive(true); currentVariant = -1; flag = true; } return flag; } if (!instantiateVariant) { GameObject val = ((Component)targetTransform).gameObject; if (InRange(currentVariant)) { val = base[currentVariant].option ?? val; } val.SetActive(false); GameObject val2 = base[index].option ?? ((Component)targetTransform).gameObject; val2.SetActive(true); currentVariant = index; flag = true; return flag; } Vector3 localPosition = targetTransform.localPosition; Quaternion localRotation = targetTransform.localRotation; Vector3 localScale = targetTransform.localScale; Transform parent = targetTransform; if (!targetIsParent) { parent = targetTransform.parent; } if (InRange(currentVariant) && (Object)(object)base[currentVariant].option != (Object)null) { Object.Destroy((Object)(object)base[currentVariant].option); } GameObject val3 = Object.Instantiate(base[index].option, parent); val3.transform.localPosition = localPosition; val3.transform.localRotation = localRotation; val3.transform.localScale = localScale; if (targetTransform == null) { targetTransform = val3.transform; } currentVariant = index; flag = true; return flag; } catch (Exception ex) { Debug.LogError((object)ex); return flag; } finally { if (flag) { string name = baseName; if (InRange(currentVariant)) { name = base[currentVariant].name; } base.Base.Name = name; if (networked) { if (perClient) { base.Base.SetVariantNetworked(base.Id, RandomOptionIndex()); } else { base.Base.SetVariantNetworked(base.Id, currentVariant); } } } } } public bool SwitchRandom(bool ignoreWeights = false, bool networked = true) { return Switch(RandomOptionIndex(ignoreWeights), networked); } } [Serializable] public abstract class SelectableWithWeights : Selectable> { public int TotalWeight { get { int num = 0; for (int i = 0; i < base.Count; i++) { num += base[i].weight; } return num; } } public int[] Weights { get { int[] array = new int[base.Count]; for (int i = 0; i < array.Length; i++) { array[i] = base[i].weight; } return array; } } public SelectableWithWeights(int id, params WeightedOption[] arrayItems) : base(id, arrayItems) { } public override void Initialize(IWildCardBase wildCardBase) { Ratio(); } public T RandomOption(bool ignoreWeights = false) { int index = RandomOptionIndex(ignoreWeights); if (!InRange(index)) { return default(T); } return base[index].option; } public int RandomOptionIndex(bool ignoreWeights = false) { if (ignoreWeights) { return RandomIndex(); } int num = base.Base.Random.Next(1, TotalWeight + 1); int num2 = 0; for (int i = 0; i < base.Count; i++) { WeightedOption weightedOption = base[i]; int weight = weightedOption.weight; if (weight != 0) { num2 += weight; if (num2 >= num) { return i; } } } return -1; } public void Equalize(bool ignoreZero = false) { for (int i = 0; i < base.Count; i++) { if (!ignoreZero || GetWeight(i) > 0) { SetWeight(i, 1); } } } public void SetWeight(int index, int weight) { if (InRange(index)) { base[index].weight = weight; } } public int GetWeight(int index) { if (!InRange(index)) { return 0; } return base[index].weight; } public void Ratio() { int num = Weights.GCD(); if (num == 0) { return; } for (int i = 0; i < base.Count; i++) { if (base[i].weight < 0) { base[i].weight = 0; } base[i].weight /= num; } } } [Serializable] public abstract class SelectableWithTextures : Selectable { [SerializeField] private List textures = new List(); public ReadOnlyCollection Textures => new ReadOnlyCollection(textures); public SelectableWithTextures(int id, params T[] arrayItems) : base(id, arrayItems) { } public abstract void SetMaterialsTexture(int itemIndex, int textureIndex); public abstract void SetMaterialTexture(int itemIndex, int materialIndex, int textureIndex); public void SetAllMaterialsTexture(int textureIndex) { for (int i = 0; i < base.Count; i++) { SetMaterialsTexture(i, textureIndex); } } public void SetAllMaterialsRandomTexture() { SetAllMaterialsTexture(RandomTextureIndex()); } public void SetMaterialsRandomTexture(int itemIndex) { SetMaterialsTexture(itemIndex, RandomTextureIndex()); } public void SetMaterialRandomTexture(int itemIndex, int materialIndex) { SetMaterialTexture(itemIndex, materialIndex, RandomTextureIndex()); } public void AddTextures(params Texture[] newTextures) { foreach (Texture item in newTextures) { if (!textures.Contains(item)) { textures.Add(item); } } } public void SetTextures(params Texture[] newTextures) { textures = newTextures.ToList(); } public void SetTexture(int index, Texture newTexture) { if (InRangeTextures(index)) { textures[index] = newTexture; } } public Texture GetTexture(int index) { if (!InRangeTextures(index)) { return null; } return textures[index]; } public void RemoveTextures(params Texture[] toRemoveTextures) { for (int i = 0; i < toRemoveTextures.Length; i++) { textures.Remove(toRemoveTextures[i]); } } public void RemoveTextures(int start, int count) { if (InRangeTextures(start) && InRangeTextures(start + count) && count > 0) { textures.RemoveRange(start, count); } } public void RemoveTexture(int index) { if (InRangeTextures(index)) { RemoveTextures(index, 1); } } public void ClearTextures() { SetTextures(); } public bool InRangeTextures(int index) { return index >= 0 && index < textures.Count; } public int IndexOfTexture(Texture texture) { return textures.IndexOf(texture); } public Texture RandomTexture() { if (textures.Count == 0) { return null; } return textures[RandomTextureIndex()]; } public int RandomTextureIndex() { if (textures.Count == 0) { return 0; } return base.Base.Random.Next(0, textures.Count); } } [Serializable] public abstract class Selectable { [SerializeField] private List items = new List(); [HideInInspector] [SerializeField] private int id = 0; [HideInInspector] [SerializeField] internal bool initialized = false; private IWildCardBase wildCardBase = null; public int Id { get { return id; } internal set { id = value; } } public IWildCardBase Base => wildCardBase; public ReadOnlyCollection Items => new ReadOnlyCollection(items); public int Count { get { if (items == null) { return 0; } return items.Count; } } public T this[int index] { get { if (!InRange(index)) { return default(T); } return items[index]; } set { if (InRange(index)) { items[index] = value; } } } public Selectable(int id, params T[] arrayItems) { Id = id; Set(arrayItems); } public virtual void Initialize(IWildCardBase wildCardBase) { } public void SetBase(IWildCardBase wildCardBase) { this.wildCardBase = wildCardBase; if (!initialized) { Initialize(wildCardBase); initialized = true; } } public T Random() { if (Count == 0) { return default(T); } return this[RandomIndex()]; } public int RandomIndex() { if (Count == 0) { return 0; } return Base.Random.Next(0, Count); } public bool InRange(int index) { return index >= 0 && index < Count; } public void Add(params T[] newSelectables) { if (newSelectables != null) { Add(newSelectables.AsEnumerable()); } } public void Add(IEnumerable newSelectables) { if (newSelectables != null) { if (items == null) { Set(newSelectables); } else { items.AddRange(newSelectables); } } } public void Set(params T[] newSelectables) { if (newSelectables == null) { items?.Clear(); } else { Set(newSelectables.AsEnumerable()); } } public void Set(IEnumerable newSelectables) { if (newSelectables == null) { items?.Clear(); } else { items = newSelectables.ToList(); } } public void Set(int index, T newSelectable) { if (InRange(index)) { items[index] = newSelectable; } } public void Remove(params T[] toRemoveSelectables) { if (toRemoveSelectables != null && items != null) { Remove(toRemoveSelectables.AsEnumerable()); } } public void Remove(IEnumerable toRemoveSelectables) { if (toRemoveSelectables == null || items == null) { return; } for (int i = 0; i < Count; i++) { if (toRemoveSelectables.Contains(items[i])) { items.RemoveAt(i); i--; } } } public void Remove(int start, int count) { if (InRange(start) && InRange(start + count)) { if (count == 1) { items.RemoveAt(start); } else { items.RemoveRange(start, count); } } } public void Remove(int index) { Remove(index, 1); } public void Insert(int index, T item) { if (item != null && items != null && InRange(index)) { items.Insert(index, item); } } public void Insert(int index, params T[] toInsertSelectables) { if (toInsertSelectables != null && items != null && InRange(index)) { Insert(index, toInsertSelectables.AsEnumerable()); } } public void Insert(int index, IEnumerable toInsertSelectables) { if (toInsertSelectables != null && items != null && InRange(index)) { items.InsertRange(index, toInsertSelectables); } } public void Clear() { Set(); } public int IndexOf(T selectable) { return items.IndexOf(selectable); } } public static class HarmonyHelper { internal static MethodInfo toString = AccessTools.Method(typeof(object), "ToString", (Type[])null, (Type[])null); internal static MethodInfo stringConcat3 = AccessTools.Method(typeof(string), "Concat", new Type[3] { typeof(string), typeof(string), typeof(string) }, (Type[])null); internal static MethodInfo logString = AccessTools.Method(typeof(HarmonyHelper), "LogString", new Type[1] { typeof(string) }, (Type[])null); internal static MethodInfo inequality = AccessTools.Method(typeof(Object), "op_Inequality", new Type[2] { typeof(Object), typeof(Object) }, (Type[])null); internal static MethodInfo mathfClamp3Int = AccessTools.Method(typeof(Mathf), "Clamp", new Type[3] { typeof(int), typeof(int), typeof(int) }, (Type[])null); internal static MethodInfo collision = AccessTools.Method(typeof(EnemyAI), "MeetsStandardPlayerCollisionConditions", new Type[3] { typeof(Collider), typeof(bool), typeof(bool) }, (Type[])null); internal static MethodInfo onCollision = AccessTools.Method(typeof(EnemyAI), "OnCollideWithPlayer", new Type[1] { typeof(Collider) }, (Type[])null); internal static MethodInfo exitDriver = AccessTools.Method(typeof(VehicleController), "ExitDriverSideSeat", (Type[])null, (Type[])null); internal static MethodInfo exitPassenger = AccessTools.Method(typeof(VehicleController), "ExitPassengerSideSeat", (Type[])null, (Type[])null); internal static MethodInfo savePlayer = AccessTools.Method(typeof(ILifeSaver), "TrySave", new Type[4] { typeof(PlayerControllerB), typeof(CauseOfDeath), typeof(Vector3), typeof(EnemyAI) }, (Type[])null); internal static MethodInfo savePlayerGrace = AccessTools.Method(typeof(ILifeSaver), "TrySaveGraceOnly", new Type[4] { typeof(PlayerControllerB), typeof(CauseOfDeath), typeof(Vector3), typeof(EnemyAI) }, (Type[])null); internal static MethodInfo savePlayerTrigger = AccessTools.Method(typeof(ILifeSaver), "TrySaveTriggerOnly", new Type[4] { typeof(PlayerControllerB), typeof(CauseOfDeath), typeof(Vector3), typeof(EnemyAI) }, (Type[])null); internal static MethodInfo killPlayer = AccessTools.Method(typeof(PlayerControllerB), "KillPlayer", new Type[6] { typeof(Vector3), typeof(bool), typeof(CauseOfDeath), typeof(int), typeof(Vector3), typeof(bool) }, (Type[])null); internal static MethodInfo damagePlayer = AccessTools.Method(typeof(PlayerControllerB), "DamagePlayer", new Type[7] { typeof(int), typeof(bool), typeof(bool), typeof(CauseOfDeath), typeof(int), typeof(bool), typeof(Vector3) }, (Type[])null); internal static MethodInfo makeInjured = AccessTools.Method(typeof(PlayerControllerB), "MakeCriticallyInjured", new Type[1] { typeof(bool) }, (Type[])null); internal static MethodInfo updateHealth = AccessTools.Method(typeof(HUDManager), "UpdateHealthUI", new Type[2] { typeof(int), typeof(bool) }, (Type[])null); internal static MethodInfo switchBehaviour = AccessTools.Method(typeof(EnemyAI), "SwitchToBehaviourState", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo switchBehaviourLocal = AccessTools.Method(typeof(EnemyAI), "SwitchToBehaviourStateOnLocalClient", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo allowDeath = AccessTools.Method(typeof(PlayerControllerB), "AllowPlayerDeath", (Type[])null, (Type[])null); internal static MethodInfo cancelSpecialAnim = AccessTools.Method(typeof(EnemyAI), "CancelSpecialAnimationWithPlayer", (Type[])null, (Type[])null); internal static MethodInfo beeKill = AccessTools.Method(typeof(RedLocustBees), "BeeKillPlayerOnLocalClient", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo dogKill = AccessTools.Method(typeof(MouthDogAI), "KillPlayerServerRpc", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo jesterKill = AccessTools.Method(typeof(JesterAI), "KillPlayerServerRpc", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo dwellerKill = AccessTools.Method(typeof(CaveDwellerAI), "KillPlayerAnimationServerRpc", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo bloomBurst = AccessTools.Method(typeof(CadaverBloomAI), "BurstForth", new Type[4] { typeof(PlayerControllerB), typeof(bool), typeof(Vector3), typeof(Vector3) }, (Type[])null); internal static MethodInfo foxCancelReel = AccessTools.Method(typeof(BushWolfEnemy), "CancelReelingPlayerIn", (Type[])null, (Type[])null); internal static MethodInfo cadaverCure = AccessTools.Method(typeof(CadaverGrowthAI), "CurePlayer", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo cadaverCureRPC = AccessTools.Method(typeof(CadaverGrowthAI), "CurePlayerRpc", new Type[1] { typeof(int) }, (Type[])null); internal static MethodInfo giantStopKill = AccessTools.Method(typeof(ForestGiantAI), "StopKillAnimation", (Type[])null, (Type[])null); internal static MethodInfo ghostStopChase = AccessTools.Method(typeof(DressGirlAI), "StopChasing", (Type[])null, (Type[])null); internal static FieldInfo playerName = AccessTools.Field(typeof(PlayerControllerB), "playerUsername"); internal static FieldInfo playerClientId = AccessTools.Field(typeof(PlayerControllerB), "playerClientId"); internal static FieldInfo enemyType = AccessTools.Field(typeof(EnemyAI), "enemyType"); internal static FieldInfo enemyName = AccessTools.Field(typeof(EnemyType), "enemyName"); internal static FieldInfo foxInKill = AccessTools.Field(typeof(BushWolfEnemy), "inKillAnimation"); internal static FieldInfo clingPlayer = AccessTools.Field(typeof(CentipedeAI), "clingingToPlayer"); internal static FieldInfo timesSeenByPlayer = AccessTools.Field(typeof(DressGirlAI), "timesSeenByPlayer"); internal static FieldInfo timesStared = AccessTools.Field(typeof(DressGirlAI), "timesStared"); internal static FieldInfo couldNotStare = AccessTools.Field(typeof(DressGirlAI), "couldNotStareLastAttempt"); internal static FieldInfo hauntingPlayer = AccessTools.Field(typeof(DressGirlAI), "hauntingPlayer"); internal static FieldInfo maskHeldBy = AccessTools.Field(typeof(HauntedMaskItem), "previousPlayerHeldBy"); internal static FieldInfo specialAnim = AccessTools.Field(typeof(EnemyAI), "inSpecialAnimationWithPlayer"); internal static FieldInfo playerSinking = AccessTools.Field(typeof(PlayerControllerB), "sinkingValue"); internal static FieldInfo playerHealth = AccessTools.Field(typeof(PlayerControllerB), "health"); internal static FieldInfo giantPlayerStealth = AccessTools.Field(typeof(ForestGiantAI), "playerStealthMeters"); private static readonly ReadOnlyDictionary stackChange = new ReadOnlyDictionary(new Dictionary { [OpCodes.Ldloc] = 1, [OpCodes.Ldloc_0] = 1, [OpCodes.Ldloc_1] = 1, [OpCodes.Ldloc_2] = 1, [OpCodes.Ldloc_3] = 1, [OpCodes.Ldloc_S] = 1, [OpCodes.Ldloca] = 1, [OpCodes.Ldloca_S] = 1, [OpCodes.Ldarg] = 1, [OpCodes.Ldarg_0] = 1, [OpCodes.Ldarg_1] = 1, [OpCodes.Ldarg_2] = 1, [OpCodes.Ldarg_3] = 1, [OpCodes.Ldarg_S] = 1, [OpCodes.Ldarga] = 1, [OpCodes.Ldarga_S] = 1, [OpCodes.Ldnull] = 1, [OpCodes.Ldobj] = 0, [OpCodes.Ldfld] = 0, [OpCodes.Ldsfld] = 1, [OpCodes.Ldflda] = 0, [OpCodes.Ldsflda] = 1, [OpCodes.Ldstr] = 1, [OpCodes.Ldtoken] = 1, [OpCodes.Ldftn] = 1, [OpCodes.Ldvirtftn] = 1, [OpCodes.Ldc_I4] = 1, [OpCodes.Ldc_I4_0] = 1, [OpCodes.Ldc_I4_1] = 1, [OpCodes.Ldc_I4_2] = 1, [OpCodes.Ldc_I4_3] = 1, [OpCodes.Ldc_I4_4] = 1, [OpCodes.Ldc_I4_5] = 1, [OpCodes.Ldc_I4_6] = 1, [OpCodes.Ldc_I4_7] = 1, [OpCodes.Ldc_I4_8] = 1, [OpCodes.Ldc_I4_M1] = 1, [OpCodes.Ldc_I4_S] = 1, [OpCodes.Ldc_I8] = 1, [OpCodes.Ldc_R4] = 1, [OpCodes.Ldc_R8] = 1, [OpCodes.Ldelem] = -1, [OpCodes.Ldelem_I] = -1, [OpCodes.Ldelem_I1] = -1, [OpCodes.Ldelem_I2] = -1, [OpCodes.Ldelem_I4] = -1, [OpCodes.Ldelem_I8] = -1, [OpCodes.Ldelem_R4] = -1, [OpCodes.Ldelem_R8] = -1, [OpCodes.Ldelem_U1] = -1, [OpCodes.Ldelem_U2] = -1, [OpCodes.Ldelem_U4] = -1, [OpCodes.Ldelem_Ref] = -1, [OpCodes.Ldelema] = -1, [OpCodes.Ldlen] = 0, [OpCodes.Ldind_I] = 1, [OpCodes.Ldind_I1] = 1, [OpCodes.Ldind_I2] = 1, [OpCodes.Ldind_I4] = 1, [OpCodes.Ldind_I8] = 1, [OpCodes.Ldind_R4] = 1, [OpCodes.Ldind_R8] = 1, [OpCodes.Ldind_Ref] = 1, [OpCodes.Ldind_U1] = 1, [OpCodes.Ldind_U2] = 1, [OpCodes.Ldind_U4] = 1, [OpCodes.Localloc] = 1, [OpCodes.Stloc] = -1, [OpCodes.Stloc_0] = -1, [OpCodes.Stloc_1] = -1, [OpCodes.Stloc_2] = -1, [OpCodes.Stloc_3] = -1, [OpCodes.Stloc_S] = -1, [OpCodes.Starg] = -1, [OpCodes.Starg_S] = -1, [OpCodes.Stfld] = -2, [OpCodes.Stsfld] = -1, [OpCodes.Stobj] = -2, [OpCodes.Stelem] = -3, [OpCodes.Stelem_I] = -3, [OpCodes.Stelem_I1] = -3, [OpCodes.Stelem_I2] = -3, [OpCodes.Stelem_I4] = -3, [OpCodes.Stelem_I8] = -3, [OpCodes.Stelem_R4] = -3, [OpCodes.Stelem_R8] = -3, [OpCodes.Stelem_Ref] = -2, [OpCodes.Stind_I] = -2, [OpCodes.Stind_I1] = -2, [OpCodes.Stind_I2] = -2, [OpCodes.Stind_I4] = -2, [OpCodes.Stind_I8] = -2, [OpCodes.Stind_R4] = -2, [OpCodes.Stind_Ref] = -2, [OpCodes.Initobj] = -1, [OpCodes.Newobj] = 1, [OpCodes.Initblk] = -1, [OpCodes.Newarr] = 1, [OpCodes.Add] = -1, [OpCodes.Add_Ovf] = -1, [OpCodes.Add_Ovf_Un] = -1, [OpCodes.Sub] = -1, [OpCodes.Sub_Ovf] = -1, [OpCodes.Sub_Ovf_Un] = -1, [OpCodes.Mul] = -1, [OpCodes.Mul_Ovf] = -1, [OpCodes.Mul_Ovf_Un] = -1, [OpCodes.Div] = -1, [OpCodes.Div_Un] = -1, [OpCodes.Rem] = -1, [OpCodes.Rem_Un] = -1, [OpCodes.Neg] = 0, [OpCodes.And] = -1, [OpCodes.Or] = 0, [OpCodes.Not] = 0, [OpCodes.Xor] = -1, [OpCodes.Ceq] = -1, [OpCodes.Clt] = -1, [OpCodes.Clt_Un] = -1, [OpCodes.Cgt] = -1, [OpCodes.Cgt_Un] = -1, [OpCodes.Br] = 0, [OpCodes.Br_S] = 0, [OpCodes.Brtrue] = -1, [OpCodes.Brtrue_S] = -1, [OpCodes.Brfalse] = -1, [OpCodes.Brfalse_S] = -1, [OpCodes.Beq] = -2, [OpCodes.Beq_S] = -2, [OpCodes.Blt] = -2, [OpCodes.Blt_S] = -2, [OpCodes.Ble] = -2, [OpCodes.Ble_S] = -2, [OpCodes.Bge] = -2, [OpCodes.Bge_S] = -2, [OpCodes.Bgt] = -2, [OpCodes.Bgt_S] = -2, [OpCodes.Bne_Un] = -2, [OpCodes.Bne_Un_S] = -2, [OpCodes.Blt_Un] = -2, [OpCodes.Blt_Un_S] = -2, [OpCodes.Ble_Un] = -2, [OpCodes.Ble_Un_S] = -2, [OpCodes.Bge_Un] = -2, [OpCodes.Bge_Un_S] = -2, [OpCodes.Bgt_Un] = -2, [OpCodes.Bgt_Un_S] = -2, [OpCodes.Switch] = -1, [OpCodes.Jmp] = 0, [OpCodes.Ret] = 0, [OpCodes.Leave] = 0, [OpCodes.Leave_S] = 0, [OpCodes.Refanytype] = 0, [OpCodes.Refanyval] = 0, [OpCodes.Mkrefany] = 0, [OpCodes.Castclass] = 0, [OpCodes.Box] = 0, [OpCodes.Unbox] = 0, [OpCodes.Unbox_Any] = 0, [OpCodes.Conv_I] = 0, [OpCodes.Conv_I1] = 0, [OpCodes.Conv_I2] = 0, [OpCodes.Conv_I4] = 0, [OpCodes.Conv_I8] = 0, [OpCodes.Conv_Ovf_I] = 0, [OpCodes.Conv_Ovf_I1] = 0, [OpCodes.Conv_Ovf_I2] = 0, [OpCodes.Conv_Ovf_I4] = 0, [OpCodes.Conv_Ovf_I8] = 0, [OpCodes.Conv_Ovf_I_Un] = 0, [OpCodes.Conv_Ovf_I1_Un] = 0, [OpCodes.Conv_Ovf_I2_Un] = 0, [OpCodes.Conv_Ovf_I4_Un] = 0, [OpCodes.Conv_Ovf_I8_Un] = 0, [OpCodes.Conv_U] = 0, [OpCodes.Conv_U1] = 0, [OpCodes.Conv_U2] = 0, [OpCodes.Conv_U4] = 0, [OpCodes.Conv_U8] = 0, [OpCodes.Conv_Ovf_U] = 0, [OpCodes.Conv_Ovf_U1] = 0, [OpCodes.Conv_Ovf_U2] = 0, [OpCodes.Conv_Ovf_U4] = 0, [OpCodes.Conv_Ovf_U8] = 0, [OpCodes.Conv_Ovf_U_Un] = 0, [OpCodes.Conv_Ovf_U1_Un] = 0, [OpCodes.Conv_Ovf_U2_Un] = 0, [OpCodes.Conv_Ovf_U4_Un] = 0, [OpCodes.Conv_Ovf_U8_Un] = 0, [OpCodes.Conv_R4] = 0, [OpCodes.Conv_R8] = 0, [OpCodes.Conv_R_Un] = 0, [OpCodes.Cpblk] = -2, [OpCodes.Cpobj] = -2, [OpCodes.Dup] = 1, [OpCodes.Nop] = 0, [OpCodes.Pop] = -1, [OpCodes.Shl] = -1, [OpCodes.Shr] = -1, [OpCodes.Shr_Un] = -1, [OpCodes.Sizeof] = 1, [OpCodes.Isinst] = 0, [OpCodes.Break] = 0, [OpCodes.Arglist] = 1, [OpCodes.Throw] = -1, [OpCodes.Rethrow] = 0, [OpCodes.Ckfinite] = -1, [OpCodes.Endfinally] = 0, [OpCodes.Endfilter] = 0 }); [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogString(string toLog) { WildCardMod.Instance.Log.LogDebug((object)toLog); } public static void LogIL(this MethodBase patch, MethodBase patching, List codes) { //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) if (((MemberInfo)patch).GetCustomAttribute() == null) { return; } Dictionary dictionary = new Dictionary { [0] = "(" + patching.DeclaringType.FullName + ")" }; ParameterInfo[] parameters = patching.GetParameters(); List list = new List(); for (int i = 0; i < parameters.Length; i++) { ParameterInfo parameterInfo = parameters[i]; list.Add(parameterInfo.ParameterType.FullName + " " + parameterInfo.Name); dictionary.Add(i + 1, "(" + list[list.Count - 1] + ")"); } StringBuilder stringBuilder = new StringBuilder("IL after patching "); stringBuilder.Append(patching.DeclaringType.FullName).Append('.').Append(patching.Name) .Append('(') .AppendJoin(", ", list) .Append(')') .Append(" with ") .Append(patch.DeclaringType.FullName) .Append('.') .Append(patch.Name) .AppendLine("\n"); Dictionary dictionary2 = new Dictionary(); LocalVariableInfo[] array = patching.GetMethodBody().LocalVariables.ToArray(); foreach (LocalVariableInfo localVariableInfo in array) { dictionary2.Add(localVariableInfo.LocalIndex, "(" + localVariableInfo.LocalType.FullName + ")"); } Dictionary dictionary3 = new Dictionary(); Dictionary dictionary4 = new Dictionary(); Dictionary dictionary5 = new Dictionary(); List list2 = new List(); int num = 0; bool flag = false; int count = codes.Count; Label? label = default(Label?); Label? label2 = default(Label?); for (int k = 0; k < count; k++) { bool flag2 = k == count - 1; CodeInstruction val = codes[k]; OpCode opcode = val.opcode; object operand = val.operand; Label[] array2 = val.labels.ToArray(); StringBuilder stringBuilder2; int num2; int num5; int count3; bool flag3; int num6; switch (num) { case 0: { int num3 = 0; if (opcode == OpCodes.Call || opcode == OpCodes.Callvirt) { MethodInfo methodInfo = val.operand as MethodInfo; num3 = -methodInfo.GetParameters().Length; if (!methodInfo.IsStatic) { num3--; } if (methodInfo.ReturnType != typeof(void)) { num3++; } } else if (stackChange.ContainsKey(opcode)) { num3 = stackChange[opcode]; } else { stringBuilder.Append("Error: Tried to add stack change value for OpCode: ").Append(opcode).Append(", but there was no saved value, setting change to 0!") .AppendLine("\n"); } list2.Add(num3); Label[] array3 = null; if (CodeInstructionExtensions.Branches(val, ref label)) { array3 = new Label[1] { label.Value }; } else if (opcode == OpCodes.Switch) { array3 = val.operand as Label[]; } Vector2Int val2; if (array3 != null) { dictionary4.Add(k, array3); for (int l = 0; l < array3.Length; l++) { label = array3[l]; if (!dictionary3.TryAdd(label.Value, new Vector2Int(k, -1))) { Label value = label.Value; int num4 = k; val2 = dictionary3[label.Value]; dictionary3[value] = new Vector2Int(num4, ((Vector2Int)(ref val2)).y); } } } int count2 = val.labels.Count; if (count2 <= 0) { break; } dictionary5.Add(k, array2); for (int m = 0; m < count2; m++) { Label key = array2[m]; if (!dictionary3.TryAdd(key, new Vector2Int(-1, k))) { val2 = dictionary3[key]; dictionary3[key] = new Vector2Int(((Vector2Int)(ref val2)).x, k); } } break; } case 1: stringBuilder2 = new StringBuilder(); if (stringBuilder[stringBuilder.Length - 1] == '\n') { if (stringBuilder[stringBuilder.Length - 2] == '\r') { num2 = ((stringBuilder[stringBuilder.Length - 3] == '\n') ? 1 : 0); goto IL_04af; } } num2 = 0; goto IL_04af; default: { flag = true; break; } IL_05d8: if (num5 >= 0) { stringBuilder2.Append(' ').Append(dictionary[num5]); } goto IL_08da; IL_08da: count3 = val.labels.Count; if (count3 > 0) { if (!flag3) { stringBuilder2.Insert(0, '\n'); } stringBuilder2.Append(" (Receives jump"); if (count3 > 1) { stringBuilder2.Append('s'); } stringBuilder2.Append(" from: "); List list3 = new List(); for (int n = 0; n < count3; n++) { if (!dictionary3.TryGetValue(val.labels[n], out var value2)) { list3.Add("NOT FOUND"); } else { list3.Add(((Vector2Int)(ref value2)).x); } } stringBuilder2.AppendJoin(", ", list3).Append(')'); } stringBuilder.AppendLine(stringBuilder2.ToString()); break; IL_04af: flag3 = (byte)num2 != 0; stringBuilder2.Append(k).Append(" (").Append(list2[k]) .Append(')') .Append(": ") .Append(((object)val).ToString()) .Replace("::", ".") .Replace(" NULL", string.Empty); if (CodeInstructionExtensions.IsLdarg(val, (int?)null) || CodeInstructionExtensions.IsLdarga(val, (int?)null) || CodeInstructionExtensions.IsStarg(val, (int?)null)) { if (operand is int) { num5 = (int)operand; if (true) { goto IL_05d8; } } num5 = -1; if (opcode == OpCodes.Ldarg_0) { num5 = 0; } else if (opcode == OpCodes.Ldarg_1) { num5 = 1; } else if (opcode == OpCodes.Ldarg_2) { num5 = 2; } else if (opcode == OpCodes.Ldarg_3) { num5 = 3; } goto IL_05d8; } if (CodeInstructionExtensions.IsLdloc(val, (LocalBuilder)null) || CodeInstructionExtensions.IsStloc(val, (LocalBuilder)null)) { if (operand is int) { num6 = (int)operand; if (true) { goto IL_0731; } } num6 = -1; if (CodeInstructionExtensions.IsLdloc(val, (LocalBuilder)null)) { if (opcode == OpCodes.Ldloc_0) { num6 = 0; } else if (opcode == OpCodes.Ldloc_1) { num6 = 1; } else if (opcode == OpCodes.Ldloc_2) { num6 = 2; } else if (opcode == OpCodes.Ldloc_3) { num6 = 3; } } else if (CodeInstructionExtensions.IsStloc(val, (LocalBuilder)null)) { if (opcode == OpCodes.Stloc_0) { num6 = 0; } else if (opcode == OpCodes.Stloc_1) { num6 = 1; } else if (opcode == OpCodes.Stloc_2) { num6 = 2; } else if (opcode == OpCodes.Stloc_3) { num6 = 3; } } goto IL_0731; } if (CodeInstructionExtensions.Branches(val, ref label2)) { stringBuilder2.Append(" (Jumps to: "); if (dictionary3.TryGetValue(label2.Value, out var value3)) { stringBuilder2.Append(((Vector2Int)(ref value3)).y); } else { stringBuilder2.Append("NOT FOUND"); } stringBuilder2.AppendLine(")"); } else if (opcode == OpCodes.Switch && operand is Label[] array4 && array2.Length != 0) { stringBuilder2.Append(" (Jumps to: "); List list4 = new List(); for (int num7 = 0; num7 < array4.Length; num7++) { if (!dictionary3.TryGetValue(array4[num7], out var value4)) { list4.Add("NOT FOUND"); } else { list4.Add(((Vector2Int)(ref value4)).y); } } stringBuilder2.AppendJoin(", ", list4).AppendLine(")"); } else if (!flag2 && opcode.Leaves()) { stringBuilder2.Append('\n'); } else if (opcode == OpCodes.Break) { if (!flag3) { stringBuilder2.Insert(0, '\n'); flag3 = true; } stringBuilder2.Append('\n'); } goto IL_08da; IL_0731: if (num6 >= 0) { stringBuilder2.Append(' ').Append(dictionary2[num6]); } goto IL_08da; } if (flag) { break; } if (flag2) { k = -1; num++; } } stringBuilder.Append('\n').AppendLine("----------------------------------------------------------------"); LogString(stringBuilder.ToString()); } public static List DebugString(string toLog, params Label[] labelsStart) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown return new List { CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldstr, (object)toLog), labelsStart), new CodeInstruction(OpCodes.Call, (object)logString) }; } public static List DebugLoad(string toLog, OpCode opcode, object operand = null, params Label[] labelsStart) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown List list = new List(); list.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldstr, (object)toLog), labelsStart)); list.Add(new CodeInstruction(OpCodes.Ldstr, (object)": ")); list.Add(new CodeInstruction(opcode, operand)); list.Add(new CodeInstruction(OpCodes.Box, (object)typeof(T))); list.Add(new CodeInstruction(OpCodes.Callvirt, (object)toString)); list.Add(new CodeInstruction(OpCodes.Call, (object)stringConcat3)); list.Add(new CodeInstruction(OpCodes.Call, (object)logString)); return list; } public static List DebugLoad(string toLog, IEnumerable loadInstructions, params Label[] labelsStart) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown List list = new List(); list.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldstr, (object)toLog), labelsStart)); list.Add(new CodeInstruction(OpCodes.Ldstr, (object)": ")); list.Add(new CodeInstruction(OpCodes.Box, (object)typeof(T))); list.Add(new CodeInstruction(OpCodes.Callvirt, (object)toString)); list.Add(new CodeInstruction(OpCodes.Call, (object)stringConcat3)); list.Add(new CodeInstruction(OpCodes.Call, (object)logString)); List list2 = list; list2.InsertRange(2, loadInstructions); return list2; } public static List DebugLoadFromThis(string toLog, IEnumerable loadInstructions, params Label[] labelsStart) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown List list = new List(); list.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldstr, (object)toLog), labelsStart)); list.Add(new CodeInstruction(OpCodes.Ldstr, (object)": ")); list.Add(new CodeInstruction(OpCodes.Ldarg, (object)0)); list.Add(new CodeInstruction(OpCodes.Box, (object)typeof(T))); list.Add(new CodeInstruction(OpCodes.Callvirt, (object)toString)); list.Add(new CodeInstruction(OpCodes.Call, (object)stringConcat3)); list.Add(new CodeInstruction(OpCodes.Call, (object)logString)); List list2 = list; list2.InsertRange(3, loadInstructions); return list2; } public static List DebugLoadFromThis(string toLog, OpCode opcode, object operand = null, params Label[] labelsStart) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown List list = new List(); list.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldstr, (object)toLog), labelsStart)); list.Add(new CodeInstruction(OpCodes.Ldstr, (object)": ")); list.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list.Add(new CodeInstruction(opcode, operand)); list.Add(new CodeInstruction(OpCodes.Box, (object)typeof(T))); list.Add(new CodeInstruction(OpCodes.Callvirt, (object)toString)); list.Add(new CodeInstruction(OpCodes.Call, (object)stringConcat3)); list.Add(new CodeInstruction(OpCodes.Call, (object)logString)); return list; } public static List DebugThisEnemyName(params Label[] labelsStart) { return DebugEnemyName(OpCodes.Ldarg_S, 0, labelsStart); } public static List DebugEnemyName(OpCode loadEnemyOpcode, object loadEnemyOperand = null, params Label[] labelsStart) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown return DebugLoad("Enemy", new List { new CodeInstruction(loadEnemyOpcode, loadEnemyOperand), new CodeInstruction(OpCodes.Ldfld, (object)enemyType), new CodeInstruction(OpCodes.Ldfld, (object)enemyName) }, labelsStart); } public static List DebugEnemyName(IEnumerable loadEnemyInstructions, params Label[] labelsStart) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown return DebugLoad("Enemy", new List(loadEnemyInstructions) { new CodeInstruction(OpCodes.Ldfld, (object)enemyType), new CodeInstruction(OpCodes.Ldfld, (object)enemyName) }, labelsStart); } public static List DebugThisPlayerName(params Label[] labelsStart) { return DebugPlayerName(OpCodes.Ldarg_S, 0, labelsStart); } public static List DebugPlayerName(OpCode loadPlayerOpcode, object loadPlayerOperand = null, params Label[] labelsStart) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown return DebugLoad("Player", new List { new CodeInstruction(loadPlayerOpcode, loadPlayerOperand), new CodeInstruction(OpCodes.Ldfld, (object)playerName) }, labelsStart); } public static List DebugPlayerName(IEnumerable loadPlayerInstructions, params Label[] labelsStart) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown return DebugLoad("Player", new List(loadPlayerInstructions) { new CodeInstruction(OpCodes.Ldfld, (object)playerName) }, labelsStart); } public static CodeInstruction StoreToLoad(CodeInstruction store) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown object operand = store.operand; CodeInstruction result = new CodeInstruction(OpCodes.Nop, (object)null); if (store.opcode == OpCodes.Stloc_0) { result = new CodeInstruction(OpCodes.Ldloc_S, (object)0); } else if (store.opcode == OpCodes.Stloc_1) { result = new CodeInstruction(OpCodes.Ldloc_S, (object)1); } else if (store.opcode == OpCodes.Stloc_2) { result = new CodeInstruction(OpCodes.Ldloc_S, (object)2); } else if (store.opcode == OpCodes.Stloc_3) { result = new CodeInstruction(OpCodes.Ldloc_S, (object)3); } else if (store.opcode == OpCodes.Stloc_S || store.opcode == OpCodes.Ldloc) { result = new CodeInstruction(OpCodes.Ldloc_S, operand); } else if (store.opcode == OpCodes.Starg_S || store.opcode == OpCodes.Starg) { result = new CodeInstruction(OpCodes.Ldarg_S, operand); } else if (store.opcode == OpCodes.Stfld || store.opcode == OpCodes.Stsfld) { result = new CodeInstruction(OpCodes.Ldfld, operand); } else if (store.opcode == OpCodes.Stobj) { result = new CodeInstruction(OpCodes.Ldobj, operand); } return result; } public static CodeInstruction LoadToStore(CodeInstruction load) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Expected O, but got Unknown //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Expected O, but got Unknown object operand = load.operand; CodeInstruction result = new CodeInstruction(OpCodes.Nop, (object)null); if (load.opcode == OpCodes.Ldloc_0) { result = new CodeInstruction(OpCodes.Stloc_S, (object)0); } else if (load.opcode == OpCodes.Ldloc_1) { result = new CodeInstruction(OpCodes.Stloc_S, (object)1); } else if (load.opcode == OpCodes.Ldloc_2) { result = new CodeInstruction(OpCodes.Stloc_S, (object)2); } else if (load.opcode == OpCodes.Ldloc_3) { result = new CodeInstruction(OpCodes.Stloc_S, (object)3); } else if (load.opcode == OpCodes.Ldloc_S || load.opcode == OpCodes.Ldloc) { result = new CodeInstruction(OpCodes.Stloc_S, operand); } else if (load.opcode == OpCodes.Ldarg_0) { result = new CodeInstruction(OpCodes.Starg_S, (object)0); } else if (load.opcode == OpCodes.Ldarg_1) { result = new CodeInstruction(OpCodes.Starg_S, (object)1); } else if (load.opcode == OpCodes.Ldarg_2) { result = new CodeInstruction(OpCodes.Starg_S, (object)2); } else if (load.opcode == OpCodes.Ldarg_3) { result = new CodeInstruction(OpCodes.Starg_S, (object)3); } else if (load.opcode == OpCodes.Ldarg_S || load.opcode == OpCodes.Ldarg) { result = new CodeInstruction(OpCodes.Starg_S, operand); } else if (load.opcode == OpCodes.Ldfld) { FieldInfo fieldInfo = operand as FieldInfo; if (fieldInfo != null) { result = ((!fieldInfo.IsStatic) ? new CodeInstruction(OpCodes.Stfld, operand) : new CodeInstruction(OpCodes.Stsfld, operand)); } } else if (load.opcode == OpCodes.Ldobj) { result = new CodeInstruction(OpCodes.Stobj, operand); } return result; } public static bool AreLoadEqual(CodeInstruction load1, CodeInstruction load2) { int? num = load1.operand as int?; int? num2 = load2.operand as int?; OpCode opcode = load1.opcode; OpCode opcode2 = load2.opcode; if (CodeInstructionExtensions.IsLdloc(load1, (LocalBuilder)null) && CodeInstructionExtensions.IsLdloc(load2, (LocalBuilder)null)) { if (opcode == opcode2 && CodeInstructionExtensions.OperandIs(load1, load2.operand)) { return true; } if (opcode == OpCodes.Ldloc || opcode == OpCodes.Ldloc_S) { return CodeInstructionExtensions.OperandIs(load1, load2.operand); } if (opcode == OpCodes.Ldloc_0) { return opcode2 == OpCodes.Ldloc_0 || (num2.HasValue && num2.Value == 0); } if (opcode == OpCodes.Ldloc_1) { return opcode2 == OpCodes.Ldloc_1 || (num2.HasValue && num2.Value == 1); } if (opcode == OpCodes.Ldloc_2) { return opcode2 == OpCodes.Ldloc_2 || (num2.HasValue && num2.Value == 2); } if (opcode == OpCodes.Ldloc_3) { return opcode2 == OpCodes.Ldloc_3 || (num2.HasValue && num2.Value == 3); } if ((opcode == OpCodes.Ldloca || opcode == OpCodes.Ldloca_S) && (opcode2 == OpCodes.Ldloca || opcode2 == OpCodes.Ldloca_S)) { return CodeInstructionExtensions.OperandIs(load1, load2.operand); } } else { if (CodeInstructionExtensions.IsLdarg(load1, (int?)null) && CodeInstructionExtensions.IsLdarg(load2, (int?)null)) { return (num2.HasValue && CodeInstructionExtensions.IsLdarg(load1, (int?)num2.Value)) || (num.HasValue && CodeInstructionExtensions.IsLdarg(load2, (int?)num.Value)); } if (CodeInstructionExtensions.IsLdarga(load1, (int?)null) && CodeInstructionExtensions.IsLdarga(load2, (int?)null)) { return CodeInstructionExtensions.OperandIs(load1, load2.operand); } } return opcode == opcode2 && CodeInstructionExtensions.OperandIs(load1, load2.operand); } public static bool Leaves(this CodeInstruction code) { return code.opcode.Leaves(); } public static bool Leaves(this OpCode opcode) { return opcode == OpCodes.Ret || opcode == OpCodes.Jmp || opcode == OpCodes.Leave || opcode == OpCodes.Leave_S || opcode == OpCodes.Throw || opcode == OpCodes.Rethrow || opcode == OpCodes.Ckfinite || opcode == OpCodes.Endfinally || opcode == OpCodes.Endfilter; } internal static (Harmony, Type[]) GetHarmony(string id, params Type[] toPatch) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown Dictionary harmonies = WildCardMod.Harmonies; if (!WildCardMod.Harmonies.TryGetValue(id, out var value)) { value = (new Harmony(id), toPatch); harmonies.Add(id, value); } return value; } internal static void TogglePatches(string harmonyID, bool patchIf, params Type[] types) { (Harmony, Type[]) harmony = GetHarmony(harmonyID, types); Harmony item = harmony.Item1; types = harmony.Item2; bool flag = Harmony.HasAnyPatches(harmonyID); if (patchIf) { if (flag || types == null) { return; } foreach (Type type in types) { if (WildCardMod.ModConfig.Debug) { WildCardMod.Instance.Log.LogDebug((object)$"Patching methods of class \"{type}\" with Harmony ID \"{harmonyID}\""); } item.PatchAll(type); } } else if (flag) { if (WildCardMod.ModConfig.Debug) { WildCardMod.Instance.Log.LogDebug((object)("Unpatching methods with Harmony ID \"" + harmonyID + "\"")); } item.UnpatchSelf(); } } internal static void ILCodeCheck() { } } public interface IWildCardBase { internal static int totalBases; string Name { get; set; } bool IsServer => false; bool IsOwner => false; Transform Transform => null; ListDict Audio => null; ListDict Animations => null; ListDict Particles => null; ListDict MeshRenderers => null; ListDict ModelVariants => null; ListDict Lights => null; int State { get; set; } AnimationHandler Animator { get; set; } bool NetworkAnimations { get; set; } Random Random => null; static void Awake(IWildCardBase instance) { totalBases++; if (instance.Animator != null) { instance.Animator.Base = instance; } for (int i = 0; i < instance.Audio.Count; i++) { SelectAudioClips selectAudioClips = instance.Audio[i]; selectAudioClips.SetBase(instance); if (selectAudioClips.HUDAudio) { selectAudioClips.HUDOverride(); } else { selectAudioClips.SetMixer(WildUtils.DiageticMasterGroup); } } for (int j = 0; j < instance.Animations.Count; j++) { SelectAnimationParameters selectAnimationParameters = instance.Animations[j]; selectAnimationParameters.SetBase(instance); selectAnimationParameters.SetAnimator(instance.Animator); selectAnimationParameters.SetRandom(instance.Random); if (selectAnimationParameters.playOnSpawn) { selectAnimationParameters.PlayAll(resetTimer: true); } } for (int k = 0; k < instance.Particles.Count; k++) { SelectParticles selectParticles = instance.Particles[k]; selectParticles.SetBase(instance); if (selectParticles.playOnAwake) { selectParticles.PlayAll(); } if (selectParticles.applyOnAwake) { selectParticles.AllApplyAll(); } } for (int l = 0; l < instance.MeshRenderers.Count; l++) { SelectRenderers selectRenderers = instance.MeshRenderers[l]; selectRenderers.SetBase(instance); if (selectRenderers.applyOnAwake) { selectRenderers.AllApplyAll(); } } for (int m = 0; m < instance.ModelVariants.Count; m++) { SelectModelVariants selectModelVariants = instance.ModelVariants[m]; selectModelVariants.SetBase(instance); } for (int n = 0; n < instance.Lights.Count; n++) { SelectLights selectLights = instance.Lights[n]; selectLights.SetBase(instance); } } static void OnNetworkPostSpawn(IWildCardBase instance, bool skipAudio = false) { instance.Animator?.SetNetworkEnabled(instance.NetworkAnimations); for (int i = 0; i < instance.ModelVariants.Count; i++) { SelectModelVariants selectModelVariants = instance.ModelVariants[i]; if (selectModelVariants.randomOnSpawn) { selectModelVariants.SwitchRandom(); } } for (int j = 0; j < instance.Lights.Count; j++) { SelectLights selectLights = instance.Lights[j]; if (selectLights.enableOnSpawn) { selectLights.EnableAll(); } } if (skipAudio) { return; } for (int k = 0; k < instance.Audio.Count; k++) { SelectAudioClips selectAudioClips = instance.Audio[k]; if (selectAudioClips.playOnSpawn) { selectAudioClips.PlayRandomClip(); } } } static void Update(IWildCardBase instance) { for (int i = 0; i < instance.Audio.Count; i++) { SelectAudioClips selectAudioClips = instance.Audio[i]; if (selectAudioClips.Loops) { selectAudioClips.LoopTick(); } } for (int j = 0; j < instance.Animations.Count; j++) { SelectAnimationParameters selectAnimationParameters = instance.Animations[j]; if (selectAnimationParameters.clientsTick || instance.IsServer) { selectAnimationParameters.TickAll(); } } } static void Initialize(IWildCardBase instance, ref List> audioClips, ref List> animations, ref List> particles, ref List> meshRenderers, ref List> modelVariants, ref List> lights, out ListDict audioDict, out ListDict animDict, out ListDict particleDict, out ListDict renderDict, out ListDict variantDict, out ListDict lightDict) { instance.Animator = AnimationHandler.Create(((Component)instance.Transform).GetComponentInChildren()); audioDict = new ListDict(); for (int i = 0; i < audioClips.Count; i++) { SelectablePair selectablePair = audioClips[i]; selectablePair.selectable.Id = i; selectablePair.selectable.SetBase(instance); audioDict.Add(selectablePair.id, selectablePair.selectable); } audioClips = null; animDict = new ListDict(); for (int j = 0; j < animations.Count; j++) { SelectablePair selectablePair2 = animations[j]; selectablePair2.selectable.Id = j; selectablePair2.selectable.SetBase(instance); animDict.Add(selectablePair2.id, selectablePair2.selectable); } animations = null; particleDict = new ListDict(); for (int k = 0; k < particles.Count; k++) { SelectablePair selectablePair3 = particles[k]; selectablePair3.selectable.Id = k; selectablePair3.selectable.SetBase(instance); particleDict.Add(selectablePair3.id, selectablePair3.selectable); } particles = null; renderDict = new ListDict(); for (int l = 0; l < meshRenderers.Count; l++) { SelectablePair selectablePair4 = meshRenderers[l]; selectablePair4.selectable.Id = l; selectablePair4.selectable.SetBase(instance); renderDict.Add(selectablePair4.id, selectablePair4.selectable); } meshRenderers = null; variantDict = new ListDict(); for (int m = 0; m < modelVariants.Count; m++) { SelectablePair selectablePair5 = modelVariants[m]; selectablePair5.selectable.Id = m; selectablePair5.selectable.SetBase(instance); variantDict.Add(selectablePair5.id, selectablePair5.selectable); } modelVariants = null; lightDict = new ListDict(); for (int n = 0; n < lights.Count; n++) { SelectablePair selectablePair6 = lights[n]; selectablePair6.selectable.Id = n; selectablePair6.selectable.SetBase(instance); lightDict.Add(selectablePair6.id, selectablePair6.selectable); } lights = null; } static bool HitOrDamage(IWildCardBase instance, IHittable hittable, int playerDamage, int hitForce, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1, CauseOfDeath playerDeathCause = (CauseOfDeath)0, float playerForceMultiplier = 1f) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = (PlayerControllerB)(object)((hittable is PlayerControllerB) ? hittable : null); if ((Object)(object)val != (Object)null) { instance.DamagePlayer(val, playerDamage, playerDeathCause, 0, hitDirection * playerForceMultiplier); return true; } return hittable.Hit(hitForce, hitDirection, playerWhoHit, playHitSFX, hitID); } void Initialize(); void PlayClipNetworked(int id, int index, bool oneShot, float volume, float pitch); void RepeatClipNetworked(int id, bool oneShot); void StopAudioNetworked(int id); void PauseAudioNetworked(int id, bool pause); void MuteAudioNetworked(int id, bool oneShot); void DogNoiseNetworked(int id, float volume, float pitch); void PlayParticlesNetworked(int id, bool restart, int index = -1); void StopParticlesNetworked(int id, bool clear, int index = -1); void PauseParticlesNetworked(int id, int index = -1); void ClearParticlesNetworked(int id, int index = -1); void EmitParticlesNetworked(int id, int count, int index = -1); void SetStateNetworked(int newState); void SetNetworkAnimationsNetworked(bool value); void SetParameterNetworked(int hash, float value = 0f); void SetVariantNetworked(int id, int variantIndex); void SetLightEnabledNetworked(int id, bool enable, int index = -1); void DamagePlayer(PlayerControllerB player, int damage, CauseOfDeath causeOfDeath = (CauseOfDeath)0, int animation = 0, Vector3 force = default(Vector3)); bool HitOrDamage(IHittable hittable, int playerDamage, int hitForce, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1, CauseOfDeath playerDeathCause = (CauseOfDeath)0, float playerForceMultiplier = 1f); } internal interface ILifeSaver { private static readonly Dictionary> lifeSavers = new Dictionary>(); internal static Dictionary> AllLifeSavers => lifeSavers; internal static bool AnyEnabled => AllLifeSavers.Count > 0; internal int Priority => 0; internal static bool TrySave(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0, Vector3 hitVelocity = default(Vector3), EnemyAI enemy = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) ILifeSaver lifeSaver = HasLifeSaver(player); if (lifeSaver == null) { return false; } if (lifeSaver.CanSave(player, cause)) { if (lifeSaver.TriggerWhen(player, cause)) { lifeSaver.Save(player, cause, hitVelocity, enemy); } return true; } return false; } internal static bool TrySaveGraceOnly(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0, Vector3 hitVelocity = default(Vector3), EnemyAI enemy = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) ILifeSaver lifeSaver = HasLifeSaver(player); if (lifeSaver == null) { return false; } if (lifeSaver.CanSave(player, cause) && lifeSaver.GraceWhen(player, cause)) { if (lifeSaver.TriggerWhen(player, cause)) { lifeSaver.Save(player, cause, hitVelocity, enemy); } return true; } return false; } internal static bool TrySaveTriggerOnly(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0, Vector3 hitVelocity = default(Vector3), EnemyAI enemy = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) ILifeSaver lifeSaver = HasLifeSaver(player); if (lifeSaver == null) { return false; } if (lifeSaver.CanSave(player, cause) && lifeSaver.TriggerWhen(player, cause)) { lifeSaver.Save(player, cause, hitVelocity, enemy); return true; } return false; } internal static ILifeSaver HasLifeSaver(PlayerControllerB player) { if ((Object)(object)player == (Object)null) { return null; } List list = new List(); string[] array = AllLifeSavers.Keys.ToArray(); for (int i = 0; i < array.Length; i++) { List list2 = AllLifeSavers[array[i]]; for (int j = 0; j < list2.Count; j++) { ILifeSaver lifeSaver = list2[j]; if (lifeSaver.CanSave(player, (CauseOfDeath)0)) { list.Add(lifeSaver); } } } list.Sort((ILifeSaver x, ILifeSaver y) => x.Priority.CompareTo(y.Priority)); return list.FirstOrDefault(); } internal static bool IsLifeSaver(GameObject gameObject, out ILifeSaver lifeSaver) { return IsLifeSaver((object)gameObject.GetComponentInChildren(), out lifeSaver); } internal static bool IsLifeSaver(object instance, out ILifeSaver lifeSaver) { if (instance == null) { lifeSaver = null; return false; } lifeSaver = instance as ILifeSaver; return lifeSaver != null; } internal static bool Register(object instance) { if (!IsLifeSaver(instance, out var lifeSaver)) { return false; } return Register(lifeSaver); } internal static bool Register(ILifeSaver newLifeSaver) { string name = newLifeSaver.GetType().Name; if (!AllLifeSavers.TryGetValue(name, out var value)) { return false; } value.Add(newLifeSaver); return true; } internal static void Unregister(object instance) { if (IsLifeSaver(instance, out var lifeSaver)) { Unregister(lifeSaver); } } internal static void Unregister(ILifeSaver oldLifeSaver) { string name = oldLifeSaver.GetType().Name; if (AllLifeSavers.TryGetValue(name, out var value)) { value.Remove(oldLifeSaver); } } internal bool UntargetableWhen(PlayerControllerB player); internal bool GraceWhen(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0); internal bool TriggerWhen(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0); internal bool CanSave(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0); internal void Save(PlayerControllerB player, CauseOfDeath cause = (CauseOfDeath)0, Vector3 hitVelocity = default(Vector3), EnemyAI enemy = null); } public static class EventsClass { public delegate void RoundStart(); public delegate void RoundEnd(); public static bool RoundStarted { get; private set; } public static event RoundStart OnRoundStart; public static event RoundEnd OnRoundEnd; internal static void RoundStartInvoke() { if (!RoundStarted) { RoundStarted = true; EventsClass.OnRoundStart?.Invoke(); } } internal static void RoundEndInvoke() { if (RoundStarted) { RoundStarted = false; EventsClass.OnRoundEnd?.Invoke(); } } } public static class WildUtils { private static AudioMixerGroup diageticMaster = null; public static readonly Dictionary playerSpeedMultipliers = new Dictionary(); public static ListDict AllEnemies { get; internal set; } public static ReadOnlyDictionary TrueEnemyNames { get; internal set; } public static AudioMixerGroup DiageticMasterGroup { get { if ((Object)(object)diageticMaster == (Object)null && (Object)(object)SoundManager.Instance != (Object)null) { diageticMaster = SoundManager.Instance.diageticMixer.FindMatchingGroups("Master")[0]; } return diageticMaster; } } public static bool IsSubclassOfRawGeneric(this Type toCheck, Type generic) { while (toCheck != null && toCheck != typeof(object)) { Type type = toCheck; if (toCheck.IsGenericType) { type = toCheck.GetGenericTypeDefinition(); } if (generic == type) { return true; } toCheck = toCheck.BaseType; } return false; } public static bool IsLocal(this PlayerControllerB player) { if ((Object)(object)player == (Object)null) { return false; } return ((NetworkBehaviour)player).IsOwner && (!((NetworkBehaviour)player).IsOwnedByServer || player.isHostPlayerObject); } public static StringBuilder GetAllFieldValues(this object instance, StringBuilder builder = null, int nestCount = 0) { nestCount++; if (builder == null) { builder = new StringBuilder(); } builder.AppendLine("\n"); for (int i = 0; i < nestCount - 1; i++) { builder.Append('\t'); } builder.Append($"{instance} values "); for (int j = 0; j < nestCount + 1; j++) { builder.Append('-'); } builder.Append('\n'); Type type = instance.GetType(); List declaredFields = AccessTools.GetDeclaredFields(type); Type baseType = type.BaseType; while (baseType != null && (typeof(GrabbableObject).IsAssignableFrom(baseType) || baseType.IsSubclassOfRawGeneric(typeof(Selectable<>)))) { declaredFields.AddRange(AccessTools.GetDeclaredFields(baseType)); baseType = baseType.BaseType; } for (int k = 0; k < declaredFields.Count; k++) { FieldInfo fieldInfo = declaredFields[k]; object value = fieldInfo.GetValue(instance); Type fieldType = fieldInfo.FieldType; string text = fieldType.ToString(); for (int l = 0; l < nestCount; l++) { builder.Append('\t'); } StringBuilder stringBuilder = builder; string name = fieldInfo.Name; string text2 = text; int num = text.LastIndexOf('.') + 1; stringBuilder.Append(name + " (" + text2.Substring(num, text2.Length - num) + "):"); if ((fieldType.IsArray && fieldType != typeof(string)) || (fieldType.IsGenericType && fieldType.GetGenericTypeDefinition() == typeof(List<>))) { builder = (value as IEnumerable).GetEnumerableValues(builder, nestCount); continue; } if (instance is Item && fieldInfo.Name == "spawnPrefab") { builder = ((GameObject)((value is GameObject) ? value : null)).GetComponent().GetAllFieldValues(builder, nestCount); continue; } if (instance is WildCardMapObject && fieldInfo.Name == "spawnableMapObject") { builder = ((SpawnableMapObject)((value is SpawnableMapObject) ? value : null)).prefabToSpawn.GetComponent().GetAllFieldValues(builder, nestCount); continue; } if (fieldType == typeof(RepeatingAnimation) || fieldType == typeof(BurstIntermediary) || fieldType.IsSubclassOfRawGeneric(typeof(Selectable<>))) { builder = value.GetAllFieldValues(builder, nestCount); continue; } string text3 = "null"; if (value != null && !(value is string { Length: 0 })) { text3 = value.ToString(); } builder.AppendLine(" " + text3 + "\n"); } return builder; } public static StringBuilder GetEnumerableValues(this IEnumerable data, StringBuilder builder = null, int nestCount = 0) { nestCount++; if (builder == null) { builder = new StringBuilder(); } if (data != null) { foreach (object datum in data) { builder.Append('\n'); Type type = datum.GetType(); if ((type.IsArray && type != typeof(string)) || (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>))) { builder = (datum as IEnumerable).GetEnumerableValues(builder, nestCount); continue; } if (type.IsAssignableFrom(typeof(Object))) { builder.AppendLine(datum.GetAllFieldValues(builder, nestCount).ToString()); continue; } if (type == typeof(RepeatingAnimation) || type == typeof(BurstIntermediary)) { builder.AppendLine(datum.GetAllFieldValues(builder, nestCount).ToString()); continue; } string value = "null"; if (datum != null && !(datum is string { Length: 0 })) { value = datum.ToString(); } for (int i = 0; i < nestCount; i++) { builder.Append('\t'); } builder.AppendLine(value); } } if (builder.ToString().EndsWith(':')) { builder.AppendLine(" null"); } return builder.AppendLine(); } public static RpcParams GetRPCTarget(this PlayerControllerB player) { //IL_0003: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) return RpcParams.op_Implicit(new RpcSendParams { Target = ((NetworkBehaviour)player).RpcTarget.Single(player.actualClientId, (RpcTargetUse)0) }); } public static float MultiplyPlayerSpeed(this PlayerControllerB player, float multiplier) { if ((Object)(object)player == (Object)null) { return 0f; } player.movementSpeed *= multiplier; int key = (int)player.playerClientId; if (!playerSpeedMultipliers.TryAdd(key, multiplier)) { playerSpeedMultipliers[key] *= multiplier; } return player.movementSpeed; } public static float MultiplyPlayerSpeed(int id, float multiplier) { return StartOfRound.Instance.allPlayerScripts[id].MultiplyPlayerSpeed(multiplier); } public static float ResetPlayerSpeed(this PlayerControllerB player) { if ((Object)(object)player == (Object)null) { return 0f; } int key = (int)player.playerClientId; if (!playerSpeedMultipliers.TryGetValue(key, out var value)) { return player.movementSpeed; } playerSpeedMultipliers[key] = 1f; player.movementSpeed /= value; return player.movementSpeed; } public static float ResetPlayerSpeed(int id) { return StartOfRound.Instance.allPlayerScripts[id].ResetPlayerSpeed(); } public static int GCD(this int[] values) { if (values == null || values.Length == 0) { return 0; } int num = values[0]; if (values.Length == 1) { return num; } for (int i = 1; i < values.Length; i++) { int num2 = values[i]; if (num2 <= 0 || num == 0) { num = num2; continue; } int num3 = num; int num4 = num2; while (num3 > 0 && num4 > 0) { if (num3 > num4) { num3 %= num4; } else { num4 %= num3; } } num = num3 | num4; } return num; } public static Burst CreateBurst(BurstIntermediary intermediary) { //IL_0036: 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_003a: Unknown result type (might be due to invalid IL or missing references) Burst result = default(Burst); ((Burst)(ref result))..ctor(intermediary.time, (short)intermediary.minCount, (short)intermediary.maxCount, intermediary.cycles, intermediary.interval); ((Burst)(ref result)).probability = intermediary.probability; return result; } public static Particles CreateParticleSystem(Transform transformTarget) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = ((Component)transformTarget).gameObject.AddComponent(); MainModule main = val.main; ((MainModule)(ref main)).playOnAwake = false; return Particles.Create(val); } public static void RegisterMapObject(IndoorMapHazard mapObject, LevelTypes levels, Func spawnRateFunction = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) RegisterMapObject(mapObject.hazardType, levels, spawnRateFunction); } public static void RegisterMapObject(IndoorMapHazard mapObject, LevelTypes levels = (LevelTypes)1, string[] levelOverrides = null, Func spawnRateFunction = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) RegisterMapObject(mapObject.hazardType, levels, levelOverrides, spawnRateFunction); } public static void RegisterMapObject(IndoorMapHazardType mapObject, LevelTypes levels, Func spawnRateFunction = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) RegisterMapObject(mapObject, levels, null, spawnRateFunction); } public static void RegisterMapObject(IndoorMapHazardType mapObject, LevelTypes levels = (LevelTypes)1, string[] levelOverrides = null, Func spawnRateFunction = null) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown MapObjects.mapObjects.Add(new RegisteredMapObject { indoorMapHazardType = mapObject, levels = levels, spawnRateFunction = spawnRateFunction, spawnLevelOverrides = levelOverrides }); } public static void RemoveMapObject(IndoorMapHazard mapObject, LevelTypes levelFlags, string[] levelOverrides = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) RemoveMapObject(mapObject.hazardType, levelFlags, levelOverrides); } public static void RemoveMapObject(IndoorMapHazardType mapObject, LevelTypes levelFlags, string[] levelOverrides = null) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)StartOfRound.Instance == (Object)null) { return; } SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { string name = ((Object)val).name; bool flag = ((Enum)levelFlags).HasFlag((Enum)(object)(LevelTypes)(-1)) || (levelOverrides != null && levelOverrides.Any((string item) => item.ToLowerInvariant() == name.ToLowerInvariant())) || (((Enum)levelFlags).HasFlag((Enum)(object)(LevelTypes)1024) && !Enum.IsDefined(typeof(LevelTypes), name)); if (!(Enum.IsDefined(typeof(LevelTypes), name) || flag)) { continue; } LevelTypes val2 = (LevelTypes)(flag ? (-1) : ((int)(LevelTypes)Enum.Parse(typeof(LevelTypes), name))); if (flag || ((Enum)levelFlags).HasFlag((Enum)(object)val2)) { val.indoorMapHazards = val.indoorMapHazards.Where((IndoorMapHazard x) => (Object)(object)x.hazardType.prefabToSpawn != (Object)(object)mapObject.prefabToSpawn).ToArray(); } } } public static string[] LayersFromMask(int mask) { string text = Convert.ToString(mask, 2); List list = new List(); for (int num = text.Length - 1; num >= 0; num--) { if (text[num] != '0') { list.Add(LayerMask.LayerToName(num)); } } return list.ToArray(); } } [Serializable] public class KeyBinds : LcInputActions { [InputAction(/*Could not decode attribute arguments.*/)] public InputAction WildCardButton { get; private set; } } [Serializable] public class BurstIntermediary { [Min(0f)] [SerializeField] public float time = 0f; [Min(0f)] [SerializeField] public int minCount = 0; [Min(0f)] [SerializeField] public int maxCount = 0; [Min(0f)] [SerializeField] public int cycles = 0; [Range(0f, 1f)] [SerializeField] public float interval = 0f; [Range(0f, 1f)] [SerializeField] public float probability = 0f; public BurstIntermediary(float time = 0f, int minCount = 30, int maxCount = 30, int cycles = 0, float interval = 0.01f, float probability = 1f) { this.time = Mathf.Max(0f, time); this.minCount = Mathf.Max(0, minCount); this.maxCount = Mathf.Max(0, maxCount); this.cycles = Mathf.Max(0, cycles); this.interval = Mathf.Clamp01(interval); this.probability = Mathf.Clamp01(probability); } public BurstIntermediary(float time = 0f, int count = 30, int cycles = 0, float interval = 0.01f, float probability = 1f) : this(time, count, count, cycles, interval, probability) { } } [Serializable] public class AnimationHandler { [HideInInspector] [SerializeReference] private NetworkAnimator networkAnimator = null; [HideInInspector] [SerializeReference] private Animator animator = null; private Dictionary nameHashTypesDict; private Traverse updaterTraverse; private IWildCardBase wildCardBase; private ManualLogSource Log => WildCardMod.Instance.Log; public bool IsNetworked { get { if ((Object)(object)networkAnimator == (Object)null) { return false; } return ((Behaviour)networkAnimator).enabled; } } public Animator Original => animator; public NetworkAnimator OriginalNetworked => networkAnimator; public Dictionary Parameters { get { if (nameHashTypesDict == null || nameHashTypesDict.Count == 0) { ResetDictionary(); } return nameHashTypesDict; } } public IWildCardBase Base { get { if (wildCardBase == null) { wildCardBase = ((Component)networkAnimator).GetComponentInParent(); } return wildCardBase; } set { if (wildCardBase == null) { wildCardBase = value; } } } private AnimationHandler(NetworkAnimator animator) { networkAnimator = animator; this.animator = networkAnimator.Animator; } public static AnimationHandler Create(NetworkAnimator animator) { if ((Object)(object)animator == (Object)null) { return null; } if ((Object)(object)animator.Animator == (Object)null) { return null; } return new AnimationHandler(animator); } public bool SetParameter(string parameter, float value) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected I4, but got Unknown try { switch (GetParameterType(parameter)) { case (AnimatorControllerParameterType)0L: animator.SetFloat(parameter, value); break; case (AnimatorControllerParameterType)2L: animator.SetInteger(parameter, Mathf.RoundToInt(value)); break; case (AnimatorControllerParameterType)3L: animator.SetBool(parameter, Convert.ToBoolean(Mathf.RoundToInt(value))); break; default: if (IsNetworked) { networkAnimator.SetTrigger(parameter); } else { animator.SetTrigger(parameter); } break; } } catch (Exception ex) { ManualLogSource log = Log; Animator obj = animator; log.LogWarning((object)(((obj != null) ? ((Object)obj).name : null) + " animator tried to set parameter \"" + parameter + "\" but something went wrong!")); Log.LogWarning((object)ex); return false; } return true; } public bool SetParameter(int hash, float value) { return SetParameter(GetParameter(hash), value); } public bool Trigger(string parameter) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 if (!Parameters.TryGetValue(parameter, out var value)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return false; } if ((int)value.Item2 != 9) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not a trigger!")); return false; } try { if (IsNetworked) { networkAnimator.SetTrigger(value.Item1, true); return true; } animator.SetTrigger(value.Item1); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)(((obj3 != null) ? ((Object)obj3).name : null) + " animator tried to trigger \"" + parameter + "\" but something went wrong!")); Log.LogWarning((object)ex); return false; } return true; } public bool ResetTrigger(string parameter) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Invalid comparison between Unknown and I4 if (!Parameters.TryGetValue(parameter, out var value)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return false; } if ((int)value.Item2 != 9) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not a trigger!")); return false; } try { if (IsNetworked) { networkAnimator.ResetTrigger(value.Item1); return true; } animator.ResetTrigger(value.Item1); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)(((obj3 != null) ? ((Object)obj3).name : null) + " animator tried to trigger \"" + parameter + "\" but something went wrong!")); Log.LogWarning((object)ex); return false; } return true; } public bool SetFloat(string parameter, float value) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 if (!Parameters.TryGetValue(parameter, out var value2)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return false; } if ((int)value2.Item2 != 1) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not a float!")); return false; } try { animator.SetFloat(value2.Item1, value); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)$"{((obj3 != null) ? ((Object)obj3).name : null)} animator tried to set \"{parameter}\" to float \"{value}\" but something went wrong!"); Log.LogWarning((object)ex); return false; } return true; } public bool SetBool(string parameter, bool value) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 if (!Parameters.TryGetValue(parameter, out var value2)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return false; } if ((int)value2.Item2 != 4) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not a bool!")); return false; } try { animator.SetBool(value2.Item1, value); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)$"{((obj3 != null) ? ((Object)obj3).name : null)} animator tried to set \"{parameter}\" to bool \"{value}\" but something went wrong!"); Log.LogWarning((object)ex); return false; } return true; } public bool SetInt(string parameter, int value) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 if (!Parameters.TryGetValue(parameter, out var value2)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return false; } if ((int)value2.Item2 != 3) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not an int!")); return false; } try { animator.SetInteger(value2.Item1, value); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)$"{((obj3 != null) ? ((Object)obj3).name : null)} animator tried to set \"{parameter}\" to int \"{value}\" but something went wrong!"); Log.LogWarning((object)ex); return false; } return true; } public float GetFloat(string parameter) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 float result = 0f; if (!Parameters.TryGetValue(parameter, out var value)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return result; } if ((int)value.Item2 != 1) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not a float!")); return result; } try { result = animator.GetFloat(value.Item1); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)(((obj3 != null) ? ((Object)obj3).name : null) + " animator tried to get float from \"" + parameter + "\" but something went wrong!")); Log.LogWarning((object)ex); return result; } return result; } public bool GetBool(string parameter) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 bool result = false; if (!Parameters.TryGetValue(parameter, out var value)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return result; } if ((int)value.Item2 != 4) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not a bool!")); return result; } try { result = animator.GetBool(value.Item1); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)(((obj3 != null) ? ((Object)obj3).name : null) + " animator tried to get bool from \"" + parameter + "\" but something went wrong!")); Log.LogWarning((object)ex); return result; } return result; } public int GetInt(string parameter) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 int result = 0; if (!Parameters.TryGetValue(parameter, out var value)) { if (WildCardMod.ModConfig.Debug) { ManualLogSource log = Log; Animator obj = animator; log.LogDebug((object)(((obj != null) ? ((Object)obj).name : null) + " animator could not find a parameter of name \"" + parameter + "\"!")); } return result; } if ((int)value.Item2 != 3) { ManualLogSource log2 = Log; Animator obj2 = animator; log2.LogWarning((object)(((obj2 != null) ? ((Object)obj2).name : null) + " animator parameter \"" + parameter + "\" was not an int!")); return result; } try { result = animator.GetInteger(value.Item1); } catch (Exception ex) { ManualLogSource log3 = Log; Animator obj3 = animator; log3.LogWarning((object)(((obj3 != null) ? ((Object)obj3).name : null) + " animator tried to get int from \"" + parameter + "\" but something went wrong!")); Log.LogWarning((object)ex); return result; } return result; } public float GetNormalizedTime(int layerIndex = 0) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(layerIndex); return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime; } public void SetNetworkEnabled(bool enable) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown if (!((Object)(object)networkAnimator == (Object)null) && enable != ((Behaviour)networkAnimator).enabled) { if (updaterTraverse == null) { updaterTraverse = Traverse.Create((object)networkAnimator).Field("m_NetworkAnimatorStateChangeHandler"); } INetworkUpdateSystem val = (INetworkUpdateSystem)updaterTraverse.GetValue(); ((Behaviour)networkAnimator).enabled = enable; Base.SetNetworkAnimationsNetworked(enable); if (enable) { NetworkUpdateLoop.RegisterNetworkUpdate(val, (NetworkUpdateStage)4); } else { NetworkUpdateLoop.UnregisterNetworkUpdate(val, (NetworkUpdateStage)4); } } } public string[] GetParameters() { return Parameters.Keys.ToArray(); } public int[] GetHashes() { return Parameters.Values.Select(((int, AnimatorControllerParameterType) x) => x.Item1).ToArray(); } public int GetHash(string parameter) { if (!Parameters.TryGetValue(parameter, out var value)) { return 0; } return value.Item1; } public string GetParameter(int hash) { string[] parameters = GetParameters(); foreach (string text in parameters) { if (GetHash(text) == hash) { return text; } } return string.Empty; } public AnimatorControllerParameterType? GetParameterType(string parameter) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (!Parameters.TryGetValue(parameter, out var value)) { return null; } return value.Item2; } private void ResetDictionary() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) AnimatorControllerParameter[] parameters = animator.parameters; if (nameHashTypesDict == null) { nameHashTypesDict = new Dictionary(); } nameHashTypesDict.Clear(); foreach (AnimatorControllerParameter val in parameters) { nameHashTypesDict.TryAdd(val.name, (val.nameHash, val.type)); } } } [Serializable] public class Particles { [SerializeField] private ParticleSystem system = null; private ParticleSystemRenderer renderer = null; public ParticleSystem System => system; public ParticleSystemRenderer Renderer { get { if ((Object)(object)renderer == (Object)null && (Object)(object)system != (Object)null) { renderer = ((Component)system).GetComponent(); } return renderer; } } public Particles(ParticleSystem particleSystem) { system = particleSystem; renderer = ((Component)particleSystem).GetComponent(); } public static Particles Create(ParticleSystem particleSystem) { if ((Object)(object)particleSystem == (Object)null) { return null; } return new Particles(particleSystem); } } [Serializable] public class RepeatingTimer : Repeater { public bool Complete => base.CurrentTime <= 0f; public RepeatingTimer() { manualReset = true; } public RepeatingTimer(float min, float max) : base(min, max) { manualReset = true; } public RepeatingTimer(float noRandom) : this(noRandom, noRandom) { } public void Restart() { ResetTimer(); Resume(); } public override bool TimerOverride() { return false; } public override void TimerTrigger(bool overriden = false) { } } [Serializable] public class RepeatingAction : Repeater { private Action action; public RepeatingAction(Action action) { SetAction(action); } public override bool TimerOverride() { return false; } public override void TimerTrigger(bool overriden = false) { action(); } public void SetAction(Action action) { this.action = action; } } [Serializable] public class RepeatingAnimation : Repeater { public enum RandomAnimationType { None, FlipFlop, Between, From } [SerializeField] private string parameter = string.Empty; [SerializeField] private RandomAnimationType randomType = RandomAnimationType.None; [SerializeField] private float[] randomValues = null; [SerializeField] private bool manualNetwork = false; [SerializeField] private string syncToAudio = string.Empty; private AnimationHandler animator = null; private bool flipFlop = false; public string ParameterName => parameter; public RandomAnimationType RandomType { get { return randomType; } private set { randomType = value; } } public float[] Values { get { return randomValues; } private set { randomValues = value; } } public RepeatingAnimation(string parameter) { this.parameter = parameter; } public RepeatingAnimation(string parameter, AnimationHandler animationHandler) : this(parameter) { this.parameter = parameter; SetAnimator(animationHandler); } public override void TimerTrigger(bool overriden = false) { if (overriden) { SelectAudioClips selectAudioClips = animator.Base.Audio[syncToAudio]; if (selectAudioClips != null && selectAudioClips.IsPlaying) { DoAnimation(selectAudioClips.ClipTime); } else { DoAnimation(0f); } } else { DoAnimation(); } } public override bool TimerOverride() { return syncToAudio != null && syncToAudio.Length > 0; } public void DoAnimation(float? overrideValue = null) { if (overrideValue.HasValue) { SetParameter(overrideValue.Value); return; } float num = 0f; float num2 = 0f; if (Values != null && Values.Length != 0) { num = Mathf.Min(Values); num2 = Mathf.Max(Values); } if (Mathf.Approximately(num, num2)) { SetParameter(num); return; } switch (RandomType) { case RandomAnimationType.Between: SetParameter((float)animator.Base.Random.Next(Mathf.RoundToInt(num * 100f), Mathf.RoundToInt(num2 * 100f) + 1) * 0.01f); break; case RandomAnimationType.FlipFlop: flipFlop = !flipFlop; if (flipFlop) { SetParameter(num2); } else { SetParameter(num); } break; case RandomAnimationType.From: SetParameter(randomValues[animator.Base.Random.Next(0, randomValues.Length)]); break; default: SetParameter(0f); break; } } public void SetValues(RandomAnimationType? type = null, params float?[] toChange) { if (type.HasValue) { RandomType = type.Value; } if (toChange == null) { Values = new float[0]; return; } float[] array = new float[toChange.Length]; for (int i = 0; i < toChange.Length; i++) { if (toChange[i].HasValue) { array[i] = toChange[i].Value; } else if (i >= Values.Length) { array[i] = 0f; } else { array[i] = Values[i]; } } Values = array; } public void UpdateValues(params float?[] toChange) { float?[] array = new float?[Values.Length]; for (int i = 0; i < array.Length; i++) { if (i < toChange.Length && toChange[i].HasValue) { array[i] = toChange[i]; } else { array[i] = Values[i]; } } float?[] toChange2 = array; SetValues(null, toChange2); } public void SetAnimator(AnimationHandler animationHandler) { if (!animationHandler.GetParameterType(ParameterName).HasValue) { AnimationHandler animationHandler2 = animator; object obj; if (animationHandler2 == null) { obj = null; } else { Animator original = animationHandler2.Original; obj = ((original != null) ? ((Object)original).name : null); } throw new ArgumentOutOfRangeException((string?)obj + " animator could not find a parameter of name \"" + ParameterName + "\""); } animator = animationHandler; } private void SetParameter(float value) { animator.SetParameter(ParameterName, value); if (!animator.IsNetworked && manualNetwork) { animator.Base.SetParameterNetworked(animator.GetHash(ParameterName), value); } } } [Serializable] public abstract class Repeater { [Min(0f)] [SerializeField] private float timerMin = 0.5f; [Min(0f)] [SerializeField] private float timerMax = 5f; [SerializeField] internal bool manualReset = false; private Vector2Int timerMinMaxRound; private Func waitFor = () => true; private float timer = 0f; private bool pause = false; private Vector2? oldTimerValues = null; private Random random; public float CurrentTime => timer; public Vector2 TimerValues { get { //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_0015: Unknown result type (might be due to invalid IL or missing references) return new Vector2(timerMin, timerMax); } private set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) timerMin = value.x; timerMax = value.y; timerMinMaxRound = new Vector2Int(Mathf.RoundToInt(timerMin * 100f), Mathf.RoundToInt(timerMax * 100f) + 1); } } public Func LoopWaitsFor { get { if (waitFor == null) { waitFor = () => true; } return waitFor; } set { waitFor = value; } } public bool IsPlaying { get { return !pause; } private set { pause = !value; } } public Random Random { get { return random; } private set { random = value; } } public Repeater() { } public Repeater(float min, float max) { timerMin = min; timerMax = max; } public Repeater(float noRandom) : this(noRandom, noRandom) { } public void Tick() { if (pause) { return; } bool flag = TimerOverride(); if (flag) { TimerTrigger(flag); } else if (timer > 0f) { timer -= Time.deltaTime; } else if (LoopWaitsFor()) { if (manualReset) { Pause(); } else { ResetTimer(); } TimerTrigger(); } } public abstract void TimerTrigger(bool overriden = false); public abstract bool TimerOverride(); public void ResetTimer(bool undoOneTime = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0025: 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) Vector2 timerValues = TimerValues; if (undoOneTime && oldTimerValues.HasValue) { TimerValues = oldTimerValues.Value; oldTimerValues = null; } if (Mathf.Approximately(timerValues.x, timerValues.y)) { timer = timerValues.x; } else { timer = (float)Random.Next(((Vector2Int)(ref timerMinMaxRound)).x, ((Vector2Int)(ref timerMinMaxRound)).y) * 0.01f; } } public void Pause() { IsPlaying = false; } public void Resume() { IsPlaying = true; } public void SetTimer(float? newMin = null, float? newMax = null, bool oneTime = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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) Vector2 timerValues = TimerValues; if (oneTime) { oldTimerValues = timerValues; } if (newMin.HasValue) { timerValues.x = newMin.Value; } if (newMax.HasValue) { timerValues.y = newMax.Value; } TimerValues = timerValues; } public void SetRandom(Random random) { Random = random; SetTimer(); ResetTimer(); } } [Serializable] public class SelectablePair { [SerializeField] public string id = null; [SerializeField] public T selectable = default(T); } [Serializable] public class ListDict { [HideInInspector] [SerializeField] private List keys = new List(); [HideInInspector] [SerializeField] private List values = new List(); public TValue this[TKey target] { get { int index = IndexOf(target); if (!InRange(index)) { return default(TValue); } return values[index]; } set { int index = IndexOf(target); if (InRange(index)) { values[index] = value; } } } public TValue this[int index] { get { if (!InRange(index)) { return default(TValue); } return values[index]; } set { if (InRange(index)) { values[index] = value; } } } public List Keys => new List(keys); public List Values => new List(values); public int Count => keys.Count; public ListDict() { } public ListDict(IEnumerable keys, IEnumerable values) { this.keys = keys.ToList(); this.values = values.ToList(); } public bool Add(TKey key, TValue value) { if (keys.Contains(key)) { return false; } keys.Add(key); values.Add(value); return true; } public TValue NewGet(TKey key) { if (Add(key, default(TValue))) { TValue val = default(TValue); try { val = Activator.CreateInstance(); } finally { this[key] = val; } return val; } return this[key]; } public bool Insert(int index, TKey key, TValue value) { if (!InRange(index) || keys.Contains(key)) { return false; } keys.Insert(index, key); values.Insert(index, value); return true; } public bool Remove(TKey key) { return RemoveAt(keys.IndexOf(key)); } public bool RemoveAt(int index) { if (!InRange(index)) { return false; } keys.RemoveAt(index); values.RemoveAt(index); return true; } public void Clear() { keys.Clear(); values.Clear(); } public bool ContainsKey(TKey key) { return keys.Contains(key); } public bool ContainsValue(TValue value) { return values.Contains(value); } public bool ContainsPair(TKey key, TValue value) { if (!InRange(keys.IndexOf(key))) { return false; } return this[key].Equals(value); } public int IndexOf(TKey key) { return keys.IndexOf(key); } public TKey KeyOf(int index) { if (!InRange(index)) { return default(TKey); } return keys[index]; } public bool InRange(int index) { return index >= 0 && index < keys.Count; } public bool TryGetValue(TKey key, out TValue value) { value = default(TValue); if (!ContainsKey(key)) { return false; } value = this[key]; return true; } public ListDict Combined(ListDict other) { return new ListDict(keys.Concat(other.keys), values.Concat(other.values)); } } [Serializable] public class WeightedOption { [SerializeField] public string name; [Min(0f)] [SerializeField] public int weight = 0; [SerializeField] public T option = default(T); public WeightedOption(T option, int weight = 0) : this(option.ToString(), option, weight) { } public WeightedOption(string name, T option, int weight = 0) { this.name = name; this.option = option; this.weight = weight; } } [Serializable] public enum SkinType { Item, Enemy } [Serializable] [Flags] public enum AssetType { None = 0, Scrap = 1, Skin = 2, MapObject = 4, All = 7 } } namespace LCWildCardMod.Patches { internal static class CojiroPatches { private static ManualLogSource Log => WildCardMod.Instance.Log; [HarmonyPatch(typeof(PlayerControllerB), "PlayerHitGroundEffects")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool PlayerControllerB_PreventFallDamage(PlayerControllerB __instance) { try { if (!__instance.takingFallDamage) { return true; } Cojiro cojiro = default(Cojiro); if (__instance.isHoldingObject && ((Component)__instance.currentlyHeldObjectServer).TryGetComponent(ref cojiro) && cojiro.isFloating) { Log.LogDebug((object)"Cojiro Preventing Fall Damage"); __instance.takingFallDamage = false; return true; } for (int i = 0; i < __instance.ItemSlots.Length; i++) { if (!((Object)(object)__instance.ItemSlots[i] == (Object)null) && ((Component)__instance.ItemSlots[i]).TryGetComponent(ref cojiro) && ((GrabbableObject)cojiro).isPocketed && cojiro.LastPlayerHeldBy.IsLocal() && !(((GrabbableObject)cojiro).currentUseCooldown <= 0f)) { Log.LogDebug((object)"Cojiro Preventing Fall Damage"); __instance.takingFallDamage = false; return true; } } } catch (Exception ex) { Log.LogError((object)ex); } return true; } } internal static class DebugPatches { private static ManualLogSource Log => WildCardMod.Instance.Log; [HarmonyPatch(typeof(HarmonyHelper), "ILCodeCheck")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable CheckIL(IEnumerable instructions, ILGenerator generator, MethodBase original) { List list = new List(instructions); MethodBase.GetCurrentMethod().LogIL(original, list); return list; } } internal static class NecessaryPatches { private static ManualLogSource Log => WildCardMod.Instance.Log; [HarmonyPatch(typeof(StartOfRound), "ShipHasLeft")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool StartOfRound_EndRoundInvoke() { try { EventsClass.RoundEndInvoke(); } catch (Exception ex) { Log.LogError((object)ex); } return true; } [HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool GameNetworkManager_EndRoundInvoke() { try { EventsClass.RoundEndInvoke(); } catch (Exception ex) { Log.LogError((object)ex); } return true; } [HarmonyPatch(typeof(RoundManager), "waitForMainEntranceTeleportToSpawn")] [HarmonyWrapSafe] [HarmonyPostfix] internal static void RoundManager_StartRoundInvoke() { try { EventsClass.RoundStartInvoke(); } catch (Exception ex) { Log.LogError((object)ex); } } [HarmonyPatch(typeof(RoundManager), "Start")] [HarmonyWrapSafe] [HarmonyPostfix] internal static void RoundManager_GetEnemies() { WildUtils.AllEnemies = new ListDict(); for (int i = 0; i < StartOfRound.Instance.levels.Length; i++) { SelectableLevel val = StartOfRound.Instance.levels[i]; List list = new List(RoundManager.Instance.WeedEnemies); list.AddRange(val.Enemies); list.AddRange(val.OutsideEnemies); list.AddRange(val.DaytimeEnemies); for (int j = 0; j < list.Count; j++) { EnemyType enemyType = list[j].enemyType; WildUtils.AllEnemies.Add(enemyType.enemyName, enemyType); } } Dictionary dictionary = new Dictionary(); for (int k = 0; k < WildUtils.AllEnemies.Count; k++) { EnemyType val2 = WildUtils.AllEnemies[k]; if (!dictionary.ContainsKey(val2.enemyName)) { string value = val2.enemyName; ScanNodeProperties componentInChildren = val2.enemyPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { value = componentInChildren.headerText; } dictionary.Add(val2.enemyName, value); } } WildUtils.TrueEnemyNames = new ReadOnlyDictionary(dictionary); } } internal static class EnemyAIGraceSavePatch { [HarmonyTargetMethods] internal static IEnumerable GetEachEnemyPlayerCollision() { Assembly assembly = Assembly.GetAssembly(typeof(EnemyAI)); Type[] types = assembly.GetTypes(); IEnumerable source = types.Where((Type type) => typeof(EnemyAI).IsAssignableFrom(type)); IEnumerable source2 = source.Select((Type x) => x.GetMethod("OnCollideWithPlayer")); return source2.Where((MethodInfo x) => x.DeclaringType != typeof(EnemyAI) && x.DeclaringType != typeof(DressGirlAI)); } [HarmonyWrapSafe] [HarmonyTranspiler] [HarmonyAfter(new string[] { "deB.WildCard.save" })] internal static IEnumerable GraceSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Expected O, but got Unknown //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Expected O, but got Unknown //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Expected O, but got Unknown //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Expected O, but got Unknown //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Expected O, but got Unknown //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Expected O, but got Unknown //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Expected O, but got Unknown //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Expected O, but got Unknown //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown List list = new List(instructions); bool flag = false; int num = -1; int num2 = HarmonyHelper.damagePlayer.GetParameters().Length; CodeInstruction val = null; for (int i = 0; i < list.Count; i++) { if (val == null && CodeInstructionExtensions.Calls(list[i], HarmonyHelper.collision) && CodeInstructionExtensions.IsStloc(list[i + 1], (LocalBuilder)null)) { num = i; val = HarmonyHelper.StoreToLoad(list[i + 1]); } if (num == -1 || !CodeInstructionExtensions.Calls(list[i], HarmonyHelper.damagePlayer)) { continue; } flag = true; int num3 = -1; for (int num4 = i - num2; num4 >= 0; num4--) { if (HarmonyHelper.AreLoadEqual(list[num4], val)) { num3 = num4; break; } } if (num3 != -1) { Label label = generator.DefineLabel(); CodeInstruction val2 = new CodeInstruction(val); CodeInstructionExtensions.MoveLabelsTo(list[num3], val2); LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(val2); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerGrace)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label)); List collection = list2; list[i + 1].labels.Add(label); list.InsertRange(num3, collection); } break; } if (num == -1) { if (WildCardMod.ModConfig.Debug) { WildCardMod.Instance.Log.LogDebug((object)(original.DeclaringType.FullName + "." + original.Name + " does not use a local to store player collision result!")); } return list; } int num5 = -1; bool flag2 = false; Label? label2 = default(Label?); for (int j = num; j < list.Count; j++) { if (!CodeInstructionExtensions.Branches(list[j], ref label2)) { continue; } for (int num6 = j; num6 > num; num6--) { if (CodeInstructionExtensions.Calls(list[num6], HarmonyHelper.inequality)) { if (list[list.Count - 1].labels.Contains(label2.Value)) { num5 = j + 1; } else if (list[j + 1].opcode.Equals(OpCodes.Ret)) { num5 = j + 2; } flag2 = true; break; } } break; } int index = num + 2; List list3 = new List(); if (!flag2) { Label label3 = generator.DefineLabel(); list3.Add(val); list3.Add(new CodeInstruction(OpCodes.Ldnull, (object)null)); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.inequality)); list3.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label3)); list[list.Count - 1].labels.Add(label3); } if (!flag) { LocalBuilder localBuilder2 = generator.DeclareLocal(typeof(Vector3)); Label label4 = generator.DefineLabel(); list3.Add(val); list3.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder2)); list3.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list3.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder2)); list3.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerGrace)); list3.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label4)); if (num5 != -1 && list3.Count > 0) { index = num5; CodeInstructionExtensions.MoveLabelsTo(list[index], list3[0]); } list[list.Count - 1].labels.Add(label4); } list.InsertRange(index, list3); if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } } internal static class SavePatches { [HarmonyPatch(typeof(CadaverGrowthAI), "CurePlayer")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool CadaverGrowthAI_CureMore(CadaverGrowthAI __instance) { if (__instance.playerInfections[(uint)GameNetworkManager.Instance.localPlayerController.playerClientId].infected) { __instance.numberOfInfected--; } HUDManager.Instance.cadaverFilter = 0f; SoundManager.Instance.alternateEarsRinging = false; SoundManager.Instance.earsRingingTimer = 0f; return true; } [HarmonyPatch(typeof(DepositItemsDesk), "CollisionDetect")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool DepositItemsDesk_Save(DepositItemsDesk __instance) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (!__instance.attacking) { return true; } return !ILifeSaver.TrySave(GameNetworkManager.Instance.localPlayerController, (CauseOfDeath)0); } [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool PlayerControllerB_SaveDamage(PlayerControllerB __instance, ref CauseOfDeath causeOfDeath, ref Vector3 force) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return !ILifeSaver.TrySaveGraceOnly(__instance, causeOfDeath, force); } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool PlayerControllerB_SaveKill(PlayerControllerB __instance, ref Vector3 bodyVelocity, ref bool spawnBody, ref CauseOfDeath causeOfDeath) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if ((int)causeOfDeath == 0 || !spawnBody || !ILifeSaver.TrySave(__instance, causeOfDeath, bodyVelocity)) { return true; } return false; } [HarmonyPatch(typeof(SandWormAI), "EatPlayer")] [HarmonyWrapSafe] [HarmonyPrefix] internal static bool SandWormAI_Save(SandWormAI __instance, ref PlayerControllerB playerScript) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return !ILifeSaver.TrySave(playerScript, (CauseOfDeath)0, Vector3.up * 10f, (EnemyAI)(object)__instance); } [HarmonyPatch(typeof(BushWolfEnemy), "OnCollideWithPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable BushWolfEnemy_Save(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Expected O, but got Unknown //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Expected O, but got Unknown //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Expected O, but got Unknown //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Expected O, but got Unknown //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Expected O, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Expected O, but got Unknown //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Expected O, but got Unknown //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Expected O, but got Unknown //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Expected O, but got Unknown //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Expected O, but got Unknown //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Expected O, but got Unknown //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Expected O, but got Unknown //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Expected O, but got Unknown List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.onCollision)) { continue; } LocalBuilder localBuilder = generator.DeclareLocal(typeof(PlayerControllerB)); List list2 = new List { new CodeInstruction(OpCodes.Ldarg_S, (object)0), new CodeInstruction(OpCodes.Ldarg_S, (object)1), new CodeInstruction(OpCodes.Ldarg_S, (object)0), new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.foxInKill), new CodeInstruction(OpCodes.Ldc_I4_S, (object)0), new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.collision), new CodeInstruction(OpCodes.Stloc_S, (object)localBuilder) }; list.InsertRange(i + 1, list2); i += list2.Count + 1; for (int j = i; j < list.Count; j++) { if (!CodeInstructionExtensions.Calls(list[j], HarmonyHelper.collision)) { continue; } list[j] = new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder); for (int num = j - 1; num >= 0; num--) { if (list[num].labels.Count != 0) { CodeInstructionExtensions.MoveLabelsTo(list[num], list[j]); int num2 = j - num; list.RemoveRange(num, num2); if (j < i) { i -= num2; } break; } } break; } for (int k = i; k < list.Count; k++) { if (!CodeInstructionExtensions.Calls(list[k], HarmonyHelper.killPlayer)) { continue; } int num3 = -1; Label? label = null; for (int num4 = k; num4 >= 0; num4--) { if (CodeInstructionExtensions.Branches(list[num4], ref label)) { num3 = num4; break; } } if (!label.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } Label label2 = generator.DefineLabel(); for (int l = k; l < list.Count; l++) { if (list[l].labels.Contains(label.Value)) { LocalBuilder localBuilder2 = generator.DeclareLocal(typeof(Vector3)); Label label3 = generator.DefineLabel(); List list3 = new List(); list3.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list3.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)6)); list3.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder2)); list3.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list3.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder2)); list3.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayer)); list3.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label3)); list3.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.foxCancelReel)); list3.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.switchBehaviourLocal)); list3.Add(new CodeInstruction(OpCodes.Br_S, (object)label2)); List collection = list3; list[l].labels.Add(label2); list[num3 + 1].labels.Add(label3); list.InsertRange(num3 + 1, collection); break; } } break; } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(CadaverGrowthAI), "BurstFromPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable CadaverGrowthAI_Save(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Expected O, but got Unknown //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown List list = new List(instructions); Label? label = default(Label?); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.bloomBurst)) { continue; } for (int num = i; num >= 0; num--) { if (CodeInstructionExtensions.Branches(list[num], ref label)) { LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); Label label2 = generator.DefineLabel(); Label label3 = generator.DefineLabel(); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)5)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldnull, (object)null)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayer)); list2.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label2)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.playerClientId)); list2.Add(new CodeInstruction(OpCodes.Conv_I4, (object)null)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.cadaverCure)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.playerClientId)); list2.Add(new CodeInstruction(OpCodes.Conv_I4, (object)null)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.cadaverCureRPC)); list2.Add(new CodeInstruction(OpCodes.Br_S, (object)label3)); List collection = list2; list[num + 1].labels.Add(label2); list[i + 1].labels.Add(label3); list.InsertRange(num + 1, collection); break; } } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(CaveDwellerAI), "OnCollideWithPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable CaveDwellerAI_TriggerSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown List list = new List(instructions); Label? label2 = default(Label?); for (int num = list.Count - 1; num >= 0; num--) { if (CodeInstructionExtensions.Calls(list[num], HarmonyHelper.dwellerKill)) { Label? label = null; for (int i = num; i < list.Count; i++) { if (list[i].labels.Count != 0) { label = generator.DefineLabel(); list[i].labels.Add(label.Value); break; } } for (int num2 = num; num2 >= 0; num2--) { if (CodeInstructionExtensions.Branches(list[num2], ref label2)) { LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)6)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label.Value)); List collection = list2; list.InsertRange(num2 + 1, collection); break; } } break; } } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(CentipedeAI), "DamagePlayerOnIntervals")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable CentipedeAI_GraceSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown List list = new List(instructions); for (int num = list.Count - 1; num >= 0; num--) { if (CodeInstructionExtensions.Calls(list[num], HarmonyHelper.damagePlayer)) { for (int num2 = num; num2 >= 0; num2--) { if (list[num2].labels.Count != 0) { Label label = generator.DefineLabel(); CodeInstruction val = new CodeInstruction(OpCodes.Ldarg_S, (object)0); CodeInstructionExtensions.MoveLabelsTo(list[num2], val); LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(val); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.clingPlayer)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)5)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerGrace)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label)); List collection = list2; list[num + 1].labels.Add(label); list.InsertRange(num2, collection); break; } } break; } } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(DressGirlAI), "OnCollideWithPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable DressGirlAI_Save(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Expected O, but got Unknown //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Expected O, but got Unknown //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Expected O, but got Unknown //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Expected O, but got Unknown //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Expected O, but got Unknown List list = new List(instructions); Label? label2 = default(Label?); for (int num = list.Count - 1; num >= 0; num--) { if (CodeInstructionExtensions.Calls(list[num], HarmonyHelper.killPlayer)) { Label? label = null; List list2; for (int num2 = num; num2 >= 0; num2--) { if (CodeInstructionExtensions.Branches(list[num2], ref label2)) { LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); label = generator.DefineLabel(); list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayer)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label.Value)); List list3 = list2; list.InsertRange(num2 + 1, list3); num += list3.Count; break; } } if (!label.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } list2 = new List(); list2.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldarg_S, (object)0), new Label[1] { label.Value })); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.ghostStopChase)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Stfld, (object)HarmonyHelper.timesStared)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Stfld, (object)HarmonyHelper.timesSeenByPlayer)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Stfld, (object)HarmonyHelper.couldNotStare)); List collection = list2; list.InsertRange(num + 1, collection); break; } } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(DressGirlAI), "Update")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable DressGirlAI_Switch(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Expected O, but got Unknown List list = new List(instructions); Label? label = default(Label?); Label? label3 = default(Label?); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Branches(list[i], ref label)) { continue; } for (int j = i; j < list.Count; j++) { if (!list[j].labels.Contains(label.Value)) { continue; } Label label2 = generator.DefineLabel(); list[j].labels.Add(label2); for (int k = i + 1; k < list.Count; k++) { if (CodeInstructionExtensions.Branches(list[k], ref label3)) { list[k].opcode = OpCodes.Brfalse_S; for (int l = k; l < list.Count && !list[l].labels.Remove(label3.Value); l++) { } list[k + 1].labels.Add(label3.Value); LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.hauntingPlayer)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerGrace)); list2.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label2)); List collection = list2; list.InsertRange(k + 1, collection); break; } } break; } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable FlowermanAI_TriggerSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown List list = new List(instructions); Label? label = default(Label?); for (int num = list.Count - 1; num >= 0; num--) { if (CodeInstructionExtensions.Calls(list[num], HarmonyHelper.killPlayer)) { for (int num2 = num; num2 >= 0; num2--) { if (CodeInstructionExtensions.Branches(list[num2], ref label)) { Label label2 = generator.DefineLabel(); for (int i = num2; i < list.Count; i++) { if (list[i].labels.Contains(label.Value)) { list[i].labels.Add(label2); break; } } LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.specialAnim)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)4)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label2)); List collection = list2; list.InsertRange(num2 + 1, collection); break; } } break; } } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable ForestGiantAI_TriggerSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Expected O, but got Unknown //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown List list = new List(instructions); FieldInfo field = original.DeclaringType.GetField("playerBeingEaten"); Label? label = default(Label?); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.killPlayer)) { continue; } for (int num = i; num >= 0; num--) { if (CodeInstructionExtensions.Branches(list[num], ref label)) { LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); Label label2 = generator.DefineLabel(); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)field)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)8)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list2.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label2)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.giantStopKill)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.giantPlayerStealth)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)field)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.playerClientId)); list2.Add(new CodeInstruction(OpCodes.Conv_I4, (object)null)); list2.Add(new CodeInstruction(OpCodes.Ldc_R4, (object)0f)); list2.Add(new CodeInstruction(OpCodes.Stelem_R4, (object)null)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.switchBehaviour)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ret, (object)null)); List collection = list2; list[num + 1].labels.Add(label2); list.InsertRange(num + 1, collection); break; } } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(HauntedMaskItem), "FinishAttaching")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable HauntedMaskItem_Save(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Expected O, but got Unknown List list = new List(instructions); Label? label = default(Label?); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.allowDeath)) { continue; } for (int j = i; j < list.Count; j++) { if (!CodeInstructionExtensions.Branches(list[j], ref label)) { continue; } Label? label2 = null; for (int k = j; k < list.Count; k++) { if (list[k].labels.Contains(label.Value)) { label2 = generator.DefineLabel(); list[j].opcode = OpCodes.Brfalse_S; CodeInstructionExtensions.MoveLabelsTo(list[k], list[j + 1]); list[k].labels.Add(label2.Value); break; } } if (!label2.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.maskHeldBy)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)5)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldnull, (object)null)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayer)); list2.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label2.Value)); List collection = list2; list.InsertRange(j + 1, collection); break; } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(JesterAI), "OnCollideWithPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable JesterAI_TriggerSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.jesterKill)) { continue; } for (int num = i; num >= 0; num--) { if (list[num].opcode.Equals(OpCodes.Ret)) { LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); Label label = generator.DefineLabel(); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)6)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list2.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.switchBehaviour)); list2.Add(new CodeInstruction(OpCodes.Ret, (object)null)); List list3 = list2; CodeInstructionExtensions.MoveLabelsTo(list[num + 1], list3[0]); list[num + 1].labels.Add(label); list.InsertRange(num + 1, list3); break; } } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable MaskedPlayerEnemy_TriggerSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (!list[i].opcode.Equals(OpCodes.Switch) || !(list[i].operand is Label[] array) || array.Length < 5) { continue; } for (int j = i; j < list.Count; j++) { if (!list[j].labels.Contains(array[4])) { continue; } for (int k = j; k < list.Count; k++) { if (list[k].opcode.Equals(OpCodes.Stfld)) { Label label = generator.DefineLabel(); LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.specialAnim)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)4)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list2.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)1)); list2.Add(new CodeInstruction(OpCodes.Callvirt, (object)HarmonyHelper.cancelSpecialAnim)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_0, (object)null)); list2.Add(new CodeInstruction(OpCodes.Ret, (object)null)); List collection = list2; list[k + 1].labels.Add(label); list.InsertRange(k + 1, collection); break; } } break; } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(MouthDogAI), "OnCollideWithPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable MouthDogAI_TriggerSave(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Expected O, but got Unknown List list = new List(instructions); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.dogKill)) { continue; } Label? label = null; int num = i; while (num >= 0 && !CodeInstructionExtensions.Branches(list[num], ref label)) { num--; } if (!label.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); Label label2 = generator.DefineLabel(); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)6)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label2)); List collection = list2; for (int j = i; j < list.Count; j++) { if (list[j].labels.Contains(label.Value)) { list[list.Count - 1].labels.Add(label2); list.InsertRange(j, collection); break; } } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable PlayerControllerB_TriggerSaveDamage(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Expected O, but got Unknown //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected O, but got Unknown //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Expected O, but got Unknown //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Expected O, but got Unknown //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Expected O, but got Unknown //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Expected O, but got Unknown //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Expected O, but got Unknown //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Expected O, but got Unknown //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Expected O, but got Unknown //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Expected O, but got Unknown //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Expected O, but got Unknown //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Expected O, but got Unknown //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected O, but got Unknown //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Expected O, but got Unknown //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Expected O, but got Unknown //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Expected O, but got Unknown //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Expected O, but got Unknown //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Expected O, but got Unknown //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Expected O, but got Unknown //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Expected O, but got Unknown //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Expected O, but got Unknown //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06c3: Expected O, but got Unknown //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Expected O, but got Unknown //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Expected O, but got Unknown //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Expected O, but got Unknown List list = new List(instructions); LocalBuilder localBuilder = null; LocalBuilder localBuilder2 = null; Label? label = null; Label? label2 = null; Label? label3 = null; Label? label4 = default(Label?); for (int i = 0; i < list.Count; i++) { if (i - 3 < 0 || i + 6 >= list.Count) { continue; } if (CodeInstructionExtensions.Calls(list[i], HarmonyHelper.allowDeath)) { for (int j = i; j < list.Count; j++) { if (!CodeInstructionExtensions.Branches(list[j - 1], ref label4) || !list[j].opcode.Equals(OpCodes.Ret)) { continue; } for (int k = j; k < list.Count; k++) { if (CodeInstructionExtensions.Branches(list[k], ref label)) { localBuilder = generator.DeclareLocal(typeof(bool)); localBuilder2 = generator.DeclareLocal(typeof(bool)); list[k] = new CodeInstruction(OpCodes.Cgt, (object)null); List list2 = new List { new CodeInstruction(OpCodes.Ldc_I4_S, (object)0), new CodeInstruction(OpCodes.Ceq, (object)null), new CodeInstruction(OpCodes.Stloc_S, (object)localBuilder), new CodeInstruction(OpCodes.Ldc_I4_S, (object)0), new CodeInstruction(OpCodes.Stloc_S, (object)localBuilder2) }; list.InsertRange(k + 1, list2); i = k + list2.Count + 1; break; } } if (localBuilder == null || !label.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } break; } } if (localBuilder == null || !label.HasValue) { continue; } if (!label2.HasValue) { CodeInstructionExtensions.Branches(list[i], ref label2); } else if (!label3.HasValue && CodeInstructionExtensions.Branches(list[i], ref label3)) { List list3 = new List { new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder), new CodeInstruction(OpCodes.Brfalse_S, (object)label.Value), new CodeInstruction(OpCodes.Ldc_I4_S, (object)1), new CodeInstruction(OpCodes.Stloc_S, (object)localBuilder2) }; list.InsertRange(i + 1, list3); i += list3.Count + 1; Label label5 = generator.DefineLabel(); Label label6 = generator.DefineLabel(); Label label7 = generator.DefineLabel(); CodeInstruction val = new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder); for (int l = i; l < list.Count; l++) { if (CodeInstructionExtensions.Branches(list[l], ref label4)) { i = l; } if (list[l].labels.Count >= 3) { CodeInstructionExtensions.MoveLabelsTo(list[l], val); break; } } LocalBuilder localBuilder3 = generator.DeclareLocal(typeof(Vector3)); List list4 = new List(); list4.Add(val); list4.Add(new CodeInstruction(OpCodes.Brfalse_S, (object)label5)); list4.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list4.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)4)); list4.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder3)); list4.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list4.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder3)); list4.Add(new CodeInstruction(OpCodes.Ldnull, (object)null)); list4.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayerTrigger)); list4.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)0)); list4.Add(new CodeInstruction(OpCodes.Ceq, (object)null)); list4.Add(new CodeInstruction(OpCodes.Stloc_S, (object)localBuilder)); list4.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list4.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label6)); list4.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)1)); list4.Add(new CodeInstruction(OpCodes.Stloc_S, (object)localBuilder2)); list4.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder2), new Label[2] { label5, label6 })); list4.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label7)); List list5 = list4; for (int m = i; m < list.Count; m++) { if (!CodeInstructionExtensions.Calls(list[m], HarmonyHelper.mathfClamp3Int)) { continue; } for (int n = m; n < list.Count; n++) { if (CodeInstructionExtensions.StoresField(list[n], HarmonyHelper.playerHealth)) { list[n + 1].labels.Add(label7); break; } } break; } list.InsertRange(i + 1, list5); i += list5.Count + 1; for (int num = i; num < list.Count; num++) { if (!CodeInstructionExtensions.Calls(list[num], HarmonyHelper.updateHealth)) { continue; } for (int num2 = num; num2 > 0; num2--) { if (CodeInstructionExtensions.LoadsField(list[num2], HarmonyHelper.playerHealth, false)) { list.RemoveRange(num2 + 1, num - (num2 + 1)); List collection = new List { new CodeInstruction(OpCodes.Ldarg_S, (object)0), new CodeInstruction(OpCodes.Ldfld, (object)HarmonyHelper.playerHealth), new CodeInstruction(OpCodes.Ldc_I4_S, (object)100), new CodeInstruction(OpCodes.Ceq, (object)null), new CodeInstruction(OpCodes.Ldc_I4_S, (object)0), new CodeInstruction(OpCodes.Ceq, (object)null) }; list.InsertRange(num2 + 1, collection); break; } } break; } } else { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.killPlayer)) { continue; } for (int num3 = i; num3 < list.Count; num3++) { if (!CodeInstructionExtensions.Branches(list[num3], ref label4)) { continue; } Label label8 = generator.DefineLabel(); List list6 = new List { new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder), new CodeInstruction(OpCodes.Brfalse_S, (object)label8) }; CodeInstructionExtensions.MoveLabelsTo(list[num3 + 1], list6[0]); for (int num4 = num3; num4 < list.Count; num4++) { if (!CodeInstructionExtensions.Calls(list[num4], HarmonyHelper.makeInjured)) { continue; } for (int num5 = num4; num5 < list.Count; num5++) { if (CodeInstructionExtensions.Branches(list[num5], ref label4)) { list[num5 + 1].labels.Add(label8); break; } } break; } list.InsertRange(num3 + 1, list6); break; } break; } } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(RedLocustBees), "OnCollideWithPlayer")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable RedLocustBees_Save(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown List list = new List(instructions); Label? label = null; Label? label2 = default(Label?); Label? label3 = default(Label?); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.beeKill)) { continue; } for (int num = i; num >= 0; num--) { if (CodeInstructionExtensions.Branches(list[num], ref label2)) { label = generator.DefineLabel(); LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); List list2 = new List(); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)11)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayer)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label.Value)); List list3 = list2; CodeInstructionExtensions.MoveLabelsTo(list[num + 1], list3[0]); list.InsertRange(num + 1, list3); break; } } if (!label.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } for (int j = i; j < list.Count; j++) { if (CodeInstructionExtensions.Branches(list[j], ref label3) && !(label3.Value == label.Value)) { list[j].labels.Add(label.Value); break; } } break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(VehicleController), "DestroyCar")] [HarmonyWrapSafe] [HarmonyTranspiler] internal static IEnumerable VehicleController_Save(IEnumerable instructions, ILGenerator generator, MethodBase original) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Expected O, but got Unknown List list = new List(instructions); Label? label2 = default(Label?); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], HarmonyHelper.killPlayer)) { continue; } int index = -1; List list2 = new List(); Label? label = null; for (int num = i; num >= 0; num--) { if (CodeInstructionExtensions.Branches(list[num], ref label2)) { index = num + 1; label = generator.DefineLabel(); LocalBuilder localBuilder = generator.DeclareLocal(typeof(Vector3)); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)0)); list2.Add(new CodeInstruction(OpCodes.Ldc_I4_S, (object)3)); list2.Add(new CodeInstruction(OpCodes.Ldloca_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Initobj, (object)typeof(Vector3))); list2.Add(new CodeInstruction(OpCodes.Ldloc_S, (object)localBuilder)); list2.Add(new CodeInstruction(OpCodes.Ldnull, (object)null)); list2.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.savePlayer)); list2.Add(new CodeInstruction(OpCodes.Brtrue_S, (object)label.Value)); break; } } if (!label.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } int index2 = -1; Label? label3 = null; List list3 = new List(); for (int j = i; j < list.Count; j++) { if (list[j].labels.Count != 0) { index2 = j + 1; label3 = generator.DefineLabel(); list3.Add(new CodeInstruction(OpCodes.Br_S, (object)label3)); list3.Add(CodeInstructionExtensions.WithLabels(new CodeInstruction(OpCodes.Ldarg_S, (object)0), new Label[1] { label.Value })); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.exitDriver)); list3.Add(new CodeInstruction(OpCodes.Ldarg_S, (object)0)); list3.Add(new CodeInstruction(OpCodes.Call, (object)HarmonyHelper.exitPassenger)); break; } } if (!label3.HasValue) { WildCardMod.Instance.Log.LogWarning((object)("Unable to apply transpiler \"" + MethodBase.GetCurrentMethod().Name + "\" to \"" + original.Name + "\"!")); return instructions; } list[index2].labels.Add(label3.Value); list.InsertRange(index2, list3); list.InsertRange(index, list2); break; } if (WildCardMod.ModConfig.Debug) { MethodBase.GetCurrentMethod().LogIL(original, list); } return list; } [HarmonyPatch(typeof(EnemyAI), "PlayerIsTargetable")] [HarmonyWrapSafe] [HarmonyPostfix] internal static void EnemyAI_Untargetable(EnemyAI __instance, ref PlayerControllerB playerScript, ref bool __result) { if (__result) { ILifeSaver lifeSaver = ILifeSaver.HasLifeSaver(playerScript); if (lifeSaver != null) { __result = !lifeSaver.UntargetableWhen(playerScript); } } } [HarmonyPatch(typeof(PlayerControllerB), "CheckConditionsForSinkingInQuicksand")] [HarmonyWrapSafe] [HarmonyPostfix] internal static void PlayerControllerB_GraceSaveQuicksand(PlayerControllerB __instance, ref bool __result) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) if (__result && !__instance.isUnderwater) { __result = !ILifeSaver.TrySaveGraceOnly(__instance, (CauseOfDeath)5) && (!(__instance.sinkingValue >= 1f) || !ILifeSaver.TrySaveTriggerOnly(__instance, (CauseOfDeath)5)); } } } internal static class SkinsPatches { private static ManualLogSource Log => WildCardMod.Instance.Log; [HarmonyPatch(typeof(GrabbableObject), "Start")] [HarmonyWrapSafe] [HarmonyPostfix] internal static void GrabbableObject_ChangeAssets(GrabbableObject __instance) { try { WildCardSkin.SetSkin(__instance); } catch (Exception ex) { Log.LogError((object)ex); } } [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyWrapSafe] [HarmonyPostfix] internal static void EnemyAI_ChangeAssets(EnemyAI __instance) { try { WildCardSkin.SetSkin(__instance); } catch (Exception ex) { Log.LogError((object)ex); } } } } namespace LCWildCardMod.MapObjects { public class WildCardMapObject : NetworkBehaviour, IWildCardBase { [Space(3f)] [Header("WildCardMapObject")] [Space(3f)] [SerializeField] private List> audioClips = null; [SerializeField] private List> animations = null; [SerializeField] private List> particles = null; [SerializeField] private List> meshRenderers = null; [SerializeField] private List> modelVariants = null; [SerializeField] private List> lights = null; [SerializeField] private bool networkAnimations = false; [SerializeField] internal int basePlayerDamage = 15; [SerializeField] internal int baseHitDamage = 1; [SerializeField] internal float playerRange = 20f; [SerializeField] internal float maxForceDistance = 5f; [SerializeField] internal float maxForce = 3.5f; [HideInInspector] [SerializeField] private ListDict audioDict = null; [HideInInspector] [SerializeField] private ListDict animDict = null; [HideInInspector] [SerializeField] private ListDict particleDict = null; [HideInInspector] [SerializeField] private ListDict renderDict = null; [HideInInspector] [SerializeField] private ListDict variantDict = null; [HideInInspector] [SerializeField] private ListDict lightDict = null; [HideInInspector] [SerializeReference] private AnimationHandler animator = null; [HideInInspector] [SerializeReference] private bool initialized = false; private int state = -1; private PlayerControllerB targetPlayer = null; private Random random = null; internal static ManualLogSource Log => WildCardMod.Instance.Log; string IWildCardBase.Name { get { ((Object)((Component)this).gameObject).name = ((Object)((Component)this).gameObject).name.Replace("(Clone)", string.Empty); return ((Object)((Component)this).gameObject).name; } set { ScanNodeProperties componentInChildren = ((Component)this).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.headerText = value; } ((Object)((Component)this).gameObject).name = value; } } bool IWildCardBase.IsServer => ((NetworkBehaviour)this).IsServer; bool IWildCardBase.IsOwner => ((NetworkBehaviour)this).IsOwner; Transform IWildCardBase.Transform => ((Component)this).transform; ListDict IWildCardBase.Audio => Audio; ListDict IWildCardBase.Animations => Animations; ListDict IWildCardBase.Particles => Particles; ListDict IWildCardBase.MeshRenderers => MeshRenderers; ListDict IWildCardBase.ModelVariants => ModelVariants; ListDict IWildCardBase.Lights => Lights; int IWildCardBase.State { get { return State; } set { State = value; } } AnimationHandler IWildCardBase.Animator { get { return Animator; } set { Animator = value; } } bool IWildCardBase.NetworkAnimations { get { return networkAnimations; } set { NetworkAnimations = value; } } Random IWildCardBase.Random => Random; internal IWildCardBase Base => this; internal ListDict Audio { get { if (audioDict == null) { audioDict = new ListDict(); } return audioDict; } } internal ListDict Animations { get { if (animDict == null) { animDict = new ListDict(); } return animDict; } } internal ListDict Particles { get { if (particleDict == null) { particleDict = new ListDict(); } return particleDict; } } internal ListDict MeshRenderers { get { if (renderDict == null) { renderDict = new ListDict(); } return renderDict; } } internal ListDict ModelVariants { get { if (variantDict == null) { variantDict = new ListDict(); } return variantDict; } } internal ListDict Lights { get { if (lightDict == null) { lightDict = new ListDict(); } return lightDict; } } internal int State { get { return state; } set { if (state != value) { state = value; OnStateChange(value); SetStateRpc(value); } } } internal bool NetworkAnimations { get { if (animator == null) { return false; } return animator.IsNetworked; } set { if (animator != null && value != animator.IsNetworked) { networkAnimations = value; if (animator != null || animator.IsNetworked != networkAnimations) { animator.SetNetworkEnabled(networkAnimations); } } } } internal AnimationHandler Animator { get { if ((Object)(object)animator?.OriginalNetworked == (Object)null) { animator = null; } return animator; } set { animator = value; } } internal PlayerControllerB TargetPlayer { get { if (!((NetworkBehaviour)this).IsServer) { return targetPlayer; } PlayerControllerB closestPlayer = GetClosestPlayer(); if ((Object)(object)targetPlayer != (Object)(object)closestPlayer) { int playerRpc = -1; if ((Object)(object)closestPlayer != (Object)null) { playerRpc = (int)closestPlayer.playerClientId; } SetPlayerRpc(playerRpc); } targetPlayer = closestPlayer; return targetPlayer; } } internal List PlayersInRange => GetPlayersInRange(); internal Random Random { get { if (random == null) { random = new Random(StartOfRound.Instance.randomMapSeed + IWildCardBase.totalBases); } return random; } } internal virtual void InitializePrefab() { } internal virtual void Awake() { IWildCardBase.Awake(this); } internal virtual void Start() { if (WildCardMod.ModConfig.Debug) { Log.LogDebug((object)("Spawning " + ((IWildCardBase)this).Name)); } } protected override void OnNetworkPostSpawn() { ((NetworkBehaviour)this).OnNetworkPostSpawn(); IWildCardBase.OnNetworkPostSpawn(this); } internal virtual void Update() { IWildCardBase.Update(this); } internal virtual void OnStateChange(int newState) { } internal virtual void DamagePlayerLocal(int damage, CauseOfDeath causeOfDeath = (CauseOfDeath)0, int animation = 0, Vector3 force = default(Vector3)) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) GameNetworkManager.Instance.localPlayerController.DamagePlayer(damage, true, true, causeOfDeath, animation, false, force); } internal void PlayerFear(PlayerControllerB player, bool overTime, float amount, float cap) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) PlayerFearRpc(overTime, amount, cap, player.GetRPCTarget()); } internal virtual void PlayerFearLocal(bool overTime, float amount, float cap) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (overTime) { localPlayerController.IncreaseFearLevelOverTime(amount, cap); } else { localPlayerController.JumpToFearLevel(amount, true); } } internal virtual void PlayerForceLocal(float multiplier = 1f) { //IL_0012: 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_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_0049: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Vector3 val = ((Component)this).transform.position - ((Component)localPlayerController).transform.position; if (!(((Vector3)(ref val)).magnitude > maxForceDistance)) { float num = maxForce * multiplier; localPlayerController.externalForces += ((Vector3)(ref val)).normalized * (num - Mathf.Pow(((Vector3)(ref val)).magnitude * (Mathf.Sqrt(num) / maxForceDistance), 2f)); } } internal virtual PlayerControllerB GetClosestPlayer() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0055: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB result = null; float num = playerRange; List playersInRange = PlayersInRange; for (int i = 0; i < playersInRange.Count; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playersInRange[i]]; float num2 = Vector3.Distance(((Component)val.playerGlobalHead).transform.position, ((Component)this).transform.position + Vector3.up * 0.5f); if (!(num2 > num)) { result = val; num = num2; } } return result; } internal virtual List GetPlayersInRange() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 val = Vector3.up * 0.5f; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[i]; if (val2.isPlayerControlled && !Physics.Linecast(((Component)this).transform.position + val, val2.playerGlobalHead.position, 1107298560, (QueryTriggerInteraction)1)) { float num = Vector3.Distance(((Component)val2.playerGlobalHead).transform.position, ((Component)this).transform.position + val); if (!(num > playerRange)) { list.Add(i); } } } return list; } [Rpc(/*Could not decode attribute arguments.*/)] private void DamagePlayerRpc(int damage, int causeOfDeath = 0, int animation = 0, Vector3 force = default(Vector3), RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2244261178u, rpcParams, val, (SendTo)8, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, damage); BytePacker.WriteValueBitPacked(val2, causeOfDeath); BytePacker.WriteValueBitPacked(val2, animation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2244261178u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; DamagePlayerLocal(damage, (CauseOfDeath)causeOfDeath, animation, force); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayerFearRpc(bool overTime, float amount, float cap, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3727156033u, rpcParams, val, (SendTo)8, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref overTime, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref amount, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cap, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3727156033u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerFearLocal(overTime, amount, cap); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetPlayerRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2838621301u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2838621301u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (id < 0) { targetPlayer = null; } else { targetPlayer = StartOfRound.Instance.allPlayerScripts[id]; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayClipRpc(int id, int index, bool oneShot, float volume, float pitch) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(945295338u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref oneShot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref volume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pitch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 945295338u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.PlayClip(index, oneShot, networked: false, volume, pitch); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void RepeatClipRpc(int id, bool oneShot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1015524866u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref oneShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1015524866u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.RepeatClip(oneShot, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void StopAudioRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4110728965u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4110728965u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.Stop(networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PauseAudioRpc(int id, bool pause) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3811580853u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pause, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3811580853u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.SetPaused(pause); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void MuteAudioRpc(int id, bool oneShot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2476214899u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref oneShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2476214899u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.SetMute(oneShot, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void DogNoiseRpc(int id, float volume, float pitch) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1706298904u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref volume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pitch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1706298904u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.DogNoise(volume, pitch, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayParticlesRpc(int id, bool restart, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(518982720u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref restart, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 518982720u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.PlayAll(restart, networked: false); } else { selectParticles?.Play(index, restart, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void StopParticlesRpc(int id, bool clear, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(760470016u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clear, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 760470016u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.StopAll(clear, networked: false); } else { selectParticles?.Stop(index, clear, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PauseParticlesRpc(int id, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(282022709u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 282022709u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.PauseAll(networked: false); } else { selectParticles?.Pause(index, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ClearParticlesRpc(int id, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2633847748u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2633847748u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.ClearAll(networked: false); } else { selectParticles?.Clear(index, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EmitParticlesRpc(int id, int count, int index = -1) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3813186261u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, count); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3813186261u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.EmitAll(count, networked: false); } else { selectParticles?.Emit(index, count, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetStateRpc(int newState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2737144504u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newState); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2737144504u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; state = newState; OnStateChange(state); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetNetworkAnimationsRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(674122566u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 674122566u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; networkAnimations = value; if (animator != null && animator.IsNetworked != networkAnimations) { animator.SetNetworkEnabled(networkAnimations); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetParameterRpc(int hash, float value = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2044346173u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hash); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2044346173u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; animator?.SetParameter(hash, value); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetVariantRpc(int id, int variantIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1944732536u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, variantIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1944732536u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SelectModelVariants selectModelVariants = ModelVariants[id]; selectModelVariants.Switch(variantIndex, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetLightsEnabledRpc(int id, bool enable, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1903412524u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enable, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1903412524u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; SelectLights selectLights = Lights[id]; if (index < 0) { if (enable) { selectLights.EnableAll(networked: false); } else { selectLights.DisableAll(networked: false); } } else if (enable) { selectLights.Enable(index, networked: false); } else { selectLights.Disable(index, networked: false); } } void IWildCardBase.Initialize() { if (!initialized) { InitializePrefab(); IWildCardBase.Initialize(this, ref audioClips, ref animations, ref particles, ref meshRenderers, ref modelVariants, ref lights, out audioDict, out animDict, out particleDict, out renderDict, out variantDict, out lightDict); initialized = true; } } void IWildCardBase.PlayClipNetworked(int id, int index, bool oneShot, float volume, float pitch) { PlayClipRpc(id, index, oneShot, volume, pitch); } void IWildCardBase.RepeatClipNetworked(int id, bool oneShot) { RepeatClipRpc(id, oneShot); } void IWildCardBase.StopAudioNetworked(int id) { StopAudioRpc(id); } void IWildCardBase.PauseAudioNetworked(int id, bool pause) { PauseAudioRpc(id, pause); } void IWildCardBase.MuteAudioNetworked(int id, bool oneShot) { MuteAudioRpc(id, oneShot); } void IWildCardBase.DogNoiseNetworked(int id, float volume, float pitch) { DogNoiseRpc(id, volume, pitch); } void IWildCardBase.PlayParticlesNetworked(int id, bool restart, int index) { PlayParticlesRpc(id, restart, index); } void IWildCardBase.StopParticlesNetworked(int id, bool clear, int index) { StopParticlesRpc(id, clear, index); } void IWildCardBase.PauseParticlesNetworked(int id, int index) { PauseParticlesRpc(id, index); } void IWildCardBase.ClearParticlesNetworked(int id, int index) { ClearParticlesRpc(id, index); } void IWildCardBase.EmitParticlesNetworked(int id, int count, int index) { EmitParticlesRpc(id, count, index); } void IWildCardBase.SetStateNetworked(int newState) { SetStateRpc(newState); } void IWildCardBase.SetNetworkAnimationsNetworked(bool value) { SetNetworkAnimationsRpc(value); } void IWildCardBase.SetParameterNetworked(int hash, float value) { SetParameterRpc(hash, value); } void IWildCardBase.SetVariantNetworked(int id, int variantIndex) { SetVariantRpc(id, variantIndex); } void IWildCardBase.SetLightEnabledNetworked(int id, bool enable, int index) { SetLightsEnabledRpc(id, enable, index); } void IWildCardBase.DamagePlayer(PlayerControllerB player, int damage, CauseOfDeath causeOfDeath, int animation, Vector3 force) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected I4, but got Unknown DamagePlayerRpc(damage, (int)causeOfDeath, animation, force, player.GetRPCTarget()); } bool IWildCardBase.HitOrDamage(IHittable hittable, int playerDamage, int hitForce, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID, CauseOfDeath playerDeathCause, float playerForceMultiplier) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return IWildCardBase.HitOrDamage(this, hittable, playerDamage, hitForce, hitDirection, playerWhoHit, playHitSFX, hitID, playerDeathCause, playerForceMultiplier); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2244261178u, new RpcReceiveHandler(__rpc_handler_2244261178), "DamagePlayerRpc"); ((NetworkBehaviour)this).__registerRpc(3727156033u, new RpcReceiveHandler(__rpc_handler_3727156033), "PlayerFearRpc"); ((NetworkBehaviour)this).__registerRpc(2838621301u, new RpcReceiveHandler(__rpc_handler_2838621301), "SetPlayerRpc"); ((NetworkBehaviour)this).__registerRpc(945295338u, new RpcReceiveHandler(__rpc_handler_945295338), "PlayClipRpc"); ((NetworkBehaviour)this).__registerRpc(1015524866u, new RpcReceiveHandler(__rpc_handler_1015524866), "RepeatClipRpc"); ((NetworkBehaviour)this).__registerRpc(4110728965u, new RpcReceiveHandler(__rpc_handler_4110728965), "StopAudioRpc"); ((NetworkBehaviour)this).__registerRpc(3811580853u, new RpcReceiveHandler(__rpc_handler_3811580853), "PauseAudioRpc"); ((NetworkBehaviour)this).__registerRpc(2476214899u, new RpcReceiveHandler(__rpc_handler_2476214899), "MuteAudioRpc"); ((NetworkBehaviour)this).__registerRpc(1706298904u, new RpcReceiveHandler(__rpc_handler_1706298904), "DogNoiseRpc"); ((NetworkBehaviour)this).__registerRpc(518982720u, new RpcReceiveHandler(__rpc_handler_518982720), "PlayParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(760470016u, new RpcReceiveHandler(__rpc_handler_760470016), "StopParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(282022709u, new RpcReceiveHandler(__rpc_handler_282022709), "PauseParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(2633847748u, new RpcReceiveHandler(__rpc_handler_2633847748), "ClearParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(3813186261u, new RpcReceiveHandler(__rpc_handler_3813186261), "EmitParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(2737144504u, new RpcReceiveHandler(__rpc_handler_2737144504), "SetStateRpc"); ((NetworkBehaviour)this).__registerRpc(674122566u, new RpcReceiveHandler(__rpc_handler_674122566), "SetNetworkAnimationsRpc"); ((NetworkBehaviour)this).__registerRpc(2044346173u, new RpcReceiveHandler(__rpc_handler_2044346173), "SetParameterRpc"); ((NetworkBehaviour)this).__registerRpc(1944732536u, new RpcReceiveHandler(__rpc_handler_1944732536), "SetVariantRpc"); ((NetworkBehaviour)this).__registerRpc(1903412524u, new RpcReceiveHandler(__rpc_handler_1903412524), "SetLightsEnabledRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2244261178(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); int causeOfDeath = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeath); int animation = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref animation); Vector3 force = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).DamagePlayerRpc(damage, causeOfDeath, animation, force, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3727156033(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool overTime = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref overTime, default(ForPrimitives)); float amount = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref amount, default(ForPrimitives)); float cap = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cap, default(ForPrimitives)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).PlayerFearRpc(overTime, amount, cap, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2838621301(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).SetPlayerRpc(playerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_945295338(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_0049: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool oneShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref oneShot, default(ForPrimitives)); float volume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref volume, default(ForPrimitives)); float pitch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).PlayClipRpc(id, index, oneShot, volume, pitch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1015524866(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool oneShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref oneShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).RepeatClipRpc(id, oneShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4110728965(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).StopAudioRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3811580853(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool pause = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pause, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).PauseAudioRpc(id, pause); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2476214899(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool oneShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref oneShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).MuteAudioRpc(id, oneShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1706298904(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); float volume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref volume, default(ForPrimitives)); float pitch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).DogNoiseRpc(id, volume, pitch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_518982720(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool restart = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref restart, default(ForPrimitives)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).PlayParticlesRpc(id, restart, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_760470016(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool clear = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clear, default(ForPrimitives)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).StopParticlesRpc(id, clear, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_282022709(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).PauseParticlesRpc(id, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2633847748(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).ClearParticlesRpc(id, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3813186261(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int count = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref count); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).EmitParticlesRpc(id, count, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2737144504(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int stateRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stateRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).SetStateRpc(stateRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_674122566(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool networkAnimationsRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref networkAnimationsRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).SetNetworkAnimationsRpc(networkAnimationsRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2044346173(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hash = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hash); float value = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).SetParameterRpc(hash, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1944732536(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int variantIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref variantIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).SetVariantRpc(id, variantIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1903412524(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool enable = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enable, default(ForPrimitives)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardMapObject)(object)target).SetLightsEnabledRpc(id, enable, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WildCardMapObject"; } } public class WormPit : WildCardMapObject, IHittable { [Space(3f)] [Header("WormPit")] [Space(3f)] [SerializeField] private Transform irisTransform = null; [SerializeField] private float damageRadius = 2f; [SerializeField] private Vector2 peepingFear = new Vector2(1f, 0.5f); [SerializeField] private Vector2 consumingFear = new Vector2(2f, 1f); [SerializeField] private Vector2 peepBetweenMinMax = new Vector2(2.5f, 7.5f); [SerializeField] private Vector2 peepHoldMinMax = new Vector2(4f, 7f); [SerializeField] private float lookSpeed = 135f; [SerializeField] private float peepCooldown = 0f; private float peepWaitBetween = 5f; private float peepWaitHold = 0f; private bool peeping = false; private float lookLerp = 0f; private Quaternion initialRot = Quaternion.identity; private float hunger = 0f; private float patience = 5f; private float sleepiness = 0f; private bool consuming = false; private float localForceTimer = 0f; private Vector2 lookMinMax = new Vector2(225f, 315f); private Vector2Int peepBetweenRound = Vector2Int.zero; private Vector2Int peepHoldRound = Vector2Int.zero; private Vector2 PeepBetweenMinMax { set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) peepBetweenMinMax = value; peepBetweenRound = new Vector2Int(Mathf.RoundToInt(peepBetweenMinMax.x * 10f), Mathf.RoundToInt(peepBetweenMinMax.y * 10f) + 1); } } private Vector2 PeepHoldMinMax { set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) peepHoldMinMax = value; peepHoldRound = new Vector2Int(Mathf.RoundToInt(peepHoldMinMax.x * 10f), Mathf.RoundToInt(peepHoldMinMax.y * 10f) + 1); } } internal override void Start() { //IL_0003: 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) PeepBetweenMinMax = peepBetweenMinMax; PeepHoldMinMax = peepHoldMinMax; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { base.State = 0; } } internal override void Update() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (base.State == 0) { IrisLook(base.TargetPlayer); } else if (base.State == 2) { float num = 1f; if (localForceTimer > 0f) { num += localForceTimer; localForceTimer -= Time.deltaTime; } List playersInRange = base.PlayersInRange; if (playersInRange.Contains((int)GameNetworkManager.Instance.localPlayerController.playerClientId)) { PlayerFearLocal(overTime: true, consumingFear.x, consumingFear.y); PlayerForceLocal(num); } } if (!((NetworkBehaviour)this).IsServer) { return; } Vector3 val = Vector3.up * 0.5f; switch (base.State) { case 0: { PlayerControllerB val2 = base.TargetPlayer; if (peeping) { if ((Object)(object)val2 != (Object)null) { PlayerFear(val2, overTime: true, peepingFear.x, peepingFear.y); } if (peepCooldown >= peepWaitHold) { base.Audio["Squish"].PlayRandomOneshot(); base.Animator.SetBool("HoldPeep", value: false); peeping = false; peepCooldown = 0f; } } else if (peepCooldown >= peepWaitBetween) { base.Audio["Squish"].PlayRandomOneshot(); base.Animator.Trigger("Peep"); base.Animator.SetBool("HoldPeep", value: true); peepWaitBetween = (float)base.Random.Next(((Vector2Int)(ref peepBetweenRound)).x, ((Vector2Int)(ref peepBetweenRound)).y) / 10f; peepWaitHold = (float)base.Random.Next(((Vector2Int)(ref peepHoldRound)).x, ((Vector2Int)(ref peepHoldRound)).y) / 10f; peeping = true; peepCooldown = 0f; } if (hunger >= 5f) { peeping = false; peepCooldown = 0f; base.Animator.SetBool("HoldPeep", value: false); hunger = 0f; base.Audio["Growl"].PlayRandomOneshot(); base.State = 1; break; } peepCooldown += Time.deltaTime; if (peeping && !((Object)(object)val2 == (Object)null)) { float num2 = 1f; if (Vector3.Distance(((Component)this).transform.position + val, ((Component)val2).transform.position) <= 3f) { num2 = 2f; } hunger += Time.deltaTime * num2; } break; } case 1: { PlayerControllerB val3 = base.TargetPlayer; if (!((Object)(object)val3 == (Object)null)) { float num3 = Vector3.Distance(((Component)this).transform.position + val, ((Component)base.TargetPlayer).transform.position); if (num3 <= 5f || patience <= 0f) { patience = 5f; base.State = 2; } else if (!(num3 > 15f)) { patience -= Time.deltaTime; } } break; } case 2: if (consuming) { if (sleepiness >= 12.5f) { consuming = false; base.Animator.Trigger("Emerge"); base.Audio["Growl"].PlayRandomOneshot(); base.Audio["Music"].Stop(); sleepiness = (float)base.Random.Next(50, 126) / 10f; base.State = 3; } else if (base.PlayersInRange.Count == 0 && sleepiness >= 7.5f) { consuming = false; base.Animator.Trigger("Emerge"); sleepiness = 0f; base.Audio["Music"].Stop(); base.State = 0; } else { sleepiness += Time.deltaTime; } } else { consuming = true; sleepiness = 0f; base.Animator.Trigger("Emerge"); base.Audio["Music"].PlayRandomClip(); for (int i = 0; i < base.PlayersInRange.Count; i++) { PlayerFear(StartOfRound.Instance.allPlayerScripts[base.PlayersInRange[i]], overTime: false, 0.25f, 0f); } } break; case 3: if (sleepiness > 0f) { sleepiness -= Time.deltaTime; } else { base.State = 0; } break; } } internal override PlayerControllerB GetClosestPlayer() { if (!peeping && base.State != 1) { return null; } return base.GetClosestPlayer(); } internal override void OnStateChange(int newState) { base.OnStateChange(newState); if (base.State == 2) { localForceTimer = 1f; } } private void IrisLook(PlayerControllerB target) { //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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) if (Mathf.Approximately(lookLerp, 0f)) { initialRot = irisTransform.rotation; } if (lookLerp < 360f) { lookLerp += Time.deltaTime * lookSpeed; } else if (lookLerp > 360f) { lookLerp = 360f; } if (Quaternion.Dot(initialRot, irisTransform.rotation) < 0.95f) { lookLerp = 0f; return; } Quaternion val = Quaternion.LookRotation(((Component)this).transform.up); if ((Object)(object)target != (Object)null) { val = ((!target.IsLocal()) ? Quaternion.LookRotation(((Component)target.playerGlobalHead).transform.position - ((Component)this).transform.position) : Quaternion.LookRotation(((Component)target.gameplayCamera).transform.position - ((Component)this).transform.position)); } if (((Quaternion)(ref val)).eulerAngles.x < lookMinMax.x) { val = Quaternion.Euler(lookMinMax.x, ((Quaternion)(ref val)).eulerAngles.y, ((Quaternion)(ref val)).eulerAngles.z); } else if (((Quaternion)(ref val)).eulerAngles.x > lookMinMax.y) { val = Quaternion.Euler(lookMinMax.y, ((Quaternion)(ref val)).eulerAngles.y, ((Quaternion)(ref val)).eulerAngles.z); } irisTransform.rotation = Quaternion.RotateTowards(initialRot, val, lookLerp); } public void PitChomp() { //IL_002b: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00b1: 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) if (!((NetworkBehaviour)this).IsServer || !consuming) { return; } HashSet hashSet = new HashSet(); RaycastHit[] array = Physics.SphereCastAll(((Component)this).transform.position, damageRadius, Vector3.one, 0f, 1084754248, (QueryTriggerInteraction)2); IHittable val2 = default(IHittable); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2) && hashSet.Add(val2)) { IWildCardBase wildCardBase = base.Base; IHittable hittable = val2; int playerDamage = basePlayerDamage; int hitForce = baseHitDamage; Vector3 val3 = ((RaycastHit)(ref val)).transform.position - ((Component)this).transform.position; wildCardBase.HitOrDamage(hittable, playerDamage, hitForce, ((Vector3)(ref val3)).normalized, null, playHitSFX: true, 1, (CauseOfDeath)6); } } } public void PitAudioAnim() { if (base.State == 2 && ((NetworkBehaviour)this).IsServer) { base.Audio["Bite"].PlayRandomOneshot(); } } bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (base.State != 0) { return false; } HitRpc(); return true; } [Rpc(/*Could not decode attribute arguments.*/)] private void HitRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(91841300u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 91841300u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hunger = 5f; patience = 1f; base.State = 2; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(91841300u, new RpcReceiveHandler(__rpc_handler_91841300), "HitRpc"); base.__initializeRpcs(); } private static void __rpc_handler_91841300(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; ((WormPit)(object)target).HitRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WormPit"; } } } namespace LCWildCardMod.Items { public class BleedingHeart : WildCardProp { [Space(3f)] [Header("BleedingHeart")] [Space(3f)] [SerializeField] private AnimationCurve weightCurve = null; [SerializeField] private int valueLoss = 5; [SerializeField] private float minSlosh = 0.01f; [SerializeField] private Vector2 burstMinMax = new Vector2(0.2f, 0.8f); [SerializeField] private int burstIndex = 0; [SerializeField] private float killRange = 5f; [SerializeField] private float damageRange = 10f; [SerializeField] private int playerDamage = 25; [SerializeField] private float forceMultiplier = 10f; private int startingValue = 0; private float inverseStartingValue = 0f; private float intensityValue = 0f; private float targetLiquidLevel = 0f; private float startWeight = -1f; private float weightOverTime = 0f; private float movementMag = 0f; private int sensitivity = 0; private int levelLayerIndex = 0; private int sloshLayerIndex = 0; private bool exploding = false; public override void Start() { base.Start(); levelLayerIndex = base.Animator.Original.GetLayerIndex("LiquidLevelLayer"); sloshLayerIndex = base.Animator.Original.GetLayerIndex("SloshingLayer"); SetStartingValue(); } internal override void OnEnable() { EventsClass.OnRoundStart += SetStartingValue; } internal override void OnDisable() { EventsClass.OnRoundStart -= SetStartingValue; } private void SetStartingValue() { if (startingValue == 0) { startingValue = base.ScrapValue; } inverseStartingValue = 1f / (float)Mathf.Max(1, startingValue); } public override void Update() { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (((NetworkBehaviour)this).IsServer && ((GrabbableObject)this).currentUseCooldown <= 0f && !((GrabbableObject)this).isHeld && !((GrabbableObject)this).isHeldByEnemy && startingValue > 0 && !StartOfRound.Instance.inShipPhase) { movementMag = 0f; if (((GrabbableObject)this).scrapValue > 0) { base.ScrapValue -= valueLoss; SetIntensity(((float)startingValue - (float)base.ScrapValue) * inverseStartingValue); } ((GrabbableObject)this).currentUseCooldown = ((GrabbableObject)this).useCooldown; } if (((GrabbableObject)this).isHeld) { if (base.LastPlayerHeldBy.IsLocal()) { SetSlosh(Mathf.Clamp01(((Vector2)(ref base.LastPlayerHeldBy.moveInputVector)).magnitude), IngamePlayerSettings.Instance.settings.lookSensitivity); } float num = Mathf.Sqrt(minSlosh); Animator original = base.Animator.Original; int num2 = sloshLayerIndex; float num3 = movementMag + 0.5f; MovementActions movement = base.LastPlayerHeldBy.playerActions.Movement; Vector2 val = ((MovementActions)(ref movement)).Look.ReadValue(); original.SetLayerWeight(num2, Mathf.Clamp(num3 * Mathf.Max(num, ((Vector2)(ref val)).magnitude * 0.002777f) * Mathf.Max(1f, (float)sensitivity), num, 1f)); } else if (((GrabbableObject)this).isHeldByEnemy) { if (((NetworkBehaviour)base.LastEnemyHeldBy).IsOwner) { SetSlosh(Mathf.Lerp(0f, 1f, base.LastEnemyHeldBy.agent.speed * 0.05f), 50); } float num4 = Mathf.Sqrt(minSlosh); base.Animator.Original.SetLayerWeight(sloshLayerIndex, Mathf.Clamp((movementMag + 0.5f) * 0.25f * Mathf.Max(1f, (float)sensitivity), num4, 1f)); } if (((GrabbableObject)this).scrapValue <= 0 && ((GrabbableObject)this).hasBeenHeld && !exploding) { ((MonoBehaviour)this).StartCoroutine(ExplodeCoroutine()); } float layerWeight = base.Animator.Original.GetLayerWeight(levelLayerIndex); if (!Mathf.Approximately(layerWeight, targetLiquidLevel)) { if (Mathf.Approximately(startWeight, -1f)) { startWeight = layerWeight; } weightOverTime += Time.deltaTime; float num5 = Mathf.Lerp(startWeight, targetLiquidLevel, weightCurve.Evaluate(weightOverTime)); base.Animator.Original.SetLayerWeight(levelLayerIndex, num5); layerWeight = base.Animator.Original.GetLayerWeight(levelLayerIndex); if (Mathf.Approximately(layerWeight, targetLiquidLevel)) { startWeight = -1f; weightOverTime = 0f; } } } public override void EquipItem() { base.EquipItem(); SelectParticles selectParticles = base.Particles["Drip"]; selectParticles.PlayAll(restart: false, networked: false); selectParticles.EmitAll(2, networked: false); } public override void PocketItem() { base.PocketItem(); base.Particles["Drip"].StopAll(clear: true, networked: false); } public override void DiscardItem() { base.DiscardItem(); SelectParticles selectParticles = base.Particles["Drip"]; if (((NetworkBehaviour)this).IsServer && !selectParticles.AnyAlive()) { selectParticles.PlayAll(); selectParticles.EmitAll(2); } } internal override void GrabFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.GrabFromAny(fromPlayer, enemy); base.Animations["Beat"].ResumeAll(); } internal override void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.DiscardFromAny(fromPlayer, enemy); base.Animator.Original.SetLayerWeight(sloshLayerIndex, 0.1f); SelectAnimationParameters selectAnimationParameters = base.Animations["Beat"]; selectAnimationParameters.ResetAllTimers(); selectAnimationParameters.ResumeAll(); } public void HeartBeat() { if (((GrabbableObject)this).scrapValue > 0) { base.Audio["HeartBeat"].PlayRandomClip(oneShot: false, networked: false); } } private IEnumerator ExplodeCoroutine() { WildCardProp.Log.LogDebug((object)"Bleeding Heart is exploding!"); exploding = true; if (((GrabbableObject)this).isHeld) { PlayerControllerB player = base.LastPlayerHeldBy; int playerOriginalSlot = player.currentItemSlot; if ((Object)(object)player.currentlyHeldObjectServer != (Object)(object)this) { player.SwitchToItemSlot(Array.FindIndex(player.ItemSlots, (GrabbableObject x) => (Object)(object)x == (Object)(object)this), (GrabbableObject)null); } player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); if (playerOriginalSlot != player.currentItemSlot) { player.SwitchToItemSlot(playerOriginalSlot, (GrabbableObject)null); } } else if (((GrabbableObject)this).isHeldByEnemy) { EnemyForceDropItem(); } yield return (object)new WaitForEndOfFrame(); ((GrabbableObject)this).EnableItemMeshes(false); if (((NetworkBehaviour)this).IsServer) { base.Audio["Break"].PlayRandomOneshot(); } yield return (object)new WaitForEndOfFrame(); Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, killRange, damageRange, playerDamage, forceMultiplier, (GameObject)null, false); yield return (object)new WaitForSeconds(0.5f); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } public override int GetItemDataToSave() { return startingValue; } public override void LoadItemSaveData(int saveData) { startingValue = saveData; SetStartingValue(); } private void SetIntensity(float intensity, bool networked = true) { intensityValue = intensity; targetLiquidLevel = intensityValue; SelectParticles selectParticles = base.Particles["Drip"]; BurstIntermediary burstIntermediary = selectParticles.bursts[burstIndex]; burstIntermediary.probability = Mathf.Clamp(targetLiquidLevel, burstMinMax.x, burstMinMax.y); selectParticles.SetBurst(burstIndex, burstIntermediary); selectParticles.AllApplyEmission(); if (networked) { SetIntensityRpc(intensity); } } private void SetSlosh(float magnitude, int sensitivity, bool networked = true) { movementMag = magnitude; this.sensitivity = sensitivity; if (networked) { SetSloshRpc(magnitude, sensitivity); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetIntensityRpc(float intensity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2494649212u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref intensity, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2494649212u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetIntensity(intensity, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetSloshRpc(float magnitude, int sensitivity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1597123549u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref magnitude, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, sensitivity); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1597123549u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetSlosh(magnitude, sensitivity, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2494649212u, new RpcReceiveHandler(__rpc_handler_2494649212), "SetIntensityRpc"); ((NetworkBehaviour)this).__registerRpc(1597123549u, new RpcReceiveHandler(__rpc_handler_1597123549), "SetSloshRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2494649212(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float intensityRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref intensityRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BleedingHeart)(object)target).SetIntensityRpc(intensityRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1597123549(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) { float magnitude = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref magnitude, default(ForPrimitives)); int num = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref num); target.__rpc_exec_stage = (__RpcExecStage)1; ((BleedingHeart)(object)target).SetSloshRpc(magnitude, num); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BleedingHeart"; } } public class ClauviMask : WildCardProp { [Space(3f)] [Header("ClauviMask")] [Space(3f)] [SerializeField] private Transform meshTransform = null; private bool isLifted = false; private Coroutine peekCoroutine = null; public override void OnDestroy() { EndPeek(force: true, networked: false); ((GrabbableObject)this).OnDestroy(); } public override void GrabItemFromEnemy(EnemyAI enemy) { base.Animator.SetBool("IsEnemy", value: true); meshTransform.SetParent(enemy.eye); base.GrabItemFromEnemy(enemy); } public override void EquipItem() { base.EquipItem(); base.Animator.SetBool("IsEnemy", value: false); base.Animator.SetBool("IsOwner", ((NetworkBehaviour)this).IsOwner); if (((NetworkBehaviour)this).IsOwner) { meshTransform.SetParent(((Component)base.LastPlayerHeldBy.gameplayCamera).transform); } else { meshTransform.SetParent(base.LastPlayerHeldBy.bodyParts[0]); } } public override void PocketItem() { if (((NetworkBehaviour)this).IsOwner) { EndPeek(force: true); } base.PocketItem(); } internal override void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.DiscardFromAny(fromPlayer, enemy); if (((NetworkBehaviour)this).IsOwner) { EndPeek(force: true); } } internal override void WildCardUse(CallbackContext useContext) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Vector2 moveInputVector = base.LastPlayerHeldBy.moveInputVector; if (((NetworkBehaviour)this).IsOwner && ((GrabbableObject)this).isHeld && !isLifted && Mathf.Approximately(moveInputVector.x, 0f) && Mathf.Approximately(moveInputVector.y, 0f)) { peekCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayerPeek(((CallbackContext)(ref useContext)).action)); } } internal override void WildCardUse() { base.WildCardUse(); if (((GrabbableObject)this).isHeldByEnemy) { peekCoroutine = ((MonoBehaviour)this).StartCoroutine(EnemyPeek()); } } private IEnumerator PlayerPeek(InputAction action) { BeginPeek(); while (action.IsPressed() && ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed) { Vector2 movement = base.LastPlayerHeldBy.moveInputVector; if (!Mathf.Approximately(movement.x, 0f) || !Mathf.Approximately(movement.y, 0f)) { break; } yield return null; } EndPeek(); } private IEnumerator EnemyPeek() { if (((NetworkBehaviour)this).IsOwner) { BeginPeek(); } yield return (object)new WaitForSeconds((float)base.Random.Next(10, 51) * 0.1f); if (((NetworkBehaviour)this).IsOwner) { EndPeek(); } } private void BeginPeek(bool networked = true) { WildCardProp.Log.LogDebug((object)("\"" + ((Item)base.CurrentItem).itemName + "\" Beginning Peek")); isLifted = true; base.Animator.SetBool("Lifted", isLifted); if (networked) { BeginPeekRpc(); } } private void EndPeek(bool force = false, bool networked = true) { WildCardProp.Log.LogDebug((object)("\"" + ((Item)base.CurrentItem).itemName + "\" Ending Peek")); if (force) { meshTransform.SetParent(((Component)this).transform); } if (peekCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(peekCoroutine); peekCoroutine = null; } isLifted = false; base.Animator.SetBool("Lifted", isLifted); if (networked) { EndPeekRpc(force); } } [Rpc(/*Could not decode attribute arguments.*/)] private void BeginPeekRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2170430057u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2170430057u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BeginPeek(networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EndPeekRpc(bool force) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3590753455u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3590753455u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EndPeek(force, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2170430057u, new RpcReceiveHandler(__rpc_handler_2170430057), "BeginPeekRpc"); ((NetworkBehaviour)this).__registerRpc(3590753455u, new RpcReceiveHandler(__rpc_handler_3590753455), "EndPeekRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2170430057(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; ((ClauviMask)(object)target).BeginPeekRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3590753455(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool force = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClauviMask)(object)target).EndPeekRpc(force); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ClauviMask"; } } public class ClauviMouse : WildCardProp { [Space(3f)] [Header("ClauviMouse")] [Space(3f)] [SerializeField] private float intensityMultiplier = 0.5f; [SerializeField] private int maxAgitate = 10; [SerializeField] private Vector2 agitateMinMax = new Vector2(4.5f, 9f); [SerializeField] private int maxCryTime = 20; private Vector2Int agitateMinMaxRound = Vector2Int.zero; private Coroutine agitateCounter = null; private int agitate = 0; private int Agitate { get { return agitate; } set { if (agitate != value) { SetAgitateRpc(value); } agitate = value; } } private Vector2 AgitateMinMax { set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) agitateMinMax = value; agitateMinMaxRound = new Vector2Int(Mathf.RoundToInt(agitateMinMax.x * 10f), Mathf.RoundToInt(agitateMinMax.y * 10f) + 1); } } public override void Start() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) base.Start(); base.Animations["Sleep Sync"].clientsTick = true; base.Particles["Sleep"].PlayAll(restart: false, networked: false); AgitateMinMax = agitateMinMax; } public override void OnNetworkSpawn() { base.OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { base.State = 0; } } public override void ItemActivate(bool used, bool buttonDown = true) { float num = 1f; if (base.State == 1) { num = Mathf.Max(1f, (float)Agitate * intensityMultiplier); ((GrabbableObject)this).currentUseCooldown = ((GrabbableObject)this).currentUseCooldown / num; } base.Animator.SetFloat("Intensity", num); if (((NetworkBehaviour)this).IsOwner) { Agitate = Mathf.Max(agitate - 1, 0); if (Agitate == 0 && base.State == 1) { base.State = 0; } } base.ItemActivate(used, buttonDown); } public override void GrabItem() { base.GrabItem(); if (((NetworkBehaviour)this).IsServer && agitateCounter == null) { agitateCounter = ((MonoBehaviour)this).StartCoroutine(AgitateCoroutine()); } } public override void PocketItem() { base.PocketItem(); base.Particles["Sleep"].StopAll(clear: true, networked: false); } public override void EquipItem() { base.EquipItem(); base.Particles["Sleep"].PlayAll(restart: false, networked: false); } public override void DiscardItem() { base.DiscardItem(); base.Particles["Sleep"].PlayAll(restart: false, networked: false); } private IEnumerator AgitateCoroutine() { while (Agitate < maxAgitate) { yield return (object)new WaitForSeconds((float)base.Random.Next(((Vector2Int)(ref agitateMinMaxRound)).x, ((Vector2Int)(ref agitateMinMaxRound)).y) * 0.1f); Agitate++; } yield return (object)new WaitUntil((Func)(() => !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.currentLevel.planetHasTime)); WildCardProp.Log.LogDebug((object)"Clauvi Mouse Crying"); base.State = 1; ((MonoBehaviour)this).StartCoroutine(CryingCoroutine()); } private IEnumerator CryingCoroutine() { int cryingTime = 0; while (base.State == 1 || cryingTime < maxCryTime) { cryingTime++; yield return (object)new WaitForSeconds(1f); } WildCardProp.Log.LogDebug((object)"Clauvi Mouse Sleebing"); agitateCounter = ((MonoBehaviour)this).StartCoroutine(AgitateCoroutine()); } internal override void OnStateChange(int id) { base.Particles["Sleep"].SetMaterialTexture(0, 0, id); base.MeshRenderers["Main"].SetMaterialTexture(0, 1, id); SelectAudioClips selectAudioClips; SelectAudioClips selectAudioClips2; if (base.State == 0) { selectAudioClips = base.Audio["Sleep"]; selectAudioClips2 = base.Audio["Cry"]; } else { selectAudioClips = base.Audio["Cry"]; selectAudioClips.SetAudibleLoop(loop: true); selectAudioClips2 = base.Audio["Sleep"]; } selectAudioClips2.SetAudibleLoop(loop: false); selectAudioClips2.Stop(networked: false); base.Animator.SetBool("Sleeping", base.State == 0); if (((NetworkBehaviour)this).IsServer) { selectAudioClips.PlayRandomClip(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetAgitateRpc(int newValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2501320399u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newValue); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2501320399u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; agitate = newValue; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2501320399u, new RpcReceiveHandler(__rpc_handler_2501320399), "SetAgitateRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2501320399(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int agitateRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref agitateRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((ClauviMouse)(object)target).SetAgitateRpc(agitateRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ClauviMouse"; } } public class CloverBee : WildCardProp { [Space(3f)] [Header("CloverBee")] [Space(3f)] [SerializeField] private Transform stinger = null; [SerializeField] private string[] noNecklaceTooltips = null; [SerializeField] private float stingerSpeed = 8f; [SerializeField] private float stingerSize = 0.25f; [SerializeField] private int stingerDamage = 25; [SerializeField] private int stingerHit = 1; [SerializeField] private float stingerRange = 20f; private Vector3 targetPosition = Vector3.zero; private bool isShooting = false; private float stingerTime = 0f; private Vector3 startingPosition = Vector3.zero; private Vector3 stingerLocalPos = Vector3.zero; public override void Start() { //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) base.Start(); CloverNecklace.beeList.Add(this); base.Properties.Add("NoNecklace", (Item)(object)ScriptableObjectExtension.Clone(base.OriginalItem)); base.Properties["NoNecklace"].toolTips = noNecklaceTooltips; stingerLocalPos = stinger.localPosition; ((GrabbableObject)this).insertedBattery.charge = 1f; } public override void OnNetworkSpawn() { base.OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { base.Audio["Buzz"].PlayRandomClip(); } } public override void OnDestroy() { CloverNecklace.beeList.Remove(this); ((GrabbableObject)this).OnDestroy(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) base.ItemActivate(used, buttonDown); if (!((NetworkBehaviour)this).IsOwner) { return; } if ((Object)(object)CloverNecklace.oneNecklace == (Object)null || (!((GrabbableObject)this).isHeldByEnemy && !CloverNecklace.oneNecklace.LastPlayerHeldBy.IsLocal())) { base.Audio["Revolt"].PlayRandomClip(); Shoot(); if (((GrabbableObject)this).isHeld) { DamagePlayerLocal(stingerDamage, (CauseOfDeath)14); } else { base.LastEnemyHeldBy.HitEnemyOnLocalClient(stingerHit, default(Vector3), (PlayerControllerB)null, true, -1); } return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)base.LastPlayerHeldBy.gameplayCamera).transform.position, ((Component)base.LastPlayerHeldBy.gameplayCamera).transform.forward); targetPosition = ((Ray)(ref val)).GetPoint(stingerRange); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, stingerRange, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) { targetPosition = ((Ray)(ref val)).GetPoint(((RaycastHit)(ref val2)).distance - 0.05f); } base.Audio["Shoot"].PlayRandomClip(); base.Particles["Flash"].PlayAll(); Shoot(targetPosition); } public override void Update() { //IL_0022: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (!isShooting) { return; } stinger.position = Vector3.Lerp(startingPosition, targetPosition, stingerTime); stingerTime += Time.deltaTime * stingerSpeed; if (!((NetworkBehaviour)this).IsOwner) { return; } if (stingerTime >= 1f) { EndShoot(); return; } List list = Physics.SphereCastAll(stinger.position, stingerSize, Vector3.one, 0f, 1084754248, (QueryTriggerInteraction)2).ToList(); list.Sort((RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance)); IHittable val2 = default(IHittable); for (int num = 0; num < list.Count; num++) { RaycastHit val = list[num]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2) && (object)val2 != base.LastPlayerHeldBy) { IWildCardBase wildCardBase = base.Base; IHittable hittable = val2; int playerDamage = stingerDamage; int hitForce = stingerHit; Vector3 val3 = targetPosition - startingPosition; wildCardBase.HitOrDamage(hittable, playerDamage, hitForce, ((Vector3)(ref val3)).normalized, base.LastPlayerHeldBy, playHitSFX: true, 1, (CauseOfDeath)14); EndShoot(); break; } } } public override void EquipItem() { base.EquipItem(); if (((NetworkBehaviour)this).IsServer) { base.Audio["Buzz"].SetLoop(loop: false); } } public override void PocketItem() { base.PocketItem(); if (((NetworkBehaviour)this).IsServer) { base.Audio["Buzz"].SetLoop(loop: false); } } public override void DiscardItem() { if (((NetworkBehaviour)this).IsServer) { SelectAudioClips selectAudioClips = base.Audio["Buzz"]; selectAudioClips.SetLoop(loop: true); selectAudioClips.PlayRandomClip(); } base.DiscardItem(); } private IEnumerator WaitForParticles() { SelectParticles particle = base.Particles["Sparks"]; yield return (object)new WaitUntil((Func)(() => !particle.AnyAlive())); stinger.localPosition = stingerLocalPos; stingerTime = 0f; WildCardProp.Log.LogDebug((object)"Clover Bee Resetting Projectile"); if (((NetworkBehaviour)this).IsServer) { base.Animator.Trigger("New Stinger"); } } internal void ToggleHeld(bool held) { if (held) { ((GrabbableObject)this).itemProperties = (Item)(object)base.OriginalItem; } else { ((GrabbableObject)this).itemProperties = base.Properties["NoNecklace"]; } } private void Shoot(Vector3 target = default(Vector3), bool networked = true) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).insertedBattery.empty = ((GrabbableObject)this).insertedBattery.charge <= 0f; if (target != default(Vector3)) { WildCardProp.Log.LogDebug((object)"Clover Bee Shooting"); targetPosition = target; startingPosition = stinger.position; isShooting = true; } if (networked) { ShootRpc(target); } } private void EndShoot(bool networked = true) { base.Particles["Sparks"].PlayAll(restart: false, networked: false); isShooting = false; ((MonoBehaviour)this).StartCoroutine(WaitForParticles()); if (networked) { EndShootRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ShootRpc(Vector3 target = default(Vector3)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1572957901u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref target); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1572957901u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Shoot(target, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EndShootRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(401997023u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 401997023u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EndShoot(networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1572957901u, new RpcReceiveHandler(__rpc_handler_1572957901), "ShootRpc"); ((NetworkBehaviour)this).__registerRpc(401997023u, new RpcReceiveHandler(__rpc_handler_401997023), "EndShootRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1572957901(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 target2 = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref target2); target.__rpc_exec_stage = (__RpcExecStage)1; ((CloverBee)(object)target).ShootRpc(target2); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_401997023(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; ((CloverBee)(object)target).EndShootRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CloverBee"; } } public class Cojiro : WildCardProp { [Space(3f)] [Header("Cojiro")] [Space(3f)] [SerializeField] private float slowAmount = 0.1f; [SerializeField] private float pocketCooldown = 1f; [SerializeField] private float cooldownRecover = 2f; internal bool isFloating = false; public override void ItemActivate(bool used, bool buttonDown = true) { if (!isFloating) { base.ItemActivate(used, buttonDown); } } public override void Update() { base.Update(); if (!((NetworkBehaviour)this).IsOwner) { return; } if (((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && (base.LastPlayerHeldBy.isFallingFromJump || base.LastPlayerHeldBy.isFallingNoJump)) { if (!isFloating) { ToggleFloating(); WildCardProp.Log.LogDebug((object)("Cojiro is slowing \"" + base.LastPlayerHeldBy.playerUsername + "\"'s fall!")); } PlayerControllerB lastPlayerHeldBy = base.LastPlayerHeldBy; lastPlayerHeldBy.fallValue *= 1f - slowAmount; } else if (isFloating) { ToggleFloating(); } if (isFloating && !(((GrabbableObject)this).currentUseCooldown >= pocketCooldown)) { ((GrabbableObject)this).currentUseCooldown = ((GrabbableObject)this).currentUseCooldown + cooldownRecover * Time.deltaTime; } } private void ToggleFloating(bool networked = true) { isFloating = !isFloating; base.Animator.SetBool("Floating", isFloating); if (!isFloating) { base.Audio["Flap"].Stop(networked: false); } else if (networked) { base.Audio["Flap"].PlayRandomClip(); } if (networked) { SetFloatingRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetFloatingRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2105678761u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2105678761u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleFloating(networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2105678761u, new RpcReceiveHandler(__rpc_handler_2105678761), "SetFloatingRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2105678761(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; ((Cojiro)(object)target).SetFloatingRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Cojiro"; } } public class FyrusStar : WildCardProp, ILifeSaver { [Space(3f)] [Header("FyrusStar")] [Space(3f)] [SerializeField] private Transform musicTransform = null; [SerializeField] private float speedMultiplier = 1.25f; [SerializeField] private float hitCooldownMax = 0.5f; [SerializeField] private int hitAmount = 1; [SerializeField] private float forceMultiplier = 0.5f; private TrailRenderer trailRenderer = null; private float inverseSpeedMultiplier = 0f; private float hitCooldown = 0f; private bool active = false; private bool activated = false; int ILifeSaver.Priority => 1; public override void Start() { base.Start(); ILifeSaver.Register(this); trailRenderer = ((Component)musicTransform).GetComponent(); hitCooldown = hitCooldownMax; } public override void OnDestroy() { ILifeSaver.Unregister(this); if (active) { musicTransform.SetParent(((Component)this).transform); base.LastPlayerHeldBy.MultiplyPlayerSpeed(inverseSpeedMultiplier); } ((GrabbableObject)this).OnDestroy(); } public override void PocketItem() { base.PocketItem(); base.Particles["Sparkles"].StopAll(clear: true, networked: false); } public override void EquipItem() { base.EquipItem(); base.Particles["Sparkles"].PlayAll(restart: false, networked: false); } public override void DiscardItem() { base.DiscardItem(); base.Particles["Sparkles"].PlayAll(restart: false, networked: false); } public override void ItemActivate(bool used, bool buttonDown = true) { //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) base.ItemActivate(used, buttonDown); activated = true; ((MonoBehaviour)this).StartCoroutine(StarCoroutine(((NetworkBehaviour)this).IsOwner, !((GrabbableObject)this).isHeld)); if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } else { EnemyForceDropItem(hide: true); } } public override void Update() { base.Update(); if (active && ((GrabbableObject)this).isHeld && !(hitCooldown <= 0f)) { hitCooldown -= Time.deltaTime; } } public override void PlayDropSFX() { if (!activated) { ((GrabbableObject)this).PlayDropSFX(); } else { ((GrabbableObject)this).hasHitGround = true; } } private IEnumerator StarCoroutine(bool isLocal, bool byEnemy) { yield return (object)new WaitForEndOfFrame(); base.Particles["Sparkles"].StopAll(clear: true, networked: false); ((GrabbableObject)this).EnableItemMeshes(false); ((GrabbableObject)this).EnablePhysics(false); ((GrabbableObject)this).grabbable = false; yield return (object)new WaitForSeconds(1.2f); Transform musicParent; if (byEnemy) { musicParent = ((Component)base.LastEnemyHeldBy).transform; NavMeshAgent agent = base.LastEnemyHeldBy.agent; agent.speed *= speedMultiplier; } else { WildCardProp.Log.LogDebug((object)(base.LastPlayerHeldBy.playerUsername + " has begun Fyrus Star invincibility")); base.LastPlayerHeldBy.MultiplyPlayerSpeed(speedMultiplier); musicParent = ((Component)base.LastPlayerHeldBy).transform; } inverseSpeedMultiplier = 1f / speedMultiplier; musicTransform.SetParent(musicParent); musicTransform.localPosition = new Vector3(0f, 1f, -1f); active = true; SelectAudioClips audio = base.Audio["StarStart"]; if (isLocal) { audio.Set3DSettings(0f); audio.PlayRandomClip(); } yield return (object)new WaitUntil((Func)(() => audio.IsPlaying)); trailRenderer.emitting = true; yield return (object)new WaitUntil((Func)(() => !audio.IsPlaying)); if (byEnemy) { NavMeshAgent agent2 = base.LastEnemyHeldBy.agent; agent2.speed *= inverseSpeedMultiplier; } else { base.LastPlayerHeldBy.MultiplyPlayerSpeed(inverseSpeedMultiplier); WildCardProp.Log.LogDebug((object)(base.LastPlayerHeldBy.playerUsername + "'s Fyrus Star invincibility has ended")); } if (isLocal) { base.Audio["StarEnd"].PlayRandomOneshot(); } trailRenderer.emitting = false; musicTransform.SetParent(((Component)this).transform); active = false; if (((NetworkBehaviour)this).IsServer) { yield return (object)new WaitForSeconds(1f); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } bool ILifeSaver.UntargetableWhen(PlayerControllerB player) { return false; } bool ILifeSaver.TriggerWhen(PlayerControllerB player, CauseOfDeath cause) { return active && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player; } bool ILifeSaver.CanSave(PlayerControllerB player, CauseOfDeath cause) { return active && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player; } void ILifeSaver.Save(PlayerControllerB player, CauseOfDeath cause, Vector3 hitVelocity, EnemyAI enemy) { //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_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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00ab: Unknown result type (might be due to invalid IL or missing references) WildCardMod.Instance.Log.LogDebug((object)("Fyrus star saved " + player.playerUsername + "!")); if (!player.IsLocal()) { return; } player.externalForceAutoFade += hitVelocity * forceMultiplier; if (!(hitCooldown > 0f)) { IHittable val = ((enemy != null) ? ((Component)enemy).GetComponentInChildren() : null); if (val != null) { int num = hitAmount; Vector3 val2 = ((Component)enemy).transform.position - ((Component)player).transform.position; val.Hit(num, ((Vector3)(ref val2)).normalized, player, true, 1); hitCooldown = hitCooldownMax; } } } bool ILifeSaver.GraceWhen(PlayerControllerB player, CauseOfDeath cause) { return active && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "FyrusStar"; } } public class SmithHalo : WildCardThrowable, ILifeSaver { [Space(3f)] [Header("SmithHalo")] [Space(3f)] [SerializeField] private int playerDamage = 10; [SerializeField] private int hitAmount = 1; [SerializeField] private float forceMultiplier = 2f; [SerializeField] private float saveForceMultiplier = 0.5f; [SerializeField] private float exhaustColourMultiplier = 0.1f; [SerializeField] private float uiRegenTime = 1f; private PlayerControllerB savedPlayer = null; private bool exhausted = false; private bool exhausting = false; private readonly HashSet hitList = new HashSet(); private bool resetList = false; int ILifeSaver.Priority => 0; public override void Start() { base.Start(); ILifeSaver.Register(this); base.Particles["Spin"].StopAll(clear: true, networked: false); if (!exhausted && !exhausting) { base.Particles["Drip"].PlayAll(restart: false, networked: false); return; } base.MeshRenderers["Main"].SetColours(exhaustColourMultiplier); exhausted = true; exhausting = false; } public override void OnDestroy() { ILifeSaver.Unregister(this); if (exhausting && savedPlayer.IsLocal()) { HUDManager.Instance.UpdateHealthUI(savedPlayer.health, false); } base.OnDestroy(); } internal override void WildCardUse() { if (!exhausted && !exhausting) { base.WildCardUse(); } } internal override void ThrowUpdate() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0162: Unknown result type (might be due to invalid IL or missing references) base.ThrowUpdate(); if (!((NetworkBehaviour)this).IsOwner || (!((GrabbableObject)this).isHeld && !((GrabbableObject)this).isHeldByEnemy)) { return; } RaycastHit[] array = Physics.SphereCastAll(transformToThrow.position, 0.5f, Vector3.one, 0f, 1084754248, (QueryTriggerInteraction)2); Vector3 val = targetPosition - transformToThrow.position; Vector3 val2 = ((Vector3)(ref val)).normalized; if (throwTime >= 0.5f) { val2 *= -1f; if (!resetList) { hitList.Clear(); if (((GrabbableObject)this).isHeld) { hitList.Add((IHittable)(object)base.LastPlayerHeldBy); } else { hitList.Add((IHittable)(object)((Component)base.LastEnemyHeldBy).GetComponentInChildren()); } resetList = true; } } IHittable hittable = default(IHittable); for (int i = 0; i < array.Length; i++) { RaycastHit val3 = array[i]; if (((Component)((RaycastHit)(ref val3)).transform).TryGetComponent(ref hittable) && hitList.Add(hittable)) { PlayerControllerB playerWhoHit = null; if (((GrabbableObject)this).isHeld) { playerWhoHit = base.LastPlayerHeldBy; } base.Base.HitOrDamage(hittable, playerDamage, hitAmount, val2, playerWhoHit, playHitSFX: true, 1, (CauseOfDeath)1, forceMultiplier); } } } public override void EquipItem() { base.EquipItem(); if (!exhausted && !exhausting) { base.Particles["Drip"].PlayAll(restart: false, networked: false); } } internal override void Throw(Vector3 newPosition, bool byEnemy, bool networked = true) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) base.Throw(newPosition, byEnemy, networked); hitList.Clear(); if (((GrabbableObject)this).isHeld) { hitList.Add((IHittable)(object)base.LastPlayerHeldBy); } else { hitList.Add((IHittable)(object)((Component)base.LastEnemyHeldBy).GetComponentInChildren()); } base.Particles["Drip"].StopAll(clear: true, networked: false); base.Particles["Spin"].PlayAll(restart: false, networked: false); } internal override void ThrowEnd(bool networked = true) { base.ThrowEnd(networked); hitList.Clear(); resetList = false; base.Particles["Spin"].StopAll(clear: true, networked: false); if (!exhausted && !exhausting) { base.Particles["Drip"].PlayAll(restart: false, networked: false); } } public override void PocketItem() { base.PocketItem(); if (!exhausted && !exhausting) { base.Particles["Drip"].StopAll(clear: false, networked: false); } } private IEnumerator ExhaustCoroutine() { exhausting = true; base.MeshRenderers["Main"].SetColours(exhaustColourMultiplier); ThrowEnd(networked: false); base.Particles["Drip"].StopAll(clear: false, networked: false); if (!savedPlayer.IsLocal()) { yield break; } base.Audio["Break"].PlayRandomClip(); yield return null; if (!HUDManager.Instance.playerIsCriticallyInjured) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); HUDManager.Instance.UpdateHealthUI(1, true); } yield return (object)new WaitForSeconds(uiRegenTime * 2f); WildCardProp.Log.LogDebug((object)"Halo Fully Exhausted"); float interval = uiRegenTime * 0.1f; for (int i = 2; i <= 10; i++) { if (!savedPlayer.isPlayerControlled) { break; } if (savedPlayer.health != 100) { break; } yield return (object)new WaitForSeconds(interval); HUDManager.Instance.UpdateHealthUI(i * 10, false); } EndExhaust(); } public override int GetItemDataToSave() { return Convert.ToInt32(exhausted); } public override void LoadItemSaveData(int saveData) { exhausted = Convert.ToBoolean(saveData); } private void ExhaustHalo(int id, bool networked = true) { savedPlayer = StartOfRound.Instance.allPlayerScripts[id]; ((MonoBehaviour)this).StartCoroutine(ExhaustCoroutine()); if (networked) { ExhaustHaloRpc(id); } } private void EndExhaust(bool networked = true) { exhausted = true; exhausting = false; if (networked) { EndExhaustRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExhaustHaloRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2996895710u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2996895710u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ExhaustHalo(id, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EndExhaustRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2613082482u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2613082482u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EndExhaust(networked: false); } } } bool ILifeSaver.UntargetableWhen(PlayerControllerB player) { return exhausting && (Object)(object)savedPlayer == (Object)(object)player; } bool ILifeSaver.TriggerWhen(PlayerControllerB player, CauseOfDeath cause) { return !exhausted && !exhausting && ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player; } bool ILifeSaver.CanSave(PlayerControllerB player, CauseOfDeath cause) { return (!exhausted && ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player) || (exhausting && (Object)(object)savedPlayer == (Object)(object)player); } void ILifeSaver.Save(PlayerControllerB player, CauseOfDeath cause, Vector3 hitVelocity, EnemyAI enemy) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!player.IsLocal()) { return; } player.externalForceAutoFade += hitVelocity * saveForceMultiplier; if (!exhausting) { WildCardProp.Log.LogDebug((object)"Halo exhausting..."); if (player.criticallyInjured) { player.MakeCriticallyInjured(false); } player.health = 100; ExhaustHalo((int)player.playerClientId); } } bool ILifeSaver.GraceWhen(PlayerControllerB player, CauseOfDeath cause) { return exhausting && (Object)(object)savedPlayer == (Object)(object)player; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2996895710u, new RpcReceiveHandler(__rpc_handler_2996895710), "ExhaustHaloRpc"); ((NetworkBehaviour)this).__registerRpc(2613082482u, new RpcReceiveHandler(__rpc_handler_2613082482), "EndExhaustRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2996895710(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SmithHalo)(object)target).ExhaustHaloRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2613082482(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; ((SmithHalo)(object)target).EndExhaustRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SmithHalo"; } } public class Hellgato : WildCardThrowable, ILifeSaver { [Space(3f)] [Header("Hellgato")] [Space(3f)] [SerializeField] private int playerDamage = 15; [SerializeField] private int hitAmount = 1; [SerializeField] private float damageRadius = 5f; [SerializeField] private float killRadius = 2f; [SerializeField] private float forceMultiplier = 2f; [SerializeField] private float saveForceMultiplier = 0.5f; private bool exploding = false; int ILifeSaver.Priority => -1; public override void Start() { base.Start(); ILifeSaver.Register(this); } public override void OnDestroy() { ILifeSaver.Unregister(this); base.OnDestroy(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0041: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) base.ItemActivate(used, buttonDown); base.Particles["Burst"].PlayAll(restart: false, networked: false); if (!((NetworkBehaviour)this).IsOwner) { return; } HashSet hashSet = new HashSet(); RaycastHit[] array = Physics.SphereCastAll(((Component)this).transform.position, damageRadius, Vector3.one, 0f, 1084754248, (QueryTriggerInteraction)2); IHittable val2 = default(IHittable); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2) && hashSet.Add(val2)) { PlayerControllerB playerWhoHit = null; if (((GrabbableObject)this).isHeld) { playerWhoHit = base.LastPlayerHeldBy; } IWildCardBase wildCardBase = base.Base; IHittable hittable = val2; int num = playerDamage; int hitForce = hitAmount; Vector3 val3 = ((RaycastHit)(ref val)).transform.position - ((Component)this).transform.position; wildCardBase.HitOrDamage(hittable, num, hitForce, ((Vector3)(ref val3)).normalized, playerWhoHit, playHitSFX: true, 1, (CauseOfDeath)13, forceMultiplier); } } } public override void EquipItem() { base.EquipItem(); SelectAudioClips selectAudioClips = base.Audio["Crackle"]; selectAudioClips.SetLoop(loop: true); selectAudioClips.PlayRandomClip(oneShot: false, networked: false); base.Particles["Flame"].PlayAll(restart: false, networked: false); base.Animations["Idle"].ResumeAll(); } public override void PocketItem() { base.PocketItem(); base.Audio["Crackle"].SetLoop(loop: false); base.Particles["Flame"].StopAll(clear: true, networked: false); base.Animations["Idle"].PauseAll(); } public override void OnHitGround() { if (((NetworkBehaviour)this).IsOwner && throwing) { ExplodeRpc(); } base.OnHitGround(); } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3893781943u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3893781943u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position, true, killRadius, damageRadius, playerDamage * 3, 0.5f, (GameObject)null, false); if (((NetworkBehaviour)this).IsOwner) { if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.DespawnHeldObject(); } else { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } bool ILifeSaver.CanSave(PlayerControllerB player, CauseOfDeath cause) { return ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player; } bool ILifeSaver.GraceWhen(PlayerControllerB player, CauseOfDeath cause) { return exploding; } void ILifeSaver.Save(PlayerControllerB player, CauseOfDeath cause, Vector3 hitVelocity, EnemyAI enemy) { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (player.IsLocal() && !exploding) { exploding = true; player.externalForceAutoFade += hitVelocity * saveForceMultiplier; player.health = 20; HUDManager.Instance.UpdateHealthUI(20, false); ExplodeRpc(); } } bool ILifeSaver.TriggerWhen(PlayerControllerB player, CauseOfDeath cause) { return !exploding && ((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && (Object)(object)base.LastPlayerHeldBy == (Object)(object)player; } bool ILifeSaver.UntargetableWhen(PlayerControllerB player) { return false; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3893781943u, new RpcReceiveHandler(__rpc_handler_3893781943), "ExplodeRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3893781943(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; ((Hellgato)(object)target).ExplodeRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Hellgato"; } } public class KingKRoolGem : WildCardProp { [Space(3f)] [Header("KingKRoolGem")] [Space(3f)] [SerializeField] private int minValue = 5; [SerializeField] private float valueMultiplier = 0.5f; public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if (((NetworkBehaviour)this).IsOwner) { base.ScrapValue = Mathf.RoundToInt((float)base.ScrapValue * valueMultiplier); if (base.ScrapValue <= minValue) { ((MonoBehaviour)this).StartCoroutine(DespawnCoroutine()); base.Audio["Break"].SetVolume(0.75f); } base.Audio["Break"].PlayRandomOneshot(); } } private IEnumerator DespawnCoroutine() { yield return (object)new WaitForEndOfFrame(); Disable(); yield return (object)new WaitForSeconds(base.Audio["Break"].LastClip.length); DespawnRpc(); } private void Disable(bool networked = true) { ((GrabbableObject)this).EnableItemMeshes(false); ((GrabbableObject)this).EnablePhysics(false); ((GrabbableObject)this).grabbable = false; base.Lights["Main"].DisableAll(networked: false); if (networked) { DisableRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void DisableRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(36056394u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 36056394u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Disable(networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void DespawnRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(79563409u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 79563409u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(36056394u, new RpcReceiveHandler(__rpc_handler_36056394), "DisableRpc"); ((NetworkBehaviour)this).__registerRpc(79563409u, new RpcReceiveHandler(__rpc_handler_79563409), "DespawnRpc"); base.__initializeRpcs(); } private static void __rpc_handler_36056394(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; ((KingKRoolGem)(object)target).DisableRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_79563409(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; ((KingKRoolGem)(object)target).DespawnRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "KingKRoolGem"; } } public class MarioDice : WildCardThrowable { private static GameObject[] maskPrefabs; [Space(3f)] [Header("MarioDice")] [Space(3f)] [SerializeField] private float diceGracePeriod = 1.5f; [SerializeField] private float explodeKillRadius = 2f; [SerializeField] private float explodeDamageRadius = 5f; [SerializeField] private int explodePlayerDamage = 35; [SerializeField] private string[] maskNames = new string[2] { "TragedyMask", "ComedyMask" }; [SerializeField] private Vector2Int bugsMinMax = new Vector2Int(3, 6); [SerializeField] private Vector2Int wormsMinMax = new Vector2Int(3, 5); [SerializeField] private AudioClip teleportAudio = null; [SerializeField] private int coroutineLoopMax = 120; private int currentSide = 1; private int startingValue = -1; private bool animFinished = false; private bool rollable = false; private bool spawnedBugs = false; private bool spawnedWorms = false; private HoarderBugAI[] currentBugs = null; private SandWormAI[] currentWorms = null; private Coroutine effectCoroutine = null; public override void Start() { base.Start(); if (startingValue < 0) { startingValue = base.ScrapValue; } if (maskPrefabs != null) { return; } maskPrefabs = (GameObject[])(object)new GameObject[maskNames.Length]; for (int i = 0; i < maskNames.Length; i++) { string mask = maskNames[i]; if (!((Object)(object)maskPrefabs[i] != (Object)null)) { maskPrefabs[i] = StartOfRound.Instance.allItemsList.itemsList.Find((Item x) => ((Object)x).name == mask)?.spawnPrefab; } } } internal override void Throw(Vector3 newPosition, bool byEnemy, bool networked = true) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { SetSide(base.Random.Next(1, 7)); base.Audio["Roll"].PlayRandomClip(); } rollable = true; base.Throw(newPosition, byEnemy, networked); } private void SetSide(int side, bool networked = true) { animFinished = false; currentSide = side; base.Animator.SetInt("Side", currentSide); if (networked) { SetSideRpc(side); } } public override void OnHitGround() { base.OnHitGround(); if (((NetworkBehaviour)this).IsServer && ((GrabbableObject)this).hasBeenHeld && rollable) { if (effectCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(effectCoroutine); effectCoroutine = null; } effectCoroutine = ((MonoBehaviour)this).StartCoroutine(DiceEffectCoroutine(currentSide)); } } public void AnimationFinished() { animFinished = true; } private IEnumerator DiceEffectCoroutine(int side) { WildCardProp.Log.LogDebug((object)$"Running dice roll {side}"); yield return (object)new WaitUntil((Func)(() => animFinished)); EffectToggle(enable: false); SelectAudioClips audio = base.Audio["Negative"]; if (side >= 4) { audio = base.Audio["Positive"]; } audio.PlayRandomOneshot(); yield return (object)new WaitForSeconds(diceGracePeriod); if (((GrabbableObject)this).isHeld || ((GrabbableObject)this).isHeldByEnemy || !StartOfRound.Instance.currentLevel.planetHasTime || StartOfRound.Instance.inShipPhase) { EffectToggle(enable: true); yield break; } switch (side) { default: if (base.ScrapValue <= 0) { Explode(); } else { ValueZero(); } break; case 2: if (lastThrownByEnemy) { Swarm(); } else { ForceMask(); } break; case 3: Swarm(); break; case 4: { if (StartOfRound.Instance.connectedPlayersAmount < 1) { TeleportSelf(); break; } List players = new List(); for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { PlayerControllerB playerToAdd = StartOfRound.Instance.allPlayerScripts[i]; if (playerToAdd.isPlayerControlled && !playerToAdd.isPlayerDead && (lastThrownByEnemy || !((Object)(object)playerToAdd == (Object)(object)base.LastPlayerHeldBy))) { players.Add(playerToAdd); } } if (players.Count == 0) { TeleportSelf(); } else { PlayerSwap(players); } break; } case 5: TeleportSelf(); break; case 6: ValueIncrease(); break; } } private void EffectToggle(bool enable, bool networked = true) { ((GrabbableObject)this).EnablePhysics(enable); ((GrabbableObject)this).grabbable = enable; ((GrabbableObject)this).grabbableToEnemies = enable; if (!enable) { rollable = false; base.Audio["Roll"].Stop(networked: false); base.Particles["Effects"].SetMaterialsTexture(0, Mathf.Clamp(base.Animator.GetInt("Side") - 1, 0, 5)); base.Particles["Effects"].PlayAll(restart: false, networked: false); } if (networked) { ToggleEffectRpc(enable); } } private void ValueZero() { base.ScrapValue = 0; EffectToggle(enable: true); } private void Explode() { ExplodeRpc(); } private void ForceMask() { //IL_0074: 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 (maskPrefabs == null || maskPrefabs.Length == 0) { EffectToggle(enable: true); return; } GameObject val = maskPrefabs[base.Random.Next(0, maskPrefabs.Length)]; if ((Object)(object)val == (Object)null) { EffectToggle(enable: true); return; } HauntedMaskItem component = Object.Instantiate(val).GetComponent(); NetworkObject networkObject = ((NetworkBehaviour)component).NetworkObject; networkObject.Spawn(false); MaskRpc(NetworkObjectReference.op_Implicit(networkObject), base.LastPlayerHeldBy.GetRPCTarget()); } private IEnumerator MaskCoroutine(NetworkObjectReference maskRef) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForEndOfFrame(); NetworkObject maskObject = null; while (!((NetworkObjectReference)(ref maskRef)).TryGet(ref maskObject, (NetworkManager)null)) { yield return (object)new WaitForEndOfFrame(); } PlayerControllerB player = GameNetworkManager.Instance.localPlayerController; HauntedMaskItem mask = ((Component)maskObject).GetComponent(); player.DropAllHeldItemsAndSync(((Component)player).transform.position, player.localItemHolder.position, player.localItemHolder.eulerAngles, player.playerEye.position, player.playerEye.eulerAngles); yield return (object)new WaitUntil((Func)(() => (Object)(object)player.ItemSlots[player.currentItemSlot] == (Object)null)); player.GrabObjectServerRpc(maskRef); ((GrabbableObject)mask).parentObject = player.localItemHolder; yield return (object)new WaitUntil((Func)(() => ((GrabbableObject)mask).isHeld && !((GrabbableObject)mask).isPocketed)); ((GrabbableObject)mask).ItemActivate(true, true); mask.BeginAttachment(); EffectToggle(enable: true); } private void Swarm() { if (((GrabbableObject)this).isInFactory) { if (spawnedBugs) { Explode(); } else { BugSwarm(); } } else if (spawnedWorms) { Explode(); } else { WormSwarm(); } } private void BugSwarm() { //IL_009a: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) List list = RoundManager.Instance.allEnemyVents.ToList(); list.Sort((EnemyVent x, EnemyVent y) => Vector3.Distance(x.floorNode.position, ((Component)this).transform.position).CompareTo(Vector3.Distance(y.floorNode.position, ((Component)this).transform.position))); int num = base.Random.Next(((Vector2Int)(ref bugsMinMax)).x, ((Vector2Int)(ref bugsMinMax)).y + 1); NetworkObjectReference[] array = (NetworkObjectReference[])(object)new NetworkObjectReference[num]; for (int num2 = 0; num2 < num; num2++) { int num3 = num2; if (num2 >= list.Count) { num3 -= list.Count; } Transform val = list[num3].floorNode; if (val == null) { val = ((Component)this).transform; } array[num2] = RoundManager.Instance.SpawnEnemyGameObject(val.position, val.eulerAngles.y, -1, WildUtils.AllEnemies["Hoarding bug"]); } spawnedBugs = true; ((MonoBehaviour)this).StartCoroutine(BugModeCoroutine(array)); } private IEnumerator BugModeCoroutine(NetworkObjectReference[] refs) { yield return (object)new WaitForEndOfFrame(); currentBugs = (HoarderBugAI[])(object)new HoarderBugAI[refs.Length]; int loopTimes = 0; int bugsLoaded = 0; NetworkObject newBug = default(NetworkObject); while (bugsLoaded < refs.Length && loopTimes <= coroutineLoopMax) { for (int i = 0; i < refs.Length; i++) { if (!((Object)(object)currentBugs[i] != (Object)null) && ((NetworkObjectReference)(ref refs[i])).TryGet(ref newBug, (NetworkManager)null)) { currentBugs[i] = ((Component)newBug).GetComponent(); bugsLoaded++; newBug = null; } } yield return (object)new WaitForEndOfFrame(); loopTimes++; } EffectToggle(enable: true); int bugsAlive = currentBugs.Length; bool[] bugNestChange = new bool[currentBugs.Length]; while (bugsAlive > 0) { bugsAlive = currentBugs.Length; for (int j = 0; j < currentBugs.Length; j++) { HoarderBugAI bug = currentBugs[j]; if ((Object)(object)bug == (Object)null || ((EnemyAI)bug).isEnemyDead) { bugsAlive--; continue; } ((EnemyAI)bug).removedPowerLevel = true; if (!((GrabbableObject)this).isHeld && !((GrabbableObject)this).isHeldByEnemy && !((EnemyAI)bug).SetDestinationToPosition(((Component)this).transform.position, true)) { ((EnemyAI)bug).KillEnemy(false); ((NetworkBehaviour)bug).NetworkObject.Despawn(true); bugsAlive--; continue; } if (!bugNestChange[j]) { bugNestChange[j] = true; bug.choseNestPosition = true; bug.nestPosition = ((EnemyAI)bug).ChooseClosestNodeToPosition(((Component)this).transform.position, false, 0).position; bug.SyncNestPositionClientRpc(bug.nestPosition); } if (!bug.isAngry && !((Object)(object)bug.heldItem?.itemGrabbableObject == (Object)(object)this) && HoarderBugAI.grabbableObjectsInMap.Contains(((Component)this).gameObject) && !(Vector3.Distance(((Component)this).transform.position, bug.nestPosition) < 0.75f)) { bug.targetItem = (GrabbableObject)(object)this; } } yield return null; } } private void WormSwarm() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) List list = RoundManager.Instance.outsideAINodes.ToList(); list.Sort((GameObject x, GameObject y) => Vector3.Distance(x.transform.position, ((Component)base.LastPlayerHeldBy).transform.position).CompareTo(Vector3.Distance(y.transform.position, ((Component)base.LastPlayerHeldBy).transform.position))); int num = base.Random.Next(((Vector2Int)(ref wormsMinMax)).x, ((Vector2Int)(ref wormsMinMax)).y + 1); NetworkObjectReference[] array = (NetworkObjectReference[])(object)new NetworkObjectReference[num]; for (int num2 = 0; num2 < num; num2++) { int num3 = num2; if (num2 >= list.Count) { num3 -= list.Count; } Transform transform = list[num3].transform; array[num2] = RoundManager.Instance.SpawnEnemyGameObject(RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(transform.position, 50f, default(NavMeshHit), base.Random, -1, 1f) + Vector3.up, 0f, -1, WildUtils.AllEnemies["Earth Leviathan"]); } spawnedWorms = true; ((MonoBehaviour)this).StartCoroutine(WormModeCoroutine(array)); } private IEnumerator WormModeCoroutine(NetworkObjectReference[] refs) { yield return (object)new WaitForEndOfFrame(); currentWorms = (SandWormAI[])(object)new SandWormAI[refs.Length]; int loopTimes = 0; int wormsLoaded = 0; NetworkObject newWorm = default(NetworkObject); while (wormsLoaded < refs.Length && loopTimes <= coroutineLoopMax) { for (int i = 0; i < refs.Length; i++) { if (!((Object)(object)currentWorms[i] != (Object)null) && ((NetworkObjectReference)(ref refs[i])).TryGet(ref newWorm, (NetworkManager)null)) { currentWorms[i] = ((Component)newWorm).GetComponent(); wormsLoaded++; newWorm = null; } } yield return (object)new WaitForEndOfFrame(); loopTimes++; } EffectToggle(enable: true); yield return (object)new WaitForSeconds((float)base.Random.Next(2, 6)); for (int j = 0; j < currentWorms.Length; j++) { SandWormAI worm = currentWorms[j]; if (!((Object)(object)worm == (Object)null) && !((EnemyAI)worm).isEnemyDead) { worm.StartEmergeAnimation(); } } } private void PlayerSwap(List players) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = players[base.Random.Next(0, players.Count)]; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(((Component)base.LastPlayerHeldBy).transform.position.x, RoundManager.Instance.GetNavMeshPosition(((Component)base.LastPlayerHeldBy).transform.position, RoundManager.Instance.navHit, 5f, -1).y, ((Component)base.LastPlayerHeldBy).transform.position.z); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(((Component)val).transform.position.x, RoundManager.Instance.GetNavMeshPosition(((Component)val).transform.position, RoundManager.Instance.navHit, 5f, -1).y, ((Component)val).transform.position.z); TeleportMultipleRpc(new int[2] { (int)base.LastPlayerHeldBy.playerClientId, (int)val.playerClientId }, (Vector3[])(object)new Vector3[2] { val3, val2 }, new bool[2] { val.isInHangarShipRoom, base.LastPlayerHeldBy.isInHangarShipRoom }, new bool[2] { val.isInsideFactory, base.LastPlayerHeldBy.isInsideFactory }); } private void TeleportPlayer(int id, Vector3 position, bool inShip, bool inside) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[id]; val.averageVelocity = 0f; val.velocityLastFrame = Vector3.zero; val.TeleportPlayer(position, true, 0f, false, true); val.beamOutParticle.Play(); val.isInElevator = inShip; val.isInHangarShipRoom = inShip; val.isInsideFactory = inside; for (int i = 0; i < val.ItemSlots.Length; i++) { GrabbableObject val2 = val.ItemSlots[i]; if (!((Object)(object)val2 == (Object)null)) { val2.isInElevator = val.isInElevator; val2.isInShipRoom = val.isInHangarShipRoom; val2.isInFactory = val.isInsideFactory; } } val.movementAudio.PlayOneShot(teleportAudio); if (!val.IsLocal()) { return; } HUDManager.Instance.ShakeCamera((ScreenShakeType)1); if (inside) { TimeOfDay.Instance.DisableAllWeather(false); return; } LevelWeatherType currentWeather = StartOfRound.Instance.currentLevel.currentWeather; if ((int)currentWeather != -1) { TimeOfDay.Instance.effects[currentWeather].effectEnabled = true; } } private void TeleportSelf() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) if (lastThrownByEnemy) { Swarm(); return; } int id = (int)base.LastPlayerHeldBy.playerClientId; if (base.LastPlayerHeldBy.isInsideFactory) { TeleportSingleRpc(id, StartOfRound.Instance.middleOfShipNode.position, inShip: true, inside: false); return; } int num = 1537; int num2 = 1375734017; int num3 = Mathf.Min(12, RoundManager.Instance.insideAINodes.Length); Vector3 val = Vector3.zero; NavMeshHit val2 = default(NavMeshHit); Ray val3 = default(Ray); RaycastHit val4 = default(RaycastHit); for (int i = 0; i < num3; i++) { val = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(RoundManager.Instance.insideAINodes[base.Random.Next(0, RoundManager.Instance.insideAINodes.Length)].transform.position, 10f, default(NavMeshHit), base.Random, num, 1f); if (!RoundManager.Instance.GotNavMeshPositionResult || !NavMesh.FindClosestEdge(val, ref val2, num)) { continue; } ((Ray)(ref val3))..ctor(((NavMeshHit)(ref val2)).position + Vector3.up * 0.5f, default(Vector3)); if (((NavMeshHit)(ref val2)).position == val) { ((Ray)(ref val3)).direction = ((NavMeshHit)(ref val2)).position - new Vector3(RoundManager.Instance.randomPositionInBoxRadius.x, ((NavMeshHit)(ref val2)).position.y, RoundManager.Instance.randomPositionInBoxRadius.z); } else { ((Ray)(ref val3)).direction = val - ((NavMeshHit)(ref val2)).position; } if (Physics.Raycast(val3, ref val4, 5f, num2, (QueryTriggerInteraction)1)) { if (!(((RaycastHit)(ref val4)).distance < 0.35f)) { val = RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val3)).GetPoint(((RaycastHit)(ref val4)).distance / 2f), default(NavMeshHit), 2f, num); break; } ((Ray)(ref val3)).origin = ((Ray)(ref val3)).origin + Vector3.Normalize(((Ray)(ref val3)).direction * 1000f) * 0.4f; if (!Physics.Raycast(val3, ref val4, 5f, num2, (QueryTriggerInteraction)1)) { val = RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val3)).GetPoint(2.5f), default(NavMeshHit), 2f, num); break; } if (((RaycastHit)(ref val4)).distance > 0.35f) { val = RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val3)).GetPoint(((RaycastHit)(ref val4)).distance / 2f), default(NavMeshHit), 2f, num); break; } } val = RoundManager.Instance.GetNavMeshPosition(((Ray)(ref val3)).GetPoint(2.5f), default(NavMeshHit), 2f, num); } if (!(val == Vector3.zero)) { TeleportSingleRpc(id, val, inShip: false, inside: true); } } private void ValueIncrease() { base.ScrapValue += startingValue; EffectToggle(enable: true); } private IEnumerator DespawnCoroutine() { SelectParticles particles = base.Particles["Effects"]; yield return (object)new WaitUntil((Func)(() => particles == null || !particles.AnyAlive())); yield return null; ((NetworkBehaviour)this).NetworkObject.Despawn(true); } public override int GetItemDataToSave() { string s = $"{currentSide}0{startingValue}"; return int.Parse(s); } public override void LoadItemSaveData(int saveData) { base.LoadItemSaveData(saveData); ReadOnlySpan readOnlySpan = saveData.ToString(); SetSide(int.Parse(readOnlySpan.Slice(0, 1)), networked: false); startingValue = int.Parse(readOnlySpan.Slice(2, readOnlySpan.Length - 2)); } [Rpc(/*Could not decode attribute arguments.*/)] private void SetSideRpc(int side) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(657566252u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, side); ((NetworkBehaviour)this).__endSendRpc(ref val2, 657566252u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetSide(side, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ToggleEffectRpc(bool enable) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(863982449u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 863982449u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EffectToggle(enable, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_014e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1636523129u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1636523129u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position, true, explodeKillRadius, explodeDamageRadius, explodePlayerDamage, 0.5f, (GameObject)null, false); if (((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed) { int currentItemSlot = base.LastPlayerHeldBy.currentItemSlot; if ((Object)(object)base.LastPlayerHeldBy.currentlyHeldObjectServer != (Object)(object)this) { base.LastPlayerHeldBy.SwitchToItemSlot(Array.FindIndex(base.LastPlayerHeldBy.ItemSlots, (GrabbableObject x) => (Object)(object)x == (Object)(object)this), (GrabbableObject)null); } base.LastPlayerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); if (currentItemSlot != base.LastPlayerHeldBy.currentItemSlot) { base.LastPlayerHeldBy.SwitchToItemSlot(currentItemSlot, (GrabbableObject)null); } } ((GrabbableObject)this).EnableItemMeshes(false); EffectToggle(enable: false, networked: false); if (((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(DespawnCoroutine()); } } [Rpc(/*Could not decode attribute arguments.*/)] private void MaskRpc(NetworkObjectReference mask, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1950643690u, rpcParams, val, (SendTo)8, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref mask, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1950643690u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(MaskCoroutine(mask)); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportMultipleRpc(int[] ids, Vector3[] positions, bool[] inShips, bool[] insides) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00a9: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1267967437u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = ids != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(ids, default(ForPrimitives)); } bool flag2 = positions != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(positions); } bool flag3 = inShips != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag3, default(ForPrimitives)); if (flag3) { ((FastBufferWriter)(ref val2)).WriteValueSafe(inShips, default(ForPrimitives)); } bool flag4 = insides != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag4, default(ForPrimitives)); if (flag4) { ((FastBufferWriter)(ref val2)).WriteValueSafe(insides, default(ForPrimitives)); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 1267967437u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; for (int i = 0; i < ids.Length; i++) { TeleportPlayer(ids[i], positions[i], inShips[i], insides[i]); } EffectToggle(enable: true, networked: false); } } [Rpc(/*Could not decode attribute arguments.*/)] private void TeleportSingleRpc(int id, Vector3 position, bool inShip, bool inside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3617173725u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref inShip, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref inside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3617173725u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TeleportPlayer(id, position, inShip, inside); EffectToggle(enable: true, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(657566252u, new RpcReceiveHandler(__rpc_handler_657566252), "SetSideRpc"); ((NetworkBehaviour)this).__registerRpc(863982449u, new RpcReceiveHandler(__rpc_handler_863982449), "ToggleEffectRpc"); ((NetworkBehaviour)this).__registerRpc(1636523129u, new RpcReceiveHandler(__rpc_handler_1636523129), "ExplodeRpc"); ((NetworkBehaviour)this).__registerRpc(1950643690u, new RpcReceiveHandler(__rpc_handler_1950643690), "MaskRpc"); ((NetworkBehaviour)this).__registerRpc(1267967437u, new RpcReceiveHandler(__rpc_handler_1267967437), "TeleportMultipleRpc"); ((NetworkBehaviour)this).__registerRpc(3617173725u, new RpcReceiveHandler(__rpc_handler_3617173725), "TeleportSingleRpc"); base.__initializeRpcs(); } private static void __rpc_handler_657566252(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int sideRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref sideRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((MarioDice)(object)target).SetSideRpc(sideRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_863982449(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enable = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enable, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MarioDice)(object)target).ToggleEffectRpc(enable); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1636523129(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; ((MarioDice)(object)target).ExplodeRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1950643690(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_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference mask = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref mask, default(ForNetworkSerializable)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((MarioDice)(object)target).MaskRpc(mask, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1267967437(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); int[] ids = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref ids, default(ForPrimitives)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); Vector3[] positions = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref positions); } bool flag3 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag3, default(ForPrimitives)); bool[] inShips = null; if (flag3) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref inShips, default(ForPrimitives)); } bool flag4 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag4, default(ForPrimitives)); bool[] insides = null; if (flag4) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref insides, default(ForPrimitives)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((MarioDice)(object)target).TeleportMultipleRpc(ids, positions, inShips, insides); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3617173725(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool inShip = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inShip, default(ForPrimitives)); bool inside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inside, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MarioDice)(object)target).TeleportSingleRpc(id, position, inShip, inside); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MarioDice"; } } public class PixelJar : WildCardProp { private int floaterCurrent = -1; public override void OnNetworkSpawn() { base.OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { SelectParticles selectParticles = base.Particles["Floater"]; if (floaterCurrent < 0) { floaterCurrent = selectParticles.RandomTextureIndex(); } TextureUpdate(floaterCurrent); selectParticles.EmitAll(1); selectParticles.PlayAll(); } } public override void EquipItem() { base.EquipItem(); SelectParticles selectParticles = base.Particles["Floater"]; selectParticles.EmitAll(1, networked: false); selectParticles.PlayAll(restart: false, networked: false); } public override void PocketItem() { base.PocketItem(); base.Particles["Floater"].StopAll(clear: true, networked: false); } public override int GetItemDataToSave() { return floaterCurrent; } public override void LoadItemSaveData(int saveData) { floaterCurrent = saveData; } private void TextureUpdate(int index, bool networked = true) { floaterCurrent = index; SelectParticles selectParticles = base.Particles["Floater"]; selectParticles.SetMaterialsTexture(0, floaterCurrent); WildCardProp.Log.LogDebug((object)("Chosen Pixel Jar texture: \"" + ((Object)selectParticles.GetTexture(floaterCurrent)).name + "\"")); if (networked) { TextureUpdateRpc(index); } } [Rpc(/*Could not decode attribute arguments.*/)] private void TextureUpdateRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4174687607u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4174687607u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; TextureUpdate(index, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4174687607u, new RpcReceiveHandler(__rpc_handler_4174687607), "TextureUpdateRpc"); base.__initializeRpcs(); } private static void __rpc_handler_4174687607(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((PixelJar)(object)target).TextureUpdateRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PixelJar"; } } public class Poppy : WildCardProp { [Space(3f)] [Header("Poppy")] [Space(3f)] [Range(0f, 99f)] [SerializeField] private int healAmount = 50; [SerializeField] private float effectTime = 30f; [SerializeField] private float targetVignette = 0.25f; [SerializeField] private float targetFilmGrain = 1f; [SerializeField] private Color targetColourFilter = new Color(1f, 0.5f, 0f); [SerializeField] private float targetSaturation = -75f; [Min(0f)] [SerializeField] private float transitionTime = 5f; private bool active = false; private bool vignetteWasActive = false; private VolumeParameter[] origVignetteParameters = null; private bool filmGrainWasActive = false; private VolumeParameter[] origFilmGrainParameters = null; private bool colourAdjustWasActive = false; private VolumeParameter[] origColourAdjustParameters = null; private Vignette vignette = null; private FilmGrain filmGrain = null; private ColorAdjustments colourAdjust = null; public override void Start() { base.Start(); VolumeProfile sharedProfile = HUDManager.Instance.playerGraphicsVolume.sharedProfile; if (!sharedProfile.TryGet(ref vignette)) { vignette = sharedProfile.Add(false); ((VolumeComponent)vignette).active = false; } if (!sharedProfile.TryGet(ref filmGrain)) { filmGrain = sharedProfile.Add(false); ((VolumeComponent)filmGrain).active = false; } if (!sharedProfile.TryGet(ref colourAdjust)) { colourAdjust = sharedProfile.Add(false); ((VolumeComponent)colourAdjust).active = false; } } public override void OnDestroy() { if (active) { VolumeProfile sharedProfile = HUDManager.Instance.playerGraphicsVolume.sharedProfile; FilmGrain val = default(FilmGrain); if (sharedProfile.TryGet(ref val)) { ((VolumeComponent)val).active = filmGrainWasActive; for (int i = 0; i < origFilmGrainParameters.Length; i++) { VolumeParameter val2 = ((VolumeComponent)val).parameters[i]; VolumeParameter val3 = origFilmGrainParameters[i]; val2.SetValue(val3); val2.overrideState = val3.overrideState; } } Vignette val4 = default(Vignette); if (sharedProfile.TryGet(ref val4)) { ((VolumeComponent)val4).active = vignetteWasActive; for (int j = 0; j < origVignetteParameters.Length; j++) { VolumeParameter val5 = ((VolumeComponent)val4).parameters[j]; VolumeParameter val6 = origVignetteParameters[j]; val5.SetValue(val6); val5.overrideState = val6.overrideState; } } ColorAdjustments val7 = default(ColorAdjustments); if (sharedProfile.TryGet(ref val7)) { ((VolumeComponent)val7).active = colourAdjustWasActive; for (int k = 0; k < origColourAdjustParameters.Length; k++) { VolumeParameter val8 = ((VolumeComponent)val7).parameters[k]; VolumeParameter val9 = origColourAdjustParameters[k]; val8.SetValue(val9); val8.overrideState = val9.overrideState; } } SoundManager.Instance.SetDiageticMixerSnapshot(0, 1f); } ((GrabbableObject)this).OnDestroy(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!active) { base.ItemActivate(used, buttonDown); base.LastPlayerHeldBy.health = Mathf.Min(100, base.LastPlayerHeldBy.health + healAmount); base.LastPlayerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); ((MonoBehaviour)this).StartCoroutine(EffectCoroutine(((NetworkBehaviour)this).IsOwner)); } } internal override void ItemActivateFromEnemy(bool used, bool buttonHeld = true) { if (!active && ((GrabbableObject)this).isHeldByEnemy) { if (((NetworkBehaviour)this).IsOwner == ((NetworkBehaviour)base.LastEnemyHeldBy).IsOwner) { EnemyForceDropItem(hide: true); } ((MonoBehaviour)this).StartCoroutine(EffectCoroutine(isLocal: false, despawnAnyway: true)); } } private IEnumerator EffectCoroutine(bool isLocal, bool despawnAnyway = false) { active = true; if (isLocal) { HUDManager.Instance.UpdateHealthUI(base.LastPlayerHeldBy.health, false); } yield return (object)new WaitForEndOfFrame(); ((GrabbableObject)this).EnableItemMeshes(false); ((GrabbableObject)this).EnablePhysics(false); ((GrabbableObject)this).grabbable = false; if (!isLocal) { if (despawnAnyway && ((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } yield break; } vignetteWasActive = ((VolumeComponent)vignette).active; origVignetteParameters = (VolumeParameter[])(object)new VolumeParameter[((VolumeComponent)vignette).parameters.Count]; for (int i = 0; i < origVignetteParameters.Length; i++) { origVignetteParameters[i] = (VolumeParameter)((VolumeComponent)vignette).parameters[i].Clone(); } if ((int)((VolumeParameter)(object)vignette.mode).value == 0) { if (!((VolumeParameter)vignette.color).overrideState) { ((VolumeParameter)(object)vignette.color).Override(Color.black); } if (!((VolumeParameter)vignette.center).overrideState) { ((VolumeParameter)(object)vignette.center).Override(new Vector2(0.5f, 0.5f)); } if (!((VolumeParameter)vignette.intensity).overrideState) { ((VolumeParameter)(object)vignette.intensity).Override(0f); } if (!((VolumeParameter)vignette.roundness).overrideState) { ((VolumeParameter)(object)vignette.roundness).Override(1f); } if (((VolumeParameter)(object)vignette.intensity).value < 0.25f) { ((VolumeParameter)(object)vignette.smoothness).Override(0.2f); ((VolumeParameter)(object)vignette.rounded).Override(true); } } else { if (!((VolumeParameter)vignette.color).overrideState) { ((VolumeParameter)(object)vignette.color).Override(Color.black); } if (!vignette.IsActive() || !((VolumeParameter)vignette.opacity).overrideState) { ((VolumeParameter)(object)vignette.opacity).Override(0f); } } filmGrainWasActive = ((VolumeComponent)filmGrain).active; origFilmGrainParameters = (VolumeParameter[])(object)new VolumeParameter[((VolumeComponent)filmGrain).parameters.Count]; for (int j = 0; j < origFilmGrainParameters.Length; j++) { origFilmGrainParameters[j] = (VolumeParameter)((VolumeComponent)filmGrain).parameters[j].Clone(); } if (!((VolumeParameter)filmGrain.intensity).overrideState) { ((VolumeParameter)(object)filmGrain.intensity).Override(0f); } if (!((VolumeParameter)filmGrain.type).overrideState) { ((VolumeParameter)(object)filmGrain.type).Override((FilmGrainLookup)9); } colourAdjustWasActive = ((VolumeComponent)colourAdjust).active; origColourAdjustParameters = (VolumeParameter[])(object)new VolumeParameter[((VolumeComponent)colourAdjust).parameters.Count]; for (int k = 0; k < origColourAdjustParameters.Length; k++) { origColourAdjustParameters[k] = (VolumeParameter)((VolumeComponent)colourAdjust).parameters[k].Clone(); } if (!((VolumeParameter)colourAdjust.colorFilter).overrideState) { ((VolumeParameter)(object)colourAdjust.colorFilter).Override(Color.white); } if (!((VolumeParameter)colourAdjust.saturation).overrideState) { ((VolumeParameter)(object)colourAdjust.saturation).Override(0f); } if (!colourAdjust.IsActive()) { ((VolumeParameter)(object)colourAdjust.postExposure).Override(0.2f); ((VolumeParameter)(object)colourAdjust.contrast).Override(24.5f); } float originalVignette = ((VolumeParameter)(object)vignette.intensity).value; float originalFilmGrain = ((VolumeParameter)(object)filmGrain.intensity).value; float originalSaturation = ((VolumeParameter)(object)colourAdjust.saturation).value; Color originalColourFilter = ((VolumeParameter)(object)colourAdjust.colorFilter).value; float timer = 0f; float detransTime = effectTime + transitionTime; float maxTime = detransTime + transitionTime; float inverseTransitionTime = 1f / transitionTime; bool reachedEffect = false; SoundManager.Instance.SetDiageticMixerSnapshot(1, transitionTime); ((VolumeComponent)vignette).active = true; ((VolumeComponent)filmGrain).active = true; ((VolumeComponent)colourAdjust).active = true; bool deTransitioningSnapshot = false; while (timer < maxTime) { yield return null; timer += Time.deltaTime; float t = timer * inverseTransitionTime; if (GameNetworkManager.Instance.localPlayerController.isPlayerControlled) { if (timer < transitionTime) { ((VolumeParameter)(object)vignette.intensity).Interp(originalVignette, targetVignette, t); ((VolumeParameter)(object)filmGrain.intensity).Interp(originalFilmGrain, targetFilmGrain, t); ((VolumeParameter)(object)colourAdjust.saturation).Interp(originalSaturation, targetSaturation, t); ((VolumeParameter)(object)colourAdjust.colorFilter).Interp(originalColourFilter, targetColourFilter, t); continue; } if (!reachedEffect) { reachedEffect = true; ((VolumeParameter)(object)vignette.intensity).value = targetVignette; ((VolumeParameter)(object)filmGrain.intensity).value = targetFilmGrain; ((VolumeParameter)(object)colourAdjust.saturation).value = targetSaturation; ((VolumeParameter)(object)colourAdjust.colorFilter).value = targetColourFilter; } } if (!(timer < detransTime)) { if (!deTransitioningSnapshot) { deTransitioningSnapshot = true; SoundManager.Instance.SetDiageticMixerSnapshot(0, transitionTime); } t = (timer - detransTime) * inverseTransitionTime; ((VolumeParameter)(object)vignette.intensity).Interp(targetVignette, originalVignette, t); ((VolumeParameter)(object)filmGrain.intensity).Interp(targetFilmGrain, originalFilmGrain, t); ((VolumeParameter)(object)colourAdjust.saturation).Interp(targetSaturation, originalSaturation, t); ((VolumeParameter)(object)colourAdjust.colorFilter).Interp(targetColourFilter, originalColourFilter, t); } } DespawnRpc(); } [Rpc(/*Could not decode attribute arguments.*/)] private void DespawnRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(719155593u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 719155593u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(719155593u, new RpcReceiveHandler(__rpc_handler_719155593), "DespawnRpc"); base.__initializeRpcs(); } private static void __rpc_handler_719155593(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; ((Poppy)(object)target).DespawnRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Poppy"; } } public class SmithGojoGlasses : WildCardProp, ILifeSaver { [Space(3f)] [Header("SmithGojoGlasses")] [Space(3f)] [SerializeField] private Transform meshTransform = null; [SerializeField] private float enemyTimer = 1f; [SerializeField] private GameObject effectsGameObject = null; [SerializeField] private int hitAmount = 1; [SerializeField] internal float playerForce = 2.5f; private ListDict enemyCooldowns = new ListDict(); private bool active = false; public override void Start() { base.Start(); ILifeSaver.Register(this); } public override void OnDestroy() { ILifeSaver.Unregister(this); meshTransform.SetParent(((Component)this).transform); ((GrabbableObject)this).OnDestroy(); } public override void ItemActivate(bool used, bool buttonDown = true) { base.ItemActivate(used, buttonDown); ToggleEffects(); } private void ToggleEffects(bool? overrideActive = null) { if (overrideActive.HasValue) { active = overrideActive.Value; } else { active = !active; } base.Animator.SetBool("Lifted", !active); effectsGameObject.SetActive(active); if (((NetworkBehaviour)this).IsOwner) { if (!active) { base.Particles["Sparkles"].StopAll(clear: true); base.Audio["Technique"].Stop(); enemyCooldowns.Clear(); } else { base.Particles["Sparkles"].PlayAll(restart: true); base.Audio["Technique"].PlayRandomClip(); } } } public override void Update() { base.Update(); if (((NetworkBehaviour)this).IsOwner && active) { for (int i = 0; i < enemyCooldowns.Count; i++) { enemyCooldowns[i].Tick(); } } } public override void GrabItemFromEnemy(EnemyAI enemy) { base.Animator.SetBool("IsEnemy", value: true); meshTransform.SetParent(enemy.eye); base.GrabItemFromEnemy(enemy); } public override void EquipItem() { base.EquipItem(); base.Animator.SetBool("IsEnemy", value: false); base.Animator.SetBool("IsOwner", ((NetworkBehaviour)this).IsOwner); if (((NetworkBehaviour)this).IsOwner) { meshTransform.SetParent(((Component)base.LastPlayerHeldBy.gameplayCamera).transform); } else { meshTransform.SetParent(base.LastPlayerHeldBy.bodyParts[0]); } } public override void PocketItem() { ToggleEffects(false); meshTransform.SetParent(((Component)this).transform); base.PocketItem(); } public override void UseUpBatteries() { ((GrabbableObject)this).UseUpBatteries(); ToggleEffects(false); } internal override void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.DiscardFromAny(fromPlayer, enemy); ToggleEffects(false); meshTransform.SetParent(((Component)this).transform); } internal void EnemyOverlapped(EnemyAI enemy) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) if (!active || (!((GrabbableObject)this).isHeld && (!((GrabbableObject)this).isHeldByEnemy || (Object)(object)enemy == (Object)(object)base.LastEnemyHeldBy)) || ((GrabbableObject)this).isPocketed) { return; } int thisEnemyIndex = enemy.thisEnemyIndex; if (!enemyCooldowns.ContainsKey(thisEnemyIndex)) { enemyCooldowns.Add(thisEnemyIndex, new RepeatingTimer(enemyTimer)); } RepeatingTimer repeatingTimer = enemyCooldowns[thisEnemyIndex]; if (repeatingTimer.Complete) { repeatingTimer.Restart(); EnemyBehaviourRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject), RpcParams.op_Implicit(((NetworkBehaviour)enemy).RpcTarget.Single(((NetworkBehaviour)enemy).OwnerClientId, (RpcTargetUse)0))); IHittable val = ((enemy != null) ? ((Component)enemy).GetComponentInChildren() : null); if (val != null) { base.Audio["Hit"].PlayRandomClip(); int num = hitAmount; Vector3 val2 = ((Component)enemy).transform.position - ((Component)base.LastPlayerHeldBy).transform.position; val.Hit(num, ((Vector3)(ref val2)).normalized, base.LastPlayerHeldBy, true, 1); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EnemyBehaviourRpc(NetworkObjectReference enemyRef, RpcParams rpcParams) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3798052896u, rpcParams, val, (SendTo)8, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3798052896u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); EnemyAI val4 = default(EnemyAI); if (((NetworkObjectReference)(ref enemyRef)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent(ref val4)) { val4.StopSearch(val4.currentSearch, true); val4.SetDestinationToPosition(val4.ChooseFarthestNodeFromPosition(((Component)this).transform.position, false, 0, false, 50, -1).position, false); } } } bool ILifeSaver.UntargetableWhen(PlayerControllerB player) { return active && ((GrabbableObject)this).isHeld && (Object)(object)player == (Object)(object)base.LastPlayerHeldBy; } bool ILifeSaver.GraceWhen(PlayerControllerB player, CauseOfDeath cause) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 return active && ((GrabbableObject)this).isHeld && (Object)(object)player == (Object)(object)base.LastPlayerHeldBy && ((int)cause == 7 || (int)cause == 3); } bool ILifeSaver.TriggerWhen(PlayerControllerB player, CauseOfDeath cause) { return false; } bool ILifeSaver.CanSave(PlayerControllerB player, CauseOfDeath cause) { return false; } void ILifeSaver.Save(PlayerControllerB player, CauseOfDeath cause, Vector3 hitVelocity, EnemyAI enemy) { } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3798052896u, new RpcReceiveHandler(__rpc_handler_3798052896), "EnemyBehaviourRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3798052896(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_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyRef, default(ForNetworkSerializable)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((SmithGojoGlasses)(object)target).EnemyBehaviourRpc(enemyRef, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SmithGojoGlasses"; } } public class GojoTrigger : MonoBehaviour { [SerializeField] private SmithGojoGlasses glasses = null; [SerializeField] private Volume gojoVolume = null; [SerializeField] private float volumeMaxDistance = 2.5f; private float volumeMaxDistanceInverse = -1f; private int layerMask = 0; private void OnEnable() { layerMask = LayerMask.GetMask(new string[2] { "Player", "Enemies" }); volumeMaxDistanceInverse = 1f / volumeMaxDistance; } private void OnDisable() { gojoVolume.weight = 0f; } private void Update() { //IL_001c: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) gojoVolume.weight = Mathf.Min(1f, Mathf.Lerp(2f, 0f, Vector3.Distance(((Component)this).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).transform.position) * volumeMaxDistanceInverse)); RaycastHit[] array = Physics.SphereCastAll(((Component)this).transform.position, volumeMaxDistance, ((Component)this).transform.up, 0f, layerMask, (QueryTriggerInteraction)2); EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); PlayerControllerB val3 = default(PlayerControllerB); for (int i = 0; i < array.Length; i++) { RaycastHit val = array[i]; if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val2) && (!((GrabbableObject)glasses).isHeldByEnemy || (Object)(object)val2.mainScript != (Object)(object)glasses.LastEnemyHeldBy)) { glasses.EnemyOverlapped(val2.mainScript); } else if (((Component)((RaycastHit)(ref val)).transform).TryGetComponent(ref val3) && ((GrabbableObject)glasses).isHeld && !((Object)(object)val3 == (Object)(object)glasses.LastPlayerHeldBy)) { WildCardMod.Instance.Log.LogDebug((object)$"GOJO TRYING TO PUSH \"{val3.playerUsername}\" with force: {glasses.playerForce}"); PlayerControllerB obj = val3; Vector3 externalForces = obj.externalForces; Vector3 val4 = ((Component)val3).transform.position - ((Component)this).transform.position; obj.externalForces = externalForces + ((Vector3)(ref val4)).normalized * glasses.playerForce; } } } } public class SmithNote : WildCardProp { internal static readonly Dictionary enemyPageTextures = new Dictionary(); private static Animator localHudAnim = null; private static int noteCount = 0; private static int pageMask = 0; [Space(3f)] [Header("SmithNote")] [Space(3f)] [SerializeField] private Transform hudTextures = null; [SerializeField] private List textMeshList = null; [SerializeField] private List rawImageList = null; [SerializeField] private List> enemyTextures = new List>(); [SerializeField] private Texture2D defaultPlayerTexture = null; [SerializeField] private Texture2D defaultEnemyTexture = null; [SerializeField] private float addPageDistance = 10f; private readonly ListDict playerPages = new ListDict(); private readonly ListDict enemyPages = new ListDict(); private readonly Dictionary enemyIndices = new Dictionary(); private ListDict allPages = new ListDict(); private int currentElement = 0; private bool currentlyEnemy = false; private float selectCooldown = 0f; private bool isFlippable = false; private PlayerControllerB killingPlayer = null; private EnemyAI killingEnemy = null; private int lastLivingPlayers = 0; private float lastEnemyPower = 0f; private Coroutine killCoroutine = null; private ListDict AllPages { get { if (playerPages.Count + enemyPages.Count != allPages.Count) { allPages = playerPages.Combined(enemyPages); } return allPages; } } private float TotalEnemyPower { get { RoundManager instance = RoundManager.Instance; return instance.currentEnemyPower + instance.currentOutsideEnemyPower + instance.currentDaytimeEnemyPower + instance.currentWeedEnemyPower; } } public override void Start() { base.Start(); noteCount++; ((Component)((Transform)((TMP_Text)textMeshList[2]).rectTransform).parent).gameObject.SetActive(true); lastLivingPlayers = StartOfRound.Instance.livingPlayers; lastEnemyPower = TotalEnemyPower; } internal override void InitializePrefab() { base.InitializePrefab(); pageMask = LayerMask.GetMask(new string[2] { "Player", "Enemies" }); if (enemyTextures != null) { enemyPageTextures.Clear(); for (int i = 0; i < enemyTextures.Count; i++) { SelectablePair selectablePair = enemyTextures[i]; enemyPageTextures.Add(selectablePair.id, selectablePair.selectable); } enemyTextures = null; } if (!((Object)(object)SmithNoteInfo.playerDefault != (Object)null) || !((Object)(object)SmithNoteInfo.enemyDefault != (Object)null)) { SmithNoteInfo.playerDefault = defaultPlayerTexture; SmithNoteInfo.enemyDefault = defaultEnemyTexture; defaultPlayerTexture = null; defaultEnemyTexture = null; } } public override void OnDestroy() { noteCount--; if (noteCount <= 0 && (Object)(object)localHudAnim != (Object)null) { Object.Destroy((Object)(object)((Component)localHudAnim).gameObject); localHudAnim = null; } ((GrabbableObject)this).OnDestroy(); } public override void EquipItem() { base.EquipItem(); SetHUD(); int num = (int)base.LastPlayerHeldBy.playerClientId; if (((NetworkBehaviour)this).IsOwner && !playerPages.ContainsKey(num)) { NewPlayer(num); } ((Component)((Transform)((TMP_Text)textMeshList[2]).rectTransform).parent).gameObject.SetActive(true); StartOpening(); } internal override void GrabFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.GrabFromAny(fromPlayer, enemy); SetHUD(); ((Component)((Transform)((TMP_Text)textMeshList[2]).rectTransform).parent).gameObject.SetActive(true); StartOpening(); } public override void GrabItemFromEnemy(EnemyAI enemy) { if (((NetworkBehaviour)this).IsOwner && !enemyPages.ContainsKey(enemy.thisEnemyIndex)) { NewEnemy(enemy); } base.GrabItemFromEnemy(enemy); } public override void PocketItem() { base.PocketItem(); StartClosing(); ((Component)((Transform)((TMP_Text)textMeshList[0]).rectTransform).parent).gameObject.SetActive(false); ((Component)((Transform)((Graphic)rawImageList[0]).rectTransform).parent).gameObject.SetActive(false); ((Component)((Transform)((TMP_Text)textMeshList[2]).rectTransform).parent).gameObject.SetActive(false); } internal override void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.DiscardFromAny(fromPlayer, enemy); StartClosing(); } public override void ItemActivate(bool used, bool buttonDown = true) { if (isFlippable) { StartFlipping(); base.ItemActivate(used, buttonDown); } } public override void Update() { base.Update(); if (((Object)(object)killingPlayer != (Object)null && killingPlayer.isPlayerDead) || ((Object)(object)killingEnemy != (Object)null && killingEnemy.isEnemyDead)) { if (killCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(killCoroutine); killCoroutine = null; } killingPlayer = null; killingEnemy = null; } if (selectCooldown > 0f) { selectCooldown -= Time.deltaTime; } if ((((GrabbableObject)this).isHeld || ((GrabbableObject)this).isHeldByEnemy) && !((GrabbableObject)this).isPocketed) { int livingPlayers = StartOfRound.Instance.livingPlayers; float totalEnemyPower = TotalEnemyPower; if (lastLivingPlayers != livingPlayers || !Mathf.Approximately(lastEnemyPower, totalEnemyPower)) { CheckDead(); lastLivingPlayers = livingPlayers; lastEnemyPower = totalEnemyPower; } } } internal override void WildCardUse() { //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) base.WildCardUse(); if (!((NetworkBehaviour)this).IsOwner || (!((GrabbableObject)this).isHeld && !((GrabbableObject)this).isHeldByEnemy) || selectCooldown > 0f) { return; } selectCooldown = 5f; if ((((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed) || (((GrabbableObject)this).isHeldByEnemy && base.Random.Next(0, 15) == 0)) { int num = AllPages.KeyOf(currentElement); if (!currentlyEnemy) { KillPlayer(num); return; } if (!enemyIndices.TryGetValue(num, out var value)) { return; } KillEnemy(value); } base.Audio["Countdown"].PlayRandomOneshot(networked: false); Transform val = ((!((GrabbableObject)this).isHeld) ? base.LastEnemyHeldBy.eye : ((Component)base.LastPlayerHeldBy.gameplayCamera).transform); float distance = addPageDistance; RaycastHit[] array = Physics.SphereCastAll(new Ray(val.position, val.forward), 0.5f, distance, pageMask, (QueryTriggerInteraction)2); if (array.Length == 0) { return; } PlayerControllerB val2 = null; EnemyAI val3 = null; for (int i = 0; i < array.Length; i++) { RaycastHit val4 = array[i]; PlayerControllerB component = ((Component)((RaycastHit)(ref val4)).transform).GetComponent(); EnemyAICollisionDetect component2 = ((Component)((RaycastHit)(ref val4)).transform).GetComponent(); if (!(((RaycastHit)(ref val4)).distance > distance) && (!((Object)(object)component == (Object)null) || !((Object)(object)component2 == (Object)null))) { if ((Object)(object)component != (Object)null && (((GrabbableObject)this).isHeldByEnemy || (Object)(object)component != (Object)(object)base.LastPlayerHeldBy)) { distance = ((RaycastHit)(ref val4)).distance; val2 = component; } else if (!((Object)(object)component2 == (Object)null) && (!((GrabbableObject)this).isHeldByEnemy || !((Object)(object)component2 == (Object)(object)base.LastEnemyHeldBy)) && !(component2.mainScript.enemyType.enemyName == "Cadaver Growths")) { distance = ((RaycastHit)(ref val4)).distance; val3 = component2.mainScript; } } } int num2; if ((Object)(object)val2 != (Object)null) { num2 = (int)val2.playerClientId; if (playerPages.ContainsKey(num2)) { WildCardProp.Log.LogDebug((object)(val2.playerUsername + " was already in the players list!")); } else { NewPlayer(num2); } return; } WildCardProp.Log.LogDebug((object)"No valid player, checking enemies"); if ((Object)(object)val3 == (Object)null) { WildCardProp.Log.LogDebug((object)"No valid enemy, no new page added"); return; } num2 = val3.thisEnemyIndex; if (enemyPages.ContainsKey(num2)) { WildCardProp.Log.LogDebug((object)$"{val3.enemyType.enemyName} {num2} was already in the players list!"); } else { NewEnemy(val3); } } private void StartOpening() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) currentElement = 0; currentlyEnemy = false; SmithNoteInfo smithNoteInfo = AllPages[currentElement]; if (!smithNoteInfo.initialized) { CheckDead(); } ((TMP_Text)textMeshList[0]).text = smithNoteInfo.targetName; rawImageList[0].texture = (Texture)(object)smithNoteInfo.texture; ((Graphic)rawImageList[0]).color = smithNoteInfo.colour; ((Component)((Transform)((TMP_Text)textMeshList[0]).rectTransform).parent).gameObject.SetActive(true); ((Component)((Transform)((Graphic)rawImageList[0]).rectTransform).parent).gameObject.SetActive(true); base.Animator.Trigger("OpenBook"); } private void StartClosing() { ((Component)((Transform)((TMP_Text)textMeshList[1]).rectTransform).parent).gameObject.SetActive(false); ((Component)((Transform)((Graphic)rawImageList[1]).rectTransform).parent).gameObject.SetActive(false); isFlippable = false; base.Animator.Trigger("CloseBook"); } private void StartFlipping() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) isFlippable = false; SmithNoteInfo smithNoteInfo = AllPages[currentElement]; rawImageList[1].texture = (Texture)(object)smithNoteInfo.texture; ((Graphic)rawImageList[1]).color = smithNoteInfo.colour; currentElement++; if (currentElement >= AllPages.Count) { currentElement = 0; } currentlyEnemy = currentElement >= playerPages.Count; WildCardProp.Log.LogDebug((object)$"Page index: {currentElement}"); ((TMP_Text)textMeshList[1]).text = AllPages[currentElement].targetName; ((Component)((Transform)((TMP_Text)textMeshList[1]).rectTransform).parent).gameObject.SetActive(true); ((Component)((Transform)((Graphic)rawImageList[1]).rectTransform).parent).gameObject.SetActive(true); ((Component)((Transform)((Graphic)rawImageList[0]).rectTransform).parent).gameObject.SetActive(false); } public void FinishOpening() { isFlippable = true; } public void FinishClosing() { if (!((GrabbableObject)this).isHeld) { ((Component)((Transform)((TMP_Text)textMeshList[0]).rectTransform).parent).gameObject.SetActive(false); ((Component)((Transform)((Graphic)rawImageList[0]).rectTransform).parent).gameObject.SetActive(false); } } public void FinishFlipping() { ((TMP_Text)textMeshList[0]).text = AllPages[currentElement].targetName; ((Component)((Transform)((TMP_Text)textMeshList[1]).rectTransform).parent).gameObject.SetActive(false); ((Component)((Transform)((Graphic)rawImageList[1]).rectTransform).parent).gameObject.SetActive(false); isFlippable = true; } public void PfpFrameUpdate() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) SmithNoteInfo smithNoteInfo = AllPages[currentElement]; rawImageList[0].texture = (Texture)(object)smithNoteInfo.texture; ((Graphic)rawImageList[0]).color = smithNoteInfo.colour; ((Component)((Transform)((Graphic)rawImageList[0]).rectTransform).parent).gameObject.SetActive(true); } private void CheckDead() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) int count = playerPages.Count; int[] array = playerPages.Keys.Concat(enemyPages.Keys).ToArray(); for (int i = 0; i < array.Length; i++) { int num = array[i]; SmithNoteInfo smithNoteInfo; bool flag; string text; if (i >= count) { EnemyAI val = enemyIndices[num]; smithNoteInfo = enemyPages[num]; flag = val.isEnemyDead || ((Object)(object)killingEnemy == (Object)(object)val && (val.enemyType.canBeDestroyed || val.enemyType.canDie)); text = WildUtils.TrueEnemyNames[val.enemyType.enemyName]; } else { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[num]; smithNoteInfo = playerPages[num]; flag = val2.isPlayerDead || (Object)(object)killingPlayer == (Object)(object)val2; text = val2.playerUsername; } if (smithNoteInfo.initialized && smithNoteInfo.isDead == flag) { continue; } smithNoteInfo.initialized = true; Color white = Color.white; smithNoteInfo.targetName = text; if (flag) { smithNoteInfo.targetName = "" + smithNoteInfo.targetName; white.g *= 0.5f; white.b *= 0.5f; } smithNoteInfo.isDead = flag; smithNoteInfo.colour = white; for (int j = 0; j < textMeshList.Count - 1; j++) { TextMeshProUGUI val3 = textMeshList[j]; if (((TMP_Text)val3).text.EndsWith(text)) { ((TMP_Text)val3).text = smithNoteInfo.targetName; } } for (int k = 0; k < rawImageList.Count; k++) { RawImage val4 = rawImageList[k]; if (!((Object)(object)val4.texture != (Object)(object)smithNoteInfo.texture)) { ((Graphic)val4).color = smithNoteInfo.colour; } } } } private IEnumerator KillCoroutine(PlayerControllerB localPlayer) { yield return (object)new WaitForSeconds(4.5f); if (!ILifeSaver.TrySave(localPlayer, (CauseOfDeath)0)) { localPlayer.KillPlayer(Vector3.up, true, (CauseOfDeath)0, 1, default(Vector3), false); } } private IEnumerator KillEnemyCoroutine(EnemyAI enemy) { yield return (object)new WaitForSeconds(4.5f); enemy.KillEnemy(!enemy.enemyType.canDie); CheckDead(); } private void SetHUD() { //IL_0034: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)localHudAnim != (Object)null)) { hudTextures.SetParent(GameNetworkManager.Instance.localPlayerController.playerHudUIContainer); hudTextures.localPosition = Vector3.zero; hudTextures.localScale = Vector3.one * 0.75f; hudTextures.localRotation = Quaternion.identity; ((Component)hudTextures).gameObject.SetActive(true); localHudAnim = ((Component)hudTextures).GetComponent(); } } private void NewPlayer(int id, bool networked = true) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[id]; WildCardProp.Log.LogDebug((object)("Adding player " + val.playerUsername + " to players list!")); playerPages.Add(id, new SmithNoteInfo(val)); if (networked) { base.Audio["Select"].PlayRandomOneshot(networked: false); NewPlayerRpc(id); } } private void NewEnemy(EnemyAI enemy, bool networked = true) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)enemy == (Object)null)) { int thisEnemyIndex = enemy.thisEnemyIndex; enemyIndices.Add(thisEnemyIndex, enemy); WildCardProp.Log.LogDebug((object)$"Adding enemy {enemy.enemyType.enemyName} {thisEnemyIndex} to players list!"); enemyPages.Add(thisEnemyIndex, new SmithNoteInfo(enemy)); if (networked) { base.Audio["Select"].PlayRandomOneshot(networked: false); NewEnemyRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject)); } } } private void KillEnemy(EnemyAI enemy, bool networked = true) { //IL_00bc: Unknown result type (might be due to invalid IL or missing references) int thisEnemyIndex = enemy.thisEnemyIndex; WildCardProp.Log.LogDebug((object)$"Attempting Kill of enemy with enemyIndex: {thisEnemyIndex}"); killingEnemy = enemy; if (!killingEnemy.isEnemyDead) { killCoroutine = ((MonoBehaviour)this).StartCoroutine(KillEnemyCoroutine(killingEnemy)); WildCardProp.Log.LogDebug((object)$"Smith Note Killing {killingEnemy.enemyType.enemyName} {killingEnemy.thisEnemyIndex}!"); } CheckDead(); if (networked) { base.Audio["Write"].PlayRandomClip(); KillEnemyRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)enemy).NetworkObject)); } } private void KillPlayer(int id, bool networked = true) { killingPlayer = StartOfRound.Instance.allPlayerScripts[id]; if (!killingPlayer.isPlayerDead) { WildCardProp.Log.LogDebug((object)$"Attempting Kill of player with client id: {id}"); if (killingPlayer.IsLocal()) { base.Audio["Kill"].PlayRandomOneshot(networked: false); WildCardProp.Log.LogDebug((object)"Smith Note Killing This Player!"); killingPlayer.JumpToFearLevel(1f, true); Animator obj = localHudAnim; if (obj != null) { obj.SetTrigger("Kill"); } killCoroutine = ((MonoBehaviour)this).StartCoroutine(KillCoroutine(killingPlayer)); } WildCardProp.Log.LogDebug((object)("Smith Note Killing " + killingPlayer.playerUsername + "!")); } CheckDead(); if (networked) { base.Audio["Write"].PlayRandomClip(); KillPlayerRpc(id); } } [Rpc(/*Could not decode attribute arguments.*/)] private void NewPlayerRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3675708101u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3675708101u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NewPlayer(id, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void NewEnemyRpc(NetworkObjectReference enemy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2522244187u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemy, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2522244187u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (!((NetworkObjectReference)(ref enemy)).TryGet(ref val4, (NetworkManager)null)) { WildCardProp.Log.LogError((object)"Network Object of enemy could not be found while trying to add a page to Smith Note!"); } else { NewEnemy(((Component)val4).GetComponent(), networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void KillEnemyRpc(NetworkObjectReference enemy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3509048374u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemy, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3509048374u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (!((NetworkObjectReference)(ref enemy)).TryGet(ref val4, (NetworkManager)null)) { WildCardProp.Log.LogError((object)"Network Object of enemy could not be found while trying to kill an enemy with the Smith Note!"); } else { KillEnemy(((Component)val4).GetComponent(), networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void KillPlayerRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(752265147u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendRpc(ref val2, 752265147u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; KillPlayer(id, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3675708101u, new RpcReceiveHandler(__rpc_handler_3675708101), "NewPlayerRpc"); ((NetworkBehaviour)this).__registerRpc(2522244187u, new RpcReceiveHandler(__rpc_handler_2522244187), "NewEnemyRpc"); ((NetworkBehaviour)this).__registerRpc(3509048374u, new RpcReceiveHandler(__rpc_handler_3509048374), "KillEnemyRpc"); ((NetworkBehaviour)this).__registerRpc(752265147u, new RpcReceiveHandler(__rpc_handler_752265147), "KillPlayerRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3675708101(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SmithNote)(object)target).NewPlayerRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2522244187(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemy = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemy, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SmithNote)(object)target).NewEnemyRpc(enemy); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3509048374(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemy = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemy, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SmithNote)(object)target).KillEnemyRpc(enemy); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_752265147(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((SmithNote)(object)target).KillPlayerRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SmithNote"; } } internal class SmithNoteInfo { internal static Texture2D playerDefault; internal static Texture2D enemyDefault; internal bool initialized = false; internal string targetName = string.Empty; internal Color colour = Color.white; internal Texture2D texture = null; internal bool isDead = false; internal SmithNoteInfo(PlayerControllerB player) { //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) targetName = player.playerUsername; isDead = player.isPlayerDead; if (GameNetworkManager.Instance.disableSteam) { texture = playerDefault; } else { GetProfilePicture(player.playerSteamId); } } internal SmithNoteInfo(EnemyAI enemy) { //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) targetName = enemy.enemyType.enemyName; isDead = enemy.isEnemyDead; if (!SmithNote.enemyPageTextures.TryGetValue(enemy.enemyType.enemyName, out texture)) { texture = enemyDefault; } } private async void GetProfilePicture(ulong steamID) { try { texture = HUDManager.GetTextureFromImage(await SteamFriends.GetLargeAvatarAsync(SteamId.op_Implicit(steamID))); } catch (Exception ex) { Exception exception = ex; WildCardMod.Instance.Log.LogError((object)exception); texture = playerDefault; } } } public class SmithWing : WildCardProp { [Space(3f)] [Header("SmithWing")] [Space(3f)] [SerializeField] private float speedMultiplier = 1.25f; private float inverseSpeedMultiplier = 0f; private bool doingSpeed = false; private bool wasEnemy = false; public override void OnDestroy() { if (doingSpeed) { if (wasEnemy) { NavMeshAgent agent = base.LastEnemyHeldBy.agent; agent.speed *= inverseSpeedMultiplier; } else { base.LastPlayerHeldBy.MultiplyPlayerSpeed(inverseSpeedMultiplier); } } ((GrabbableObject)this).OnDestroy(); } public override void Update() { base.Update(); if ((((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed) || ((GrabbableObject)this).isHeldByEnemy) { if (!doingSpeed) { inverseSpeedMultiplier = 1f / speedMultiplier; doingSpeed = true; if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.MultiplyPlayerSpeed(speedMultiplier); return; } wasEnemy = true; NavMeshAgent agent = base.LastEnemyHeldBy.agent; agent.speed *= speedMultiplier; } } else if (doingSpeed) { doingSpeed = false; if (!wasEnemy) { base.LastPlayerHeldBy.MultiplyPlayerSpeed(inverseSpeedMultiplier); return; } wasEnemy = false; NavMeshAgent agent2 = base.LastEnemyHeldBy.agent; agent2.speed *= inverseSpeedMultiplier; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SmithWing"; } } public class WildCardSwingable : WildCardProp { internal const int HitMask = 1084754248; [Space(3f)] [Header("WildCardSwingable")] [Space(3f)] [SerializeField] internal int hitForce = 1; [SerializeField] internal int playerDamage = 15; [SerializeField] internal CauseOfDeath playerCOD = (CauseOfDeath)1; [SerializeField] internal float playerForceMultiplier = 1f; internal bool reeling = false; internal bool forceEndReel = false; private Coroutine reelingCoroutine = null; public override void Start() { base.Start(); base.Audio["Surface"]?.Add(StartOfRound.Instance.footstepSurfaces.Select((FootstepSurface x) => x.hitSurfaceSFX)); } public override void ItemActivate(bool used, bool buttonDown = true) { base.ItemActivate(used, buttonDown); if (!reeling && buttonDown) { reeling = true; StartReel(); } } internal virtual void StartReel() { if (reelingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingCoroutine); } if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.activatingItem = true; base.LastPlayerHeldBy.twoHanded = true; if (((NetworkBehaviour)this).IsOwner) { base.LastPlayerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); base.LastPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); } } if (((NetworkBehaviour)this).IsOwner) { base.Audio["Reel"]?.PlayRandomOneshot(); } reelingCoroutine = ((MonoBehaviour)this).StartCoroutine(Reel()); } private IEnumerator Reel() { yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !base.ButtonDown || (!((GrabbableObject)this).isHeld && !((GrabbableObject)this).isHeldByEnemy) || forceEndReel)); bool cancel = (!((GrabbableObject)this).isHeld && !((GrabbableObject)this).isHeldByEnemy) || forceEndReel; Swing(cancel); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); Hit(cancel); yield return (object)new WaitForSeconds(0.3f); reeling = false; forceEndReel = false; reelingCoroutine = null; } public override void Update() { base.Update(); if (reeling) { ReelUpdate(); } } internal virtual void ReelUpdate() { } public override void DiscardItem() { if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.activatingItem = false; } base.DiscardItem(); } internal virtual void Swing(bool cancel = false) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsOwner) { return; } if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); } if (!cancel) { base.Audio["Swing"]?.PlayRandomOneshot(); if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)base.LastPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } } internal virtual void Hit(bool cancel = false) { //IL_00b1: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.activatingItem = false; base.LastPlayerHeldBy.twoHanded = false; } if (cancel || !((NetworkBehaviour)this).IsOwner) { return; } bool flag = false; bool flag2 = false; bool flag3 = false; int num = -1; HashSet hashSet; Transform val; if (((GrabbableObject)this).isHeld) { hashSet = new HashSet { (IHittable)(object)base.LastPlayerHeldBy }; val = ((Component)base.LastPlayerHeldBy.gameplayCamera).transform; } else { hashSet = new HashSet { (IHittable)(object)((Component)base.LastEnemyHeldBy).GetComponentInChildren() }; val = base.LastEnemyHeldBy.eye; } List list = Physics.SphereCastAll(val.position + val.right * -0.35f, 0.8f, val.forward, 1.5f, 1084754248, (QueryTriggerInteraction)2).ToList(); list.Sort((RaycastHit x, RaycastHit y) => ((RaycastHit)(ref x)).distance.CompareTo(((RaycastHit)(ref y)).distance)); IHittable val3 = default(IHittable); RaycastHit val4 = default(RaycastHit); for (int num2 = 0; num2 < list.Count; num2++) { RaycastHit val2 = list[num2]; int layer = ((Component)((RaycastHit)(ref val2)).transform).gameObject.layer; if (layer == 8 || layer == 11) { if (((RaycastHit)(ref val2)).collider.isTrigger) { continue; } flag = true; string tag = ((Component)((RaycastHit)(ref val2)).collider).gameObject.tag; for (int num3 = 0; num3 < StartOfRound.Instance.footstepSurfaces.Length; num3++) { if (StartOfRound.Instance.footstepSurfaces[num3].surfaceTag == tag) { num = num3; break; } } } else { if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent(ref val3) || !hashSet.Add(val3) || (((RaycastHit)(ref val2)).point != Vector3.zero && Physics.Linecast(((Component)base.LastPlayerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref val2)).point, ref val4, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))) { continue; } flag = true; bool flag4 = false; EnemyAICollisionDetect val5 = (EnemyAICollisionDetect)(object)((val3 is EnemyAICollisionDetect) ? val3 : null); if ((Object)(object)val5 != (Object)null) { flag4 = (Object)(object)val5.mainScript != (Object)null && (!StartOfRound.Instance.hangarDoorsClosed || val5.mainScript.isInsidePlayerShip == base.LastPlayerHeldBy.isInHangarShipRoom); } else { PlayerControllerB val6 = (PlayerControllerB)(object)((val3 is PlayerControllerB) ? val3 : null); flag4 = (Object)(object)val6 == (Object)null || !flag3; flag3 = (Object)(object)val6 != (Object)null && !flag3; } if (flag4) { PlayerControllerB playerWhoHit = null; if (((GrabbableObject)this).isHeld) { playerWhoHit = base.LastPlayerHeldBy; } bool flag5 = base.Base.HitOrDamage(val3, playerDamage, hitForce, val.forward, playerWhoHit, playHitSFX: true, 1, playerCOD, playerForceMultiplier); if (!flag2) { flag2 = flag5; } } } } if (flag) { base.Audio["Hit"]?.PlayRandomClip(); if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.playerBodyAnimator.SetTrigger("shovelHit"); } if (!flag2 && num >= 0) { base.Audio["Surface"]?.PlayOneshot(num); } } } internal virtual void ForceEndReel(bool networked = true) { forceEndReel = true; if (networked) { ForceEndReelRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ForceEndReelRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3402168344u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3402168344u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ForceEndReel(networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3402168344u, new RpcReceiveHandler(__rpc_handler_3402168344), "ForceEndReelRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3402168344(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; ((WildCardSwingable)(object)target).ForceEndReelRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WildCardSwingable"; } } public class WildCardThrowable : WildCardProp { internal static float defaultSpeed = 7.5f; [Space(3f)] [Header("WildCardThrowable")] [Space(3f)] [SerializeField] internal AnimationCurve throwCurve = null; [SerializeField] internal AnimationCurve throwVerticalCurve = null; [SerializeField] internal AnimationCurve throwVerticalCurveNoBounce = null; [SerializeField] internal Transform transformToThrow = null; [SerializeField] internal bool throwToFloor = true; [SerializeField] internal bool discardOnThrow = true; [SerializeField] internal float throwDistance = 20f; [SerializeField] internal float throwSpeed = 1f; internal bool throwing = false; internal float throwTime = 0f; internal Vector3 targetPosition; internal bool lastThrownByEnemy = false; private Vector3 startThrowLocalPos = Vector3.zero; public override void OnDestroy() { if (throwing && ((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.throwingObject = false; } ((GrabbableObject)this).OnDestroy(); } internal override void WildCardUse() { //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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) base.WildCardUse(); if (!((NetworkBehaviour)this).IsOwner || throwing || ((!((GrabbableObject)this).isHeld || ((GrabbableObject)this).isPocketed) && !((GrabbableObject)this).isHeldByEnemy)) { return; } targetPosition = GetThrowDestination(); bool isHeldByEnemy = ((GrabbableObject)this).isHeldByEnemy; if (discardOnThrow) { if (isHeldByEnemy) { EnemyForceDropItem(); } else { base.LastPlayerHeldBy.DiscardHeldObject(true, (NetworkObject)null, targetPosition, true); } } base.Audio["Throw"]?.PlayRandomClip(); Throw(targetPosition, isHeldByEnemy); } internal virtual void Throw(Vector3 newPosition, bool byEnemy, bool networked = true) { //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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) lastThrownByEnemy = byEnemy; targetPosition = newPosition; if (!discardOnThrow) { if (!byEnemy) { base.LastPlayerHeldBy.throwingObject = true; } startThrowLocalPos = transformToThrow.localPosition; } throwTime = 0f; throwing = true; if (((NetworkBehaviour)this).IsServer || !base.NetworkAnimations) { base.Animator?.SetBool("BeingThrown", value: true); } if (networked) { ThrowRpc(newPosition, byEnemy); } } internal Vector3 GetThrowDestination() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) Transform val = ((!((GrabbableObject)this).isHeld) ? base.LastEnemyHeldBy.eye : ((Component)base.LastPlayerHeldBy.gameplayCamera).transform); Ray val2 = default(Ray); ((Ray)(ref val2))..ctor(val.position, val.forward); Vector3 point = ((Ray)(ref val2)).GetPoint(throwDistance); RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, ref val3, throwDistance, StartOfRound.Instance.allPlayersCollideWithMask, (QueryTriggerInteraction)1)) { point = ((Ray)(ref val2)).GetPoint(((RaycastHit)(ref val3)).distance - 0.05f); } if (!throwToFloor) { return point; } ((Ray)(ref val2))..ctor(point, Vector3.down); if (Physics.Raycast(val2, ref val3, throwDistance, StartOfRound.Instance.allPlayersCollideWithMask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val3)).point + Vector3.up * 0.05f; } return ((Ray)(ref val2)).GetPoint(throwDistance * 1.5f); } public override void Update() { base.Update(); if (!discardOnThrow && throwing) { ThrowUpdate(); if (!(throwTime < 1f) && ((NetworkBehaviour)this).IsOwner) { ThrowEnd(); } } } internal virtual void ThrowUpdate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0062: Unknown result type (might be due to invalid IL or missing references) transformToThrow.position = Vector3.Lerp(((Component)this).transform.position, targetPosition, throwCurve.Evaluate(throwTime)); float num = defaultSpeed * throwSpeed; throwTime += Time.deltaTime * num / Mathf.Max(num * 0.5f, Vector3.Distance(((Component)this).transform.position, targetPosition)); } internal virtual void ThrowEnd(bool networked = true) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer || !base.NetworkAnimations) { base.Animator?.SetBool("BeingThrown", value: false); } base.Audio["Throw"]?.Stop(networked: false); if (((GrabbableObject)this).isHeld || ((GrabbableObject)this).isHeldByEnemy) { if (((GrabbableObject)this).isHeld) { base.LastPlayerHeldBy.throwingObject = false; } if (!discardOnThrow) { throwTime = 0f; targetPosition = ((Component)this).transform.position; transformToThrow.localPosition = startThrowLocalPos; } } ((MonoBehaviour)this).StartCoroutine(FrameWait()); if (networked) { ThrowEndRpc(); } } private IEnumerator FrameWait() { yield return (object)new WaitForEndOfFrame(); throwing = false; } public override void EquipItem() { base.EquipItem(); ThrowEnd(networked: false); } internal override void GrabFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.GrabFromAny(fromPlayer, enemy); ThrowEnd(networked: false); } internal override void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.DiscardFromAny(fromPlayer, enemy); if (!discardOnThrow && ((NetworkBehaviour)this).IsOwner && throwing && (!fromPlayer || base.LastPlayerHeldBy.throwingObject)) { ThrowEnd(); } } public override void FallWithCurve() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) if (!discardOnThrow || !throwing) { ((GrabbableObject)this).FallWithCurve(); return; } Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; float num = Time.deltaTime * defaultSpeed * throwSpeed / magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, (float)(((GrabbableObject)this).floorYRot + ((GrabbableObject)this).itemProperties.floorYOffset) + 90f, ((GrabbableObject)this).itemProperties.restingRotation.z), num); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, throwCurve.Evaluate(((GrabbableObject)this).fallTime)); AnimationCurve val2 = throwVerticalCurve; if (magnitude > 5f) { val2 = throwVerticalCurveNoBounce; } ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), val2.Evaluate(((GrabbableObject)this).fallTime)); ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + num; } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); ThrowEnd(networked: false); } [Rpc(/*Could not decode attribute arguments.*/)] private void ThrowRpc(Vector3 newPosition, bool byEnemy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1455032299u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref newPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref byEnemy, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1455032299u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Throw(newPosition, byEnemy, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ThrowEndRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(976946943u, val3, val, (SendTo)5, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 976946943u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ThrowEnd(networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1455032299u, new RpcReceiveHandler(__rpc_handler_1455032299), "ThrowRpc"); ((NetworkBehaviour)this).__registerRpc(976946943u, new RpcReceiveHandler(__rpc_handler_976946943), "ThrowEndRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1455032299(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 newPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref newPosition); bool byEnemy = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref byEnemy, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardThrowable)(object)target).ThrowRpc(newPosition, byEnemy); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_976946943(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; ((WildCardThrowable)(object)target).ThrowEndRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WildCardThrowable"; } } public class Valentine : WildCardProp { [Space(3f)] [Header("Valentine")] [Space(3f)] [SerializeField] private int valueLoss = 5; [SerializeField] private int nearMax = 10; [SerializeField] private float valueMaxMultiplier = 30f; [SerializeField] private float maxEffectIntensity = 0.5f; private int startingValue = 0; private float inverseMaxValue = 0f; public override void Start() { base.Start(); SetStartingValue(); } internal override void OnEnable() { EventsClass.OnRoundStart += SetStartingValue; } internal override void OnDisable() { EventsClass.OnRoundStart -= SetStartingValue; } private void SetStartingValue() { if (startingValue == 0) { startingValue = base.ScrapValue; } inverseMaxValue = 1f / Mathf.Max(1f, (float)startingValue * valueMaxMultiplier); } public override void Update() { base.Update(); if (((NetworkBehaviour)this).IsOwner && (((GrabbableObject)this).isHeld || ((GrabbableObject)this).isHeldByEnemy) && !((GrabbableObject)this).isPocketed && StartOfRound.Instance.currentLevel.planetHasTime && !StartOfRound.Instance.inShipPhase && !(base.Audio["HeartBeat"]?.TimesNearby >= nearMax) && !(((GrabbableObject)this).currentUseCooldown > 0f)) { base.ScrapValue += valueLoss; ((GrabbableObject)this).currentUseCooldown = ((GrabbableObject)this).useCooldown; } } public override void EquipItem() { base.EquipItem(); if (((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).currentUseCooldown = ((GrabbableObject)this).useCooldown; } } public void HeartBeat() { if (((NetworkBehaviour)this).IsOwner) { base.Audio["HeartBeat"].PlayRandomClip(); float num = Mathf.Lerp(0.01f, 1f, ((float)base.ScrapValue - (float)startingValue) * inverseMaxValue); if (!(num <= maxEffectIntensity)) { SetIntensity(num); } } } public override int GetItemDataToSave() { return startingValue; } public override void LoadItemSaveData(int saveData) { startingValue = saveData; } private void SetIntensity(float intensity, bool networked = true) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) float num = intensity * 2f - 1f; float num2 = Mathf.Lerp(1f, 3f, num); base.Animator.SetFloat("BeatSpeed", num2); base.Animator.SetFloat("RestSpeed", Mathf.Lerp(1f, 32f, num)); base.Audio["HeartBeat"].SetPitch(num + 1f); base.MeshRenderers["Main"].SetColours(new Color(num2, num2, num2, 1f)); if (networked) { SetIntensityRpc(intensity); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetIntensityRpc(float intensity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3826531864u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref intensity, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3826531864u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetIntensity(intensity, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3826531864u, new RpcReceiveHandler(__rpc_handler_3826531864), "SetIntensityRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3826531864(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float intensityRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref intensityRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Valentine)(object)target).SetIntensityRpc(intensityRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Valentine"; } } public class VulpixieItem : WildCardProp { [Space(3f)] [Header("VulpixieItem")] [Space(3f)] [SerializeField] private Transform meshTransform = null; [SerializeField] private Vector2 scaleMinMax = new Vector2(0.5f, 1.5f); private Vector2Int scaleMinMaxRound = Vector2Int.zero; private Vector3 meshScale = Vector3.one; private Vector2 ScaleMinMax { set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) scaleMinMax = value; scaleMinMaxRound = new Vector2Int(Mathf.RoundToInt(value.x * 10f), Mathf.RoundToInt(value.y * 10f) + 1); } } public override void Start() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) base.Start(); ScaleMinMax = scaleMinMax; } public void RandomizeScale() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) meshScale = meshTransform.localScale; if (((NetworkBehaviour)this).IsOwner) { SetScale(Vector3.Scale(meshScale, new Vector3((float)base.Random.Next(((Vector2Int)(ref scaleMinMaxRound)).x, ((Vector2Int)(ref scaleMinMaxRound)).y), (float)base.Random.Next(((Vector2Int)(ref scaleMinMaxRound)).x, ((Vector2Int)(ref scaleMinMaxRound)).y), (float)base.Random.Next(((Vector2Int)(ref scaleMinMaxRound)).x, ((Vector2Int)(ref scaleMinMaxRound)).y)) * 0.1f)); } } public void ResetScale() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { SetScale(meshScale); } } private void SetScale(Vector3 scale, bool networked = true) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) meshTransform.localScale = scale; if (networked) { SetScaleRpc(scale); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetScaleRpc(Vector3 scale) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1385331967u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scale); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1385331967u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetScale(scale, networked: false); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1385331967u, new RpcReceiveHandler(__rpc_handler_1385331967), "SetScaleRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1385331967(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 scaleRpc = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scaleRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((VulpixieItem)(object)target).SetScaleRpc(scaleRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "VulpixieItem"; } } public class WildCardProp : PhysicsProp, IWildCardBase { private static bool firstControlsReminder; [Space(3f)] [Header("WildCardProp")] [Space(3f)] [SerializeField] private List> audioClips = null; [SerializeField] private List> animations = null; [SerializeField] private List> particles = null; [SerializeField] private List> meshRenderers = null; [SerializeField] private List> modelVariants = null; [SerializeField] private List> lights = null; [SerializeField] private bool networkAnimations = false; [SerializeField] private RepeatingAction enemyUse = null; [SerializeField] private RepeatingAction enemyActivate = null; [HideInInspector] [SerializeField] private ListDict audioDict = null; [HideInInspector] [SerializeField] private ListDict animDict = null; [HideInInspector] [SerializeField] private ListDict particleDict = null; [HideInInspector] [SerializeField] private ListDict renderDict = null; [HideInInspector] [SerializeField] private ListDict variantDict = null; [HideInInspector] [SerializeField] private ListDict lightDict = null; [HideInInspector] [SerializeReference] private AnimationHandler animator = null; [HideInInspector] [SerializeReference] private bool initialized = false; private WildCardItem item = null; private Dictionary properties = null; private int state = -1; private PlayerControllerB lastPlayer = null; private ScanNodeProperties scanNode = null; private bool buttonDown = false; private Random random = null; internal EnemyAI heldByEnemy = null; private EnemyAI lastEnemy = null; internal static ManualLogSource Log => WildCardMod.Instance.Log; string IWildCardBase.Name { get { if ((Object)(object)ScanNode != (Object)null) { return ScanNode.headerText; } if ((Object)(object)((GrabbableObject)this).itemProperties != (Object)null) { return ((GrabbableObject)this).itemProperties.itemName; } return ((Object)((Component)this).gameObject).name.Replace("(Clone)", string.Empty); } set { if ((Object)(object)ScanNode != (Object)null) { ScanNode.headerText = value; } if (!Properties.TryGetValue(value, out var value2)) { value2 = ScriptableObjectExtension.Clone(Properties["Default"]); value2.itemName = value; Properties.Add(value, value2); } ((GrabbableObject)this).itemProperties = value2; } } bool IWildCardBase.IsServer => ((NetworkBehaviour)this).IsServer; bool IWildCardBase.IsOwner => ((NetworkBehaviour)this).IsOwner; Transform IWildCardBase.Transform => ((Component)this).transform; ListDict IWildCardBase.Audio => Audio; ListDict IWildCardBase.Animations => Animations; ListDict IWildCardBase.Particles => Particles; ListDict IWildCardBase.MeshRenderers => MeshRenderers; ListDict IWildCardBase.ModelVariants => ModelVariants; ListDict IWildCardBase.Lights => Lights; int IWildCardBase.State { get { return State; } set { State = value; } } AnimationHandler IWildCardBase.Animator { get { return Animator; } set { animator = value; } } bool IWildCardBase.NetworkAnimations { get { return networkAnimations; } set { NetworkAnimations = value; } } Random IWildCardBase.Random => Random; internal IWildCardBase Base => this; internal ListDict Audio { get { if (audioDict == null) { audioDict = new ListDict(); } return audioDict; } } internal ListDict Animations { get { if (animDict == null) { animDict = new ListDict(); } return animDict; } } internal ListDict Particles { get { if (particleDict == null) { particleDict = new ListDict(); } return particleDict; } } internal ListDict MeshRenderers { get { if (renderDict == null) { renderDict = new ListDict(); } return renderDict; } } internal ListDict ModelVariants { get { if (variantDict == null) { variantDict = new ListDict(); } return variantDict; } } internal ListDict Lights { get { if (lightDict == null) { lightDict = new ListDict(); } return lightDict; } } internal bool NetworkAnimations { get { if (animator == null) { return false; } return animator.IsNetworked; } set { if (animator != null && value != animator.IsNetworked) { networkAnimations = value; if (animator != null || animator.IsNetworked != networkAnimations) { animator.SetNetworkEnabled(networkAnimations); } } } } internal WildCardItem OriginalItem { get { if (item == null) { item = Properties["Default"] as WildCardItem; } return item; } } internal WildCardItem CurrentItem { get { if (((GrabbableObject)this).itemProperties == null) { ((GrabbableObject)this).itemProperties = (Item)(object)OriginalItem; } return ((GrabbableObject)this).itemProperties as WildCardItem; } } internal int ScrapValue { get { return ((GrabbableObject)this).scrapValue; } set { if (value != ((GrabbableObject)this).scrapValue) { if (value < 0) { value = 0; } ((GrabbableObject)this).SetScrapValue(value); SetValueRpc(value); } } } internal Dictionary Properties { get { if (properties == null) { properties = new Dictionary(); } properties.TryAdd("Default", ((GrabbableObject)this).itemProperties); return properties; } } internal int State { get { return state; } set { if (state != value) { state = value; OnStateChange(value); SetStateRpc(value); } } } internal PlayerControllerB LastPlayerHeldBy { get { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { lastPlayer = ((GrabbableObject)this).playerHeldBy; } return lastPlayer; } } internal EnemyAI LastEnemyHeldBy { get { if ((Object)(object)heldByEnemy != (Object)null) { lastEnemy = heldByEnemy; } return lastEnemy; } } internal ScanNodeProperties ScanNode { get { if ((Object)(object)scanNode == (Object)null) { scanNode = ((Component)this).GetComponentInChildren(); } return scanNode; } } internal AnimationHandler Animator { get { if ((Object)(object)animator?.OriginalNetworked == (Object)null) { animator = null; } return animator; } set { animator = value; } } internal Random Random { get { if ((Object)(object)RoundManager.Instance != (Object)null && random == null) { random = new Random(StartOfRound.Instance.randomMapSeed + IWildCardBase.totalBases); } return random; } } internal bool ButtonDown => buttonDown; internal virtual void InitializePrefab() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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_006b: Expected O, but got Unknown AudioSource val = ((Component)this).gameObject.AddComponent(); val.spatialBlend = 1f; val.maxDistance = 25f; val.rolloffMode = (AudioRolloffMode)2; val.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 1f), new Keyframe(1f, 0f) })); } internal virtual void Awake() { ((Component)this).GetComponent().outputAudioMixerGroup = WildUtils.DiageticMasterGroup; IWildCardBase.Awake(this); enemyUse.SetRandom(Random); enemyUse.SetAction(WildCardUse); enemyActivate.SetRandom(Random); enemyActivate.SetAction(EnemyItemActivate); enemyActivate.LoopWaitsFor = () => ((GrabbableObject)this).currentUseCooldown <= 0f; } public override void Start() { ((GrabbableObject)this).Start(); if (WildCardMod.ModConfig.Debug) { Log.LogDebug((object)("Spawning " + ((IWildCardBase)this).Name)); } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer && WildCardMod.ModConfig.Debug) { SetValueRpc(ScrapValue); } } protected override void OnNetworkPostSpawn() { ((NetworkBehaviour)this).OnNetworkPostSpawn(); IWildCardBase.OnNetworkPostSpawn(this, ((GrabbableObject)this).hasBeenHeld); } internal virtual void OnEnable() { if (CurrentItem.usesButton) { WildCardMod.KeyBinds.WildCardButton.performed += WildCardUse; } } internal virtual void OnDisable() { WildCardMod.KeyBinds.WildCardButton.performed -= WildCardUse; } internal virtual void WildCardUse(CallbackContext useContext) { WildCardUse(); } internal virtual void WildCardUse() { } internal virtual void OnStateChange(int newState) { } public override void Update() { ((GrabbableObject)this).Update(); IWildCardBase.Update(this); if (((GrabbableObject)this).isHeldByEnemy) { WildCardItem currentItem = CurrentItem; if (currentItem.usesButton && currentItem.enemyCanUseButton) { enemyUse.Tick(); } if (currentItem.enemyCanActivate) { enemyActivate.Tick(); } } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); this.buttonDown = buttonDown; if (((NetworkBehaviour)this).IsOwner) { Audio["Activate"]?.PlayRandomClip(); } if (!NetworkAnimations || ((NetworkBehaviour)this).IsServer) { Animator?.Trigger("Activate"); } } internal virtual void ItemActivateFromEnemy(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); } private void EnemyItemActivate() { if (((NetworkBehaviour)this).IsServer) { WildCardItem currentItem = CurrentItem; if (!((GrabbableObject)this).RequireCooldown() && ((GrabbableObject)this).UseItemBatteries(!((Item)currentItem).holdButtonUse, !buttonDown)) { ItemActivateFromEnemy(((GrabbableObject)this).isBeingUsed, !buttonDown); EnemyItemActivateRpc(((GrabbableObject)this).isBeingUsed, !buttonDown); } } } public override void EquipItem() { ((PhysicsProp)this).EquipItem(); Animator?.SetBool("BeingHeld", value: true); for (int i = 0; i < Lights.Count; i++) { SelectLights selectLights = Lights[i]; if (selectLights.disableWhilePocketed) { selectLights.EnableAll(networked: false); } } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); for (int i = 0; i < Lights.Count; i++) { SelectLights selectLights = Lights[i]; if (selectLights.disableWhilePocketed) { selectLights.DisableAll(networked: false); } } } public override void GrabItem() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).GrabItem(); lastPlayer = ((GrabbableObject)this).playerHeldBy; if (!firstControlsReminder && !((GrabbableObject)this).hasBeenHeld && LastPlayerHeldBy.IsLocal() && CurrentItem.usesButton) { firstControlsReminder = true; HUDManager instance = HUDManager.Instance; InputBinding val = WildCardMod.KeyBinds.WildCardButton.bindings[InputActionRebindingExtensions.GetBindingIndexForControl(WildCardMod.KeyBinds.WildCardButton, WildCardMod.KeyBinds.WildCardButton.controls[0])]; instance.DisplayTip("Try the " + InputControlPath.ToHumanReadableString(((InputBinding)(ref val)).effectivePath, (HumanReadableStringOptions)2, (InputControl)null) + " button!", "Some items from WildCardStuff have cool effects when this is pressed!", false, false, "LC_Tip1"); } GrabFromAny(); } public override void DiscardItem() { lastPlayer = ((GrabbableObject)this).playerHeldBy; DiscardFromAny(); ((GrabbableObject)this).DiscardItem(); } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); heldByEnemy = enemy; lastEnemy = enemy; enemyUse.ResetTimer(); enemyActivate.ResetTimer(); if (((NetworkBehaviour)this).IsServer || !NetworkAnimations) { Animator?.SetBool("BeingHeld", value: true); } GrabFromAny(fromPlayer: false, enemy); } public override void DiscardItemFromEnemy() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).isHeldByEnemy = false; lastEnemy = heldByEnemy; DiscardFromAny(fromPlayer: false, heldByEnemy); heldByEnemy = null; if (((GrabbableObject)this).grabbableToEnemies && !((GrabbableObject)this).deactivated && HoarderBugAI.HoarderBugItems.Count > 0) { HoarderBugItem val = ((IEnumerable)HoarderBugAI.HoarderBugItems).FirstOrDefault((Func)((HoarderBugItem x) => (Object)(object)x.itemGrabbableObject == (Object)(object)this)); if (val != null && Vector3.Distance(val.itemNestPosition, ((Component)this).transform.position) > 7.5f) { HoarderBugAI.grabbableObjectsInMap.Add(((Component)this).gameObject); } } ((GrabbableObject)this).DiscardItemFromEnemy(); } internal virtual void GrabFromAny(bool fromPlayer = true, EnemyAI enemy = null) { ((GrabbableObject)this).isHeldByEnemy = !fromPlayer; Audio["SpawnMusic"]?.Stop(networked: false); } internal virtual void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { if (((NetworkBehaviour)this).IsServer || !NetworkAnimations) { Animator?.SetBool("BeingHeld", value: false); } } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).hasBeenHeld = true; } internal virtual void DamagePlayerLocal(int damage, CauseOfDeath causeOfDeath = (CauseOfDeath)0, int animation = 0, Vector3 force = default(Vector3)) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) GameNetworkManager.Instance.localPlayerController.DamagePlayer(damage, true, true, causeOfDeath, animation, false, force); } internal void EnemyForceDropItem(bool hide = false, bool networked = true) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (networked) { EnemyAI lastEnemyHeldBy = LastEnemyHeldBy; HoarderBugAI val = (HoarderBugAI)(object)((lastEnemyHeldBy is HoarderBugAI) ? lastEnemyHeldBy : null); if (val != null && (Object)(object)val.heldItem.itemGrabbableObject == (Object)(object)this) { val.DropItemAndCallDropRPC(((Component)this).GetComponent(), false); return; } EnemyAI lastEnemyHeldBy2 = LastEnemyHeldBy; BaboonBirdAI val2 = (BaboonBirdAI)(object)((lastEnemyHeldBy2 is BaboonBirdAI) ? lastEnemyHeldBy2 : null); if (val2 != null && (Object)(object)val2.heldScrap == (Object)(object)this) { val2.DropHeldItemAndSync(true); return; } } ((GrabbableObject)this).parentObject = null; ((Component)this).transform.SetParent(StartOfRound.Instance.propsContainer, true); ((GrabbableObject)this).EnablePhysics(!hide); if (hide) { ((GrabbableObject)this).EnableItemMeshes(false); ((GrabbableObject)this).grabbable = false; } else { ((GrabbableObject)this).fallTime = 0f; ((GrabbableObject)this).startFallingPosition = ((Component)this).transform.parent.InverseTransformPoint(((Component)this).transform.position); ((GrabbableObject)this).targetFloorPosition = ((Component)this).transform.parent.InverseTransformPoint(((GrabbableObject)this).targetFloorPosition); ((GrabbableObject)this).floorYRot = -1; } ((GrabbableObject)this).DiscardItemFromEnemy(); if (networked) { EnemyForceDropItemRpc(hide); } } [Rpc(/*Could not decode attribute arguments.*/)] private void EnemyItemActivateRpc(bool used, bool buttonDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(938203751u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref used, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref buttonDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 938203751u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ItemActivateFromEnemy(used, buttonDown); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EnemyForceDropItemRpc(bool hide) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2420364286u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref hide, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2420364286u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EnemyForceDropItem(hide, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void DamagePlayerRpc(int damage, int causeOfDeath = 0, int animation = 0, Vector3 force = default(Vector3), RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2848341701u, rpcParams, val, (SendTo)8, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, damage); BytePacker.WriteValueBitPacked(val2, causeOfDeath); BytePacker.WriteValueBitPacked(val2, animation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref force); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2848341701u, rpcParams, val, (SendTo)8, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DamagePlayerLocal(damage, (CauseOfDeath)causeOfDeath, animation, force); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayClipRpc(int id, int index, bool oneShot, float volume, float pitch) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3799310916u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref oneShot, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref volume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pitch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3799310916u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.PlayClip(index, oneShot, networked: false, volume, pitch); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void RepeatClipRpc(int id, bool oneShot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1633927102u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref oneShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1633927102u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.RepeatClip(oneShot, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void StopAudioRpc(int id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3915841943u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3915841943u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.Stop(networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PauseAudioRpc(int id, bool pause) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4165629235u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pause, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4165629235u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.SetPaused(pause); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void MuteAudioRpc(int id, bool oneShot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(570750831u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref oneShot, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 570750831u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.SetMute(oneShot, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void DogNoiseRpc(int id, float volume, float pitch) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(680463705u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref volume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pitch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 680463705u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Audio[id]?.DogNoise(volume, pitch, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayParticlesRpc(int id, bool restart, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2876069006u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref restart, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2876069006u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.PlayAll(restart, networked: false); } else { selectParticles?.Play(index, restart, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void StopParticlesRpc(int id, bool clear, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(393797802u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clear, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 393797802u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.StopAll(clear, networked: false); } else { selectParticles?.Stop(index, clear, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PauseParticlesRpc(int id, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3337249166u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3337249166u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.PauseAll(networked: false); } else { selectParticles?.Pause(index, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ClearParticlesRpc(int id, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1422088568u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1422088568u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.ClearAll(networked: false); } else { selectParticles?.Clear(index, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void EmitParticlesRpc(int id, int count, int index = -1) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(166894921u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, count); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 166894921u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectParticles selectParticles = Particles[id]; if (index < 0) { selectParticles?.EmitAll(count, networked: false); } else { selectParticles?.Emit(index, count, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetStateRpc(int newState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(761363694u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newState); ((NetworkBehaviour)this).__endSendRpc(ref val2, 761363694u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; state = newState; OnStateChange(newState); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetNetworkAnimationsRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3677828360u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3677828360u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; networkAnimations = value; if (animator != null && animator.IsNetworked != networkAnimations) { animator.SetNetworkEnabled(networkAnimations); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetValueRpc(int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2687433922u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2687433922u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((GrabbableObject)this).SetScrapValue(value); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetParameterRpc(int hash, float value = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1415805039u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hash); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1415805039u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator?.SetParameter(hash, value); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetVariantRpc(int id, int variantIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1734205290u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, variantIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1734205290u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectModelVariants selectModelVariants = ModelVariants[id]; selectModelVariants.Switch(variantIndex, networked: false); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SetLightsEnabledRpc(int id, bool enable, int index = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4149808557u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enable, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4149808557u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SelectLights selectLights = Lights[id]; if (index < 0) { if (enable) { selectLights.EnableAll(networked: false); } else { selectLights.DisableAll(networked: false); } } else if (enable) { selectLights.Enable(index, networked: false); } else { selectLights.Disable(index, networked: false); } } void IWildCardBase.Initialize() { if (!initialized) { InitializePrefab(); IWildCardBase.Initialize(this, ref audioClips, ref animations, ref particles, ref meshRenderers, ref modelVariants, ref lights, out audioDict, out animDict, out particleDict, out renderDict, out variantDict, out lightDict); initialized = true; } } void IWildCardBase.PlayClipNetworked(int id, int index, bool oneShot, float volume, float pitch) { PlayClipRpc(id, index, oneShot, volume, pitch); } void IWildCardBase.RepeatClipNetworked(int id, bool oneShot) { RepeatClipRpc(id, oneShot); } void IWildCardBase.StopAudioNetworked(int id) { StopAudioRpc(id); } void IWildCardBase.PauseAudioNetworked(int id, bool pause) { PauseAudioRpc(id, pause); } void IWildCardBase.MuteAudioNetworked(int id, bool oneShot) { MuteAudioRpc(id, oneShot); } void IWildCardBase.DogNoiseNetworked(int id, float volume, float pitch) { DogNoiseRpc(id, volume, pitch); } void IWildCardBase.PlayParticlesNetworked(int id, bool restart, int index) { PlayParticlesRpc(id, restart, index); } void IWildCardBase.StopParticlesNetworked(int id, bool clear, int index) { StopParticlesRpc(id, clear, index); } void IWildCardBase.PauseParticlesNetworked(int id, int index) { PauseParticlesRpc(id, index); } void IWildCardBase.ClearParticlesNetworked(int id, int index) { ClearParticlesRpc(id, index); } void IWildCardBase.EmitParticlesNetworked(int id, int count, int index) { EmitParticlesRpc(id, count, index); } void IWildCardBase.SetStateNetworked(int newState) { SetStateRpc(newState); } void IWildCardBase.SetNetworkAnimationsNetworked(bool value) { SetNetworkAnimationsRpc(value); } void IWildCardBase.SetParameterNetworked(int hash, float value) { SetParameterRpc(hash, value); } void IWildCardBase.SetVariantNetworked(int id, int variantIndex) { SetVariantRpc(id, variantIndex); } void IWildCardBase.SetLightEnabledNetworked(int id, bool enable, int index) { SetLightsEnabledRpc(id, enable, index); } void IWildCardBase.DamagePlayer(PlayerControllerB player, int damage, CauseOfDeath causeOfDeath, int animation, Vector3 force) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected I4, but got Unknown DamagePlayerRpc(damage, (int)causeOfDeath, animation, force, player.GetRPCTarget()); } bool IWildCardBase.HitOrDamage(IHittable hittable, int playerDamage, int hitForce, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID, CauseOfDeath playerDeathCause, float playerForceMultiplier) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return IWildCardBase.HitOrDamage(this, hittable, playerDamage, hitForce, hitDirection, playerWhoHit, playHitSFX, hitID, playerDeathCause, playerForceMultiplier); } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(938203751u, new RpcReceiveHandler(__rpc_handler_938203751), "EnemyItemActivateRpc"); ((NetworkBehaviour)this).__registerRpc(2420364286u, new RpcReceiveHandler(__rpc_handler_2420364286), "EnemyForceDropItemRpc"); ((NetworkBehaviour)this).__registerRpc(2848341701u, new RpcReceiveHandler(__rpc_handler_2848341701), "DamagePlayerRpc"); ((NetworkBehaviour)this).__registerRpc(3799310916u, new RpcReceiveHandler(__rpc_handler_3799310916), "PlayClipRpc"); ((NetworkBehaviour)this).__registerRpc(1633927102u, new RpcReceiveHandler(__rpc_handler_1633927102), "RepeatClipRpc"); ((NetworkBehaviour)this).__registerRpc(3915841943u, new RpcReceiveHandler(__rpc_handler_3915841943), "StopAudioRpc"); ((NetworkBehaviour)this).__registerRpc(4165629235u, new RpcReceiveHandler(__rpc_handler_4165629235), "PauseAudioRpc"); ((NetworkBehaviour)this).__registerRpc(570750831u, new RpcReceiveHandler(__rpc_handler_570750831), "MuteAudioRpc"); ((NetworkBehaviour)this).__registerRpc(680463705u, new RpcReceiveHandler(__rpc_handler_680463705), "DogNoiseRpc"); ((NetworkBehaviour)this).__registerRpc(2876069006u, new RpcReceiveHandler(__rpc_handler_2876069006), "PlayParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(393797802u, new RpcReceiveHandler(__rpc_handler_393797802), "StopParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(3337249166u, new RpcReceiveHandler(__rpc_handler_3337249166), "PauseParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(1422088568u, new RpcReceiveHandler(__rpc_handler_1422088568), "ClearParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(166894921u, new RpcReceiveHandler(__rpc_handler_166894921), "EmitParticlesRpc"); ((NetworkBehaviour)this).__registerRpc(761363694u, new RpcReceiveHandler(__rpc_handler_761363694), "SetStateRpc"); ((NetworkBehaviour)this).__registerRpc(3677828360u, new RpcReceiveHandler(__rpc_handler_3677828360), "SetNetworkAnimationsRpc"); ((NetworkBehaviour)this).__registerRpc(2687433922u, new RpcReceiveHandler(__rpc_handler_2687433922), "SetValueRpc"); ((NetworkBehaviour)this).__registerRpc(1415805039u, new RpcReceiveHandler(__rpc_handler_1415805039), "SetParameterRpc"); ((NetworkBehaviour)this).__registerRpc(1734205290u, new RpcReceiveHandler(__rpc_handler_1734205290), "SetVariantRpc"); ((NetworkBehaviour)this).__registerRpc(4149808557u, new RpcReceiveHandler(__rpc_handler_4149808557), "SetLightsEnabledRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_938203751(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool used = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref used, default(ForPrimitives)); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).EnemyItemActivateRpc(used, flag); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2420364286(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool hide = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hide, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).EnemyForceDropItemRpc(hide); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2848341701(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int damage = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damage); int causeOfDeath = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeath); int animation = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref animation); Vector3 force = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref force); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).DamagePlayerRpc(damage, causeOfDeath, animation, force, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3799310916(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_0049: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); bool oneShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref oneShot, default(ForPrimitives)); float volume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref volume, default(ForPrimitives)); float pitch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).PlayClipRpc(id, index, oneShot, volume, pitch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1633927102(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool oneShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref oneShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).RepeatClipRpc(id, oneShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3915841943(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).StopAudioRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4165629235(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool pause = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pause, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).PauseAudioRpc(id, pause); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_570750831(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool oneShot = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref oneShot, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).MuteAudioRpc(id, oneShot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_680463705(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); float volume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref volume, default(ForPrimitives)); float pitch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).DogNoiseRpc(id, volume, pitch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2876069006(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool restart = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref restart, default(ForPrimitives)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).PlayParticlesRpc(id, restart, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_393797802(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool clear = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clear, default(ForPrimitives)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).StopParticlesRpc(id, clear, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3337249166(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).PauseParticlesRpc(id, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1422088568(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).ClearParticlesRpc(id, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_166894921(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int count = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref count); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).EmitParticlesRpc(id, count, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_761363694(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int stateRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stateRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).SetStateRpc(stateRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3677828360(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool networkAnimationsRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref networkAnimationsRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).SetNetworkAnimationsRpc(networkAnimationsRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2687433922(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int valueRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref valueRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).SetValueRpc(valueRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1415805039(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hash = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hash); float value = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).SetParameterRpc(hash, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1734205290(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); int variantIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref variantIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).SetVariantRpc(id, variantIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4149808557(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool enable = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enable, default(ForPrimitives)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WildCardProp)(object)target).SetLightsEnabledRpc(id, enable, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WildCardProp"; } } public class WormItem : WildCardThrowable { [Space(3f)] [Header("WormItem")] [Space(3f)] [SerializeField] private float eyeOffsetMultiplier = 0.025f; private int playersFinishedLast = 0; public override void OnNetworkSpawn() { base.OnNetworkSpawn(); base.Animator.SetBool("Spawned", !((GrabbableObject)this).hasBeenHeld); if (((NetworkBehaviour)this).IsServer) { base.Animations["Look"].SetFunctionAll(() => playersFinishedLast >= StartOfRound.Instance.connectedPlayersAmount + 1); } } internal override void GrabFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.GrabFromAny(fromPlayer, enemy); base.Animator.SetBool("Spawned", value: false); if (((NetworkBehaviour)this).IsServer) { playersFinishedLast = 0; SelectAnimationParameters selectAnimationParameters = base.Animations["Look"]; selectAnimationParameters.UpdateValues(0, null, 1f, 1f); selectAnimationParameters.DoAnimation(0, 1f); selectAnimationParameters.SetTimer(0, 3.5f, null, oneTime: true); selectAnimationParameters.ResetTimer(0, undoOneTime: false); } } internal override void DiscardFromAny(bool fromPlayer = true, EnemyAI enemy = null) { base.DiscardFromAny(fromPlayer, enemy); if (((NetworkBehaviour)this).IsServer) { base.Animations["Look"].UpdateAllValues(null, 0f, 0f); } } public void FinishAnimation() { FinishAnimRpc(); } public void RandomizeEye() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { Vector2 val = Random.insideUnitCircle * eyeOffsetMultiplier; base.MeshRenderers["Eye"].SetOffsets(val); RandomizeEyeRpc(val); } } [Rpc(/*Could not decode attribute arguments.*/)] private void FinishAnimRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(94517941u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 94517941u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; playersFinishedLast++; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void RandomizeEyeRpc(Vector2 offset) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(766586772u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref offset); ((NetworkBehaviour)this).__endSendRpc(ref val2, 766586772u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.MeshRenderers["Eye"].SetOffsets(offset); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(94517941u, new RpcReceiveHandler(__rpc_handler_94517941), "FinishAnimRpc"); ((NetworkBehaviour)this).__registerRpc(766586772u, new RpcReceiveHandler(__rpc_handler_766586772), "RandomizeEyeRpc"); base.__initializeRpcs(); } private static void __rpc_handler_94517941(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; ((WormItem)(object)target).FinishAnimRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_766586772(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector2 offset = default(Vector2); ((FastBufferReader)(ref reader)).ReadValueSafe(ref offset); target.__rpc_exec_stage = (__RpcExecStage)1; ((WormItem)(object)target).RandomizeEyeRpc(offset); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WormItem"; } } public class CloverNecklace : WildCardProp { internal static CloverNecklace oneNecklace = null; internal static List beeList = new List(); public override void Start() { base.Start(); if (EventsClass.RoundStarted) { DoChecks(); } } internal override void OnEnable() { EventsClass.OnRoundStart += DoChecks; } internal override void OnDisable() { EventsClass.OnRoundStart -= DoChecks; } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); if (!((Object)(object)oneNecklace != (Object)(object)this)) { oneNecklace = null; } } public override void GrabItem() { base.GrabItem(); if (base.LastPlayerHeldBy.IsLocal()) { for (int i = 0; i < beeList.Count; i++) { beeList[i].ToggleHeld(held: true); } } } public override void DiscardItem() { if (base.LastPlayerHeldBy.IsLocal()) { for (int i = 0; i < beeList.Count; i++) { beeList[i].ToggleHeld(held: false); } } base.DiscardItem(); } private void DoChecks() { if ((Object)(object)oneNecklace == (Object)null && beeList.Count > 0) { oneNecklace = this; return; } WildCardProp.Log.LogDebug((object)(((Item)base.CurrentItem).itemName + " is Despawning")); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CloverNecklace"; } } } namespace LCWildCardMod.Config { public class WildCardConfig { private static readonly PropertyInfo orphanedEntriesProp = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries"); private ReadOnlyDictionary publicScrapEnabled; private ReadOnlyDictionary publicScrapSpawnWeights; private ReadOnlyDictionary publicSkinEnabled; private ReadOnlyDictionary publicSkinApplyChance; private ReadOnlyDictionary publicMapObjectEnabled; private ReadOnlyDictionary publicDefaultMapObjectCurve; private ReadOnlyDictionary publicMapObjectMinMax; private readonly Dictionary> isScrapEnabled = new Dictionary>(); private readonly Dictionary> scrapSpawnWeights = new Dictionary>(); private readonly Dictionary> isSkinEnabled = new Dictionary>(); private readonly Dictionary> skinApplyChance = new Dictionary>(); private readonly Dictionary> isMapObjectEnabled = new Dictionary>(); private readonly Dictionary> useDefaultMapObjectCurve = new Dictionary>(); private readonly Dictionary, ConfigEntry)> mapObjectMinMax = new Dictionary, ConfigEntry)>(); private readonly ConfigEntry debugLogs; private readonly ConfigFile config; private static ManualLogSource Log => WildCardMod.Instance.Log; public ReadOnlyDictionary ScrapEnabled => publicScrapEnabled; public ReadOnlyDictionary ScrapSpawnWeights => publicScrapSpawnWeights; public ReadOnlyDictionary SkinEnabled => publicSkinEnabled; public ReadOnlyDictionary SkinApplyChance => publicSkinApplyChance; public ReadOnlyDictionary MapObjectEnabled => publicMapObjectEnabled; public ReadOnlyDictionary DefaultMapObjectCurve => publicDefaultMapObjectCurve; public ReadOnlyDictionary MapObjectMinMax => publicMapObjectMinMax; public bool Debug => debugLogs.Value; internal WildCardConfig(ConfigFile cfg, List scrapList, List skinList, List mapObjectsList) { config = cfg; config.SaveOnConfigSet = false; ScrapConfigs(scrapList); SkinConfigs(skinList); MapObjectConfigs(mapObjectsList); debugLogs = config.Bind("Miscellaneous", "Enable Extra Debug Logging?", false, (ConfigDescription)null); ClearOrphanedEntries(config); config.Save(); config.SaveOnConfigSet = true; config.SettingChanged += OnSettingChanged; } private static void ClearOrphanedEntries(ConfigFile config) { (orphanedEntriesProp.GetValue(config) as Dictionary).Clear(); } private void ScrapConfigs(List scrapList) { for (int i = 0; i < scrapList.Count; i++) { WildCardItem wildCardItem = scrapList[i]; string itemName = ((Item)wildCardItem).itemName; isScrapEnabled.TryAdd(itemName, config.Bind("Scrap", "Enable " + itemName + "?", wildCardItem.defaultEnabled, "")); scrapSpawnWeights.TryAdd(itemName, config.Bind("Scrap", "Spawn Weights of " + itemName + "!", wildCardItem.defaultRarities, "For example: All:20,Vanilla:20,Modded:20,Experimentation:20")); Log.LogDebug((object)("Added config for " + itemName)); } } private void SkinConfigs(List skinList) { for (int i = 0; i < skinList.Count; i++) { WildCardSkin wildCardSkin = skinList[i]; string skinName = wildCardSkin.skinName; bool skinEnabled = wildCardSkin.skinEnabled; int skinChance = wildCardSkin.skinChance; isSkinEnabled.TryAdd(skinName, config.Bind("Skins", "Enable " + skinName + "?", skinEnabled, "")); skinApplyChance.TryAdd(skinName, config.Bind("Skins", "Weighted chance that " + wildCardSkin.target + " will spawn as " + skinName, skinChance, "Must be an integer greater than, or equal to, 0.\nThe chance that no skin will be applied is 100 subtracted by this weight")); Log.LogDebug((object)("Added config for " + skinName)); } } private void MapObjectConfigs(List mapObjectsList) { for (int i = 0; i < mapObjectsList.Count; i++) { WildCardMapObject wildCardMapObject = mapObjectsList[i]; if (!wildCardMapObject.autoHandle) { string mapObjectName = wildCardMapObject.mapObjectName; isMapObjectEnabled.TryAdd(mapObjectName, config.Bind("Map Objects", "Enable " + mapObjectName + "?", true, "")); useDefaultMapObjectCurve.TryAdd(mapObjectName, config.Bind("Map Objects", "Use default min and max values for " + mapObjectName + "?", true, "")); ConfigEntry item = config.Bind("Map Objects", "Minimum number of " + mapObjectName + " to spawn per level", 0, "This only matters if you set \"Use Default\" to false.\nMust be an integer of 0 or above"); ConfigEntry item2 = config.Bind("Map Objects", "Maximum number of " + mapObjectName + " to spawn per level", 1, "This only matters if you set \"Use Default\" to false.\nMust be an integer of 0 or above"); mapObjectMinMax.TryAdd(mapObjectName, (item, item2)); Log.LogDebug((object)("Added config for " + mapObjectName)); } } } internal void ResetReadonlyDicts() { publicScrapEnabled = new ReadOnlyDictionary(new Dictionary(isScrapEnabled.Select((KeyValuePair> x) => new KeyValuePair(x.Key, x.Value.Value)))); publicScrapSpawnWeights = new ReadOnlyDictionary(new Dictionary(scrapSpawnWeights.Select((KeyValuePair> x) => new KeyValuePair(x.Key, x.Value.Value)))); publicSkinEnabled = new ReadOnlyDictionary(new Dictionary(isSkinEnabled.Select((KeyValuePair> x) => new KeyValuePair(x.Key, x.Value.Value)))); publicSkinApplyChance = new ReadOnlyDictionary(new Dictionary(skinApplyChance.Select((KeyValuePair> x) => new KeyValuePair(x.Key, x.Value.Value)))); publicMapObjectEnabled = new ReadOnlyDictionary(new Dictionary(isMapObjectEnabled.Select((KeyValuePair> x) => new KeyValuePair(x.Key, x.Value.Value)))); publicDefaultMapObjectCurve = new ReadOnlyDictionary(new Dictionary(useDefaultMapObjectCurve.Select((KeyValuePair> x) => new KeyValuePair(x.Key, x.Value.Value)))); publicMapObjectMinMax = new ReadOnlyDictionary(new Dictionary(mapObjectMinMax.Select((KeyValuePair, ConfigEntry)> x) => new KeyValuePair(x.Key, new Vector2Int(x.Value.Item1.Value, x.Value.Item2.Value))))); } private void OnSettingChanged(object sender, SettingChangedEventArgs args) { AssetType toUpdate = args.ChangedSetting.Definition.Section switch { "Scrap" => AssetType.Scrap, "Skins" => AssetType.Skin, "Map Objects" => AssetType.MapObject, _ => AssetType.None, }; WildCardMod.Instance.AssetUpdate(toUpdate); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace LCWildCardMod.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }