Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Glitchy Scrap v1.0.11
plugins/GlitchyScrap.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using Dawn; using Dawn.Utils; using Dusk; using Dusk.Weights; using GameNetcodeStuff; using GlitchyScrap.NetcodePatcher; using GlitchyScrap.src.Behaviours; using GlitchyScrap.src.Patches; using HarmonyLib; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("GlitchyScrap")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.9.0")] [assembly: AssemblyInformationalVersion("1.0.9")] [assembly: AssemblyProduct("GlitchyScrap")] [assembly: AssemblyTitle("GlitchyScrap")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.9.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace GlitchyScrap { public static class MyPluginInfo { public const string PLUGIN_GUID = "GlitchyScrap"; public const string PLUGIN_NAME = "GlitchyScrap"; public const string PLUGIN_VERSION = "1.0.9"; } } namespace GlitchyScrap.src { internal class GsContentHandler : ContentHandler<GsContentHandler> { public class ScrapConfig { public ConfigEntry<string>? MoonSpawnWeights; public ConfigEntry<string>? InteriorSpawnWeights; public ConfigEntry<string>? WeatherSpawnWeights; } public ScrapConfig? scrapConfig; public SpawnWeightsPreset SpawnWeights { get; private set; } = new SpawnWeightsPreset(); public GsContentHandler(DuskMod mod) : base(mod) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "gsassets"); string[] allAssetNames = val.GetAllAssetNames(); foreach (string text in allAssetNames) { if (Path.GetExtension(text) != ".asset") { continue; } DuskItemDefinition val2 = val.LoadAsset<DuskItemDefinition>(text); if ((Object)(object)val2 == (Object)null) { continue; } ConfigContext val3 = mod.ConfigManager.CreateConfigSection(val2.Item.itemName + " Options"); try { ExtendedGrabbableObject component = val2.Item.spawnPrefab.GetComponent<ExtendedGrabbableObject>(); if ((Object)(object)component != (Object)null) { component.PopulateConfig(val3, component); } scrapConfig = CreateItemConfig(val3, val2); SpawnWeights = new SpawnWeightsPreset(); SpawnWeights.SetupSpawnWeightsPreset(NamespacedConfigWeight.ConvertManyFromString(scrapConfig.MoonSpawnWeights?.Value ?? string.Empty), NamespacedConfigWeight.ConvertManyFromString(scrapConfig.InteriorSpawnWeights?.Value ?? string.Empty), NamespacedConfigWeight.ConvertManyFromString(scrapConfig.WeatherSpawnWeights?.Value ?? string.Empty), 0); DawnLib.RegisterNetworkPrefab(val2.Item.spawnPrefab); DawnLib.DefineItem(((DuskContentDefinition<DawnItemInfo>)(object)val2).TypedKey, val2.Item, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder) { builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder) { scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo, SpawnWeightContext>>)delegate(WeightTableBuilder<DawnMoonInfo, SpawnWeightContext> weightBuilder) { weightBuilder.SetGlobalWeight((IWeighted)(object)SpawnWeights); }); }); }); } finally { ((IDisposable)val3)?.Dispose(); } } } public ScrapConfig CreateItemConfig(ConfigContext context, DuskItemDefinition duskItemDefinition) { return new ScrapConfig { MoonSpawnWeights = context.Bind<string>("Preset Moon Weights", "Preset moon weights for " + duskItemDefinition.Item.itemName + ".", NamespacedConfigWeight.ConvertManyToString(duskItemDefinition.MoonSpawnWeightsConfig)), InteriorSpawnWeights = context.Bind<string>("Preset Interior Weights", "Preset interior weights for " + duskItemDefinition.Item.itemName + ".", NamespacedConfigWeight.ConvertManyToString(duskItemDefinition.InteriorSpawnWeightsConfig)), WeatherSpawnWeights = context.Bind<string>("Preset Weather Weights", "Preset weather weights for " + duskItemDefinition.Item.itemName + ".", NamespacedConfigWeight.ConvertManyToString(duskItemDefinition.WeatherSpawnWeightsConfig)) }; } } [BepInPlugin("GlitchyScrap", "GlitchyScrap", "1.0.11")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string DawnDep = "com.github.teamxiaolan.dawnlib"; public static DuskMod? Mod { get; private set; } private void Awake() { AssetBundle val = AssetBundleUtils.LoadBundle(Assembly.GetExecutingAssembly(), "gsmain"); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin GlitchyScrap is loaded!"); } } } namespace GlitchyScrap.src.Patches { internal class DamageDetectionPatch { private static bool patched; internal static Harmony? Harmony { get; set; } public static void PatchPlayer() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if (!patched) { patched = true; if (Harmony == null) { Harmony = new Harmony("DamageDetectionPatch"); } Harmony.PatchAll(typeof(ElecricDamagePatch)); } } } internal class ElecricDamagePatch { [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] [HarmonyPostfix] private static void DamagePlayer(PlayerControllerB __instance, CauseOfDeath causeOfDeath, int damageNumber) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 Debug.Log((object)"Player Damaged"); if ((int)causeOfDeath != 11) { return; } GrabbableObject[] itemSlots = __instance.ItemSlots; foreach (GrabbableObject val in itemSlots) { if (val is BulbScrap bulbScrap) { bulbScrap.AddCharge(damageNumber / 10); } } } } internal static class ExplosiveScrap { private static bool patched; internal static Harmony? Harmony { get; set; } public static void PatchLandmines() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if (!patched) { patched = true; if (Harmony == null) { Harmony = new Harmony("ScrapLandmineInteractionPatch"); } Harmony.PatchAll(typeof(ScrapLandmineInteractionPatch)); } } } internal class ScrapLandmineInteractionPatch { [HarmonyPatch(typeof(Landmine), "SpawnExplosion")] [HarmonyPostfix] private static void SpawnExplosion(Vector3 explosionPosition, float killRange, float damageRange) { //IL_0001: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(explosionPosition, damageRange, 64); RaycastHit val = default(RaycastHit); for (int i = 0; i < array.Length; i++) { ExtendedGrabbableObject component = ((Component)array[i]).GetComponent<ExtendedGrabbableObject>(); if (component is IExplosionInteraction explosionInteraction) { float num = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (!Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.25f, ref val, 1073742080, (QueryTriggerInteraction)1) || (((Component)((RaycastHit)(ref val)).collider).gameObject.layer != 30 && !(num > 4f))) { explosionInteraction.HitByExplosion(killRange == 2.4f && damageRange == 5f); } } } } } internal class LightningStrikePatch { private static bool patched; internal static Harmony? Harmony { get; set; } public static void PatchLightning() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if (!patched) { patched = true; if (Harmony == null) { Harmony = new Harmony("LightningDetectionPatch"); } Harmony.PatchAll(typeof(LightningDetectionPatch)); } } } internal class LightningDetectionPatch { [HarmonyPatch(typeof(StormyWeather), "LightningStrike")] [HarmonyPostfix] private static void LightningStrike(Vector3 strikePosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) Collider[] array = Physics.OverlapSphere(strikePosition + Vector3.up * 0.25f, 5f, 10); for (int i = 0; i < array.Length; i++) { PlayerControllerB component = ((Component)array[i]).GetComponent<PlayerControllerB>(); if ((Object)(object)component == (Object)null) { break; } GrabbableObject[] itemSlots = component.ItemSlots; foreach (GrabbableObject val in itemSlots) { if (val is BulbScrap bulbScrap) { bulbScrap.HitByExplosion(isLightning: true); } } } } } } namespace GlitchyScrap.src.Behaviours { internal class BulbScrap : ExtendedGrabbableObject, IExplosionInteraction { private bool isBulbEnabled = true; public Light light; private float charge; private int maxCharge = 5; public float maxIntensity = 70f; public float fadeModifier; public override void PopulateConfig(ConfigContext section, ExtendedGrabbableObject component) { base.PopulateConfig(section, component); if (isBulbEnabled) { ExplosiveScrap.PatchLandmines(); LightningStrikePatch.PatchLightning(); DamageDetectionPatch.PatchPlayer(); } } public override void Start() { base.Start(); if ((Object)(object)light != (Object)null) { ((Behaviour)light).enabled = false; if (fadeModifier <= 0f) { fadeModifier = 1f; } } else { isBulbEnabled = false; } } public void AddCharge(int value) { SetChargeRpc(value, add: true); } public void SetCharge(int value) { SetChargeRpc(value, add: false); } [Rpc(/*Could not decode attribute arguments.*/)] private void SetChargeRpc(int value, bool add) { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3962943151u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, value); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref add, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3962943151u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (isBulbEnabled) { charge = (add ? ((int)Mathf.Min(charge + (float)value, (float)maxCharge)) : value); } } } public override void Update() { ((GrabbableObject)this).Update(); if (isBulbEnabled && charge > 0f) { ((Behaviour)light).enabled = !((GrabbableObject)this).isPocketed; light.intensity = Mathf.Lerp(0f, maxIntensity, charge / fadeModifier); charge -= Time.deltaTime / fadeModifier; if (charge <= 0f) { ((Behaviour)light).enabled = false; } } } public void HitByExplosion(bool isLightning) { if (isLightning) { SetCharge(5); } } 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(3962943151u, new RpcReceiveHandler(__rpc_handler_3962943151), "SetChargeRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3962943151(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 value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); bool add = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref add, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((BulbScrap)(object)target).SetChargeRpc(value, add); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BulbScrap"; } } internal class ExtendedGrabbableObject : GrabbableObject { [CompilerGenerated] private sealed class <WaitForID>d__16 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ExtendedGrabbableObject <>4__this; private float <timeOut>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <WaitForID>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <timeOut>5__1 = 0f; goto IL_007a; case 1: <>1__state = -1; goto IL_007a; case 2: { <>1__state = -1; <>4__this.InitializeItem(<>4__this.v); return false; } IL_007a: if (<>4__this.v == -1) { <timeOut>5__1 += Time.deltaTime; if (<timeOut>5__1 > 5f) { return false; } <>2__current = null; <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(2f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Collected Item Display")] public bool useCustomPosition; public Vector3 overridePositionValue; public bool useCustomRotation; public Vector3 overrideRotationValue; [Header("Collected Item Display")] private int v = -1; [field: SerializeField] public List<ItemVariant> ItemVariants { get; private set; } = new List<ItemVariant>(); public override int GetItemDataToSave() { ((GrabbableObject)this).GetItemDataToSave(); return v; } public override void LoadItemSaveData(int saveData) { ((GrabbableObject)this).LoadItemSaveData(saveData); v = saveData; } public virtual void PopulateConfig(ConfigContext section, ExtendedGrabbableObject instance) { } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); OverrideScrapCollectionDisplay(); } public virtual void OverrideScrapCollectionDisplay() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (useCustomPosition) { ((Component)this).transform.localPosition = overridePositionValue; } if (useCustomRotation) { ((Component)this).transform.rotation = Quaternion.Euler(overrideRotationValue); } } public override void Start() { ((GrabbableObject)this).Start(); if (ItemVariants.Count > 0) { ((MonoBehaviour)this).StartCoroutine(WaitForID()); if (((NetworkBehaviour)this).IsServer && !base.scrapPersistedThroughRounds) { SyncVariantValueRpc(Random.Range(0, ItemVariants.Count)); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncVariantValueRpc(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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1795581781u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, value); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1795581781u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; v = value; } } } [IteratorStateMachine(typeof(<WaitForID>d__16))] private IEnumerator WaitForID() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <WaitForID>d__16(0) { <>4__this = this }; } private void InitializeItem(int num) { Renderer componentInChildren = ((Component)((Component)this).transform).GetComponentInChildren<Renderer>(); if (!((Object)(object)componentInChildren == (Object)null)) { if (num > ItemVariants.Count) { num %= ItemVariants.Count; } componentInChildren.material = ItemVariants[num].materialVariant; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1795581781u, new RpcReceiveHandler(__rpc_handler_1795581781), "SyncVariantValueRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1795581781(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 value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((ExtendedGrabbableObject)(object)target).SyncVariantValueRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ExtendedGrabbableObject"; } } [Serializable] internal class ItemVariant { [SerializeField] public string? Name; [SerializeField] public Material? materialVariant; [SerializeField] public string? chance; } internal interface IExplosionInteraction { void HitByExplosion(bool isLightning); } internal class SlinkyScrap : ExtendedGrabbableObject { [CompilerGenerated] private sealed class <ISlinking>d__11 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 nextNormal; public SlinkyScrap <>4__this; private bool <leadingEnd>5__1; private bool <sfxPlayedThisStep>5__2; private Vector3 <previousPosition>5__3; private Vector3 <anchorPos>5__4; private Vector3 <nextPosition>5__5; private Vector3 <axis>5__6; private float <t>5__7; private int <i>5__8; private float <b>5__9; private int <i>5__10; private float <b>5__11; private int <i>5__12; private float <b>5__13; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ISlinking>d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_078f: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Unknown result type (might be due to invalid IL or missing references) //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_083c: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_084b: Unknown result type (might be due to invalid IL or missing references) //IL_0851: Unknown result type (might be due to invalid IL or missing references) //IL_0856: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_08ba: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: 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_0524: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08e1: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_09df: Unknown result type (might be due to invalid IL or missing references) //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_0a22: Unknown result type (might be due to invalid IL or missing references) //IL_0a0c: Unknown result type (might be due to invalid IL or missing references) //IL_0a27: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) Vector3 val; switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_005b; case 1: <>1__state = -1; goto IL_005b; case 2: <>1__state = -1; goto IL_037d; case 3: <>1__state = -1; goto IL_0771; case 4: { <>1__state = -1; break; } IL_005b: if (!((GrabbableObject)<>4__this).reachedFloorTarget) { <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)((Component)<>4__this).transform.parent == (Object)null) { return false; } <leadingEnd>5__1 = true; <sfxPlayedThisStep>5__2 = false; <previousPosition>5__3 = ((GrabbableObject)<>4__this).targetFloorPosition; <anchorPos>5__4 = <previousPosition>5__3; <nextPosition>5__5 = <>4__this.GetNextPosition(((GrabbableObject)<>4__this).targetFloorPosition, ref nextNormal); if (<nextPosition>5__5 == Vector3.zero) { return false; } val = Vector3.Cross(<nextPosition>5__5 - <previousPosition>5__3, Vector3.up); <axis>5__6 = ((Vector3)(ref val)).normalized; <t>5__7 = 0f; goto IL_037d; IL_0771: if (<t>5__7 < 1f) { if (((GrabbableObject)<>4__this).isHeld || ((GrabbableObject)<>4__this).isHeldByEnemy) { return false; } <>4__this.SyncRootPositionRpc(Vector3.Lerp((<previousPosition>5__3 + <anchorPos>5__4) / 2f, (<nextPosition>5__5 + <anchorPos>5__4) / 2f, <t>5__7) + Vector3.up * Mathf.Lerp(<>4__this.curve.Evaluate(0.5f) * 0.2f, 0.5f, (<t>5__7 < 0.5f) ? <t>5__7 : (1f - <t>5__7))); <i>5__10 = 0; while (<i>5__10 < <>4__this.bones.Length) { <b>5__11 = (float)<i>5__10 / ((float)<>4__this.bones.Count() - 1f); <>4__this.SyncBonePositionRpc(<i>5__10, Vector3.Lerp(<previousPosition>5__3 * (<leadingEnd>5__1 ? (1f - <b>5__11) : <b>5__11) + <anchorPos>5__4 * (<leadingEnd>5__1 ? <b>5__11 : (1f - <b>5__11)), <nextPosition>5__5 * (<leadingEnd>5__1 ? (1f - <b>5__11) : <b>5__11) + <anchorPos>5__4 * (<leadingEnd>5__1 ? <b>5__11 : (1f - <b>5__11)), <t>5__7) + Vector3.up * Mathf.Lerp(<>4__this.curve.Evaluate(<leadingEnd>5__1 ? (1f - <b>5__11) : <b>5__11) * 0.2f, <leadingEnd>5__1 ? (1f - <b>5__11) : <b>5__11, (<t>5__7 < 0.5f) ? <t>5__7 : (1f - <t>5__7)), Quaternion.AngleAxis((<leadingEnd>5__1 ? (1f - <b>5__11) : <b>5__11) * Mathf.Lerp(180f, -180f, <t>5__7), <axis>5__6) * (((<leadingEnd>5__1 ? (1f - <b>5__11) : <b>5__11) > 0.5f) ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity)); <i>5__10++; } if (!<sfxPlayedThisStep>5__2 && <t>5__7 > 0.65f) { <>4__this.SpringSoundRpc(); <sfxPlayedThisStep>5__2 = true; } <t>5__7 += Time.deltaTime * 1.2f; <>2__current = null; <>1__state = 3; return true; } goto IL_0788; IL_0788: if (<>4__this.OnUnstableGround(nextNormal)) { <leadingEnd>5__1 = !<leadingEnd>5__1; <previousPosition>5__3 = <anchorPos>5__4; <anchorPos>5__4 = <nextPosition>5__5; <nextPosition>5__5 = <>4__this.GetNextPosition(<nextPosition>5__5, ref nextNormal); val = Vector3.Cross(<nextPosition>5__5 - <previousPosition>5__3, Vector3.up); <axis>5__6 = ((Vector3)(ref val)).normalized; <sfxPlayedThisStep>5__2 = false; <t>5__7 = 0f; goto IL_0771; } <previousPosition>5__3 = <anchorPos>5__4; <anchorPos>5__4 = <nextPosition>5__5; val = Vector3.Cross(<anchorPos>5__4 - <previousPosition>5__3, Vector3.up); <axis>5__6 = ((Vector3)(ref val)).normalized; <leadingEnd>5__1 = !<leadingEnd>5__1; <sfxPlayedThisStep>5__2 = false; <t>5__7 = 0f; break; IL_037d: if (<t>5__7 < 1f) { if (((GrabbableObject)<>4__this).isHeld || ((GrabbableObject)<>4__this).isHeldByEnemy) { return false; } <>4__this.SyncRootPositionRpc(Vector3.Lerp(<previousPosition>5__3 + Vector3.up * 0.2f, (<nextPosition>5__5 + <previousPosition>5__3) / 2f, <t>5__7)); <i>5__8 = 0; while (<i>5__8 < <>4__this.bones.Length) { <b>5__9 = (float)<i>5__8 / ((float)<>4__this.bones.Count() - 1f); <>4__this.SyncBonePositionRpc(<i>5__8, Vector3.Lerp(<previousPosition>5__3 + Vector3.up * <>4__this.restingStateBoneSpacing * (float)(<>4__this.bones.Count() - 1 - <i>5__8), <nextPosition>5__5 * (1f - <b>5__9) + <previousPosition>5__3 * <b>5__9 + Vector3.up * <>4__this.curve.Evaluate(1f - <b>5__9) * 0.2f, <t>5__7), Quaternion.AngleAxis((1f - <b>5__9) * Mathf.Lerp(0f, -180f, <t>5__7), <axis>5__6) * ((1f - <b>5__9 > 0.5f) ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity)); <i>5__8++; } if (!<sfxPlayedThisStep>5__2 && <t>5__7 > 0.65f) { <>4__this.SpringSoundRpc(); <sfxPlayedThisStep>5__2 = true; } <t>5__7 += Time.deltaTime * 2.4f; <>2__current = null; <>1__state = 2; return true; } goto IL_0788; } if (<t>5__7 < 1f) { if (((GrabbableObject)<>4__this).isHeld || ((GrabbableObject)<>4__this).isHeldByEnemy) { return false; } <>4__this.SyncRootPositionRpc(Vector3.Lerp((<previousPosition>5__3 + <anchorPos>5__4) / 2f, <nextPosition>5__5 + Vector3.up * 0.2f, <t>5__7)); <i>5__12 = 0; while (<i>5__12 < <>4__this.bones.Length) { <b>5__13 = (float)<i>5__12 / ((float)<>4__this.bones.Count() - 1f); <>4__this.SyncBonePositionRpc(<i>5__12, Vector3.Lerp(<previousPosition>5__3 * (<leadingEnd>5__1 ? (1f - <b>5__13) : <b>5__13) + <anchorPos>5__4 * (<leadingEnd>5__1 ? <b>5__13 : (1f - <b>5__13)), <nextPosition>5__5, <t>5__7) + Vector3.up * Mathf.Lerp(<>4__this.curve.Evaluate(<leadingEnd>5__1 ? (1f - <b>5__13) : <b>5__13) * 0.2f, <leadingEnd>5__1 ? (<>4__this.restingStateBoneSpacing * (float)(<>4__this.bones.Count() - 1 - <i>5__12)) : (<>4__this.restingStateBoneSpacing * (float)<i>5__12), <t>5__7), Quaternion.AngleAxis((<leadingEnd>5__1 ? (1f - <b>5__13) : <b>5__13) * Mathf.Lerp(180f, 0f, <t>5__7), <axis>5__6) * (((<leadingEnd>5__1 ? (1f - <b>5__13) : <b>5__13) > 0.5f) ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity)); <i>5__12++; } if (!<sfxPlayedThisStep>5__2 && <t>5__7 > 0.5f) { <>4__this.SpringSoundRpc(); <sfxPlayedThisStep>5__2 = true; } <t>5__7 += Time.deltaTime * 2.4f; <>2__current = null; <>1__state = 4; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int stableAngle = 30; public float horizontalSearchDistance = 0.75f; public float dropDistance = 1f; public Transform[] bones; public AnimationCurve curve; public AudioClip? sproing; private float restingStateBoneSpacing = 0.04f; public override void GrabItem() { ((GrabbableObject)this).GrabItem(); ResetPosition(); } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); ResetPosition(); } private void ResetPosition() { //IL_0021: 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_0076: 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) float num = (float)(bones.Length - 1) * restingStateBoneSpacing; for (int i = 0; i < bones.Length; i++) { bones[i].localPosition = Vector3.up * (num - restingStateBoneSpacing * (float)i - ((GrabbableObject)this).itemProperties.verticalOffset); bones[i].localRotation = ((i < bones.Count() / 2) ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity); } } public override void OnHitGround() { //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_0037: 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) if (((NetworkBehaviour)this).IsHost) { RaycastHit val = default(RaycastHit); Physics.Raycast(((Component)this).transform.position, Vector3.down, ref val, 0.2f, 268437761, (QueryTriggerInteraction)1); if (OnUnstableGround(((RaycastHit)(ref val)).normal)) { ((MonoBehaviour)this).StartCoroutine(ISlinking(((RaycastHit)(ref val)).normal)); } } } [IteratorStateMachine(typeof(<ISlinking>d__11))] private IEnumerator ISlinking(Vector3 nextNormal) { //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 decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ISlinking>d__11(0) { <>4__this = this, nextNormal = nextNormal }; } [Rpc(/*Could not decode attribute arguments.*/)] private void SpringSoundRpc() { //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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3438891213u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3438891213u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Component)this).gameObject.GetComponent<AudioSource>().PlayOneShot(sproing); } } } private bool OnUnstableGround(Vector3 hitNormal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Angle(hitNormal, Vector3.up) > (float)stableAngle) { return true; } return false; } private Vector3 GetNextPosition(Vector3 startPosition, ref Vector3 direction) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //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_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) //IL_0035: 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_00a8: 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_005a: 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_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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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) direction.y = 0f; Vector3 val = ((Component)this).transform.parent.TransformPoint(startPosition) + direction * horizontalSearchDistance; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, dropDistance, 268437761, (QueryTriggerInteraction)1)) { if (Vector3.Dot(direction, ((RaycastHit)(ref val2)).normal) < 0f) { return Vector3.zero; } direction = ((RaycastHit)(ref val2)).normal; return ((Component)this).transform.parent.InverseTransformPoint(((RaycastHit)(ref val2)).point); } return Vector3.zero; } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncRootPositionRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2054743686u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2054743686u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((GrabbableObject)this).targetFloorPosition = position; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void SyncBonePositionRpc(int bone, Vector3 position, Quaternion rotation) { //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_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) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3839355590u, val2, val, (SendTo)7, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, bone); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3839355590u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; bones[bone].SetPositionAndRotation(((Component)this).transform.parent.TransformPoint(position), rotation); } } } public override void OverrideScrapCollectionDisplay() { //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_0034: 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_0048: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0098: 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_00b7: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) base.OverrideScrapCollectionDisplay(); Vector3 forward = Vector3.forward; for (int i = 0; i < bones.Length; i++) { float num = (float)i / ((float)bones.Count() - 1f); bones[i].localPosition = Vector3.right * 0.35f * 0.5f * num + Vector3.left * 0.35f * 0.5f * (1f - num) + Vector3.up * curve.Evaluate(num) * 0.2f; bones[i].rotation = Quaternion.AngleAxis(num * -180f, forward) * ((num > 0.5f) ? Quaternion.Euler(0f, 0f, 180f) : Quaternion.identity); } } 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 ((NetworkBehaviour)this).__registerRpc(3438891213u, new RpcReceiveHandler(__rpc_handler_3438891213), "SpringSoundRpc"); ((NetworkBehaviour)this).__registerRpc(2054743686u, new RpcReceiveHandler(__rpc_handler_2054743686), "SyncRootPositionRpc"); ((NetworkBehaviour)this).__registerRpc(3839355590u, new RpcReceiveHandler(__rpc_handler_3839355590), "SyncBonePositionRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3438891213(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; ((SlinkyScrap)(object)target).SpringSoundRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2054743686(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 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((SlinkyScrap)(object)target).SyncRootPositionRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3839355590(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0063: 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 bone = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref bone); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((SlinkyScrap)(object)target).SyncBonePositionRpc(bone, position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SlinkyScrap"; } } } namespace GlitchyScrap.Behaviours { internal class BallButWithActualRotation : SoccerBallProp { public override void Update() { //IL_00fb: 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_0087: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsOwner) { if (!((GrabbableObject)this).wasOwnerLastFrame) { ((GrabbableObject)this).wasOwnerLastFrame = true; } } else if (((GrabbableObject)this).wasOwnerLastFrame) { ((GrabbableObject)this).wasOwnerLastFrame = false; } if (((GrabbableObject)this).isHeld || ((GrabbableObject)this).isHeldByEnemy) { return; } if (((GrabbableObject)this).fallTime < 1f) { ((GrabbableObject)this).FallWithCurve(); if (!((GrabbableObject)this).hasHitGround) { if (((Component)this).transform.localPosition.y - ((GrabbableObject)this).targetFloorPosition.y < 0.05f) { ((GrabbableObject)this).PlayDropSFX(); ((GrabbableObject)this).OnHitGround(); } } else if (((Component)this).transform.localPosition.y - ((GrabbableObject)this).targetFloorPosition.y > 0.05f) { ((GrabbableObject)this).hasHitGround = false; } } else { ((Component)this).transform.localPosition = ((GrabbableObject)this).targetFloorPosition; } } public override void FallWithCurve() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //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_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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00ba: 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) Vector3 val = ((GrabbableObject)this).targetFloorPosition - ((GrabbableObject)this).startFallingPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, base.grenadeFallCurve.Evaluate(((GrabbableObject)this).fallTime)); if (magnitude < 3f) { ((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), base.grenadeVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime)); } else { ((Component)this).transform.Rotate(Vector3.Cross(val, Vector3.up), 0f - magnitude / 6f, (Space)0); ((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), base.grenadeVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime)); ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y + base.soccerBallVerticalOffset.Evaluate(((GrabbableObject)this).fallTime) * base.ballHitUpwardAmount, ((Component)this).transform.localPosition.z); } ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 6f / magnitude); } protected override void __initializeVariables() { ((SoccerBallProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((SoccerBallProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BallButWithActualRotation"; } } internal class HoppingScrap : ExtendedGrabbableObject { [CompilerGenerated] private sealed class <IDoJumpingCoroutine>d__32 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int counter; public HoppingScrap <>4__this; private int <failsafeCount>5__1; private Vector3 <jumpTarget>5__2; private bool <setInShipRoom>5__3; private bool <setInElevator>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <IDoJumpingCoroutine>d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_00b2: 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_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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <failsafeCount>5__1 = 0; goto IL_0056; case 1: <>1__state = -1; goto IL_0056; case 2: <>1__state = -1; <jumpTarget>5__2 = <>4__this.GetJumpTarget(); if (<jumpTarget>5__2 != Vector3.zero) { <setInShipRoom>5__3 = false; Bounds bounds = StartOfRound.Instance.shipBounds.bounds; if (!((Bounds)(ref bounds)).Contains(<jumpTarget>5__2)) { <setInElevator>5__4 = false; <jumpTarget>5__2 = StartOfRound.Instance.propsContainer.InverseTransformPoint(<jumpTarget>5__2); } else { <setInElevator>5__4 = true; bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; <setInShipRoom>5__3 = ((Bounds)(ref bounds)).Contains(<jumpTarget>5__2); <jumpTarget>5__2 = StartOfRound.Instance.elevatorTransform.InverseTransformPoint(<jumpTarget>5__2); } counter--; <failsafeCount>5__1 = 0; <>4__this.FrogJumpRPC(<jumpTarget>5__2, <setInElevator>5__4, <setInShipRoom>5__3); goto IL_01b5; } <failsafeCount>5__1++; break; case 3: { <>1__state = -1; goto IL_01b5; } IL_0056: if (!((GrabbableObject)<>4__this).reachedFloorTarget) { <>2__current = null; <>1__state = 1; return true; } <>4__this.StartRPC(); break; IL_01b5: if (!((GrabbableObject)<>4__this).reachedFloorTarget && <>4__this.isJumping) { <>2__current = null; <>1__state = 3; return true; } break; } if (counter > 0 && <failsafeCount>5__1 < 5 && !((GrabbableObject)<>4__this).isInElevator && <>4__this.isJumping) { <>2__current = (object)new WaitForSeconds(<>4__this.jumpDelay); <>1__state = 2; return true; } <>4__this.StopRpc(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [Header("Falling Animation Curves")] public AnimationCurve JumpCurve; public float jumpHeight = 0.5f; [Header("Frog Specific FX")] public AudioClip jumpSound; public AudioClip windLoop; private Animator animator; private AudioSource audioSource; public float noiseRange = 16f; public float noiseLoudness = 1.6f; private int timesPlayedInOneSpot; private Vector3 lastPositionAtFart; [Header("Jump Parameters")] public float jumpDistance = 5f; public float jumpDelay = 0.6f; public float upwardClearance = 0.12f; public int jumpChance = 40; public int jumpCountMin = 3; public int jumpCountMax = 7; [Header("Restrictions")] public float wallAvoidance = 0.2f; public float maxFallHeight = 12f; public int slopeLimit = 45; public LayerMask hitMask = LayerMask.op_Implicit(369101569); [Header("Jump Update")] private RaycastHit soccerHit; private bool isJumping; private bool wasObjectPlaced; private const int maxFailCount = 5; public override void PopulateConfig(ConfigContext section, ExtendedGrabbableObject component) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown base.PopulateConfig(section, component); ConfigEntry<int> val = section.Bind<int>("Jump Chance", "Chance for " + ((GrabbableObject)this).itemProperties.itemName + " to jump when dropped.", jumpChance); ConfigEntry<BoundedRange> val2 = section.Bind<BoundedRange>("Jump count", "Number of times " + ((GrabbableObject)this).itemProperties.itemName + " will jump.", new BoundedRange((float)jumpCountMin, (float)jumpCountMax)); if (!((Object)(object)component == (Object)null)) { ((HoppingScrap)component).jumpChance = val.Value; ((HoppingScrap)component).jumpCountMin = (int)val2.Value.Min; ((HoppingScrap)component).jumpCountMax = (int)val2.Value.Max + 1; } } public override void Start() { base.Start(); jumpCountMax = Mathf.Max(jumpCountMin, jumpCountMax); animator = ((Component)this).GetComponent<Animator>(); audioSource = ((Component)this).GetComponent<AudioSource>(); if ((Object)(object)windLoop != (Object)null) { audioSource.clip = windLoop; audioSource.loop = true; } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); isJumping = false; } public override void GrabItemFromEnemy(EnemyAI enemy) { ((GrabbableObject)this).GrabItemFromEnemy(enemy); isJumping = false; } public override void OnHitGround() { ((GrabbableObject)this).OnHitGround(); if (!((NetworkBehaviour)this).IsHost || isJumping || ((GrabbableObject)this).isInElevator) { return; } if (wasObjectPlaced) { wasObjectPlaced = false; return; } int num = SetJumpCount(); if (num > 0) { ((MonoBehaviour)this).StartCoroutine(IDoJumpingCoroutine(num)); } } public override void OnPlaceObject() { ((GrabbableObject)this).OnPlaceObject(); wasObjectPlaced = true; } public override void FallWithCurve() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (isJumping) { Vector3 val = ((GrabbableObject)this).targetFloorPosition - ((GrabbableObject)this).startFallingPosition; float magnitude = ((Vector3)(ref val)).magnitude; ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, Mathf.Atan2(((GrabbableObject)this).targetFloorPosition.x - ((GrabbableObject)this).startFallingPosition.x, ((GrabbableObject)this).targetFloorPosition.z - ((GrabbableObject)this).startFallingPosition.z) * 57.29578f + 90f, ((GrabbableObject)this).itemProperties.restingRotation.z), 16f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, ((GrabbableObject)this).fallTime); Transform transform = ((Component)this).transform; transform.localPosition += Vector3.up * (JumpCurve.Evaluate(((GrabbableObject)this).fallTime) * jumpHeight); ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); if (((GrabbableObject)this).fallTime >= 1f) { ((GrabbableObject)this).reachedFloorTarget = true; ((GrabbableObject)this).OnHitGround(); } } else { ((GrabbableObject)this).FallWithCurve(); } } private int SetJumpCount() { if (Random.Range(0, 100) < jumpChance) { return Random.RandomRangeInt(jumpCountMin, jumpCountMax + 1); } return 0; } [IteratorStateMachine(typeof(<IDoJumpingCoroutine>d__32))] private IEnumerator IDoJumpingCoroutine(int counter) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <IDoJumpingCoroutine>d__32(0) { <>4__this = this, counter = counter }; } [Rpc(/*Could not decode attribute arguments.*/)] public void StartRPC() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(146954598u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 146954598u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isJumping = true; Animator obj = animator; if (obj != null) { obj.SetBool("Winding", true); } AudioSource obj2 = audioSource; if (obj2 != null) { obj2.Play(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void StopRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1152892137u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1152892137u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Animator obj = animator; if (obj != null) { obj.SetBool("Winding", false); } AudioSource obj2 = audioSource; if (obj2 != null) { obj2.Stop(); } } } public Vector3 GetJumpTarget() { //IL_0009: 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_0019: 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_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_00b4: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)this).transform.position, GetJumpDirection()); float num = ((!Physics.Raycast(val, ref soccerHit, jumpDistance + wallAvoidance, LayerMask.op_Implicit(hitMask), (QueryTriggerInteraction)1)) ? jumpDistance : Mathf.Max(((RaycastHit)(ref soccerHit)).distance - ((((Component)((RaycastHit)(ref soccerHit)).collider).gameObject.tag == "Rock") ? (wallAvoidance * 3f) : wallAvoidance), 0f)); if (Physics.Raycast(((Ray)(ref val)).GetPoint(num), Vector3.down, ref soccerHit, 65f, LayerMask.op_Implicit(hitMask), (QueryTriggerInteraction)1) && IsLandingPositionValid()) { return ((RaycastHit)(ref soccerHit)).point; } if (Physics.Raycast(((Ray)(ref val)).GetPoint(num - 0.15f), Vector3.down, ref soccerHit, 65f, LayerMask.op_Implicit(hitMask), (QueryTriggerInteraction)1) && IsLandingPositionValid()) { return ((RaycastHit)(ref soccerHit)).point; } return Vector3.zero; } public Vector3 GetJumpDirection() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector3 val = Vector2.op_Implicit(((Vector2)(ref insideUnitCircle)).normalized); val.z = val.y; val.y = upwardClearance; return val; } public bool IsLandingPositionValid() { //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) if (((RaycastHit)(ref soccerHit)).distance > maxFallHeight) { return false; } if (Vector3.Angle(((RaycastHit)(ref soccerHit)).normal, Vector3.up) >= (float)slopeLimit) { return false; } if (((Object)((RaycastHit)(ref soccerHit)).collider).name == "OutOfBoundsTerrain") { return false; } return true; } [Rpc(/*Could not decode attribute arguments.*/)] private void FrogJumpRPC(Vector3 destinationPos, bool setInElevator, bool setInShipRoom) { //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_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) //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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1675992513u, val2, val, (SendTo)7, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref destinationPos); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref setInShipRoom, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1675992513u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Animator obj = animator; if (obj != null) { obj.SetTrigger("Hop"); } ((GrabbableObject)this).fallTime = 0f; ((GrabbableObject)this).hasHitGround = false; if (setInElevator) { ((Component)this).transform.SetParent(StartOfRound.Instance.elevatorTransform, true); } else { ((Component)this).transform.SetParent(StartOfRound.Instance.propsContainer, true); } GameNetworkManager.Instance.localPlayerController.SetItemInElevator(setInElevator, setInShipRoom, (GrabbableObject)(object)this); ((GrabbableObject)this).startFallingPosition = ((Component)this).transform.parent.InverseTransformPoint(((Component)this).transform.position + Vector3.up * 0.07f); ((GrabbableObject)this).targetFloorPosition = destinationPos; } } private void JumpEvent() { //IL_001a: 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_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_006d: Unknown result type (might be due to invalid IL or missing references) AudioSource obj = audioSource; if (obj != null) { obj.PlayOneShot(jumpSound); } if (Vector3.Distance(lastPositionAtFart, ((Component)this).transform.position) > 2f) { timesPlayedInOneSpot = 0; } timesPlayedInOneSpot++; lastPositionAtFart = ((Component)this).transform.position; RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange / 2f, noiseLoudness / 2f, timesPlayedInOneSpot, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } 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 ((NetworkBehaviour)this).__registerRpc(146954598u, new RpcReceiveHandler(__rpc_handler_146954598), "StartRPC"); ((NetworkBehaviour)this).__registerRpc(1152892137u, new RpcReceiveHandler(__rpc_handler_1152892137), "StopRpc"); ((NetworkBehaviour)this).__registerRpc(1675992513u, new RpcReceiveHandler(__rpc_handler_1675992513), "FrogJumpRPC"); base.__initializeRpcs(); } private static void __rpc_handler_146954598(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; ((HoppingScrap)(object)target).StartRPC(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1152892137(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; ((HoppingScrap)(object)target).StopRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1675992513(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 destinationPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destinationPos); bool setInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref setInElevator, default(ForPrimitives)); bool setInShipRoom = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref setInShipRoom, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HoppingScrap)(object)target).FrogJumpRPC(destinationPos, setInElevator, setInShipRoom); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "HoppingScrap"; } } internal class VolatileScrap : ExtendedGrabbableObject, IExplosionInteraction { [CompilerGenerated] private sealed class <DetonateAfterDelay>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VolatileScrap <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DetonateAfterDelay>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.hasExploded = true; <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.DetonateRpc(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public bool explosionsEnabled = true; private bool hasExploded; public AudioClip explosionSFX; public override void PopulateConfig(ConfigContext section, ExtendedGrabbableObject component) { base.PopulateConfig(section, component); ConfigEntry<bool> val = section.Bind<bool>("Explosive", "Whether " + ((GrabbableObject)this).itemProperties.itemName + " will react to explosions.", true); ((VolatileScrap)component).explosionsEnabled = val.Value; if (val.Value) { ExplosiveScrap.PatchLandmines(); } } public void HitByExplosion(bool v) { if (((NetworkBehaviour)this).IsServer && explosionsEnabled) { StartDetonateRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] private void StartDetonateRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1306458307u, val2, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1306458307u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!hasExploded) { hasExploded = true; ((MonoBehaviour)this).StartCoroutine(DetonateAfterDelay()); } } } [IteratorStateMachine(typeof(<DetonateAfterDelay>d__6))] private IEnumerator DetonateAfterDelay() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DetonateAfterDelay>d__6(0) { <>4__this = this }; } [Rpc(/*Could not decode attribute arguments.*/)] private void DetonateRpc() { //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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2010984667u, val2, val, (SendTo)7, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2010984667u, val2, val, (SendTo)7, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AudioSource component = ((Component)this).gameObject.GetComponent<AudioSource>(); component.PlayOneShot(explosionSFX); WalkieTalkie.TransmitOneShotAudio(component, explosionSFX, 1f); Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up * 0.2f, true, 0f, 1f, 50, 0f, (GameObject)null, false); ((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy); } } } 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 Unk