Decompiled source of HunterLodge v1.0.1

BepInEx/plugins/HunterLodge/HunterLodge.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.NET.Common;
using CandideServer;
using CandideServer.Models;
using CandideServer.Models.Citizen;
using CandideServer.Models.WorkOrders;
using CandideServer.SimulationModels;
using HunterLodge.Configuration;
using Microsoft.Xna.Framework;
using ModSettingsMenu.Api;
using RomesteadContentFramework.Api;
using RomesteadLocalizationAPI.Api;
using Shared.Data;
using Shared.Data.DataModels;
using Shared.Models.Buildings;
using Shared.Models.Construction;
using Shared.Text;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Hunter Lodge")]
[assembly: AssemblyDescription("Hunter Lodge for Romestead by Ice Box Studio")]
[assembly: AssemblyCompany("Ice Box Studio")]
[assembly: AssemblyProduct("Hunter Lodge")]
[assembly: AssemblyCopyright("Copyright (C) 2026 Ice Box Studio All rights reserved.")]
[assembly: ComVisible(false)]
[assembly: Guid("73f1d16c-79ce-4522-8b42-b4ef3eb5716c")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[module: RefSafetyRules(11)]
namespace HunterLodge
{
	[BepInPlugin("IceBoxStudio.Romestead.HunterLodge", "Hunter Lodge", "1.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class HunterLodge : BasePlugin
	{
		internal static ManualLogSource Logger { get; private set; }

		public override void Load()
		{
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Expected O, but got Unknown
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			Logger = ((BasePlugin)this).Log;
			bool flag = default(bool);
			try
			{
				Logger.LogInfo((object)"=============================================");
				ManualLogSource logger = Logger;
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(16, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Hunter Lodge");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" initializing...");
				}
				logger.LogInfo(val);
				ManualLogSource logger2 = Logger;
				val = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Author: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Ice Box Studio");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("(");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("https://steamcommunity.com/id/ibox666/");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")");
				}
				logger2.LogInfo(val);
				string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
				I18n.L.RegisterJson(Path.Combine(directoryName, "Localization.json"));
				I18n.L.LanguageChanged += OnLanguageChanged;
				ModSettingsMenuRegistration.Register(((BasePlugin)this).Config);
				HunterLodgeIcon.Register();
				HunterLodgeJob.Register();
				HunterLodgeWorkRecipe.Register();
				HunterLodgeMaps.Register();
				HunterLodgeBuilding.Register();
				I18n.ApplyGameStrings();
				ManualLogSource logger3 = Logger;
				val = new BepInExInfoLogInterpolatedStringHandler(13, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Hunter Lodge");
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" initialized.");
				}
				logger3.LogInfo(val);
				Logger.LogInfo((object)"=============================================");
			}
			catch (Exception ex)
			{
				ManualLogSource logger4 = Logger;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(24, 3, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>("Hunter Lodge");
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" initialization error: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("\n");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.StackTrace);
				}
				logger4.LogError(val2);
			}
		}

		private static void OnLanguageChanged(string locale)
		{
			I18n.ApplyGameStrings();
		}
	}
	internal static class HunterLodgeIds
	{
		public const string Icon = "hunterlodge:icon:hunter_lodge";

		public const string BuildingType = "hunterlodge:building_type:hunter_lodge";

		public const string HunterJob = "hunterlodge:job:hunter";

		public const string MeatWorkRecipeLevel1 = "hunterlodge:work_recipe:hunt_small_game";

		public const string MeatWorkRecipeLevel2 = "hunterlodge:work_recipe:hunt_small_game:2";

		public const string MeatWorkRecipeLevel3 = "hunterlodge:work_recipe:hunt_small_game:3";

		public const string MeatWorkRecipeLevel4 = "hunterlodge:work_recipe:hunt_small_game:4";

		public const string BuildingLevel1 = "hunterlodge:building:hunter_lodge:0";

		public const string BuildingLevel2 = "hunterlodge:building:hunter_lodge:1";

		public const string BuildingLevel3 = "hunterlodge:building:hunter_lodge:2";

		public const string ConstructionLevel1 = "hunterlodge:construction:hunter_lodge:0";

		public const string ConstructionLevel2 = "hunterlodge:construction:hunter_lodge:1";

		public const string ConstructionLevel3 = "hunterlodge:construction:hunter_lodge:2";

		public const string ExteriorMapLevel1 = "hunterlodge:maps/hunter_lodge/exterior/1";

		public const string ExteriorMapLevel2 = "hunterlodge:maps/hunter_lodge/exterior/2";

		public const string ExteriorMapLevel3 = "hunterlodge:maps/hunter_lodge/exterior/3";

		public const string InteriorMap = "hunterlodge:maps/hunter_lodge/interior";
	}
	internal static class HunterLodgeAssets
	{
		public static string Path(string fileName)
		{
			return System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Assets", "HunterLodge", fileName);
		}
	}
	internal static class HunterLodgeBuilding
	{
		public static void Register()
		{
			RegisterBehavior();
			RegisterLevel1();
			RegisterLevel2();
			RegisterLevel3();
		}

		private static void RegisterBehavior()
		{
			RomesteadContent.Buildings.RegisterStandardType("hunterlodge:building_type:hunter_lodge", I18n.L.Text("content.building_type", Array.Empty<object>()), (Action<StandardBuildingBehaviorOptions>)delegate(StandardBuildingBehaviorOptions behavior)
			{
				behavior.UseWorkerJobs(0.5f, -0.5f);
				behavior.OnLoaded = HunterLodgeWorkRecipe.Load;
			});
		}

		private static void RegisterLevel1()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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)
			//IL_0061: 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_007b: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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)
			//IL_00d9: Expected O, but got Unknown
			//IL_00d9: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Expected O, but got Unknown
			RomesteadContent.Buildings.RegisterBuilding(new BuildingData
			{
				Id = "hunterlodge:building:hunter_lodge:0",
				BuildingTypeId = "hunterlodge:building_type:hunter_lodge",
				IconId = HunterLodgeIcon.ConstructionIcon,
				ExteriorMap = "hunterlodge:maps/hunter_lodge/exterior/1",
				InteriorMap = "hunterlodge:maps/hunter_lodge/interior",
				CitizenSlots = 
				{
					new CitizenSlotData("hunterlodge:job:hunter", new Vector3(52f, 105f, 0f), (SpawnLocation)1)
				},
				MaxBuildingAppeal = 6f
			});
			RomesteadContent.Buildings.RegisterConstruction(new ConstructionModel
			{
				Id = "hunterlodge:construction:hunter_lodge:0",
				Name = StringId.op_Implicit("hunterlodge:construction:hunter_lodge:0*construction:name"),
				RequiredConstructionProgress = 120f,
				ConstructionMaterialsRequirement = new ConstructionMaterialsAggregate
				{
					MaterialAmounts = new Dictionary<string, int>
					{
						{ "resource:lumber", 6 },
						{ "resource:stone", 2 }
					}
				},
				IconId = HunterLodgeIcon.ConstructionIcon,
				UpgradeLevel = 0,
				ConstructionSpaceInfo = CreateConstructionSpace(),
				Type = (ConstructionType)1,
				SpawnedId = "hunterlodge:building:hunter_lodge:0",
				ConstructionUiCategory = (ConstructionUiCategory)0
			}, (Action<ConstructionRegistrationOptions>)delegate(ConstructionRegistrationOptions options)
			{
				options.Name = I18n.L.Text("content.construction.1", Array.Empty<object>());
				options.Description = I18n.L.Text("content.construction.1.description", Array.Empty<object>());
				options.UnlockedByDefault = true;
			});
		}

		private static void RegisterLevel2()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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)
			//IL_0061: 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_007b: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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)
			//IL_00f1: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Expected O, but got Unknown
			RomesteadContent.Buildings.RegisterBuilding(new BuildingData
			{
				Id = "hunterlodge:building:hunter_lodge:1",
				BuildingTypeId = "hunterlodge:building_type:hunter_lodge",
				IconId = HunterLodgeIcon.ConstructionIcon,
				ExteriorMap = "hunterlodge:maps/hunter_lodge/exterior/2",
				InteriorMap = "hunterlodge:maps/hunter_lodge/interior",
				CitizenSlots = 
				{
					new CitizenSlotData("hunterlodge:job:hunter", new Vector3(52f, 105f, 0f), (SpawnLocation)1)
				},
				MaxBuildingAppeal = 10f
			});
			RomesteadContent.Buildings.RegisterConstruction(new ConstructionModel
			{
				Id = "hunterlodge:construction:hunter_lodge:1",
				Name = StringId.op_Implicit("hunterlodge:construction:hunter_lodge:1*construction:name"),
				RequiredConstructionProgress = 150f,
				ConstructionMaterialsRequirement = new ConstructionMaterialsAggregate
				{
					MaterialAmounts = new Dictionary<string, int>
					{
						{ "resource:lumber", 6 },
						{ "resource:stone", 6 },
						{ "resource:clay", 4 },
						{ "resource:brick", 8 }
					}
				},
				IconId = HunterLodgeIcon.ConstructionIcon,
				UpgradeLevel = 1,
				UpgradeForId = "hunterlodge:building:hunter_lodge:0",
				ConstructionSpaceInfo = CreateConstructionSpace(),
				Type = (ConstructionType)1,
				SpawnedId = "hunterlodge:building:hunter_lodge:1",
				ConstructionUiCategory = (ConstructionUiCategory)0
			}, (Action<ConstructionRegistrationOptions>)delegate(ConstructionRegistrationOptions options)
			{
				options.Name = I18n.L.Text("content.construction.2", Array.Empty<object>());
				options.Description = I18n.L.Text("content.construction.2.description", Array.Empty<object>());
				options.UnlockedByDefault = true;
			});
		}

		private static void RegisterLevel3()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: 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)
			//IL_0061: 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_007b: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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)
			//IL_00f2: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			RomesteadContent.Buildings.RegisterBuilding(new BuildingData
			{
				Id = "hunterlodge:building:hunter_lodge:2",
				BuildingTypeId = "hunterlodge:building_type:hunter_lodge",
				IconId = HunterLodgeIcon.ConstructionIcon,
				ExteriorMap = "hunterlodge:maps/hunter_lodge/exterior/3",
				InteriorMap = "hunterlodge:maps/hunter_lodge/interior",
				CitizenSlots = 
				{
					new CitizenSlotData("hunterlodge:job:hunter", new Vector3(52f, 105f, 0f), (SpawnLocation)1)
				},
				MaxBuildingAppeal = 14f
			});
			RomesteadContent.Buildings.RegisterConstruction(new ConstructionModel
			{
				Id = "hunterlodge:construction:hunter_lodge:2",
				Name = StringId.op_Implicit("hunterlodge:construction:hunter_lodge:2*construction:name"),
				RequiredConstructionProgress = 180f,
				ConstructionMaterialsRequirement = new ConstructionMaterialsAggregate
				{
					MaterialAmounts = new Dictionary<string, int>
					{
						{ "resource:lumber", 8 },
						{ "resource:stone", 8 },
						{ "resource:brick", 10 },
						{ "resource:concrete", 8 }
					}
				},
				IconId = HunterLodgeIcon.ConstructionIcon,
				UpgradeLevel = 2,
				UpgradeForId = "hunterlodge:building:hunter_lodge:1",
				ConstructionSpaceInfo = CreateConstructionSpace(),
				Type = (ConstructionType)1,
				SpawnedId = "hunterlodge:building:hunter_lodge:2",
				ConstructionUiCategory = (ConstructionUiCategory)0
			}, (Action<ConstructionRegistrationOptions>)delegate(ConstructionRegistrationOptions options)
			{
				options.Name = I18n.L.Text("content.construction.3", Array.Empty<object>());
				options.Description = I18n.L.Text("content.construction.3.description", Array.Empty<object>());
				options.UnlockedByDefault = true;
			});
		}

		private static ConstructionSpaceInfo CreateConstructionSpace()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0011: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			ConstructionSpaceInfo val = new ConstructionSpaceInfo();
			val.Areas = (ConstructionTileArea[])(object)new ConstructionTileArea[1]
			{
				new ConstructionTileArea
				{
					TileBounds = new Rectangle(0, 0, 8, 8),
					Requirements = (PlacementRequirements)9
				}
			};
			val.PlacingStyle = (PlacementStyle)0;
			return val;
		}
	}
	internal static class HunterLodgeIcon
	{
		public const string FallbackIcon = "leatherworker";

		public static string ConstructionIcon { get; private set; } = "leatherworker";

		public static void Register()
		{
			string text = HunterLodgeAssets.Path("hunter_lodge_full_game.png");
			if (File.Exists(text))
			{
				RomesteadContent.Icons.RegisterPng("hunterlodge:icon:hunter_lodge", text);
				ConstructionIcon = "hunterlodge:icon:hunter_lodge";
			}
		}
	}
	internal static class HunterLodgeJob
	{
		public static void Register()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			JobContentRegistry jobs = RomesteadContent.Jobs;
			JobData val = new JobData();
			val.Id = "hunterlodge:job:hunter";
			val.MName = StringId.op_Implicit("hunterlodge:job:hunter*job:name");
			val.FName = StringId.op_Implicit("hunterlodge:job:hunter*job:name:feminine");
			val.UiJobControlFlags = (UiJobControls)3;
			val.MaxLevelUpgradeSteps = new int[3] { 4, 7, 10 };
			val.AssociatedGodId = "diana";
			val.WorshipPerLevel = 10;
			val.PartOfCitizenGeneration = false;
			val.Icon = HunterLodgeIcon.ConstructionIcon;
			jobs.Register(val, I18n.L.Text("content.job", Array.Empty<object>()), I18n.L.Text("content.job", Array.Empty<object>()));
		}
	}
	internal static class HunterLodgeMaps
	{
		public static void Register()
		{
			RegisterExteriorMap("hunterlodge:maps/hunter_lodge/exterior/1", "HunterLodge_1.cmx");
			RegisterExteriorMap("hunterlodge:maps/hunter_lodge/exterior/2", "HunterLodge_2.cmx");
			RegisterExteriorMap("hunterlodge:maps/hunter_lodge/exterior/3", "HunterLodge_3.cmx");
			RegisterInteriorMap();
		}

		private static void RegisterExteriorMap(string mapId, string customCmxName)
		{
			string customCmx = HunterLodgeAssets.Path(Path.Combine("Content", "maps", customCmxName));
			string customTmx = HunterLodgeAssets.Path(Path.Combine("Content", "maps", "HunterLodge.tmx"));
			string contentRoot = HunterLodgeAssets.Path("Content");
			RomesteadContent.Maps.Register(mapId, (Action<MapRegistrationOptions>)delegate(MapRegistrationOptions options)
			{
				options.CmxPath = customCmx;
				options.TmxPath = customTmx;
				options.ContentRoot = contentRoot;
			});
		}

		private static void RegisterInteriorMap()
		{
			string customCmx = Path.Combine(Paths.GameRootPath, "Content", "maps", "interiors_new", "leather_1.cmx");
			string customTmx = Path.Combine(Paths.GameRootPath, "Content", "maps", "interiors_new", "leather_1.tmx");
			string contentRoot = Path.Combine(Paths.GameRootPath, "Content");
			RomesteadContent.Maps.Register("hunterlodge:maps/hunter_lodge/interior", (Action<MapRegistrationOptions>)delegate(MapRegistrationOptions options)
			{
				options.CmxPath = customCmx;
				options.TmxPath = customTmx;
				options.ContentRoot = contentRoot;
			});
		}
	}
	internal static class HunterLodgeWorkRecipe
	{
		public static void Register()
		{
			Register("hunterlodge:work_recipe:hunt_small_game", 1, 1, 1);
			Register("hunterlodge:work_recipe:hunt_small_game:2", 2, 4, 2);
			Register("hunterlodge:work_recipe:hunt_small_game:3", 3, 7, 3);
			Register("hunterlodge:work_recipe:hunt_small_game:4", 4, 10, 4);
		}

		public static void Load(StandardBuildingContext context)
		{
			int num = JobDataBase.GetJobOrMissing("hunterlodge:job:hunter").MaxLevelUpgradeSteps[context.UpgradeLevel];
			CitizenSlotSimulationModel val = default(CitizenSlotSimulationModel);
			JobModel val2 = default(JobModel);
			CitizenModel val3 = default(CitizenModel);
			for (int i = 0; i < context.Instance.CitizenSlots.Count; i++)
			{
				if (!ServerGameState.TryGetCitizenSlot(context.Instance.CitizenSlots[i], ref val) || !val.Model.AssociatedJobId.HasValue || !ServerGameState.TryGetJob(val.Model.AssociatedJobId.Value, ref val2) || val2.BaseId != "hunterlodge:job:hunter")
				{
					continue;
				}
				int num2 = num;
				if (val2.CitizenId.HasValue && ServerGameState.TryGetCitizen(val2.CitizenId.Value, ref val3))
				{
					num2 = Math.Min(num2, val3.GetCurrentJobLevel());
				}
				for (int num3 = val2.WorkQueue.Count - 1; num3 >= 0; num3--)
				{
					WorkOrderModel val4 = val2.WorkQueue[num3];
					if (!(val4.RecipeId != "hunterlodge:work_recipe:hunt_small_game") || !(val4.RecipeId != "hunterlodge:work_recipe:hunt_small_game:2") || !(val4.RecipeId != "hunterlodge:work_recipe:hunt_small_game:3") || !(val4.RecipeId != "hunterlodge:work_recipe:hunt_small_game:4"))
					{
						WorkRecipeModel recipeOrMissing = WorkRecipeDataBase.GetRecipeOrMissing(val4.RecipeId);
						if (recipeOrMissing.LevelRequirement > num2)
						{
							val2.RemoveWorkOrder(val4.Id);
						}
						else if (val4.RequiredProgress != recipeOrMissing.RequiredProgress)
						{
							val4.CurrentProgress = val4.CurrentProgress / val4.RequiredProgress * recipeOrMissing.RequiredProgress;
							val4.RequiredProgress = recipeOrMissing.RequiredProgress;
						}
					}
				}
			}
		}

		private static void Register(string id, int tier, int level, int amount)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			RomesteadContent.WorkRecipes.Register(new WorkRecipeModel
			{
				Id = id,
				RequiredProgress = 240f,
				Experience = 5f,
				DefaultRepeatableSelected = true,
				Output = new WorkOutputModel
				{
					CraftedId = "material:meat_small",
					Type = (WorkOrderType)0,
					Amount = amount
				}
			}, (Action<WorkRecipeRegistrationOptions>)delegate(WorkRecipeRegistrationOptions options)
			{
				options.Name = I18n.L.Text($"content.recipe.{tier}", Array.Empty<object>());
				options.Description = I18n.L.Text("content.recipe.description", new object[1] { amount });
				options.LevelRequirement = level;
				options.AddToJobGroup("hunterlodge:job:hunter", level, (WorkRecipePlacement)null);
			});
		}
	}
	internal static class I18n
	{
		public static readonly RomesteadLocalizer L = RomesteadLocalization.For("IceBoxStudio.Romestead.HunterLodge");

		public static void ApplyGameStrings()
		{
			RomesteadContent.Localization.Register("hunterlodge:building_type:hunter_lodge*building_type:name", L.Text("content.building_type", Array.Empty<object>()));
			RomesteadContent.Localization.Register("hunterlodge:job:hunter*job:name", L.Text("content.job", Array.Empty<object>()));
			RomesteadContent.Localization.Register("hunterlodge:job:hunter*job:name:feminine", L.Text("content.job", Array.Empty<object>()));
			RegisterRecipe("hunterlodge:work_recipe:hunt_small_game", 1);
			RegisterRecipe("hunterlodge:work_recipe:hunt_small_game:2", 2);
			RegisterRecipe("hunterlodge:work_recipe:hunt_small_game:3", 3);
			RegisterRecipe("hunterlodge:work_recipe:hunt_small_game:4", 4);
			RegisterConstruction("hunterlodge:construction:hunter_lodge:0", "content.construction.1", "content.construction.1.description");
			RegisterConstruction("hunterlodge:construction:hunter_lodge:1", "content.construction.2", "content.construction.2.description");
			RegisterConstruction("hunterlodge:construction:hunter_lodge:2", "content.construction.3", "content.construction.3.description");
		}

		private static void RegisterConstruction(string id, string nameKey, string descriptionKey)
		{
			RomesteadContent.Localization.Register(id + "*construction:name", L.Text(nameKey, Array.Empty<object>()));
			RomesteadContent.Localization.Register(id + "*construction:description", L.Text(descriptionKey, Array.Empty<object>()));
		}

		private static void RegisterRecipe(string id, int level)
		{
			RomesteadContent.Localization.Register(id + "*work_recipe:name", L.Text($"content.recipe.{level}", Array.Empty<object>()));
			RomesteadContent.Localization.Register(id + "*work_recipe:description", L.Text("content.recipe.description", new object[1] { level }));
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "IceBoxStudio.Romestead.HunterLodge";

		public const string PLUGIN_NAME = "Hunter Lodge";

		public const string PLUGIN_VERSION = "1.0.1";

		public const string PLUGIN_AUTHOR = "Ice Box Studio";

		public const string PLUGIN_AUTHOR_URL = "https://steamcommunity.com/id/ibox666/";

		public const int NEXUS_MODS_ID = 112;

		public const string THUNDERSTORE_TEAM = "Ice_Box_Studio_Romestead";

		public const string THUNDERSTORE_MOD_NAME = "HunterLodge";

		public const string UPDATE_MANIFEST_URL = "https://cdn.jsdelivr.net/gh/ibox233/MyMod_Version@main/HunterLodge.json";
	}
}
namespace HunterLodge.Configuration
{
	internal static class ModSettingsMenuRegistration
	{
		private static ConfigFile _config;

		private static string _locale;

		private static bool _subscribed;

		public static void Register(ConfigFile config)
		{
			_config = config;
			if (!_subscribed)
			{
				ModSettingsRegistry.RefreshRequested += Refresh;
				_subscribed = true;
			}
			RegisterCurrent(config);
		}

		private static void Refresh()
		{
			if (_config != null)
			{
				string currentLocale = I18n.L.CurrentLocale;
				ModSettingsRegistration val = default(ModSettingsRegistration);
				if (!(_locale == currentLocale) || !ModSettingsRegistry.TryGet("IceBoxStudio.Romestead.HunterLodge", ref val))
				{
					RegisterCurrent(_config);
				}
			}
		}

		private static void RegisterCurrent(ConfigFile config)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			ModSettingsRegistry.Register("IceBoxStudio.Romestead.HunterLodge", Text("mod.name"), config, new ModSettingsModOptions
			{
				Icon = "cog",
				Version = "1.0.1",
				Author = "Ice Box Studio",
				Description = Text("mod.description"),
				NexusModsId = 112,
				ThunderstoreTeam = "Ice_Box_Studio_Romestead",
				ThunderstoreModName = "HunterLodge",
				UpdateManifestUrl = "https://cdn.jsdelivr.net/gh/ibox233/MyMod_Version@main/HunterLodge.json",
				HideWhenEmpty = false,
				Order = -60
			});
			_locale = I18n.L.CurrentLocale;
		}

		private static string Text(string key)
		{
			return I18n.L.Text(key, Array.Empty<object>());
		}
	}
}