Decompiled source of Lucky Blocks v1.2.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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LuckyBlocks;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using Photon.Pun;
using UnityEngine;

[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("legocool.LuckyBlocks")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyInformationalVersion("1.2.0+4681c05a93bbcb811af05cfdca6ee5270723060d")]
[assembly: AssemblyProduct("legocool.LuckyBlocks")]
[assembly: AssemblyTitle("Lucky_Blocks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.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 = true;

	public float minBreakVelocity = 5f;

	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 = Vector3.zero;

	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_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		if (PhotonNetwork.IsMasterClient && (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_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 (!((Object)(object)rig == (Object)null) && !rig.isKinematic)
		{
			lastVelocity = rig.linearVelocity;
		}
	}

	public virtual void Break(Collision coll)
	{
		//IL_0026: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: 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_008f: 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)
		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 List<(Action<LuckyBreakable, Collision> action, int weight)> ActionWeights;

	public static void Initialize()
	{
		ActionWeights = new List<(Action<LuckyBreakable, Collision>, int)>();
		if (Config.TornadoEnabled.Value)
		{
			ActionWeights.Add((SpawnTornado, Config.TornadoWeight.Value));
		}
		if (Config.LuggageEnabled.Value)
		{
			ActionWeights.Add((SpawnLuggage, Config.LuggageWeight.Value));
		}
		if (Config.BounceEnabled.Value)
		{
			ActionWeights.Add((SpawnBounce, Config.BounceWeight.Value));
		}
		if (Config.ShelfEnabled.Value)
		{
			ActionWeights.Add((SpawnShelf, Config.ShelfWeight.Value));
		}
		if (Config.LuckyRainEnabled.Value)
		{
			ActionWeights.Add((LuckyRain, Config.LuckyRainWeight.Value));
		}
		if (Config.EruptionEnabled.Value)
		{
			ActionWeights.Add((SpawnEruption, Config.EruptionWeight.Value));
		}
		if (Config.PeelRainEnabled.Value)
		{
			ActionWeights.Add((PeelRain, Config.PeelRainWeight.Value));
		}
		if (Config.ExplodeEnabled.Value)
		{
			ActionWeights.Add((Explode, Config.ExplodeWeight.Value));
		}
		if (Config.ScorpoRainEnabled.Value)
		{
			ActionWeights.Add((ScorpoRain, Config.ScorpoRainWeight.Value));
		}
		if (Config.BerryRainEnabled.Value)
		{
			ActionWeights.Add((BerryRain, Config.BerryRainWeight.Value));
		}
		if (Config.SummonScoutmasterEnabled.Value)
		{
			ActionWeights.Add((SummonScoutmaster, Config.SummonScoutmasterWeight.Value));
		}
		if (Config.RopeSpawnEnabled.Value)
		{
			ActionWeights.Add((RopeSpawn, Config.RopeSpawnWeight.Value));
		}
		if (Config.ChaosCloudEnabled.Value)
		{
			ActionWeights.Add((ChaosCloud, Config.ChaosCloudWeight.Value));
		}
		if (Config.ZombieEnabled.Value)
		{
			ActionWeights.Add((Zombie, Config.ZombieWeight.Value));
		}
		if (Config.BackpacksEnabled.Value)
		{
			ActionWeights.Add((Backpacks, Config.BackpacksWeight.Value));
		}
		if (Config.PuffHealSpawnEnabled.Value)
		{
			ActionWeights.Add((PuffHealSpawn, Config.PuffHealSpawnWeight.Value));
		}
		if (Config.EquipmentShowerEnabled.Value)
		{
			ActionWeights.Add((EquipmentShower, Config.EquipmentShowerWeight.Value));
		}
		if (Config.MythicSpawnEnabled.Value)
		{
			ActionWeights.Add((MythicSpawn, Config.MythicSpawnWeight.Value));
		}
		if (Config.FlagEnabled.Value)
		{
			ActionWeights.Add((Flag, Config.FlagWeight.Value));
		}
		if (Config.CannonEnabled.Value)
		{
			ActionWeights.Add((Cannon, Config.CannonWeight.Value));
		}
		if (Config.CookEnabled.Value)
		{
			ActionWeights.Add((Cook, Config.CookWeight.Value));
		}
		if (Config.SunscreenEnabled.Value)
		{
			ActionWeights.Add((Sunscreen, Config.SunscreenWeight.Value));
		}
		if (Config.EnderpearlEnabled.Value)
		{
			ActionWeights.Add((Enderpearl, Config.EnderpearlWeight.Value));
		}
	}

	public static void AddOutcome(Action<LuckyBreakable, Collision> action, int weight = 100, string? name = null)
	{
		if (name == null)
		{
			name = action.Method.Name;
		}
		ConfigEntry<bool> val = Config.Instance.Bind<bool>("Custom Outcomes." + name, name + " Enabled", true, "Enable custom outcome: " + name);
		ConfigEntry<int> val2 = Config.Instance.Bind<int>("Custom Outcomes." + name, name + " Weight", weight, "Weight for custom outcome: " + name);
		Plugin.Log.LogInfo((object)$"Adding outcome {name} with weight {val2.Value}");
		if (val.Value)
		{
			ActionWeights.Add((action, val2.Value));
		}
	}

	public static void TriggerRandom(LuckyBreakable lb, Collision coll)
	{
		if (ActionWeights == null || ActionWeights.Count == 0)
		{
			return;
		}
		int num = 0;
		foreach (var actionWeight in ActionWeights)
		{
			if (actionWeight.weight > 0)
			{
				num += actionWeight.weight;
			}
		}
		if (num <= 0)
		{
			return;
		}
		int num2 = Random.Range(0, num);
		foreach (var actionWeight2 in ActionWeights)
		{
			if (actionWeight2.weight > 0)
			{
				if (num2 < actionWeight2.weight)
				{
					actionWeight2.action(lb, coll);
					break;
				}
				num2 -= actionWeight2.weight;
			}
		}
	}

	public static void SpawnTornado(LuckyBreakable lb, Collision coll)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = PhotonNetwork.Instantiate("Tornado", lb.item.Center(), Quaternion.identity, (byte)0, (object[])null);
		Tornado component = val.GetComponent<Tornado>();
		component.tornadoLifetimeMax = Config.TornadoMaxLifetime.Value;
		component.tornadoLifetimeMin = Config.TornadoMinLifetime.Value;
		component.force = Config.TornadoForce.Value;
	}

	public static void SpawnLuggage(LuckyBreakable lb, Collision coll)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		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 SpawnBounce(LuckyBreakable lb, Collision coll)
	{
		//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_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: 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)
		Quaternion val = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f);
		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);
	}

	public static void SpawnShelf(LuckyBreakable lb, Collision coll)
	{
		//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_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.Euler(0f, (float)Random.Range(0, 360), 0f);
		PhotonNetwork.Instantiate("0_Items/ShelfShroomSpawn", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
	}

	public static void LuckyRain(LuckyBreakable lb, Collision coll)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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)
		int value = Config.LuckyRainCount.Value;
		for (int i = 0; i < value; i++)
		{
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-3f, 3f), Random.Range(4f, 7f), 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_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + ((ContactPoint)(ref coll.contacts[0])).normal;
		Character lastThrownCharacter = lb.item.lastThrownCharacter;
		if ((Object)(object)lastThrownCharacter != (Object)null)
		{
			((MonoBehaviourPun)lastThrownCharacter).photonView.RPC("WarpPlayerRPC", (RpcTarget)0, new object[2] { val, true });
		}
	}

	public static void SpawnEruption(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)
		//IL_002c: 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_0031: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		int value = Config.PeelRainGridSize.Value;
		float value2 = Config.PeelRainSpacing.Value;
		float num = 6f;
		for (int i = 0; i < value; i++)
		{
			for (int j = 0; j < value; j++)
			{
				Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3((float)(i - value / 2) * value2, num, (float)(j - value / 2) * value2);
				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 = Config.PeelRainLifetime.Value;
			}
		}
	}

	public static void Explode(LuckyBreakable lb, Collision coll)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		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_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: 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)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		int value = Config.ScorpoRainCount.Value;
		for (int i = 0; i < value; i++)
		{
			Vector3 val = ((ContactPoint)(ref coll.contacts[0])).point + new Vector3(Random.Range(-1f, 1f), Random.Range(2f, 4f), Random.Range(-1f, 1f));
			GameObject val2 = PhotonNetwork.Instantiate("0_Items/Scorpion", val, Quaternion.identity, (byte)0, (object[])null);
			RemoveAfterSeconds val3 = val2.AddComponent<RemoveAfterSeconds>();
			val3.photonRemove = true;
			val3.seconds = Config.ScorpoRainLifetime.Value;
		}
	}

	public static void BerryRain(LuckyBreakable lb, Collision coll)
	{
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		int value = Config.BerryRainCount.Value;
		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 < value; 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));
			GameObject val2 = PhotonNetwork.Instantiate(text, val, Quaternion.identity, (byte)0, (object[])null);
			val2.GetComponent<Rigidbody>().isKinematic = false;
		}
	}

	public static void SummonScoutmaster(LuckyBreakable lb, Collision coll)
	{
		//IL_0018: 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_006b: Unknown result type (might be due to invalid IL or missing references)
		Scoutmaster val = default(Scoutmaster);
		if (Scoutmaster.GetPrimaryScoutmaster(ref val))
		{
			Vector3 val2 = ((ContactPoint)(ref coll.contacts[0])).point + ((ContactPoint)(ref coll.contacts[0])).normal;
			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] { val2, true });
			val.view.RPC("StopClimbingRpc", (RpcTarget)0, new object[1] { 0f });
		}
	}

	public static void RopeSpawn(LuckyBreakable lb, Collision coll)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		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;
		}
		if ((Object)(object)val2 != (Object)null)
		{
			RopeAnchorWithRope component = val2.GetComponent<RopeAnchorWithRope>();
			component.SpawnRope();
		}
	}

	public static void ChaosCloud(LuckyBreakable lb, Collision coll)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		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_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = PhotonNetwork.Instantiate("MushroomZombie", lb.item.Center(), Quaternion.identity, (byte)0, (object[])null);
		MushroomZombie component = val.GetComponent<MushroomZombie>();
		component.zombieSprintDistance = Config.ZombieSprintDistance.Value;
		component.zombieLungeDistance = Config.ZombieLungeDistance.Value;
		component.lungeRecoveryTime = Config.ZombieLungeRecoveryTime.Value;
		component.lifetime = Config.ZombieLifetime.Value;
		component.currentState = (State)0;
	}

	public static void Backpacks(LuckyBreakable lb, Collision coll)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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)
		int value = Config.BackpackCount.Value;
		for (int i = 0; i < value; 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_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		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_0066: 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_00a2: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
		int value = Config.EquipmentShowerCount.Value;
		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 < value; 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_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		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_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		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 Cannon(LuckyBreakable lb, Collision coll)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		PhotonNetwork.Instantiate("ScoutCannon_Placed", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
	}

	public static void Cook(LuckyBreakable lb, Collision coll)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.LookRotation(Vector3.forward, ((ContactPoint)(ref coll.contacts[0])).normal);
		PhotonNetwork.Instantiate("PortableStovetop_Placed", ((ContactPoint)(ref coll.contacts[0])).point, val, (byte)0, (object[])null);
	}

	public static void Flag(LuckyBreakable lb, Collision coll)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		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);
	}

	public static void SpawnErikTower(LuckyBreakable lb, Collision coll)
	{
	}
}
[HarmonyPatch(typeof(Tornado), "PickTarget")]
public static class Tornado_PickTarget_Patch
{
	private static bool Prefix(Tornado __instance)
	{
		return (Object)(object)__instance.targetParent != (Object)null;
	}
}
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 LuckyBlocks
{
	public static class Config
	{
		public static ConfigFile Instance;

		public static ConfigEntry<bool> TornadoEnabled;

		public static ConfigEntry<int> TornadoWeight;

		public static ConfigEntry<float> TornadoMaxLifetime;

		public static ConfigEntry<float> TornadoMinLifetime;

		public static ConfigEntry<int> TornadoForce;

		public static ConfigEntry<bool> LuggageEnabled;

		public static ConfigEntry<int> LuggageWeight;

		public static ConfigEntry<bool> BounceEnabled;

		public static ConfigEntry<int> BounceWeight;

		public static ConfigEntry<bool> ShelfEnabled;

		public static ConfigEntry<int> ShelfWeight;

		public static ConfigEntry<bool> LuckyRainEnabled;

		public static ConfigEntry<int> LuckyRainWeight;

		public static ConfigEntry<int> LuckyRainCount;

		public static ConfigEntry<bool> EruptionEnabled;

		public static ConfigEntry<int> EruptionWeight;

		public static ConfigEntry<bool> PeelRainEnabled;

		public static ConfigEntry<int> PeelRainWeight;

		public static ConfigEntry<int> PeelRainGridSize;

		public static ConfigEntry<float> PeelRainSpacing;

		public static ConfigEntry<float> PeelRainLifetime;

		public static ConfigEntry<bool> ExplodeEnabled;

		public static ConfigEntry<int> ExplodeWeight;

		public static ConfigEntry<bool> ScorpoRainEnabled;

		public static ConfigEntry<int> ScorpoRainWeight;

		public static ConfigEntry<int> ScorpoRainCount;

		public static ConfigEntry<float> ScorpoRainLifetime;

		public static ConfigEntry<bool> BerryRainEnabled;

		public static ConfigEntry<int> BerryRainWeight;

		public static ConfigEntry<int> BerryRainCount;

		public static ConfigEntry<bool> SummonScoutmasterEnabled;

		public static ConfigEntry<int> SummonScoutmasterWeight;

		public static ConfigEntry<bool> RopeSpawnEnabled;

		public static ConfigEntry<int> RopeSpawnWeight;

		public static ConfigEntry<bool> ChaosCloudEnabled;

		public static ConfigEntry<int> ChaosCloudWeight;

		public static ConfigEntry<bool> ZombieEnabled;

		public static ConfigEntry<int> ZombieWeight;

		public static ConfigEntry<float> ZombieSprintDistance;

		public static ConfigEntry<float> ZombieLungeDistance;

		public static ConfigEntry<float> ZombieLungeRecoveryTime;

		public static ConfigEntry<float> ZombieLifetime;

		public static ConfigEntry<bool> BackpacksEnabled;

		public static ConfigEntry<int> BackpacksWeight;

		public static ConfigEntry<int> BackpackCount;

		public static ConfigEntry<bool> PuffHealSpawnEnabled;

		public static ConfigEntry<int> PuffHealSpawnWeight;

		public static ConfigEntry<bool> EquipmentShowerEnabled;

		public static ConfigEntry<int> EquipmentShowerWeight;

		public static ConfigEntry<int> EquipmentShowerCount;

		public static ConfigEntry<bool> MythicSpawnEnabled;

		public static ConfigEntry<int> MythicSpawnWeight;

		public static ConfigEntry<bool> FlagEnabled;

		public static ConfigEntry<int> FlagWeight;

		public static ConfigEntry<bool> CannonEnabled;

		public static ConfigEntry<int> CannonWeight;

		public static ConfigEntry<bool> CookEnabled;

		public static ConfigEntry<int> CookWeight;

		public static ConfigEntry<bool> SunscreenEnabled;

		public static ConfigEntry<int> SunscreenWeight;

		public static ConfigEntry<bool> EnderpearlEnabled;

		public static ConfigEntry<int> EnderpearlWeight;

		public static void BindAll()
		{
			TornadoEnabled = Instance.Bind<bool>("Outcomes.Tornado", "Spawn Tornado Enabled", true, "Enable Spawn Tornado outcome");
			TornadoWeight = Instance.Bind<int>("Outcomes.Tornado", "Spawn Tornado Weight", 80, "Weight for Spawn Tornado");
			TornadoMinLifetime = Instance.Bind<float>("Outcomes.Tornado", "Tornado Min Lifetime", 6f, "Minimum lifetime for the tornado (in seconds)");
			TornadoMaxLifetime = Instance.Bind<float>("Outcomes.Tornado", "Tornado Max Lifetime", 10f, "Maximum lifetime for the tornado (in seconds)");
			TornadoForce = Instance.Bind<int>("Outcomes.Tornado", "Tornado Force", 50, "Force applied by the tornado");
			LuggageEnabled = Instance.Bind<bool>("Outcomes.Luggage", "Spawn Luggage Enabled", true, "Enable Spawn Luggage outcome");
			LuggageWeight = Instance.Bind<int>("Outcomes.Luggage", "Spawn Luggage Weight", 110, "Weight for Spawn Luggage");
			BounceEnabled = Instance.Bind<bool>("Outcomes.Bounce Shroom", "Spawn Bounce Shroom Enabled", true, "Enable Spawn Bounce Shroom outcome");
			BounceWeight = Instance.Bind<int>("Outcomes.Bounce Shroom", "Spawn Bounce Shroom Weight", 100, "Weight for Spawn Bounce Shroom");
			ShelfEnabled = Instance.Bind<bool>("Outcomes.Shelf Fungus", "Spawn Shelf Fungus Enabled", true, "Enable Spawn Shelf Fungus outcome");
			ShelfWeight = Instance.Bind<int>("Outcomes.Shelf Fungus", "Spawn Shelf Fungus Weight", 90, "Weight for Spawn Shelf Fungus");
			LuckyRainEnabled = Instance.Bind<bool>("Outcomes.LuckyRain", "Lucky Block Rain Enabled", true, "Enable Lucky Block Rain outcome");
			LuckyRainWeight = Instance.Bind<int>("Outcomes.LuckyRain", "Lucky Block Rain Weight", 75, "Weight for Lucky Block Rain");
			LuckyRainCount = Instance.Bind<int>("Outcomes.LuckyRain", "Lucky Block Count", 3, "Number of lucky blocks to spawn");
			EruptionEnabled = Instance.Bind<bool>("Outcomes.Eruption", "Spawn Eruption Enabled", true, "Enable Spawn Eruption outcome");
			EruptionWeight = Instance.Bind<int>("Outcomes.Eruption", "Spawn Eruption Weight", 90, "Weight for Spawn Eruption");
			PeelRainEnabled = Instance.Bind<bool>("Outcomes.Berrynana Peel Rain", "Berrynana Peel Rain Enabled", true, "Enable Berrynana Peel Rain outcome");
			PeelRainWeight = Instance.Bind<int>("Outcomes.Berrynana Peel Rain", "Berrynana Peel Rain Weight", 100, "Weight for Berrynana Peel Rain");
			PeelRainGridSize = Instance.Bind<int>("Outcomes.Berrynana Peel Rain", "Grid Size", 5, "Grid size for Berrynana Peel Rain (size of 5 = 5x5 grid or 25 peels)");
			PeelRainSpacing = Instance.Bind<float>("Outcomes.Berrynana Peel Rain", "Berrynana Peel Spacing", 1f, "Spacing between the peels");
			PeelRainLifetime = Instance.Bind<float>("Outcomes.Berrynana Peel Rain", "Berrynana Peel Lifetime", 120f, "Time before the peels despawn (in seconds)");
			ExplodeEnabled = Instance.Bind<bool>("Outcomes.Explosion", "Explosion Enabled", true, "Enable Explosion outcome");
			ExplodeWeight = Instance.Bind<int>("Outcomes.Explosion", "Explosion Weight", 80, "Weight for Explosion");
			ScorpoRainEnabled = Instance.Bind<bool>("Outcomes.Scorpion Rain", "Scorpion Rain Enabled", true, "Enable Scorpion Rain outcome");
			ScorpoRainWeight = Instance.Bind<int>("Outcomes.Scorpion Rain", "Scorpion Rain Weight", 60, "Weight for Scorpion Rain");
			ScorpoRainCount = Instance.Bind<int>("Outcomes.Scorpion Rain", "Scorpion Count", 3, "Number of scorpions to spawn");
			ScorpoRainLifetime = Instance.Bind<float>("Outcomes.Scorpion Rain", "Scorpion Lifetime", 60f, "Time before scorpions despawn (in seconds)");
			BerryRainEnabled = Instance.Bind<bool>("Outcomes.Berry Rain", "Berry Rain Enabled", true, "Enable Berry Rain outcome");
			BerryRainWeight = Instance.Bind<int>("Outcomes.Berry Rain", "Berry Rain Weight", 100, "Weight for Berry Rain");
			BerryRainCount = Instance.Bind<int>("Outcomes.Berry Rain", "Berry Count", 4, "Number of berries to spawn");
			SummonScoutmasterEnabled = Instance.Bind<bool>("Outcomes.Scoutmaster", "Spawn Scoutmaster Enabled", true, "Enable Spawn Scoutmaster outcome");
			SummonScoutmasterWeight = Instance.Bind<int>("Outcomes.Scoutmaster", "Spawn Scoutmaster Weight", 50, "Weight for Spawn Scoutmaster");
			RopeSpawnEnabled = Instance.Bind<bool>("Outcomes.Rope/Anti Rope Spawn", "Rope/Anti Rope Spawn Enabled", true, "Enable Rope/Anti Rope Spawn outcome");
			RopeSpawnWeight = Instance.Bind<int>("Outcomes.Rope/Anti Rope Spawn", "Rope/Anti Rope Spawn Weight", 95, "Weight for Rope/Anti Rope Spawn");
			ChaosCloudEnabled = Instance.Bind<bool>("Outcomes.Chaos Cloud", "Chaos Cloud Enabled", true, "Enable Chaos Cloud outcome");
			ChaosCloudWeight = Instance.Bind<int>("Outcomes.Chaos Cloud", "Chaos Cloud Weight", 100, "Weight for Chaos Cloud");
			ZombieEnabled = Instance.Bind<bool>("Outcomes.Zombie", "Spawn Zombie Enabled", true, "Enable Spawn Zombie outcome");
			ZombieWeight = Instance.Bind<int>("Outcomes.Zombie", "Spawn Zombie Weight", 70, "Weight for Spawn Zombie");
			ZombieSprintDistance = Instance.Bind<float>("Outcomes.Zombie", "Zombie Sprint Distance", 30f, "Distance at which the zombie starts sprinting");
			ZombieLungeDistance = Instance.Bind<float>("Outcomes.Zombie", "Zombie Lunge Distance", 15f, "Distance at which the zombie can lunge");
			ZombieLungeRecoveryTime = Instance.Bind<float>("Outcomes.Zombie", "Zombie Lunge Recovery Time", 2f, "Time it takes for the zombie to recover after lunging (in seconds)");
			ZombieLifetime = Instance.Bind<float>("Outcomes.Zombie", "Zombie Lifetime", 90f, "Time before the zombie dies (in seconds)");
			BackpacksEnabled = Instance.Bind<bool>("Outcomes.Backpacks", "Backpack Spawn Enabled", true, "Enable Backpack Spawn outcome");
			BackpacksWeight = Instance.Bind<int>("Outcomes.Backpacks", "Backpack Spawn Weight", 90, "Weight for Backpack Spawn");
			BackpackCount = Instance.Bind<int>("Outcomes.Backpacks", "Backpack Count", 3, "Number of backpacks to spawn");
			PuffHealSpawnEnabled = Instance.Bind<bool>("Outcomes.Remed Fungus Heal", "Remed Fungus Heal Spawn Enabled", true, "Enable Remed Fungus Heal Spawn outcome");
			PuffHealSpawnWeight = Instance.Bind<int>("Outcomes.Remed Fungus Heal", "Remed Fungus Heal Spawn Weight", 100, "Weight for Remed Fungus Heal Spawn");
			EquipmentShowerEnabled = Instance.Bind<bool>("Outcomes.Equipment Shower", "Equipment Shower Enabled", true, "Enable Equipment Shower outcome");
			EquipmentShowerWeight = Instance.Bind<int>("Outcomes.Equipment Shower", "Equipment Shower Weight", 100, "Weight for Equipment Shower");
			EquipmentShowerCount = Instance.Bind<int>("Outcomes.Equipment Shower", "Equipment Count", 4, "Number of equipment pieces to spawn");
			MythicSpawnEnabled = Instance.Bind<bool>("Outcomes.Mythic Item Spawn", "Mythic Item Spawn Enabled", true, "Enable Mythic Item Spawn outcome");
			MythicSpawnWeight = Instance.Bind<int>("Outcomes.Mythic Item Spawn", "Mythic Item Spawn Weight", 85, "Weight for Mythic Item Spawn");
			FlagEnabled = Instance.Bind<bool>("Outcomes.Checkpoint Flag", "Checkpoint Flag Enabled", true, "Enable Checkpoint Flag outcome");
			FlagWeight = Instance.Bind<int>("Outcomes.Checkpoint Flag", "Checkpoint Flag Weight", 90, "Weight for Checkpoint Flag");
			CannonEnabled = Instance.Bind<bool>("Outcomes.Scout Cannon", "Scout Cannon Spawn Enabled", true, "Enable Scout Cannon outcome");
			CannonWeight = Instance.Bind<int>("Outcomes.Scout Cannon", "Scout Cannon Spawn Weight", 95, "Weight for Scout Cannon");
			CookEnabled = Instance.Bind<bool>("Outcomes.Portable Pot", "Portable Pot Spawn Enabled", true, "Enable Portable Pot Spawn outcome");
			CookWeight = Instance.Bind<int>("Outcomes.Portable Pot", "Portable Pot Spawn Weight", 85, "Weight for Portable Pot Spawn");
			SunscreenEnabled = Instance.Bind<bool>("Outcomes.Sunscreen Area", "Sunscreen Area Enabled", true, "Enable Sunscreen area outcome");
			SunscreenWeight = Instance.Bind<int>("Outcomes.Sunscreen Area", "Sunscreen Area Weight", 65, "Weight for Sunscreen area");
			EnderpearlEnabled = Instance.Bind<bool>("Outcomes.Teleport", "Teleport Enabled", true, "Enable Teleport outcome");
			EnderpearlWeight = Instance.Bind<int>("Outcomes.Teleport", "Teleport Weight", 80, "Weight for Teleport");
		}
	}
	public static class LuckyBlockRarity
	{
		public const Rarity LuckyBlockDefault = -1;
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("legocool.LuckyBlocks", "Lucky_Blocks", "1.2.0")]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony _harmony;

		public const string Id = "legocool.LuckyBlocks";

		internal static ManualLogSource Log { get; private set; }

		public static string Name => "Lucky_Blocks";

		public static string Version => "1.2.0";

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			_harmony = new Harmony("legocool.LuckBlock");
			_harmony.PatchAll();
			Log = ((BaseUnityPlugin)this).Logger;
			Config.Instance = ((BaseUnityPlugin)this).Config;
			Config.BindAll();
			Outcomes.Initialize();
			BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "luckyblock.peakbundle", (Action<PeakBundle>)InitLuckyBlock);
			LocalizedText.mainTable["NAME_LUCKYBLOCK"] = new List<string>(new string[14]);
			for (int i = 0; i < 14; i++)
			{
				LocalizedText.mainTable["NAME_LUCKYBLOCK"][i] = "Lucky Block";
			}
			LocalizedText.mainTable["NAME_LUCKYBLOCK"][9] = "幸运方块";
			LootData.RarityWeights.Add((Rarity)(-1), 500);
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
		}

		private void InitLuckyBlock(PeakBundle bundle)
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			string[] allAssetNames = bundle.GetAllAssetNames();
			foreach (string text in allAssetNames)
			{
				Log.LogInfo((object)("Asset: " + text));
			}
			GameObject val = bundle.LoadAsset<GameObject>("LuckyBlock.prefab");
			LuckyBreakable luckyBreakable = val.AddComponent<LuckyBreakable>();
			luckyBreakable.breakOnCollision = true;
			luckyBreakable.minBreakVelocity = 10f;
			LootData component = val.GetComponent<LootData>();
			component.Rarity = (Rarity)(-1);
			bundle.Mod.RegisterContent();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}