Decompiled source of CopperRoofs v0.2.0

plugins\CopperRoofs.dll

Decompiled 5 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CopperRoof")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CopperRoof")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
namespace CopperRoofs;

[BepInPlugin("org.bepinex.plugins.bid.copperroofs", "CopperRoofs", "0.2.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class CopperRoofs : BaseUnityPlugin
{
	public const string PluginGUID = "org.bepinex.plugins.bid.copperroofs";

	public const string PluginName = "CopperRoofs";

	public const string PluginVersion = "0.2.0";

	private void Awake()
	{
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Expected O, but got Unknown
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: 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_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Expected O, but got Unknown
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Expected O, but got Unknown
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Expected O, but got Unknown
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Expected O, but got Unknown
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Expected O, but got Unknown
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_020f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_023b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0254: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Expected O, but got Unknown
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_0285: Unknown result type (might be due to invalid IL or missing references)
		//IL_0290: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Expected O, but got Unknown
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Expected O, but got Unknown
		//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Expected O, but got Unknown
		//IL_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0320: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		//IL_033a: Expected O, but got Unknown
		//IL_0355: Unknown result type (might be due to invalid IL or missing references)
		//IL_035f: Expected O, but got Unknown
		//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_03be: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ff: Expected O, but got Unknown
		//IL_0415: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0425: Unknown result type (might be due to invalid IL or missing references)
		//IL_042c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0434: Expected O, but got Unknown
		//IL_044f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0459: Expected O, but got Unknown
		//IL_049f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ff: Expected O, but got Unknown
		//IL_0515: Unknown result type (might be due to invalid IL or missing references)
		//IL_051a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0525: Unknown result type (might be due to invalid IL or missing references)
		//IL_052c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0534: Expected O, but got Unknown
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0559: Expected O, but got Unknown
		Logger.LogInfo((object)"CopperRoof has landed");
		string category = "copper_roofs";
		AssetBundle val = AssetUtils.LoadAssetBundleFromResources("copperroofs");
		if ((Object)(object)val == (Object)null)
		{
			MonoBehaviour.print((object)"Error loading assetbundle copperroof");
			return;
		}
		try
		{
			GameObject val2 = val.LoadAsset<GameObject>("bid_dome_sphere_1m");
			val2.GetComponent<Piece>().m_name = "$piece_dome_sphere 1m";
			val2.GetComponent<Piece>().m_icon = val.LoadAsset<Sprite>("dome_sphere_icon1");
			PieceManager instance = PieceManager.Instance;
			GameObject obj = val2;
			PieceConfig val3 = new PieceConfig();
			val3.PieceTable = "Hammer";
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
			{
				new RequirementConfig
				{
					Item = "Copper",
					Recover = true,
					Amount = 1
				}
			};
			val3.CraftingStation = "forge";
			val3.Category = category;
			instance.AddPiece(new CustomPiece(obj, true, val3));
			GameObject val4 = PrefabManager.Instance.CreateClonedPrefab("bid_dome_sphere_2m", "bid_dome_sphere_1m");
			val4.GetComponent<Piece>().m_name = "$piece_dome_sphere 2m";
			val4.GetComponent<Piece>().m_icon = val.LoadAsset<Sprite>("dome_sphere_icon2");
			Vector3 localScale = val4.transform.localScale;
			localScale.x *= 2f;
			localScale.y *= 2f;
			localScale.z *= 2f;
			val4.transform.localScale = localScale;
			PieceManager instance2 = PieceManager.Instance;
			GameObject obj2 = val4;
			val3 = new PieceConfig();
			val3.PieceTable = "Hammer";
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
			{
				new RequirementConfig
				{
					Item = "Copper",
					Recover = true,
					Amount = 2
				}
			};
			val3.CraftingStation = "forge";
			val3.Category = category;
			instance2.AddPiece(new CustomPiece(obj2, true, val3));
			GameObject val5 = PrefabManager.Instance.CreateClonedPrefab("bid_dome_sphere_4m", "bid_dome_sphere_1m");
			val5.GetComponent<Piece>().m_name = "$piece_dome_sphere 4m";
			val5.GetComponent<Piece>().m_icon = val.LoadAsset<Sprite>("dome_sphere_icon4");
			localScale = val5.transform.localScale;
			localScale.x *= 4f;
			localScale.y *= 4f;
			localScale.z *= 4f;
			val5.transform.localScale = localScale;
			PieceManager instance3 = PieceManager.Instance;
			GameObject obj3 = val5;
			val3 = new PieceConfig();
			val3.PieceTable = "Hammer";
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
			{
				new RequirementConfig
				{
					Item = "Copper",
					Recover = true,
					Amount = 4
				}
			};
			val3.CraftingStation = "forge";
			val3.Category = category;
			instance3.AddPiece(new CustomPiece(obj3, true, val3));
			val2 = val.LoadAsset<GameObject>("bid_dome_cone_1m");
			val2.GetComponent<Piece>().m_name = "$piece_dome_cone 1m";
			val2.GetComponent<Piece>().m_icon = val.LoadAsset<Sprite>("dome_cone_icon1");
			PieceManager instance4 = PieceManager.Instance;
			GameObject obj4 = val2;
			val3 = new PieceConfig();
			val3.PieceTable = "Hammer";
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
			{
				new RequirementConfig
				{
					Item = "Copper",
					Recover = true,
					Amount = 1
				}
			};
			val3.CraftingStation = "forge";
			val3.Category = category;
			instance4.AddPiece(new CustomPiece(obj4, true, val3));
			val4 = PrefabManager.Instance.CreateClonedPrefab("bid_dome_cone_2m", "bid_dome_cone_1m");
			val4.GetComponent<Piece>().m_name = "$piece_dome_cone 2m";
			val4.GetComponent<Piece>().m_icon = val.LoadAsset<Sprite>("dome_cone_icon2");
			localScale = val4.transform.localScale;
			localScale.x *= 2f;
			localScale.y *= 2f;
			localScale.z *= 2f;
			val4.transform.localScale = localScale;
			PieceManager instance5 = PieceManager.Instance;
			GameObject obj5 = val4;
			val3 = new PieceConfig();
			val3.PieceTable = "Hammer";
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
			{
				new RequirementConfig
				{
					Item = "Copper",
					Recover = true,
					Amount = 2
				}
			};
			val3.CraftingStation = "forge";
			val3.Category = category;
			instance5.AddPiece(new CustomPiece(obj5, true, val3));
			val5 = PrefabManager.Instance.CreateClonedPrefab("bid_dome_cone_4m", "bid_dome_cone_1m");
			val5.GetComponent<Piece>().m_name = "$piece_dome_cone 4m";
			val5.GetComponent<Piece>().m_icon = val.LoadAsset<Sprite>("dome_cone_icon4");
			localScale = val5.transform.localScale;
			localScale.x *= 4f;
			localScale.y *= 4f;
			localScale.z *= 4f;
			val5.transform.localScale = localScale;
			PieceManager instance6 = PieceManager.Instance;
			GameObject obj6 = val5;
			val3 = new PieceConfig();
			val3.PieceTable = "Hammer";
			val3.Requirements = (RequirementConfig[])(object)new RequirementConfig[1]
			{
				new RequirementConfig
				{
					Item = "Copper",
					Recover = true,
					Amount = 4
				}
			};
			val3.CraftingStation = "forge";
			val3.Category = category;
			instance6.AddPiece(new CustomPiece(obj6, true, val3));
		}
		finally
		{
			val.Unload(false);
		}
	}
}