Decompiled source of RtDTraps v0.1.5

RtDTraps.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("RtDTraps")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RtDTraps")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("65b02983-a194-4221-86a0-7e0ded5d4714")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace rtDTraps
{
	[BepInPlugin("Soloredis.RtDTraps", "RtDTraps", "0.1.5")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInIncompatibility("zolantris.ValheimRAFT")]
	public class RtDTraps : BaseUnityPlugin
	{
		public const string PluginGUID = "Soloredis.RtDTraps";

		public const string PluginName = "RtDTraps";

		public const string PluginVersion = "0.1.5";

		public static bool isModded = true;

		private CustomLocalization Localization;

		public AssetBundle MyAssets;

		public ConfigEntry<bool> LoggingEnable;

		public string[] PrefabList = new string[9] { "AshLandsSkullFX_RtD", "BlackForestSkullFX_RtD", "DeepNorthSkullFX_RtD", "MeadowsSkullFX_RtD", "MistlandsSkullFX_RtD", "PlainsSkullFX_RtD", "SwampSkullFX_RtD", "MountainSkullFX_RtD", "RuneHealFX_RtD" };

		public string[] CustomSEList = new string[8] { "SE_AshLands_RtD", "SE_BlackForest_RtD", "SE_DeepNorth_RtD", "SE_Meadows_RtD", "SE_Mistlands_RtD", "SE_Mountain_RtD", "SE_Plains_RtD", "SE_Swamp_RtD" };

		public string[] MeadowsList = new string[1] { "RuneStoneMeadows_RtD" };

		public string[] BlackForestList = new string[1] { "RuneStoneBlackForest_RtD" };

		public string[] SwampList = new string[1] { "RuneStoneSwamp_RtD" };

		public string[] MountainList = new string[1] { "RuneStoneMountain_RtD" };

		public string[] PlainsList = new string[1] { "RuneStonePlains_RtD" };

		public string[] MistlandsList = new string[1] { "RuneStoneMistlands_RtD" };

		public string[] AshlandsList = new string[1] { "RuneStoneAshLands_RtD" };

		public string[] DeepNorthList = new string[1] { "RuneStoneDeepNorth_RtD" };

		public PieceConfig PieceMeadowsTrap;

		public PieceConfig PieceBlackForestTrap;

		public PieceConfig PieceSwampTrap;

		public PieceConfig PieceMountainTrap;

		public PieceConfig PiecePlainsTrap;

		public PieceConfig PieceMistlandsTrap;

		public PieceConfig PieceAshLandsTrap;

		public PieceConfig PieceDeepNorthTrap;

		public PieceConfig PieceHealingRune;

		public static VegetationConfig ConfigMeadows = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)1,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigBlackForest = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)8,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigSwamp = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)2,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigMountain = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)4,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigPlains = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)16,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigMistlands = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)512,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigAshlands = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)32,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		public static VegetationConfig ConfigDeepNorth = new VegetationConfig
		{
			Min = 1f,
			Max = 1f,
			ScaleMin = 0.75f,
			ScaleMax = 1.25f,
			MinAltitude = 1f,
			Biome = (Biome)64,
			BiomeArea = (BiomeArea)3,
			BlockCheck = true,
			MaxTilt = 30f,
			MaxTerrainDelta = 2f,
			InForest = false
		};

		private void Awake()
		{
			LoadBundle();
			CreateConfigs();
			AddPrefabs();
			StatusEffects();
			Meadows();
			BlackForest();
			Swamp();
			Mountain();
			Plains();
			Mistlands();
			AshLands();
			DeepNorth();
			AddHammerTraps();
			LocalizationEnglish();
			if (LoggingEnable.Value)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)"Logging is enabled in the config.");
			}
		}

		private void LoadBundle()
		{
			try
			{
				MyAssets = AssetUtils.LoadAssetBundleFromResources("rtdtraps", Assembly.GetExecutingAssembly());
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while loading bundles: {arg}");
			}
		}

		private void LocalizationEnglish()
		{
			Localization = LocalizationManager.Instance.GetLocalization();
			CustomLocalization localization = Localization;
			string text = "English";
			localization.AddTranslation(ref text, new Dictionary<string, string>
			{
				{ "SkullTrapMeadows_RtD", "ITS A TRAP" },
				{ "SkullTrapBlackForest_RtD", "ITS A TRAP" },
				{ "SkullTrapSwamp_RtD", "ITS A TRAP" },
				{ "SkullTrapMountain_RtD", "ITS A TRAP" },
				{ "SkullTrapPlains_RtD", "ITS A TRAP" },
				{ "SkullTrapMistlands_RtD", "ITS A TRAP" },
				{ "SkullTrapAshLands_RtD", "ITS A TRAP" },
				{ "SkullTrapDeepNorth_RtD", "ITS A TRAP" },
				{ "RuneStonePiece_RtD", "Healing Runestone" }
			});
		}

		public void CreateConfigs()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			try
			{
				((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
				LoggingEnable = ((BaseUnityPlugin)this).Config.Bind<bool>("Logging", "Enable", false, new ConfigDescription("Enables logging.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes
				{
					IsAdminOnly = true
				} }));
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding configuration values: {arg}");
			}
		}

		public void Meadows()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] meadowsList = MeadowsList;
				foreach (string text in meadowsList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigMeadows);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void BlackForest()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] blackForestList = BlackForestList;
				foreach (string text in blackForestList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigBlackForest);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void Swamp()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] swampList = SwampList;
				foreach (string text in swampList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigSwamp);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void Mountain()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] mountainList = MountainList;
				foreach (string text in mountainList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigMountain);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void Plains()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] plainsList = PlainsList;
				foreach (string text in plainsList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigPlains);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void Mistlands()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] mistlandsList = MistlandsList;
				foreach (string text in mistlandsList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigMistlands);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void AshLands()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] ashlandsList = AshlandsList;
				foreach (string text in ashlandsList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigAshlands);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void DeepNorth()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			try
			{
				string[] deepNorthList = DeepNorthList;
				foreach (string text in deepNorthList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomVegetation val2 = new CustomVegetation(val, true, ConfigDeepNorth);
						ZoneManager.Instance.AddCustomVegetation(val2);
						if (LoggingEnable.Value)
						{
							((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Vegetation database"));
						}
					}
					else if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to Add: " + text + " to the Vegetation database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding Rock Block: {arg}");
			}
		}

		public void StatusEffects()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			try
			{
				string[] customSEList = CustomSEList;
				foreach (string text in customSEList)
				{
					SE_Stats val = MyAssets.LoadAsset<SE_Stats>(text);
					if ((Object)(object)val != (Object)null)
					{
						CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, true);
						ItemManager.Instance.AddStatusEffect(val2);
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding SE_Stats Effects: {arg}");
			}
		}

		private void AddPrefabs()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			try
			{
				string[] prefabList = PrefabList;
				foreach (string text in prefabList)
				{
					GameObject val = MyAssets.LoadAsset<GameObject>(text);
					if ((Object)(object)val != (Object)null)
					{
						GameObject prefab = Cache.GetPrefab<GameObject>(text);
						if ((Object)(object)prefab == (Object)null)
						{
							CustomPrefab val2 = new CustomPrefab(val, true);
							PrefabManager.Instance.AddPrefab(val2);
							if (LoggingEnable.Value)
							{
								((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + text + " to the Object database"));
							}
						}
					}
					else
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + text + " to the object database"));
					}
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while adding prefabs: {arg}");
			}
		}

		private void AddHammerTraps()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Expected O, but got Unknown
			//IL_0280: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Expected O, but got Unknown
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Expected O, but got Unknown
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Expected O, but got Unknown
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Expected O, but got Unknown
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Expected O, but got Unknown
			try
			{
				GameObject val = MyAssets.LoadAsset<GameObject>("SkullTrapMeadows_RtD");
				if ((Object)(object)val != (Object)null)
				{
					CustomPiece val2 = new CustomPiece(val, true, PieceMeadowsTrap);
					PieceManager.Instance.AddPiece(val2);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val).name + " to the Hammer Piecetable"));
				}
				GameObject val3 = MyAssets.LoadAsset<GameObject>("SkullTrapBlackForest_RtD");
				if ((Object)(object)val3 != (Object)null)
				{
					CustomPiece val4 = new CustomPiece(val3, true, PieceBlackForestTrap);
					PieceManager.Instance.AddPiece(val4);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val3).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val3).name + " to the Hammer Piecetable"));
				}
				GameObject val5 = MyAssets.LoadAsset<GameObject>("SkullTrapSwamp_RtD");
				if ((Object)(object)val5 != (Object)null)
				{
					CustomPiece val6 = new CustomPiece(val5, true, PieceSwampTrap);
					PieceManager.Instance.AddPiece(val6);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val5).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val5).name + " to the Hammer Piecetable"));
				}
				GameObject val7 = MyAssets.LoadAsset<GameObject>("SkullTrapMountain_RtD");
				if ((Object)(object)val7 != (Object)null)
				{
					CustomPiece val8 = new CustomPiece(val7, true, PieceMountainTrap);
					PieceManager.Instance.AddPiece(val8);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val7).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val7).name + " to the Hammer Piecetable"));
				}
				GameObject val9 = MyAssets.LoadAsset<GameObject>("SkullTrapPlains_RtD");
				if ((Object)(object)val9 != (Object)null)
				{
					CustomPiece val10 = new CustomPiece(val9, true, PiecePlainsTrap);
					PieceManager.Instance.AddPiece(val10);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val9).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val9).name + " to the Hammer Piecetable"));
				}
				GameObject val11 = MyAssets.LoadAsset<GameObject>("SkullTrapMistlands_RtD");
				if ((Object)(object)val11 != (Object)null)
				{
					CustomPiece val12 = new CustomPiece(val11, true, PieceMistlandsTrap);
					PieceManager.Instance.AddPiece(val12);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val11).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val11).name + " to the Hammer Piecetable"));
				}
				GameObject val13 = MyAssets.LoadAsset<GameObject>("SkullTrapAshLands_RtD");
				if ((Object)(object)val13 != (Object)null)
				{
					CustomPiece val14 = new CustomPiece(val13, true, PieceAshLandsTrap);
					PieceManager.Instance.AddPiece(val14);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val13).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val13).name + " to the Hammer Piecetable"));
				}
				GameObject val15 = MyAssets.LoadAsset<GameObject>("SkullTrapDeepNorth_RtD");
				if ((Object)(object)val15 != (Object)null)
				{
					CustomPiece val16 = new CustomPiece(val15, true, PieceDeepNorthTrap);
					PieceManager.Instance.AddPiece(val16);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val15).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val15).name + " to the Hammer Piecetable"));
				}
				GameObject val17 = MyAssets.LoadAsset<GameObject>("RuneStonePiece_RtD");
				if ((Object)(object)val17 != (Object)null)
				{
					CustomPiece val18 = new CustomPiece(val17, true, PieceHealingRune);
					PieceManager.Instance.AddPiece(val18);
					if (LoggingEnable.Value)
					{
						((BaseUnityPlugin)this).Logger.LogMessage((object)("Added: " + ((Object)val17).name + " to the Prefab database"));
					}
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogMessage((object)("Failed to add: " + ((Object)val17).name + " to the Hammer Piecetable"));
				}
			}
			catch (Exception arg)
			{
				((BaseUnityPlugin)this).Logger.LogWarning((object)$"Exception caught while creating plantables: {arg}");
			}
		}

		public RtDTraps()
		{
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Expected O, but got Unknown
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Expected O, but got Unknown
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: 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_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Expected O, but got Unknown
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: 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_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Expected O, but got Unknown
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Expected O, but got Unknown
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Expected O, but got Unknown
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Expected O, but got Unknown
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Expected O, but got Unknown
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Expected O, but got Unknown
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Expected O, but got Unknown
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Expected O, but got Unknown
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Expected O, but got Unknown
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Expected O, but got Unknown
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Expected O, but got Unknown
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Expected O, but got Unknown
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Expected O, but got Unknown
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Expected O, but got Unknown
			//IL_04cb: 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_04dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Expected O, but got Unknown
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0501: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0513: Expected O, but got Unknown
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Expected O, but got Unknown
			//IL_0547: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0558: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_056a: Expected O, but got Unknown
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0571: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0586: Unknown result type (might be due to invalid IL or missing references)
			//IL_058f: Expected O, but got Unknown
			PieceConfig val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "Dandelion",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceMeadowsTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "Thistle",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceBlackForestTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "Guck",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceSwampTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "FreezeGland",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceMountainTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "BlackMetal",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PiecePlainsTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "BlackCore",
					Amount = 1,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceMistlandsTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "FlametalNew",
					Amount = 5,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceAshLandsTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "FlametalNew",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceDeepNorthTrap = val;
			val = new PieceConfig();
			val.PieceTable = "_HammerPieceTable";
			val.Category = "Traps";
			val.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
			{
				new RequirementConfig
				{
					Item = "BlackMetal",
					Amount = 15,
					Recover = true
				},
				new RequirementConfig
				{
					Item = "Stone",
					Amount = 50,
					Recover = true
				}
			};
			PieceHealingRune = val;
			((BaseUnityPlugin)this)..ctor();
		}
	}
}