Decompiled source of CandyCaneEmergencyPiton v1.0.0

com.github.spidersgeorg.CandyCaneEmergencyPiton.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
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.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using Photon.Pun;
using UnityEngine;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.spidersgeorg.CandyCaneEmergencyPiton")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("com.github.spidersgeorg.CandyCaneEmergencyPiton")]
[assembly: AssemblyTitle("CandyCaneEmergencyPiton")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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 BepInEx
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class BepInAutoPluginAttribute : Attribute
	{
		public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace BepInEx.Preloader.Core.Patching
{
	[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
	[Conditional("CodeGeneration")]
	internal sealed class PatcherAutoPluginAttribute : Attribute
	{
		public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
		{
		}
	}
}
namespace CandyCaneEmergencyPiton
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.github.spidersgeorg.CandyCaneEmergencyPiton", "CandyCaneEmergencyPiton", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		internal static Dictionary<string, SFX_Instance> SFXInstances = new Dictionary<string, SFX_Instance>();

		internal static List<SFX_Instance> bonk = new List<SFX_Instance>();

		public const string Id = "com.github.spidersgeorg.CandyCaneEmergencyPiton";

		internal static ManualLogSource Log { get; private set; } = null;


		public static Plugin Instance { get; private set; }

		internal static AssetBundle Bundle { get; set; }

		public static string Name => "CandyCaneEmergencyPiton";

		public static string Version => "0.1.0";

		private void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			BundleLoader.LoadBundleAndContentsWithName((BaseUnityPlugin)this, "candycane.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
			{
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Expected O, but got Unknown
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Expected O, but got Unknown
				GameObject val12 = peakBundle.LoadAsset<GameObject>("candycanehammered");
				Renderer[] componentsInChildren4 = val12.GetComponentsInChildren<Renderer>(true);
				Renderer[] array7 = componentsInChildren4;
				foreach (Renderer val13 in array7)
				{
					Material[] array8 = (Material[])(object)new Material[val13.sharedMaterials.Length];
					for (int num = 0; num < val13.sharedMaterials.Length; num++)
					{
						Material val14 = val13.sharedMaterials[num];
						if ((Object)(object)val14 != (Object)null)
						{
							Material val15 = new Material(val14);
							val15.shader = Shader.Find("W/Peak_Standard");
							array8[num] = val15;
						}
					}
					val13.materials = array8;
				}
				GameObject val16 = peakBundle.LoadAsset<GameObject>("candycanepreview");
				Renderer[] componentsInChildren5 = val16.GetComponentsInChildren<Renderer>(true);
				Renderer[] array9 = componentsInChildren5;
				foreach (Renderer val17 in array9)
				{
					Material[] array10 = (Material[])(object)new Material[val17.sharedMaterials.Length];
					for (int num3 = 0; num3 < val17.sharedMaterials.Length; num3++)
					{
						Material val18 = val17.sharedMaterials[num3];
						if ((Object)(object)val18 != (Object)null)
						{
							Material val19 = new Material(val18);
							val19.shader = Shader.Find("Scouts/ItemPreview");
							array10[num3] = val19;
						}
					}
					val17.materials = array10;
				}
				NetworkPrefabManager.RegisterNetworkPrefab(peakBundle.Mod, "0_Items/", val12);
				NetworkPrefabManager.RegisterNetworkPrefab(peakBundle.Mod, "0_Items/", val16);
			});
			BundleLoader.LoadBundleAndContentsWithName((BaseUnityPlugin)this, "candycaneonebite.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle)
			{
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Expected O, but got Unknown
				//IL_012c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0133: Expected O, but got Unknown
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ad: Expected O, but got Unknown
				GameObject val2 = peakBundle.LoadAsset<GameObject>("candycanehammeredonebite");
				Renderer[] componentsInChildren = val2.GetComponentsInChildren<Renderer>(true);
				Renderer[] array = componentsInChildren;
				foreach (Renderer val3 in array)
				{
					Material[] array2 = (Material[])(object)new Material[val3.sharedMaterials.Length];
					for (int j = 0; j < val3.sharedMaterials.Length; j++)
					{
						Material val4 = val3.sharedMaterials[j];
						if ((Object)(object)val4 != (Object)null)
						{
							Material val5 = new Material(val4);
							if (((Object)val4).name == "M_VFX_CrackDecal")
							{
								val5.shader = Shader.Find("Decal");
							}
							else if (((Object)val4).name == "SporeSmokeExplo")
							{
								val5.shader = Shader.Find("SmokeParticleSimple");
							}
							else
							{
								val5.shader = Shader.Find("W/Peak_Standard");
							}
							array2[j] = val5;
						}
					}
					val3.materials = array2;
				}
				Shader shader = Shader.Find("SmokeParticleSimple");
				ParticleSystemRenderer[] componentsInChildren2 = val2.GetComponentsInChildren<ParticleSystemRenderer>();
				ParticleSystemRenderer[] array3 = componentsInChildren2;
				ParticleSystemRenderer[] array4 = array3;
				foreach (ParticleSystemRenderer val6 in array4)
				{
					if ((Object)(object)((Renderer)val6).sharedMaterial != (Object)null)
					{
						Material val7 = new Material(((Renderer)val6).sharedMaterial);
						val7.shader = shader;
						((Renderer)val6).material = val7;
					}
				}
				GameObject val8 = peakBundle.LoadAsset<GameObject>("candycanepreviewonebite");
				Renderer[] componentsInChildren3 = val8.GetComponentsInChildren<Renderer>(true);
				Renderer[] array5 = componentsInChildren3;
				foreach (Renderer val9 in array5)
				{
					Material[] array6 = (Material[])(object)new Material[val9.sharedMaterials.Length];
					for (int m = 0; m < val9.sharedMaterials.Length; m++)
					{
						Material val10 = val9.sharedMaterials[m];
						if ((Object)(object)val10 != (Object)null)
						{
							Material val11 = new Material(val10);
							val11.shader = Shader.Find("Scouts/ItemPreview");
							array6[m] = val11;
						}
					}
					val9.materials = array6;
				}
				NetworkPrefabManager.RegisterNetworkPrefab(peakBundle.Mod, "0_Items/", val2);
				NetworkPrefabManager.RegisterNetworkPrefab(peakBundle.Mod, "0_Items/", val8);
			});
			BundleLoader.LoadBundleAndContentsWithName((BaseUnityPlugin)this, "candycanetwobites.peakbundle", (Action<PeakBundle>)null);
			LocalizedText.mainTable["NAME_CANDY CANE"] = new List<string>(15)
			{
				"Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane",
				"Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane", "Candy Cane"
			};
			LocalizedText.mainTable["NAME_BITTEN CANDY CANE"] = new List<string>(15)
			{
				"Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane",
				"Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane", "Bitten Candy Cane"
			};
			LocalizedText.mainTable["NAME_CANDY CANE MORSEL"] = new List<string>(15)
			{
				"Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel",
				"Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel", "Candy Cane Morsel"
			};
			LocalizedText.mainTable["CANDYCANEPITONPROMPT"] = new List<string>(15)
			{
				"Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane",
				"Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane", "Grab Candy Cane"
			};
			LocalizedText.mainTable["CANDYCANEPITONBREAKINGPROMPT"] = new List<string>(15)
			{
				"Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane",
				"Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane", "Grab Unstable Candy Cane"
			};
			Harmony val = new Harmony(Name ?? "");
			val.PatchAll();
		}
	}
}
namespace CandyCaneEmergencyPiton.Patches
{
	[HarmonyPatch(typeof(Item))]
	internal class CandyCaneEatAnimPatch
	{
		public static Dictionary<BiomeType, List<SpawnPool>> BiomeSpawnPools = new Dictionary<BiomeType, List<SpawnPool>>
		{
			{
				(BiomeType)0,
				new List<SpawnPool>(7)
				{
					(SpawnPool)64,
					(SpawnPool)32768,
					(SpawnPool)65536,
					(SpawnPool)1024,
					(SpawnPool)32768,
					(SpawnPool)65536,
					(SpawnPool)1024
				}
			},
			{
				(BiomeType)1,
				new List<SpawnPool>(7)
				{
					(SpawnPool)256,
					(SpawnPool)2048,
					(SpawnPool)32768,
					(SpawnPool)65536,
					(SpawnPool)2048,
					(SpawnPool)32768,
					(SpawnPool)65536
				}
			},
			{
				(BiomeType)2,
				new List<SpawnPool>(7)
				{
					(SpawnPool)512,
					(SpawnPool)4096,
					(SpawnPool)32768,
					(SpawnPool)65536,
					(SpawnPool)4096,
					(SpawnPool)32768,
					(SpawnPool)65536
				}
			},
			{
				(BiomeType)6,
				new List<SpawnPool>(7)
				{
					(SpawnPool)4194304,
					(SpawnPool)16777216,
					(SpawnPool)32768,
					(SpawnPool)65536,
					(SpawnPool)16777216,
					(SpawnPool)32768,
					(SpawnPool)65536
				}
			},
			{
				(BiomeType)3,
				new List<SpawnPool>(6)
				{
					(SpawnPool)8192,
					(SpawnPool)32768,
					(SpawnPool)65536,
					(SpawnPool)8192,
					(SpawnPool)32768,
					(SpawnPool)65536
				}
			}
		};

		public static Dictionary<SpawnPool, Dictionary<ushort, int>> AllSpawnWeightData = null;

		[HarmonyPatch("Consume")]
		[HarmonyPrefix]
		private static bool CandyCaneEatAnimationFunc(int consumerID, Item __instance)
		{
			//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_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			string[] source = new string[2] { "Candy Cane", "Bitten Candy Cane" };
			string name = __instance.GetName();
			if (source.Contains(name))
			{
				if (Object.op_Implicit((Object)(object)__instance.holderCharacter))
				{
					PhotonView photonView = PhotonNetwork.GetPhotonView(consumerID);
					if (Object.op_Implicit((Object)(object)photonView))
					{
						Character component = ((Component)photonView).GetComponent<Character>();
						if (Object.op_Implicit((Object)(object)component))
						{
							GlobalEvents.TriggerItemConsumed(__instance, component);
						}
					}
					__instance.holderCharacter.data.lastConsumedItem = Time.time;
					if ((Object)(object)__instance.holderCharacter.data.currentItem == (Object)(object)__instance)
					{
						Optionable<byte> currentSelectedSlot = __instance.holderCharacter.refs.items.currentSelectedSlot;
						__instance.holderCharacter.refs.animator.SetBool("Consumed Item", true);
						if (__instance.holderCharacter.IsLocal)
						{
							if (currentSelectedSlot.IsSome)
							{
								if (name == "Candy Cane")
								{
									if (((MonoBehaviourPun)__instance).photonView.IsMine || (((MonoBehaviourPun)__instance).photonView.Controller.IsMasterClient && PhotonNetwork.IsMasterClient))
									{
										PhotonNetwork.Destroy(((Component)__instance).gameObject);
									}
									__instance.holderCharacter.player.EmptySlot(currentSelectedSlot);
									__instance.holderCharacter.refs.items.SpawnItemInHand("com.github.spidersgeorg.CandyCaneEmergencyPiton:CandyCaneOneBite");
								}
								else if (name == "Bitten Candy Cane")
								{
									if (((MonoBehaviourPun)__instance).photonView.IsMine || (((MonoBehaviourPun)__instance).photonView.Controller.IsMasterClient && PhotonNetwork.IsMasterClient))
									{
										PhotonNetwork.Destroy(((Component)__instance).gameObject);
									}
									__instance.holderCharacter.player.EmptySlot(currentSelectedSlot);
									__instance.holderCharacter.refs.items.SpawnItemInHand("com.github.spidersgeorg.CandyCaneEmergencyPiton:CandyCaneTwoBites");
								}
							}
							else
							{
								Debug.LogError((object)"No Item Selected locally but still consuming?? THIS IS BAD. CALL ZORRO");
							}
						}
					}
				}
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(ClimbHandle))]
	internal class ClimbHandlePatch
	{
		[HarmonyPatch("GetInteractionText")]
		[HarmonyPrefix]
		private static bool CandyCaneClimbHandleName(ClimbHandle __instance, ref string __result)
		{
			string name = ((Object)__instance).name;
			if (name.Contains("CandyCaneHammeredOneBite"))
			{
				__result = LocalizedText.GetText("CANDYCANEPITONBREAKINGPROMPT", true);
				return false;
			}
			if (name.Contains("CandyCaneHammered"))
			{
				__result = LocalizedText.GetText("CANDYCANEPITONPROMPT", true);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Item))]
	internal class ContinueUsingPrimaryPatch
	{
		[HarmonyPatch("ContinueUsePrimary")]
		[HarmonyPrefix]
		private static bool CandyCaneContinueUsePrimaryPatch(Item __instance)
		{
			string[] source = new string[3] { "Candy Cane", "Bitten Candy Cane", "Candy Cane Morsel" };
			string name = __instance.GetName();
			if (source.Contains(name))
			{
				if (__instance.isUsingSecondary)
				{
					__instance.CancelUseSecondary();
				}
				if (__instance.usingTimePrimary > 0f)
				{
					__instance.castProgress += 1f / __instance.usingTimePrimary * Time.deltaTime;
					if (__instance.castProgress >= 1f)
					{
						if (__instance.OnPrimaryHeld != null)
						{
							__instance.OnPrimaryHeld();
						}
						if (!__instance.finishedCast)
						{
							__instance.FinishCastPrimary();
						}
					}
				}
				else
				{
					if (!__instance.finishedCast)
					{
						__instance.FinishCastPrimary();
					}
					if (__instance.OnPrimaryHeld != null)
					{
						__instance.OnPrimaryHeld();
					}
				}
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(CharacterItems))]
	internal class DoUsingPatch
	{
		[HarmonyPatch("DoUsing")]
		[HarmonyPrefix]
		private static bool CandyCaneDoUsing(CharacterItems __instance)
		{
			string[] source = new string[3] { "Candy Cane", "Bitten Candy Cane", "Candy Cane Morsel" };
			if (Object.op_Implicit((Object)(object)__instance.character.data.currentItem) && !__instance.character.data.passedOut && !__instance.character.data.fullyPassedOut && source.Contains(__instance.character.data.currentItem.GetName()))
			{
				if (__instance.character.input.usePrimaryWasPressed)
				{
					__instance.character.data.currentItem.StartUsePrimary();
				}
				if (__instance.character.input.usePrimaryIsPressed)
				{
					__instance.character.data.currentItem.ContinueUsePrimary();
				}
				if (__instance.character.input.usePrimaryWasReleased)
				{
					__instance.character.data.currentItem.CancelUsePrimary();
				}
				if (!__instance.character.CanDoInput())
				{
					__instance.character.data.currentItem.CancelUsePrimary();
				}
				if (__instance.character.input.useSecondaryIsPressed && __instance.character.data.currentItem.CanUseSecondary())
				{
					__instance.character.data.currentItem.StartUseSecondary();
				}
				if (__instance.character.input.useSecondaryIsPressed && __instance.character.data.currentItem.CanUseSecondary())
				{
					__instance.character.data.currentItem.ContinueUseSecondary();
				}
				if (__instance.character.input.useSecondaryWasReleased || (__instance.character.data.currentItem.isUsingSecondary && !__instance.character.data.currentItem.CanUseSecondary()))
				{
					__instance.character.data.currentItem.CancelUseSecondary();
				}
			}
			if (Object.op_Implicit((Object)(object)__instance.character.data.currentItem) && !__instance.character.data.passedOut && !__instance.character.data.fullyPassedOut && __instance.character.data.currentItem.GetName() == "Candy Cane")
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(CharacterClimbing))]
	internal class HandleClimbHandlePatch
	{
		[HarmonyPatch("HandleClimbHandle")]
		[HarmonyPrefix]
		private static bool CandyCaneClimbHandle(CharacterClimbing __instance)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			string name = ((Object)__instance.character.data.currentClimbHandle).name;
			if (name.Contains("CandyCane"))
			{
				__instance.handleOffset = Vector2.Lerp(__instance.handleOffset, __instance.character.input.movementInput, Time.fixedDeltaTime);
				if (((Vector2)(ref __instance.handleOffset)).magnitude > 0.3f && __instance.view.IsMine)
				{
					__instance.CancelHandle(true);
					return false;
				}
				__instance.character.data.sinceGrounded = 0f;
				Vector3 val = (__instance.character.GetBodypartRig((BodypartType)10).position + __instance.character.GetBodypartRig((BodypartType)7).position) * 0.5f;
				Vector3 val2 = ((Component)__instance.character.data.currentClimbHandle).transform.TransformPoint(new Vector3(-0.1f, 0f, -0.3f));
				__instance.character.MoveBodypartTowardsPoint((BodypartType)7, val2, 100f, 1f);
				__instance.character.MoveBodypartTowardsPoint((BodypartType)10, val2, 100f, 1f);
				Vector3 val3 = __instance.character.TorsoPos() - val;
				Vector3 val4 = val2 + val3 - __instance.character.TorsoPos();
				val4 += ((Component)__instance.character.data.currentClimbHandle).transform.up * __instance.handleOffset.y;
				val4 += ((Component)__instance.character.data.currentClimbHandle).transform.right * __instance.handleOffset.x;
				__instance.character.AddForce(val4 * 50f, 1f, 1f);
				return false;
			}
			return true;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}