Decompiled source of VampireEmpire v1.1.0

VampireEmpire.dll

Decompiled 3 weeks 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.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Microsoft.CodeAnalysis;
using Stunlock.Core;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
using VampireCommandFramework;
using VampireEmpire.Army;
using VampireEmpire.Occupation;
using VampireEmpire.Patches;
using VampireEmpire.Systems;
using VampireEmpire.Thrones;
using VampireEmpire.UI;
using VampireEmpire.Utils;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("VampireEmpire")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Created with VRising.ModTemplate, you should edit this.")]
[assembly: AssemblyFileVersion("0.1.10.0")]
[assembly: AssemblyInformationalVersion("0.1.10+1.Branch.main.Sha.c33d0879382e1a0da34861ec55914ba7e637a80e")]
[assembly: AssemblyProduct("VampireEmpire")]
[assembly: AssemblyTitle("VampireEmpire")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.10.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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace VampireEmpire
{
	public static class Commands
	{
		[Command("throne", "th", "Spawn a Regional Throne at your position", null, null, false)]
		public static void SpawnRegionalThrone(ChatCommandContext ctx)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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_006f: 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)
			Entity senderCharacterEntity = ctx.Event.SenderCharacterEntity;
			LocalToWorld component = SystemAPI.GetComponent<LocalToWorld>(senderCharacterEntity);
			Vector3 val = float3.op_Implicit(((LocalToWorld)(ref component)).Position);
			GameObject val2 = new GameObject("RegionalThrone");
			val2.transform.position = val + Vector3.up * 2f;
			val2.AddComponent<RegionalThrone>();
			ctx.Reply($"<color=#FF00FF>[Empire]</color> {ctx.User.CharacterName} has raised a Regional Throne!");
		}

		[Command("gear", "g", "Open the Gear Forge window", null, null, false)]
		public static void OpenGearWindow(ChatCommandContext ctx)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GameObject val = new GameObject("VampireEmpire_GearWindow");
			val.AddComponent<GearPresetWindow>();
			Object.DontDestroyOnLoad((Object)(object)val);
			ctx.Reply("Gear Forge opened — Press F1 to close");
		}

		[Command("guardian", "gd", "Spawn a test guardian (red cube)", null, null, false)]
		public static void SpawnGuardian(ChatCommandContext ctx)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			Entity senderCharacterEntity = ctx.Event.SenderCharacterEntity;
			LocalToWorld component = SystemAPI.GetComponent<LocalToWorld>(senderCharacterEntity);
			Vector3 val = float3.op_Implicit(((LocalToWorld)(ref component)).Position);
			GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3);
			val2.transform.position = val + Vector3.up * 10f;
			((Object)val2).name = "TERRITORY GUARDIAN";
			Renderer component2 = val2.GetComponent<Renderer>();
			if ((Object)(object)component2 != (Object)null)
			{
				component2.material.color = Color.red;
			}
			ctx.Reply("Guardian summoned!");
		}

		[Command("empire", "e", "Show Empire status", null, null, false)]
		public static void EmpireStatus(ChatCommandContext ctx)
		{
			ctx.Reply($"<color=#FF0033>[Empire Status]</color> Territories: ??? | Regionals: {RegionalThrone.PlacedCount}/8 | Soldiers: ???");
		}
	}
	public static class Config
	{
		public static ConfigEntry<bool> EnableGuardians;

		public static ConfigEntry<int> ArmyMaxOverride;

		public static ConfigEntry<bool> HardcoreMode;

		public static void Bind(ConfigFile config)
		{
			EnableGuardians = config.Bind<bool>("Gameplay", "146Guardians", true, "Each territory has a unique guardian");
			ArmyMaxOverride = config.Bind<int>("Balance", "ArmyCapOverride", 0, "0 = use Kindred tiers");
			HardcoreMode = config.Bind<bool>("Challenge", "Hardcore", false, "No offline worker/army progress");
		}
	}
	public static class GuardianDatabase
	{
		public static void SpawnGuardian(int territoryId, Vector3 position)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.CreatePrimitive((PrimitiveType)0);
			((Object)val).name = $"Guardian of Territory {territoryId}";
			val.transform.position = position;
			Debug.Log(Object.op_Implicit($"Guardian spawned for {territoryId}!"));
		}
	}
	public class InvasionSystem : MonoBehaviour
	{
		private float timer = 0f;

		private int activeBiome = -1;

		private static InvasionSystem _instance;

		public static InvasionSystem Instance => _instance;

		public static bool IsActiveInBiome(int biome)
		{
			InvasionSystem instance = Instance;
			return instance != null && instance.activeBiome == biome;
		}

		private void Awake()
		{
			_instance = this;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		private void Update()
		{
			if (!GameUtils.IsSinglePlayer())
			{
				return;
			}
			timer += Time.deltaTime;
			if (!(timer < 3600f))
			{
				timer = 0f;
				if (activeBiome == -1)
				{
					activeBiome = Random.Range(1, 9);
					string biomeName = GetBiomeName(activeBiome);
					ChatUtils.Broadcast("<color=#FF0000>INVASION!</color> The Church strikes " + biomeName + "!");
				}
			}
		}

		private string GetBiomeName(int biomeId)
		{
			if (1 == 0)
			{
			}
			string result = biomeId switch
			{
				1 => "Farbane Woods", 
				2 => "Dunley Farmlands", 
				3 => "Hallowed Mountains", 
				4 => "Cursed Forest", 
				5 => "Silverlight Hills", 
				6 => "Gloomrot", 
				7 => "Oakveil Woodlands", 
				8 => "Ruins of Mortium", 
				_ => "Unknown Land", 
			};
			if (1 == 0)
			{
			}
			return result;
		}
	}
	public static class Prefabs
	{
		public static readonly PrefabGUID EmpireThroneGUID = new PrefabGUID(-1428272174);

		public static readonly PrefabGUID RegionalThroneGUID = new PrefabGUID(-1428272174);
	}
	public static class ThreatSystem
	{
		private static readonly float[] BiomeThreat = new float[9] { 0f, 80f, 85f, 70f, 90f, 95f, 92f, 88f, 100f };

		public static float GetThreat(int biomeId)
		{
			if (biomeId < 1 || biomeId >= BiomeThreat.Length)
			{
				return 100f;
			}
			float num = BiomeThreat[biomeId];
			if (InvasionSystem.IsActiveInBiome(biomeId))
			{
				num += 50f;
			}
			return Mathf.Clamp(num, 0f, 150f);
		}

		public static float GetAttritionPerHour(int biomeId, bool isOccupation = false)
		{
			float threat = GetThreat(biomeId);
			float num = (isOccupation ? KindredSystem.OccupationAttritionMod : 1f);
			return 0.05f * (1f + threat / 100f) * num * KindredSystem.AttritionMultiplier;
		}

		public static void ReduceThreat(int biomeId, float amount = 10f)
		{
			if (biomeId >= 1 && biomeId < BiomeThreat.Length)
			{
				BiomeThreat[biomeId] = Mathf.Max(0f, BiomeThreat[biomeId] - amount);
				if (BiomeThreat[biomeId] <= 0.1f)
				{
					string text = BiomeName(biomeId);
					ChatUtils.Broadcast("<color=#FF0033>[Empire]</color> " + text + " has been FULLY SUBJUGATED!");
				}
			}
		}

		private static string BiomeName(int biomeId)
		{
			if (1 == 0)
			{
			}
			string result = biomeId switch
			{
				1 => "Farbane Woods", 
				2 => "Dunley Farmlands", 
				3 => "Hallowed Mountains", 
				4 => "Cursed Forest", 
				5 => "Silverlight Hills", 
				6 => "Gloomrot", 
				7 => "Oakveil Woodlands", 
				8 => "Ruins of Mortium", 
				_ => "Unknown Biome", 
			};
			if (1 == 0)
			{
			}
			return result;
		}
	}
	[BepInPlugin("vampire_empire_restored_realms", "Vampire Empire: Restored Realms", "1.0.0")]
	public class VampireEmpirePlugin : BasePlugin
	{
		public const string PluginGuid = "vampire_empire_restored_realms";

		public const string PluginName = "Vampire Empire: Restored Realms";

		public const string PluginVersion = "1.0.0";

		private Harmony _harmony;

		private bool initialized = false;

		public static VampireEmpirePlugin Instance { get; private set; }

		public static ManualLogSource Logger
		{
			get
			{
				VampireEmpirePlugin instance = Instance;
				return (instance != null) ? ((BasePlugin)instance).Log : null;
			}
		}

		public override void Load()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			Instance = this;
			_harmony = new Harmony("vampire_empire_restored_realms");
			_harmony.PatchAll();
			CommandRegistry.RegisterAll(Assembly.GetExecutingAssembly());
			((BasePlugin)this).Log.LogInfo((object)"Vampire Empire: Restored Realms — LOADED");
			((BasePlugin)this).Log.LogInfo((object)"THE ETERNAL NIGHT HAS RISEN");
		}

		public void Update()
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			if (!initialized && !((Object)(object)Camera.main == (Object)null))
			{
				initialized = true;
				GameObject gameObject = ((Component)Camera.main).gameObject;
				gameObject.AddComponent<GearInputHandler>();
				gameObject.AddComponent<GuardianInputHandler>();
				gameObject.AddComponent<EmpireThroneHandler>();
				gameObject.AddComponent<OccupationMapWindow>();
				GameObject val = new GameObject("VampireEmpire_ArmyAutoEquip");
				val.AddComponent<ArmyAutoEquip>();
				Object.DontDestroyOnLoad((Object)(object)val);
				GameObject val2 = new GameObject("VampireEmpire_InvasionSystem");
				val2.AddComponent<InvasionSystem>();
				Object.DontDestroyOnLoad((Object)(object)val2);
				((BasePlugin)this).Log.LogInfo((object)"Empire systems initialized — THE ETERNAL NIGHT RISES!");
			}
		}

		public override bool Unload()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			return true;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "VampireEmpire";

		public const string PLUGIN_NAME = "VampireEmpire";

		public const string PLUGIN_VERSION = "0.1.10";
	}
}
namespace VampireEmpire.Utils
{
	public static class BiomeUtils
	{
		public static string GetBiome(object territory)
		{
			return "Farbane";
		}
	}
	public static class ChatUtils
	{
		public static void Broadcast(string message)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			ManualLogSource logger = VampireEmpirePlugin.Logger;
			if (logger != null)
			{
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(9, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[Empire] ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(message);
				}
				logger.LogInfo(val);
			}
		}
	}
	public static class GameUtils
	{
		public static bool IsSinglePlayer()
		{
			return true;
		}
	}
	public static class InventoryUtils
	{
		public static bool RemoveItem(object player, object itemId, int count)
		{
			return true;
		}

		public static int CountFullGearSet(object preset)
		{
			return 0;
		}
	}
	public static class PlayerUtils
	{
		public static Entity GetLocalPlayerEntity()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			return Entity.Null;
		}

		public static object GetLocalPlayer()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return GetLocalPlayerEntity();
		}

		public static int GetClaimedCount()
		{
			return 0;
		}
	}
}
namespace VampireEmpire.Thrones
{
	public class EmpireThroneHandler : MonoBehaviour
	{
		public static bool IsPlaced;

		private void Update()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: 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)
			if (Input.GetKeyDown((KeyCode)116) && !IsPlaced)
			{
				IsPlaced = true;
				ChatUtils.Broadcast("<color=#FFD700>[EMPIRE]</color> The TRUE CAPITAL has been crowned! Dracula's heir rises!");
				Debug.Log(Object.op_Implicit("Empire Throne placed — the Eternal Night begins!"));
				GameObject val = GameObject.CreatePrimitive((PrimitiveType)2);
				val.transform.position = ((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 3f + Vector3.up;
				val.transform.localScale = new Vector3(2f, 3f, 2f);
				((Object)val).name = "TRUE THRONE";
				Renderer component = val.GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material.color = new Color(0.8f, 0f, 0.8f);
				}
			}
		}
	}
	public class RegionalThrone : MonoBehaviour
	{
		public const int MaxRegionals = 8;

		public static int PlacedCount;

		public static bool FreePlacement;

		private void OnEnable()
		{
			if (PlacedCount >= 8 && !FreePlacement)
			{
				ChatUtils.Broadcast("Only 8 Regional Thrones may exist!");
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			PlacedCount++;
			string currentBiome = GetCurrentBiome();
			((Object)((Component)this).gameObject).name = currentBiome + " Regional Throne";
			ChatUtils.Broadcast($"<color=#FF0033>[Empire]</color> {currentBiome} has been subjugated! Regional Throne #{PlacedCount}");
		}

		private string GetCurrentBiome()
		{
			return (new string[8] { "Farbane", "Dunley", "Hallowed", "Cursed", "Silverlight", "Gloomrot", "Oakveil", "Mortium" })[Random.Range(0, 8)];
		}
	}
}
namespace VampireEmpire.Patches
{
	public class GearInputHandler : MonoBehaviour
	{
		private static GameObject _windowObj;

		private void Update()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			if (Input.GetKeyDown((KeyCode)282))
			{
				if ((Object)(object)_windowObj == (Object)null)
				{
					_windowObj = new GameObject("VampireEmpire_GearWindow");
					Object.DontDestroyOnLoad((Object)(object)_windowObj);
					ChatUtils.Broadcast("Gear Forge opened — Press F1 again to close");
				}
				else
				{
					Object.Destroy((Object)(object)_windowObj);
					_windowObj = null;
					ChatUtils.Broadcast("Gear Forge closed");
				}
			}
		}
	}
	public static class CastleLimitPatch
	{
		public static void Apply()
		{
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			try
			{
				string path = Path.Combine(Paths.ConfigPath, "VRisingServer", "Settings", "ServerGameSettings.json");
				if (!File.Exists(path))
				{
					((BasePlugin)VampireEmpirePlugin.Instance).Log.LogWarning((object)"ServerGameSettings.json not found — castle limit unchanged.");
					return;
				}
				string text = File.ReadAllText(path);
				string text2 = text.Replace("\"CastleLimit\": 1", "\"CastleLimit\": 250").Replace("\"CastleLimit\": 2", "\"CastleLimit\": 250").Replace("\"CastleLimit\": 3", "\"CastleLimit\": 250")
					.Replace("\"CastleLimit\": 4", "\"CastleLimit\": 250")
					.Replace("\"CastleLimit\": 5", "\"CastleLimit\": 250");
				if (text != text2)
				{
					File.WriteAllText(path, text2);
					((BasePlugin)VampireEmpirePlugin.Instance).Log.LogInfo((object)"Castle limit increased to 250!");
				}
				else
				{
					((BasePlugin)VampireEmpirePlugin.Instance).Log.LogInfo((object)"Castle limit already 250 or not found.");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource log = ((BasePlugin)VampireEmpirePlugin.Instance).Log;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(31, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to modify castle limit: ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message);
				}
				log.LogError(val);
			}
		}
	}
	public class GuardianInputHandler : MonoBehaviour
	{
		private void Update()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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_0056: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown((KeyCode)103))
			{
				Vector3 val = ((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 5f;
				GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3);
				val2.transform.position = val + Vector3.up * 10f;
				val2.transform.localScale = Vector3.one * 3f;
				((Object)val2).name = "TERRITORY GUARDIAN";
				Renderer component = val2.GetComponent<Renderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.material.color = Color.red;
				}
				ChatUtils.Broadcast("Guardian spawned! (Press G)");
			}
		}
	}
}
namespace VampireEmpire.Occupation
{
	public class OccupiablePOI
	{
		public string Name;

		public Vector3 Position;

		public int Biome;

		public ResourceYield Yield;

		public int ThreatReduction = 10;
	}
	public struct ResourceYield
	{
		public int CopperOre;

		public int IronOre;

		public int GraveDust;

		public int BloodRose;

		public int GoldDust;

		public int Radium;
	}
	public static class OccupationSystem
	{
		public static Dictionary<int, List<OccupiablePOI>> POIsByBiome = new Dictionary<int, List<OccupiablePOI>>();

		public static void InitPOIs()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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)
			POIsByBiome[1] = new List<OccupiablePOI>
			{
				new OccupiablePOI
				{
					Name = "Bandit Copper Mine",
					Position = new Vector3(-900f, 50f, -300f),
					Yield = new ResourceYield
					{
						CopperOre = 120
					}
				},
				new OccupiablePOI
				{
					Name = "Desecrated Graveyard",
					Position = new Vector3(-1200f, 50f, 100f),
					Yield = new ResourceYield
					{
						GraveDust = 40,
						BloodRose = 20
					}
				},
				new OccupiablePOI
				{
					Name = "Wolf Den",
					Position = new Vector3(-800f, 50f, -500f),
					Yield = new ResourceYield
					{
						BloodRose = 30
					}
				}
			};
			POIsByBiome[2] = new List<OccupiablePOI>
			{
				new OccupiablePOI
				{
					Name = "Dunley Iron Mine",
					Position = new Vector3(100f, 50f, 200f),
					Yield = new ResourceYield
					{
						IronOre = 150
					}
				}
			};
		}

		public static void OccupyPOI(OccupiablePOI poi, int soldierCount)
		{
			Debug.Log(Object.op_Implicit($"Occupying {poi.Name} with {soldierCount} soldiers!"));
		}
	}
}
namespace VampireEmpire.Systems
{
	public static class KindredSystem
	{
		public class KindredTier
		{
			public int MinTerritories;

			public string Title;

			public string UnlockDescription;

			public Action OnReached;
		}

		public static float AttritionMultiplier = 1f;

		public static float OccupationAttritionMod = 2f;

		public static readonly List<KindredTier> Tiers = new List<KindredTier>
		{
			new KindredTier
			{
				MinTerritories = 10,
				Title = "Fledgling of the Night",
				UnlockDescription = "Gear & Occupations unlocked",
				OnReached = delegate
				{
					Debug.Log(Object.op_Implicit("Tier 1!"));
				}
			}
		};

		public static void OnTerritoryClaimed()
		{
			int claimed = PlayerUtils.GetClaimedCount();
			KindredTier kindredTier = Tiers.FindLast((KindredTier t) => claimed >= t.MinTerritories);
			if (kindredTier != null)
			{
				ChatUtils.Broadcast("Ascended to " + kindredTier.Title + "!");
			}
			kindredTier?.OnReached?.Invoke();
		}
	}
}
namespace VampireEmpire.UI
{
	public class GearPresetWindow : MonoBehaviour
	{
		private Rect windowRect = new Rect(100f, 100f, 600f, 500f);

		private bool showWindow = false;

		private void DrawRecruitmentTab()
		{
			GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Label("<size=18><color=#FF0033>LEGION RECRUITMENT</color></size>", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) });
			GUILayout.Label($"Army Strength: <color=#00FF00>{ArmySystem.CurrentCount}</color> / {ArmySystem.MaxCount}", (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
			for (int i = 1; i <= 10; i++)
			{
				if (i > 5)
				{
					GUILayout.EndHorizontal();
					GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
				}
				string value = ((i >= 8) ? "#FF0000" : ((i >= 5) ? "#FFFF00" : "#FFFFFF"));
				if (GUILayout.Button($"<color={value}>Lvl {i}\n{cost(i)} BE</color>", (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(80f),
					GUILayout.Height(60f)
				}))
				{
					ArmySystem.Recruit(i);
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.EndVertical();
		}

		private string cost(int lvl)
		{
			return (lvl * 1000).ToString();
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)282))
			{
				showWindow = !showWindow;
			}
		}

		private void OnGUI()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (showWindow)
			{
				windowRect = GUI.Window(999, windowRect, WindowFunction.op_Implicit((Action<int>)DrawWindow), "VAMPIRE EMPIRE - Gear Forge & Legion");
			}
		}

		private void DrawWindow(int id)
		{
			GUILayout.Label("<size=24><color=#FF0033>ARMY COMMAND CENTER</color></size>", (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Space(10f);
			GUILayout.Label("<color=#00FFFF>Drag gear presets here soon™</color>", (Il2CppReferenceArray<GUILayoutOption>)null);
			GUILayout.Space(20f);
			DrawRecruitmentTab();
			GUILayout.Space(20f);
			if (GUILayout.Button("CLOSE FORGE", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(40f) }))
			{
				showWindow = false;
			}
			GUI.DragWindow();
		}
	}
	public class OccupationMapWindow : MonoBehaviour
	{
		private Vector2 scroll;

		private Rect window = new Rect(100f, 100f, 1000f, 700f);

		private bool showWindow = false;

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)111))
			{
				showWindow = !showWindow;
			}
		}

		private void OnGUI()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (showWindow)
			{
				window = GUI.Window(987655, window, WindowFunction.op_Implicit((Action<int>)DrawMap), "OCCUPATION MAP – Subjugate Vardoran");
			}
		}

		private void DrawMap(int id)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Label("<size=22><color=#FF0033>CONQUEST OF VARDORAN</color></size>", (Il2CppReferenceArray<GUILayoutOption>)null);
			scroll = GUILayout.BeginScrollView(scroll, Array.Empty<GUILayoutOption>());
			foreach (KeyValuePair<int, List<OccupiablePOI>> item in OccupationSystem.POIsByBiome)
			{
				int key = item.Key;
				List<OccupiablePOI> value = item.Value;
				GUILayout.BeginVertical(GUIStyle.op_Implicit("box"), (Il2CppReferenceArray<GUILayoutOption>)null);
				GUILayout.Label($"<color=#00FFFF>BIOME {key} – Threat: {ThreatSystem.GetThreat(key):F1}</color>", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) });
				foreach (OccupiablePOI item2 in value)
				{
					GUILayout.BeginHorizontal((Il2CppReferenceArray<GUILayoutOption>)null);
					GUILayout.Label(item2.Name, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) });
					GUILayout.Label($"Yield: {item2.Yield}", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(200f) });
					if (GUILayout.Button("Occupy (500)", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }))
					{
						OccupationSystem.OccupyPOI(item2, 500);
					}
					GUILayout.EndHorizontal();
				}
				GUILayout.EndVertical();
			}
			GUILayout.EndScrollView();
			GUI.DragWindow();
		}
	}
}
namespace VampireEmpire.Army
{
	public class ArmyAutoEquip : MonoBehaviour
	{
		private float timer = 0f;

		private void Update()
		{
			timer += Time.deltaTime;
			if (!(timer < 10f))
			{
				timer = 0f;
				Debug.Log(Object.op_Implicit("Army auto-equip tick — checking gear presets..."));
			}
		}
	}
	public static class ArmySystem
	{
		public static int CurrentCount = 0;

		public static int MaxCount = 500;

		public static void Recruit(int level = 1)
		{
			if (CurrentCount < MaxCount)
			{
				int count = level * 1000;
				if (InventoryUtils.RemoveItem(PlayerUtils.GetLocalPlayer(), null, count))
				{
					CurrentCount++;
					ChatUtils.Broadcast($"Soldier Lv{level} joins! ({CurrentCount}/{MaxCount})");
				}
			}
		}

		public static void KillOne()
		{
			if (CurrentCount > 0)
			{
				CurrentCount--;
			}
		}
	}
}