Decompiled source of Lucky Blocks v1.0.0

plugins/legocool.LuckyBlocks.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
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;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("legocool.LuckyBlocks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("legocool.LuckyBlocks")]
[assembly: AssemblyTitle("LuckBlocks")]
[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;
		}
	}
}
[RequireComponent(typeof(PhotonView))]
public class LuckyBreakable : MonoBehaviour
{
	public Item item;

	public bool breakOnCollision;

	public float minBreakVelocity;

	public List<SFX_Instance> breakSFX;

	public List<GameObject> instantiateNonItemOnBreak;

	public List<Transform> instantiatePoints;

	public bool spawnsItemsKinematic;

	public bool playAnimationOnInstantiatedObject;

	public string animString;

	public bool ragdollCharacterOnBreak;

	private Rigidbody rig;

	private bool alreadyBroke;

	private Vector3 lastVelocity;

	public float pushForce = 2f;

	public float wholeBodyPushForce = 1f;

	private void Awake()
	{
		item = ((Component)this).GetComponent<Item>();
		rig = ((Component)this).GetComponent<Rigidbody>();
	}

	private void OnCollisionEnter(Collision collision)
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		if (((MonoBehaviourPun)item).photonView.IsMine && (int)item.itemState == 0 && breakOnCollision && Object.op_Implicit((Object)(object)item.rig))
		{
			Vector3 relativeVelocity = collision.relativeVelocity;
			if (((Vector3)(ref relativeVelocity)).magnitude > minBreakVelocity)
			{
				Break(collision);
			}
		}
	}

	private void FixedUpdate()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)rig == (Object)null) && !rig.isKinematic)
		{
			lastVelocity = rig.linearVelocity;
		}
	}

	public virtual void Break(Collision coll)
	{
		//IL_002f: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		if (alreadyBroke)
		{
			return;
		}
		alreadyBroke = true;
		for (int i = 0; i < breakSFX.Count; i++)
		{
			breakSFX[i].Play(((Component)this).transform.position);
		}
		if (ragdollCharacterOnBreak)
		{
			Character componentInParent = ((Component)coll.transform).GetComponentInParent<Character>();
			if (Object.op_Implicit((Object)(object)componentInParent))
			{
				Rigidbody componentInParent2 = ((Component)coll.transform).GetComponentInParent<Rigidbody>();
				Vector3 val = ((Vector3)(ref lastVelocity)).normalized * pushForce;
				componentInParent.AddForceToBodyPart(componentInParent2, val * pushForce, val * wholeBodyPushForce);
				componentInParent.Fall(2f, 15f);
			}
		}
		Outcomes.TriggerRandom(this, coll);
		PhotonNetwork.Destroy(((Component)this).gameObject);
	}
}
public static class Outcomes
{
	public static void TriggerRandom(LuckyBreakable lb, Collision coll)
	{
		switch (Random.Range(0, 20))
		{
		case 0:
			SpawnTornado(lb);
			break;
		case 1:
			SpawnLuggage(lb, coll);
			break;
		case 2:
			SpawnBounceOrShelf(lb, coll);
			break;
		case 3:
			LuckyRain(lb, coll);
			break;
		case 4:
			SpawnEruption(lb, coll);
			break;
		case 5:
			PeelRain(lb, coll);
			break;
		case 6:
			Explode(lb, coll);
			break;
		case 7:
			ScorpoRain(lb, coll);
			break;
		case 8:
			BerryRain(lb, coll);
			break;
		case 9:
			SummonScoutmaster(lb, coll);
			break;
		case 10:
			RopeSpawn(lb, coll);
			break;
		case 11:
			ChaosCloud(lb, coll);
			break;
		case 12:
			Zombie(lb, coll);
			break;
		case 13:
			Backpacks(lb, coll);
			break;
		case 14:
			PuffHealSpawn(lb, coll);
			break;
		case 15:
			EquipmentShower(lb, coll);
			break;
		case 16:
			MythicSpawn(lb, coll);
			break;
		case 17:
			Flag(lb, coll);
			break;
		case 18:
			CannonOrCook(lb, coll);
			break;
		case 19:
			Sunscreen(lb, coll);
			break;
		}
	}

	public static void SpawnTornado(LuckyBreakable lb)
	{
		//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)
		GameObject val = PhotonNetwork.Instantiate("Tornado", lb.item.Center(), Quaternion.identity, (byte)0, (object[])null);
		Tornado component = val.GetComponent<Tornado>();
		component.tornadoLifetimeMax = 6f;
		component.tornadoLifetimeMin = 10f;
		component.force = 50f;
	}

	public static void SpawnLuggage(LuckyBreakable lb, Collision coll)
	{
		//IL_0001: 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_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_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: 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_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)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		switch (Random.Range(0, 4))
		{
		case 0:
			PhotonNetwork.Instantiate("0_Items/LuggageSmall", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		case 1:
			PhotonNetwork.Instantiate("0_Items/LuggageBig", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		case 2:
			PhotonNetwork.Instantiate("0_Items/LuggageEpic", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		case 3:
			PhotonNetwork.Instantiate("0_Items/LuggageAncient", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		}
	}

	public static void SpawnBounceOrShelf(LuckyBreakable lb, Collision coll)
	{
		//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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f);
		switch (Random.Range(0, 2))
		{
		case 0:
			PhotonNetwork.Instantiate("0_Items/ShelfShroomSpawn", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		case 1:
			val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
			PhotonNetwork.Instantiate("0_Items/BounceShroomSpawn", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		}
	}

	public static void LuckyRain(LuckyBreakable lb, Collision coll)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		int num = 3;
		for (int i = 0; i < num; i++)
		{
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-3f, 3f), Random.Range(5f, 8f), Random.Range(-3f, 3f));
			GameObject val2 = PhotonNetwork.Instantiate("0_Items/legocool.LuckyBlocks:LuckyBlock", val, Quaternion.identity, (byte)0, (object[])null);
			Item component = val2.GetComponent<Item>();
			component.lastThrownCharacter = lb.item.lastThrownCharacter;
		}
	}

	public static void Enderpearl(LuckyBreakable lb, Collision coll)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(0f, 1f, 0f);
		Character lastThrownCharacter = lb.item.lastThrownCharacter;
		if ((Object)(object)lastThrownCharacter != (Object)null)
		{
			((Component)lastThrownCharacter).transform.position = position;
		}
	}

	public static void SpawnEruption(LuckyBreakable lb, Collision coll)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		EruptionSpawner val = Object.FindAnyObjectByType<EruptionSpawner>();
		Vector3 point = ((ContactPoint)(ref coll.contacts[0])).point;
		val.photonView.RPC("RPCA_SpawnEruption", (RpcTarget)0, new object[1] { point });
	}

	public static void PeelRain(LuckyBreakable lb, Collision coll)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: 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)
		int num = 5;
		float num2 = 1f;
		float num3 = 9f;
		for (int i = 0; i < num; i++)
		{
			for (int j = 0; j < num; j++)
			{
				Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3((float)(i - num / 2) * num2, num3, (float)(j - num / 2) * num2);
				GameObject val2 = PhotonNetwork.Instantiate("0_Items/Berrynana Peel Yellow", val, Quaternion.identity, (byte)0, (object[])null);
				RemoveAfterSeconds val3 = val2.AddComponent<RemoveAfterSeconds>();
				val3.photonRemove = true;
				val3.seconds = 120f;
			}
		}
	}

	public static void Explode(LuckyBreakable lb, Collision coll)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = PhotonNetwork.Instantiate("0_Items/Dynamite", ((ContactPoint)(ref coll.contacts[0])).point, Quaternion.identity, (byte)0, (object[])null);
		Dynamite component = val.GetComponent<Dynamite>();
		component.LightFlare();
		component.startingFuseTime = 0f;
	}

	public static void ScorpoRain(LuckyBreakable lb, Collision coll)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		int num = 5;
		for (int i = 0; i < num; i++)
		{
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-2f, 2f), Random.Range(4f, 6f), Random.Range(-2f, 2f));
			GameObject val2 = PhotonNetwork.Instantiate("0_Items/Scorpion", val, Quaternion.identity, (byte)0, (object[])null);
			RemoveAfterSeconds val3 = val2.AddComponent<RemoveAfterSeconds>();
			val3.photonRemove = true;
			val3.seconds = 60f;
		}
	}

	public static void BerryRain(LuckyBreakable lb, Collision coll)
	{
		//IL_00ee: 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_012a: 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_012f: Unknown result type (might be due to invalid IL or missing references)
		int num = 4;
		string[] array = new string[23]
		{
			"0_items/Winterberry Yellow", "0_Items/Winterberry Orange", "0_Items/Prickleberry_Gold", "0_Items/Prickleberry_Red", "0_Items/Apple Berry Green", "0_Items/Apple Berry Red", "0_Items/Apple Berry Yellow", "0_Items/Berrynana Brown", "0_Items/Berrynana Blue", "0_Items/Berrynana Pink",
			"0_Items/Berrynana Yellow", "0_Items/Clusterberry Black", "0_Items/Clusterberry Red", "0_Items/Clusterberry Yellow", "0_Items/Kingberry Green", "0_Items/Kingberry Purple", "0_Items/Kingberry Yellow", "0_Items/Napberry", "0_Items/Shroomberry_Blue", "0_Items/Shroomberry_Green",
			"0_Items/Shroomberry_Purple", "0_Items/Shroomberry_Red", "0_Items/Shroomberry_Yellow"
		};
		for (int i = 0; i < num; i++)
		{
			string text = array[Random.Range(0, array.Length)];
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-3f, 3f), Random.Range(4f, 6f), Random.Range(-3f, 3f));
			PhotonNetwork.Instantiate(text, val, Quaternion.identity, (byte)0, (object[])null);
		}
	}

	public static void SummonScoutmaster(LuckyBreakable lb, Collision coll)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		Scoutmaster val = default(Scoutmaster);
		if (Scoutmaster.GetPrimaryScoutmaster(ref val))
		{
			Vector3 point = ((ContactPoint)(ref coll.contacts[0])).point;
			float num = 30f;
			Character lastThrownCharacter = lb.item.lastThrownCharacter;
			if ((Object)(object)lastThrownCharacter != (Object)null)
			{
				val.SetCurrentTarget(lastThrownCharacter, num);
			}
			val.view.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { point, false });
			val.view.RPC("StopClimbingRpc", (RpcTarget)0, new object[1] { 0f });
		}
	}

	public static void RopeSpawn(LuckyBreakable lb, Collision coll)
	{
		//IL_0001: 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_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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		GameObject val2 = null;
		switch (Random.Range(0, 2))
		{
		case 0:
			val2 = PhotonNetwork.Instantiate("RopeAnchorWithAntiRope", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		case 1:
			val2 = PhotonNetwork.Instantiate("RopeAnchorWithRope", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		}
		RopeAnchorWithRope component = val2.GetComponent<RopeAnchorWithRope>();
		component.SpawnRope();
	}

	public static void ChaosCloud(LuckyBreakable lb, Collision coll)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = PhotonNetwork.Instantiate("0_Items/PandorasBox", ((ContactPoint)(ref coll.contacts[0])).point, Quaternion.identity, (byte)0, (object[])null);
		ItemCooking component = val.GetComponent<ItemCooking>();
		component.FinishCooking();
	}

	public static void Zombie(LuckyBreakable lb, Collision coll)
	{
		//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)
		GameObject val = PhotonNetwork.Instantiate("MushroomZombie", lb.item.Center(), Quaternion.identity, (byte)0, (object[])null);
		MushroomZombie component = val.GetComponent<MushroomZombie>();
		component.zombieSprintDistance = 30f;
		component.zombieLungeDistance = 15f;
		component.lungeRecoveryTime = 2f;
		component.lifetime = 90f;
		component.currentState = (State)0;
	}

	public static void Backpacks(LuckyBreakable lb, Collision coll)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		int num = 3;
		for (int i = 0; i < num; i++)
		{
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-2f, 2f), Random.Range(3f, 6f), Random.Range(-2f, 2f));
			PhotonNetwork.Instantiate("0_Items/Backpack", val, Quaternion.identity, (byte)0, (object[])null);
		}
	}

	public static void PuffHealSpawn(LuckyBreakable lb, Collision coll)
	{
		//IL_0001: 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_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_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)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		PhotonNetwork.Instantiate("0_Items/HealingPuffShroomSpawn", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
	}

	public static void EquipmentShower(LuckyBreakable lb, Collision coll)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: 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_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		int num = 4;
		string[] array = new string[7] { "0_Items/ChainShooter", "0_Items/ClimbingSpike", "0_Items/Energy Drink", "0_Items/Lollipop", "0_Items/RescueHook", "0_Items/RopeShooter", "0_Items/RopeSpool" };
		for (int i = 0; i < num; i++)
		{
			string text = array[Random.Range(0, array.Length)];
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-2f, 2f), Random.Range(3f, 5f), Random.Range(-2f, 2f));
			PhotonNetwork.Instantiate(text, val, Quaternion.identity, (byte)0, (object[])null);
		}
	}

	public static void MythicSpawn(LuckyBreakable lb, Collision coll)
	{
		//IL_007f: 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)
		string[] array = new string[12]
		{
			"0_Items/Anti-Rope Spool", "0_Items/AncientIdol", "0_Items/BookOfBones", "0_Items/Bugle_Magic", "0_Items/Bugle_Scoutmaster Variant", "0_Items/Cure-All", "0_Items/Cursed Skull", "0_Items/Lantern_Faerie", "0_Items/PandorasBox", "0_Items/RopeShooterAnti",
			"0_Items/ScoutEffigy", "0_Items/Warp Compass"
		};
		string text = array[Random.Range(0, array.Length)];
		PhotonNetwork.Instantiate(text, lb.item.Center(), Quaternion.identity, (byte)0, (object[])null);
	}

	public static void Sunscreen(LuckyBreakable lb, Collision coll)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = PhotonNetwork.Instantiate("0_Items/Sunscreen", ((ContactPoint)(ref coll.contacts[0])).point, Quaternion.identity, (byte)0, (object[])null);
		ItemCooking component = val.GetComponent<ItemCooking>();
		component.FinishCooking();
	}

	public static void CannonOrCook(LuckyBreakable lb, Collision coll)
	{
		//IL_0001: 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_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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		switch (Random.Range(0, 2))
		{
		case 0:
			PhotonNetwork.Instantiate("ScoutCannon_Placed", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		case 1:
			PhotonNetwork.Instantiate("PortableStovetop_Placed", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
			break;
		}
	}

	public static void Flag(LuckyBreakable lb, Collision coll)
	{
		//IL_0001: 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_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_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)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		GameObject val2 = PhotonNetwork.Instantiate("Flag_Planted_Checkpoint", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
		CheckpointFlag component = val2.GetComponent<CheckpointFlag>();
		component.Initialize(lb.item.lastThrownCharacter);
	}
}
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 LuckBlocks
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("legocool.LuckyBlocks", "LuckBlocks", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony = null;

		public static GameObject urchPrefab;

		public const string Id = "legocool.LuckyBlocks";

		internal static ManualLogSource Log { get; private set; }

		public static string Name => "LuckBlocks";

		public static string Version => "0.1.0";

		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			_harmony = new Harmony("legocool.LuckBlock");
			_harmony.PatchAll();
			Log = ((BaseUnityPlugin)this).Logger;
			BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "luckyblock.peakbundle", (Action<PeakBundle>)InitLuckyBlock);
			LocalizedText.mainTable["NAME_LUCKYBLOCK"] = new List<string>(1) { "Lucky Block" };
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
		}

		private void InitLuckyBlock(PeakBundle bundle)
		{
			GameObject val = bundle.LoadAsset<GameObject>("LuckyBlock.prefab");
			LuckyBreakable luckyBreakable = val.AddComponent<LuckyBreakable>();
			luckyBreakable.breakOnCollision = true;
			luckyBreakable.minBreakVelocity = 10f;
			bundle.Mod.RegisterContent();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}