Decompiled source of ThrowableBrick v1.3.2

Assets/SeanathonHooper.ThrowableBrick.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using ReservedItemSlotCore.Data;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SeanathonHooper.ThrowableBrick")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.2.0")]
[assembly: AssemblyInformationalVersion("1.3.2+f590a58ed953c5863bed26b61e185037ca531a1b")]
[assembly: AssemblyProduct("ThrowableBrick")]
[assembly: AssemblyTitle("SeanathonHooper.ThrowableBrick")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.2.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 ThrowableBrick
{
	internal class FracturedBrickBehavior : PhysicsProp
	{
		protected Ray brickThrowRay;

		protected int brickMask = 268437761;

		protected RaycastHit brickHit;

		private PlayerControllerB playerThrower;

		public bool isExplosive = true;

		public int health = 5;

		public int entityDamage = 3;

		public int playerDamage = 20;

		public int explosiveDamange = 37;

		public bool damagePlayers = true;

		public float brickValueLoss = 0.72f;

		protected bool isThrown;

		protected HashSet<Collider> hits = new HashSet<Collider>();

		public bool isDamaged;

		protected void DamageBrick()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			health--;
			if (health <= 0)
			{
				if (isExplosive)
				{
					Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 5.7f, 6f, explosiveDamange, 10f, (GameObject)null, false);
				}
				((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy);
			}
			((GrabbableObject)this).SetScrapValue((int)((float)((GrabbableObject)this).scrapValue * brickValueLoss));
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			Debug.Log((object)"ACTIVATED!");
			isThrown = true;
			playerThrower = ((GrabbableObject)this).playerHeldBy;
			((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetThrowDestination(), true);
		}

		public override void Update()
		{
			//IL_0017: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).Update();
			if (!isThrown)
			{
				return;
			}
			Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 1f, 2621448, (QueryTriggerInteraction)2);
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				if (hits.Contains(val))
				{
					continue;
				}
				if (((Component)val).gameObject.layer == 3)
				{
					if (damagePlayers)
					{
						PlayerControllerB component = ((Component)val).gameObject.GetComponent<PlayerControllerB>();
						if ((Object)(object)component != (Object)(object)playerThrower)
						{
							Debug.Log((object)("Hit " + ((Object)((Component)component).gameObject).name));
							component.DamagePlayer(playerDamage, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
							hits.Add(val);
						}
					}
				}
				else if (((Component)val).gameObject.layer == 19)
				{
					EnemyAICollisionDetect componentInChildren = ((Component)val).gameObject.GetComponentInChildren<EnemyAICollisionDetect>();
					componentInChildren.mainScript.HitEnemy(entityDamage, ((GrabbableObject)this).playerHeldBy, true, -1);
					Debug.Log((object)("Hit " + ((Object)((Component)componentInChildren).gameObject).name));
					hits.Add(val);
				}
			}
		}

		public override void EquipItem()
		{
			((PhysicsProp)this).EquipItem();
			string[] array = new string[1] { "Throw: [LMB]" };
			if (((NetworkBehaviour)this).IsOwner)
			{
				HUDManager.Instance.ChangeControlTipMultiple(array, true, ((GrabbableObject)this).itemProperties);
			}
		}

		public override void OnHitGround()
		{
			((GrabbableObject)this).OnHitGround();
			hits.Clear();
			if (isThrown)
			{
				DamageBrick();
			}
			isThrown = false;
		}

		protected Vector3 GetThrowDestination()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)this).transform.position;
			Debug.DrawRay(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f);
			brickThrowRay = new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward);
			position = ((!Physics.Raycast(brickThrowRay, ref brickHit, 12f, brickMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref brickThrowRay)).GetPoint(10f) : ((Ray)(ref brickThrowRay)).GetPoint(((RaycastHit)(ref brickHit)).distance - 0.05f));
			Debug.DrawRay(position, Vector3.down, Color.blue, 15f);
			brickThrowRay = new Ray(position, Vector3.down);
			if (Physics.Raycast(brickThrowRay, ref brickHit, 30f, brickMask, (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref brickHit)).point + Vector3.up * 0.05f;
			}
			return ((Ray)(ref brickThrowRay)).GetPoint(30f);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SeanathonHooper.ThrowableBrick";

		public const string PLUGIN_NAME = "ThrowableBrick";

		public const string PLUGIN_VERSION = "1.3.2";
	}
}
namespace ThrowableBrick.Patches
{
	internal class BrickBehavior : PhysicsProp
	{
		protected Ray brickThrowRay;

		protected int brickMask = 268437761;

		protected RaycastHit brickHit;

		private PlayerControllerB playerThrower;

		public bool isExplosive = true;

		public int health = 5;

		public int entityDamage = 3;

		public int playerDamage = 20;

		public int explosiveDamange = 37;

		public bool damagePlayers = true;

		public float brickValueLoss = 0.72f;

		protected bool isThrown;

		protected HashSet<Collider> hits = new HashSet<Collider>();

		public bool isDamaged;

		public Item fracturedBrick;

		protected void DamageBrick()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			health--;
			if (health <= 0)
			{
				if (isExplosive)
				{
					Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 5.7f, 6f, explosiveDamange, 10f, (GameObject)null, false);
				}
				((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy);
			}
			((GrabbableObject)this).SetScrapValue((int)((float)((GrabbableObject)this).scrapValue * brickValueLoss));
		}

		public override void ItemActivate(bool used, bool buttonDown = true)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).ItemActivate(used, buttonDown);
			Debug.Log((object)"ACTIVATED!");
			isThrown = true;
			playerThrower = ((GrabbableObject)this).playerHeldBy;
			((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetThrowDestination(), true);
		}

		public override void Update()
		{
			//IL_0017: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			((GrabbableObject)this).Update();
			if (!isThrown)
			{
				return;
			}
			Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 1f, 2621448, (QueryTriggerInteraction)2);
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				if (hits.Contains(val))
				{
					continue;
				}
				if (((Component)val).gameObject.layer == 3)
				{
					if (damagePlayers)
					{
						PlayerControllerB component = ((Component)val).gameObject.GetComponent<PlayerControllerB>();
						if ((Object)(object)component != (Object)(object)playerThrower)
						{
							Debug.Log((object)("Hit " + ((Object)((Component)component).gameObject).name));
							component.DamagePlayer(playerDamage, true, true, (CauseOfDeath)0, 0, false, default(Vector3));
							hits.Add(val);
						}
					}
				}
				else if (((Component)val).gameObject.layer == 19)
				{
					EnemyAICollisionDetect componentInChildren = ((Component)val).gameObject.GetComponentInChildren<EnemyAICollisionDetect>();
					componentInChildren.mainScript.HitEnemy(entityDamage, ((GrabbableObject)this).playerHeldBy, true, -1);
					Debug.Log((object)("Hit " + ((Object)((Component)componentInChildren).gameObject).name));
					hits.Add(val);
				}
			}
		}

		public override void EquipItem()
		{
			((PhysicsProp)this).EquipItem();
			string[] array = new string[1] { "Throw: [LMB]" };
			if (((NetworkBehaviour)this).IsOwner)
			{
				HUDManager.Instance.ChangeControlTipMultiple(array, true, ((GrabbableObject)this).itemProperties);
			}
		}

		public override void OnHitGround()
		{
			//IL_0054: 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)
			((GrabbableObject)this).OnHitGround();
			hits.Clear();
			if (isThrown)
			{
				DamageBrick();
				if (!isDamaged && (Object)(object)fracturedBrick != (Object)null && health != 0)
				{
					GameObject val = Object.Instantiate<GameObject>(fracturedBrick.spawnPrefab, ((Component)this).transform.position, Quaternion.identity);
					val.GetComponent<FracturedBrickBehavior>().health = health;
					((GrabbableObject)val.GetComponent<FracturedBrickBehavior>()).SetScrapValue(((GrabbableObject)this).scrapValue);
					NetworkObject component = val.GetComponent<NetworkObject>();
					if ((Object)(object)component != (Object)null && !component.IsSpawned)
					{
						component.Spawn(false);
					}
					((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy);
				}
			}
			isThrown = false;
		}

		protected Vector3 GetThrowDestination()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = ((Component)this).transform.position;
			Debug.DrawRay(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward, Color.yellow, 15f);
			brickThrowRay = new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward);
			position = ((!Physics.Raycast(brickThrowRay, ref brickHit, 12f, brickMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref brickThrowRay)).GetPoint(10f) : ((Ray)(ref brickThrowRay)).GetPoint(((RaycastHit)(ref brickHit)).distance - 0.05f));
			Debug.DrawRay(position, Vector3.down, Color.blue, 15f);
			brickThrowRay = new Ray(position, Vector3.down);
			if (Physics.Raycast(brickThrowRay, ref brickHit, 30f, brickMask, (QueryTriggerInteraction)1))
			{
				return ((RaycastHit)(ref brickHit)).point + Vector3.up * 0.05f;
			}
			return ((Ray)(ref brickThrowRay)).GetPoint(30f);
		}
	}
	public static class ReservedItemSlotCompat
	{
		public static void CreateSlotsAddItems()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: 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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0026: 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)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			ReservedItemData val = new ReservedItemData("Brick", (PlayerBone)0, default(Vector3), default(Vector3));
			ReservedItemData val2 = new ReservedItemData("Fractured Brick", (PlayerBone)0, default(Vector3), default(Vector3));
			ReservedItemSlotData val3 = ReservedItemSlotData.CreateReservedItemSlotData("brickSlot", 20, 100);
			val3.AddItemToReservedItemSlot(val);
			val3.AddItemToReservedItemSlot(val2);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("SeanathonHooper.ThrowableBrick", "ThrowableBrick", "1.3.2")]
	public class ThrowableBrick : BaseUnityPlugin
	{
		public static AssetBundle? BrickAsset;

		public static ConfigEntry<int>? MinimumValue = null;

		public static ConfigEntry<int>? MaximumValue = null;

		public static ConfigEntry<int>? Weight = null;

		public static ConfigEntry<int>? EntityDamage = null;

		public static ConfigEntry<int>? PlayerDamage = null;

		public static ConfigEntry<int>? BrickHealth = null;

		public static ConfigEntry<bool>? GrabbableToEnemies = null;

		public static ConfigEntry<int>? ItemRarity = null;

		public static ConfigEntry<bool>? FunnyMode = null;

		public static ConfigEntry<int>? FunnyModeExplosionDamage = null;

		public static ConfigEntry<bool>? DamagePlayers = null;

		public static ConfigEntry<float>? BrickValueLoss = null;

		public static ConfigEntry<int>? FracturedWeight = null;

		public static ConfigEntry<int>? FracturedEntityDamage = null;

		public static ConfigEntry<int>? FracturedPlayerDamage = null;

		public static ConfigEntry<bool>? ReservedItemSlot = null;

		public static bool useItemSlot = true;

		public static ThrowableBrick Instance { get; private set; } = null;


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


		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Instance = this;
			Logger.LogInfo((object)"SeanathonHooper.ThrowableBrick v1.3.2 has loaded!");
			GetModConfig();
			InitializeItem();
			if (Chainloader.PluginInfos.ContainsKey("FlipMods.ReservedItemSlotCore") && useItemSlot)
			{
				ReservedItemSlotCompat.CreateSlotsAddItems();
			}
		}

		internal void GetModConfig()
		{
			MinimumValue = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MinimumValue", 32, "Minimum value of the brick");
			MaximumValue = ((BaseUnityPlugin)this).Config.Bind<int>("General", "MaximumValue", 80, "Maximum value of the brick");
			Weight = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Weight", 10, "Weight of the brick");
			EntityDamage = ((BaseUnityPlugin)this).Config.Bind<int>("General", "EntityDamage", 3, "How many shovel hits worth of damage the brick does on impact");
			PlayerDamage = ((BaseUnityPlugin)this).Config.Bind<int>("General", "PlayerDamage", 20, "Damage dealt to the player in terms of percentage of health");
			BrickHealth = ((BaseUnityPlugin)this).Config.Bind<int>("General", "BrickHealth", 5, "How many times the brick can be thrown before being destroyed.");
			GrabbableToEnemies = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "GrabbableToEnemies", true, "If true, enemies can pick up this item.");
			ItemRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ItemRarity", 100, "Controls how often this item spawns (higher = more common).");
			FunnyMode = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "FunnyMode", true, "Enables explosions on brick destruction.");
			FunnyModeExplosionDamage = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FunnyModeExplosionDamage", 37, "Explosion damage dealt when FunnyMode is enabled.");
			DamagePlayers = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DamagePlayers", true, "If true, it damages players when thrown.");
			BrickValueLoss = ((BaseUnityPlugin)this).Config.Bind<float>("General", "BrickValueLoss", 0.28f, "Percentage of scrap value lost on when thrown (0.0–1.0), set to 1 for no value lost.");
			FracturedWeight = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FractureWeight", 7, "Weight of the brick when fractured.");
			FracturedEntityDamage = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FracturdedEntityDamage", 3, "Damage dealt to enemies by the fractured brick.");
			FracturedPlayerDamage = ((BaseUnityPlugin)this).Config.Bind<int>("General", "FracturedPlayerDamage", 20, "Damage dealt to players by the fractured brick.");
			ReservedItemSlot = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "ReservedItemSlot", true, "If true, enables the ReservedItemSlot.");
		}

		internal static void InitializeItem()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			BrickAsset = AssetBundle.LoadFromFile(Path.Combine(directoryName, "brickassetbundle"));
			if ((Object)(object)BrickAsset == (Object)null)
			{
				Logger.LogInfo((object)"Failed to load custom assets");
				return;
			}
			Item val = BrickAsset.LoadAsset<Item>("Assets/BRICK/BrickItem.asset");
			Item val2 = BrickAsset.LoadAsset<Item>("Assets/BRICK/FracturedBrickItem.asset");
			BrickBehavior brickBehavior = val.spawnPrefab.AddComponent<BrickBehavior>();
			FracturedBrickBehavior fracturedBrickBehavior = val2.spawnPrefab.AddComponent<FracturedBrickBehavior>();
			((GrabbableObject)brickBehavior).grabbable = true;
			((GrabbableObject)brickBehavior).itemProperties = val;
			int value = ItemRarity.Value;
			val.minValue = MinimumValue.Value;
			val.maxValue = MaximumValue.Value;
			val.weight = (float)Weight.Value / 105f + 1f;
			brickBehavior.isExplosive = FunnyMode.Value;
			((GrabbableObject)brickBehavior).grabbableToEnemies = GrabbableToEnemies.Value;
			brickBehavior.health = BrickHealth.Value;
			brickBehavior.explosiveDamange = FunnyModeExplosionDamage.Value;
			brickBehavior.entityDamage = EntityDamage.Value;
			brickBehavior.playerDamage = PlayerDamage.Value;
			brickBehavior.damagePlayers = DamagePlayers.Value;
			brickBehavior.brickValueLoss = 1f - BrickValueLoss.Value;
			brickBehavior.fracturedBrick = val2;
			((GrabbableObject)fracturedBrickBehavior).grabbable = true;
			((GrabbableObject)fracturedBrickBehavior).itemProperties = val2;
			val2.minValue = MinimumValue.Value;
			val2.maxValue = MaximumValue.Value;
			val2.weight = (float)FracturedWeight.Value / 105f + 1f;
			fracturedBrickBehavior.isExplosive = FunnyMode.Value;
			((GrabbableObject)fracturedBrickBehavior).grabbableToEnemies = GrabbableToEnemies.Value;
			fracturedBrickBehavior.health = BrickHealth.Value;
			fracturedBrickBehavior.explosiveDamange = FunnyModeExplosionDamage.Value;
			fracturedBrickBehavior.entityDamage = FracturedEntityDamage.Value;
			fracturedBrickBehavior.playerDamage = FracturedPlayerDamage.Value;
			fracturedBrickBehavior.damagePlayers = DamagePlayers.Value;
			fracturedBrickBehavior.brickValueLoss = 1f - BrickValueLoss.Value;
			useItemSlot = ReservedItemSlot.Value;
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Items.RegisterScrap(val, value, (LevelTypes)(-1));
			Items.RegisterScrap(val2, value, (LevelTypes)1);
		}
	}
}