Decompiled source of STAWE v999999999.9.9

STAWE.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using SLMA;
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("SW")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SW")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.1.1")]
[module: UnverifiableCode]
namespace STAWE
{
	public static class UManager
	{
		public static string modname;

		public static string modder;

		private static string com;

		static UManager()
		{
			modname = "adjust";
			modder = "Shogoho";
		}

		public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders)
		{
			s.SetField<UnitBlueprint>(me, "Riders", (object)riders);
		}

		public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
		{
			//IL_001f: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Expected O, but got Unknown
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Expected O, but got Unknown
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Expected O, but got Unknown
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Expected O, but got Unknown
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Expected O, but got Unknown
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Expected O, but got Unknown
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Expected O, but got Unknown
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Expected O, but got Unknown
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Expected O, but got Unknown
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Expected O, but got Unknown
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Expected O, but got Unknown
			//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Expected O, but got Unknown
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Expected O, but got Unknown
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ef: Expected O, but got Unknown
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Expected O, but got Unknown
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_0698: Unknown result type (might be due to invalid IL or missing references)
			//IL_074b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Unknown result type (might be due to invalid IL or missing references)
			//IL_0727: Expected O, but got Unknown
			//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0938: Unknown result type (might be due to invalid IL or missing references)
			//IL_0869: Unknown result type (might be due to invalid IL or missing references)
			//IL_086f: Expected O, but got Unknown
			//IL_088a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Expected O, but got Unknown
			//IL_08ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b1: Expected O, but got Unknown
			//IL_08cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d2: Expected O, but got Unknown
			//IL_08ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f3: Expected O, but got Unknown
			//IL_090e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0914: Expected O, but got Unknown
			//IL_09a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b66: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd1: Expected O, but got Unknown
			//IL_0cec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf2: Expected O, but got Unknown
			//IL_0d0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d13: Expected O, but got Unknown
			//IL_0dfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db7: Expected O, but got Unknown
			//IL_0dd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddb: Expected O, but got Unknown
			//IL_0e7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eeb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_101a: Unknown result type (might be due to invalid IL or missing references)
			//IL_108b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1103: Unknown result type (might be due to invalid IL or missing references)
			//IL_1169: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1266: Unknown result type (might be due to invalid IL or missing references)
			//IL_121b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1221: Expected O, but got Unknown
			//IL_123c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1242: Expected O, but got Unknown
			//IL_12d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1316: Unknown result type (might be due to invalid IL or missing references)
			//IL_1375: Unknown result type (might be due to invalid IL or missing references)
			//IL_14df: Unknown result type (might be due to invalid IL or missing references)
			//IL_1410: Unknown result type (might be due to invalid IL or missing references)
			//IL_1416: Expected O, but got Unknown
			//IL_1431: Unknown result type (might be due to invalid IL or missing references)
			//IL_1437: Expected O, but got Unknown
			//IL_1452: Unknown result type (might be due to invalid IL or missing references)
			//IL_1458: Expected O, but got Unknown
			//IL_1473: Unknown result type (might be due to invalid IL or missing references)
			//IL_1479: Expected O, but got Unknown
			//IL_1494: Unknown result type (might be due to invalid IL or missing references)
			//IL_149a: Expected O, but got Unknown
			//IL_14b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_14bb: Expected O, but got Unknown
			//IL_15b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1544: Unknown result type (might be due to invalid IL or missing references)
			//IL_154a: Expected O, but got Unknown
			//IL_1565: Unknown result type (might be due to invalid IL or missing references)
			//IL_156b: Expected O, but got Unknown
			//IL_1586: Unknown result type (might be due to invalid IL or missing references)
			//IL_158c: Expected O, but got Unknown
			//IL_161a: Unknown result type (might be due to invalid IL or missing references)
			//IL_168b: Unknown result type (might be due to invalid IL or missing references)
			//IL_16fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1749: Unknown result type (might be due to invalid IL or missing references)
			//IL_17cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_182b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1899: Unknown result type (might be due to invalid IL or missing references)
			//IL_18f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1966: Unknown result type (might be due to invalid IL or missing references)
			//IL_19f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_19c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_19ce: Expected O, but got Unknown
			//IL_1a3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1aad: Unknown result type (might be due to invalid IL or missing references)
			//IL_1af3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b81: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bce: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c74: Unknown result type (might be due to invalid IL or missing references)
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SHOGUN"]).Name)
			{
				unit.holdinigWithTwoHands = true;
				unit.health = 1100f;
				unit.targetingPriorityMultiplier *= 0.9f;
				unit.balanceForceMultiplier *= 1.1f;
				unit.balanceMultiplier *= 1.1f;
				unit.massMultiplier *= 2f;
				unit.attackSpeedMultiplier *= 2f;
				SLMATool.UnitCost(unit, 3500);
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5]
				{
					(GameObject)SLMALoader.SDic["moves"]["BlockShogun"],
					(GameObject)SLMALoader.SDic["moves"]["Sensei_Dodge"],
					(GameObject)SLMALoader.SDic["moves"]["Shogun_Dodge"],
					(GameObject)SLMALoader.SDic["moves"]["SwordArtParry_Piratequeen"],
					(GameObject)SLMALoader.SDic["moves"]["Move_Shogun_Slash"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_REDJADE"]).Name)
			{
				unit.health = 2200f;
				unit.damageMultiplier *= 3f;
				unit.attackSpeedMultiplier *= 1.1f;
				SLMATool.UnitCost(unit, 3500);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_SUPERBOXER"]).Name)
			{
				unit.health = 6750f;
				unit.damageMultiplier *= 3f;
				unit.rangeMultiplier *= 5f;
				SLMATool.UnitCost(unit, 10000);
				unit.massMultiplier *= 50f;
				unit.movementSpeedMuiltiplier *= 1.75f;
				unit.targetingPriorityMultiplier *= 50f;
				unit.attackSpeedMultiplier *= -1f;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[12]
				{
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ArmLeft"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ArmRight"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ElbowLeft"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ElbowRight"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Torso"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_LegRight"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ArmLeft"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_LegLeft"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Head"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_KneeLeft"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Hip"],
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_KneeRight"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_SUPERPEASANT"]).Name)
			{
				unit.damageMultiplier = float.MaxValue;
				unit.movementSpeedMuiltiplier = 10f;
				SLMATool.UnitCost(unit, 9999999);
				unit.attackSpeedMultiplier *= -1f;
				unit.health = float.MaxValue;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_MINOTAUR"]).Name)
			{
				unit.damageMultiplier *= 1.2f;
				SLMATool.UnitCost(unit, 1600);
				unit.health = 2000f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_MAMMOTH"]).Name)
			{
				unit.damageMultiplier *= 1.55f;
				unit.health = 3750f;
				unit.targetingPriorityMultiplier *= 2f;
				SLMATool.UnitCost(unit, 2200);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_THROWER_BOULDER"]).Name)
			{
				unit.damageMultiplier *= 1.2f;
				unit.health = 200f;
				SLMATool.UnitCost(unit, 200);
				unit.attackSpeedMultiplier *= 2.2f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_FANTASYASSASSIN"]).Name)
			{
				unit.damageMultiplier *= 0.5f;
				unit.health = 20f;
				unit.attackSpeedMultiplier *= 0.88f;
				SLMATool.UnitCost(unit, 200);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_KNIGHT"]).Name)
			{
				unit.damageMultiplier *= 1.8f;
				unit.healthMultiplier *= 1.8f;
				SLMATool.UnitCost(unit, 650);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ULLR"]).Name)
			{
				unit.damageMultiplier *= 3.3f;
				SLMATool.UnitCost(unit, 3000);
				unit.rangeMultiplier *= 0.75f;
				unit.massMultiplier *= 3f;
				unit.attackSpeedMultiplier *= 1.5f;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { (GameObject)SLMALoader.SDic["moves"]["Wings_Leg_SuperP"] };
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ARTEMIS"]).Name)
			{
				unit.damageMultiplier *= 1.4f;
				SLMATool.UnitCost(unit, 5500);
				unit.attackSpeedMultiplier *= 1.3f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_WARGLAIVE"]).Name)
			{
				unit.damageMultiplier *= 2.105f;
				unit.attackSpeedMultiplier *= -1f;
				unit.massMultiplier *= 1.5f;
				unit.movementSpeedMuiltiplier *= 1.2f;
				unit.balanceForceMultiplier *= 1.1f;
				unit.balanceMultiplier *= 1.1f;
				SLMATool.UnitCost(unit, 2000);
				unit.targetingPriorityMultiplier *= 0.9f;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[6]
				{
					(GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Head"],
					(GameObject)SLMALoader.SDic["moves"]["SwordArtParry_Piratequeen"],
					(GameObject)SLMALoader.SDic["moves"]["SkeletonGiant_Damage_R"],
					(GameObject)SLMALoader.SDic["moves"]["SkeletonGiant_Damage_L"],
					(GameObject)SLMALoader.SDic["moves"]["ProjectileDodge_Painter"],
					(GameObject)SLMALoader.SDic["moves"]["Sensei_Dodge"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_GOOD_CLERIC"]).Name)
			{
				unit.damageMultiplier *= 1.5f;
				unit.attackSpeedMultiplier *= 1.25f;
				SLMATool.UnitCost(unit, 800);
				unit.health = 850f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_WITCH_BROOM"]).Name)
			{
				unit.damageMultiplier *= 0.1f;
				unit.attackSpeedMultiplier *= 0.25f;
				unit.healthMultiplier *= 0.5f;
				SLMATool.UnitCost(unit, 1000);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_DARKKING"]).Name)
			{
				unit.damageMultiplier *= 0.5f;
				unit.attackSpeedMultiplier *= 0.8f;
				unit.healthMultiplier *= 0.8f;
				SLMATool.UnitCost(unit, 3000);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_CHEERLEADER"]).Name)
			{
				unit.damageMultiplier *= 0f;
				unit.healthMultiplier *= 0.1f;
				SLMATool.UnitCost(unit, 500);
				unit.attackSpeedMultiplier *= 0.1f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_MACESPINNER"]).Name)
			{
				unit.damageMultiplier *= 1.5f;
				unit.healthMultiplier *= 1.25f;
				SLMATool.UnitCost(unit, 500);
				unit.attackSpeedMultiplier *= 2f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"]).Name)
			{
				unit.damageMultiplier *= 0f;
				unit.maxSizeRandom *= 0.9f;
				SLMATool.UnitCost(unit, 500);
				unit.minSizeRandom *= 0.9f;
				unit.health = 1f;
				unit.targetingPriorityMultiplier *= 0.79f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_SQUIRE"]).Name)
			{
				unit.damageMultiplier *= 1.1f;
				unit.health = 240f;
				SLMATool.UnitCost(unit, 100);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SENSEI"]).Name)
			{
				unit.health = 490f;
				unit.sizeMultiplier *= 1.08f;
				unit.targetingPriorityMultiplier *= 0.8f;
				SLMATool.UnitCost(unit, 3500);
				unit.movementSpeedMuiltiplier *= 1.3f;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3]
				{
					(GameObject)SLMALoader.SDic["moves"]["Sensei_Dodge"],
					(GameObject)SLMALoader.SDic["moves"]["ProjectileDodge_Painter"],
					(GameObject)SLMALoader.SDic["moves"]["Move_Sensei_Tornado"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_TIMENINJATRANSFORMED"]).Name)
			{
				unit.healthMultiplier *= 1.35f;
				unit.damageMultiplier *= 2f;
				unit.holdinigWithTwoHands = false;
				unit.healthMultiplier *= 1.1f;
				SLMATool.UnitCost(unit, 3000);
				unit.LeftWeapon = (GameObject)SLMALoader.SDic["weapons"]["TimeNinjaGauntlet"];
				unit.RightWeapon = (GameObject)SLMALoader.SDic["weapons"]["TimeNinjaGauntlet"];
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BALLOONER"]).Name)
			{
				unit.healthMultiplier *= 0.001f;
				unit.attackSpeedMultiplier *= 0.45f;
				unit.movementSpeedMuiltiplier *= 0.8f;
				SLMATool.UnitCost(unit, 120);
				unit.targetingPriorityMultiplier *= 1.45f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BOMBCANNON"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.3f;
				unit.damageMultiplier *= 10f;
				unit.healthMultiplier *= 2f;
				SLMATool.UnitCost(unit, 1500);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_CANNON"]).Name)
			{
				unit.attackSpeedMultiplier *= 0.79f;
				SLMATool.UnitCost(unit, 1000);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_VLAD"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.12f;
				unit.damageMultiplier *= 1.295f;
				unit.healthMultiplier *= 2f;
				SLMATool.UnitCost(unit, 1800);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_CAVALRYONHORSE"]).Name)
			{
				unit.attackSpeedMultiplier *= 1f;
				unit.damageMultiplier *= 40f;
				SLMATool.UnitCost(unit, 1800);
				unit.healthMultiplier *= 3.5f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_WITCH"]).Name)
			{
				unit.attackSpeedMultiplier *= 0.3f;
				unit.damageMultiplier *= 0.15f;
				unit.healthMultiplier *= 0.25f;
				SLMATool.UnitCost(unit, 1000);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_CAVALRY_KNIGHT"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.1f;
				unit.damageMultiplier *= 3.571f;
				unit.targetingPriorityMultiplier *= 0.77f;
				unit.healthMultiplier *= 6f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_CHARIOTRIDER"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.09f;
				unit.damageMultiplier *= 2f;
				unit.healthMultiplier *= 11f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_CHARIOT"]).Name)
			{
				SLMATool.UnitCost(unit, 1800);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_HORSE_CHARIOT"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.5f;
				unit.damageMultiplier *= 500f;
				SLMATool.UnitCost(unit, 1800);
				unit.healthMultiplier *= 3.8f;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
				{
					(GameObject)SLMALoader.SDic["moves"]["SkeletonGiant_Damage_R"],
					(GameObject)SLMALoader.SDic["moves"]["SkeletonGiant_Damage_L"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_DARKP"]).Name)
			{
				unit.damageMultiplier = float.MaxValue;
				unit.movementSpeedMuiltiplier = 2f;
				SLMATool.UnitCost(unit, 9999999);
				unit.attackSpeedMultiplier *= 7.5f;
				unit.health = float.MaxValue;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_DAVINCI"]).Name)
			{
				unit.healthMultiplier *= 7f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_QUICKDRAW"]).Name)
			{
				unit.healthMultiplier *= 3.8f;
				unit.attackSpeedMultiplier *= 1.3f;
				SLMATool.UnitCost(unit, 1200);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_VALKYRIE"]).Name)
			{
				unit.healthMultiplier *= 3.1f;
				unit.attackSpeedMultiplier *= 1.1f;
				unit.damageMultiplier *= 1.5f;
				SLMATool.UnitCost(unit, 500);
				unit.targetingPriorityMultiplier *= 0.9f;
				unit.movementSpeedMuiltiplier *= 4f;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[6]
				{
					(GameObject)SLMALoader.SDic["moves"]["SwordArtParry_Piratequeen"],
					(GameObject)SLMALoader.SDic["moves"]["ProjectileDodge_Quickdraw"],
					(GameObject)SLMALoader.SDic["moves"]["Sensei_Dodge"],
					(GameObject)SLMALoader.SDic["moves"]["SkeletonGiant_Damage_R"],
					(GameObject)SLMALoader.SDic["moves"]["SkeletonGiant_Damage_L"],
					(GameObject)SLMALoader.SDic["moves"]["Wings"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_TAEKWONDO"]).Name)
			{
				unit.healthMultiplier *= 3.3f;
				unit.targetingPriorityMultiplier *= 0.9f;
				SLMATool.UnitCost(unit, 400);
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3]
				{
					(GameObject)SLMALoader.SDic["moves"]["Taekwondo_Damage_R"],
					(GameObject)SLMALoader.SDic["moves"]["JumpKick_Taekwondo_L"],
					(GameObject)SLMALoader.SDic["moves"]["Sensei_Dodge"]
				};
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_EVIL_CLERIC"]).Name)
			{
				unit.damageMultiplier *= 1.5f;
				unit.attackSpeedMultiplier *= 1.25f;
				SLMATool.UnitCost(unit, 800);
				unit.health = 850f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_HOPLITE"]).Name)
			{
				unit.healthMultiplier *= 2.2f;
				unit.attackSpeedMultiplier *= 1.1f;
				unit.damageMultiplier *= 1.5f;
				SLMATool.UnitCost(unit, 180);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_BRAWLER"]).Name)
			{
				unit.healthMultiplier *= 2.2f;
				unit.attackSpeedMultiplier *= 1.1f;
				SLMATool.UnitCost(unit, 220);
				unit.damageMultiplier *= 1.5f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CHIEFTAIN"]).Name)
			{
				unit.healthMultiplier *= 1.7f;
				SLMATool.UnitCost(unit, 400);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_BONEMAGE"]).Name)
			{
				unit.attackSpeedMultiplier *= 3f;
				unit.healthMultiplier *= 1.2f;
				unit.damageMultiplier *= 2f;
				SLMATool.UnitCost(unit, 300);
				unit.rangeMultiplier *= 1.2f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_ARCHER_ICE"]).Name)
			{
				unit.attackSpeedMultiplier *= 3f;
				unit.healthMultiplier *= 1.2f;
				SLMATool.UnitCost(unit, 160);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_PEASANT"]).Name)
			{
				unit.attackSpeedMultiplier *= 0.75f;
				unit.healthMultiplier *= 0.2f;
				SLMATool.UnitCost(unit, 30);
				unit.targetingPriorityMultiplier *= 0.4f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_ELEPHANT"]).Name)
			{
				unit.healthMultiplier *= 1.75f;
				unit.targetingPriorityMultiplier *= 1.1f;
				SLMATool.UnitCost(unit, 2000);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_PITCHFORK"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.2f;
				unit.healthMultiplier *= 1.4f;
				SLMATool.UnitCost(unit, 80);
				unit.targetingPriorityMultiplier *= 1.1f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_NINJA"]).Name)
			{
				unit.attackSpeedMultiplier *= 1.8f;
				unit.healthMultiplier *= 1.3f;
				SLMATool.UnitCost(unit, 500);
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { (GameObject)SLMALoader.SDic["moves"]["ProjectileDodge_Cool2"] };
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_SKELETONWARRIOR"]).Name)
			{
				unit.healthMultiplier *= 1.4f;
				SLMATool.UnitCost(unit, 80);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_POTIONSELLER"]).Name)
			{
				unit.attackSpeedMultiplier *= 2f;
				unit.damageMultiplier *= 1.5f;
				SLMATool.UnitCost(unit, 340);
				unit.targetingPriorityMultiplier *= 1.2f;
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_JESTER"]).Name)
			{
				unit.health = 225f;
				SLMATool.UnitCost(unit, 300);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_TEACHER"]).Name)
			{
				unit.health = 300f;
				unit.attackSpeedMultiplier *= -1f;
				unit.balanceForceMultiplier *= 1.15f;
				unit.balanceMultiplier *= 1.15f;
				unit.damageMultiplier *= 1.249f;
				SLMATool.UnitCost(unit, 200);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_HAY"]).Name)
			{
				unit.healthMultiplier *= 2f;
				SLMATool.UnitCost(unit, 140);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_SARISSA"]).Name)
			{
				unit.healthMultiplier *= 2.2f;
				unit.attackSpeedMultiplier *= 1.1f;
				SLMATool.UnitCost(unit, 120);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_PROTECTOR"]).Name)
			{
				unit.healthMultiplier *= 1.6f;
				SLMATool.UnitCost(unit, 80);
			}
			if (unit.Name == ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_BOXER"]).Name)
			{
				unit.healthMultiplier *= 1.75f;
				SLMATool.UnitCost(unit, 450);
			}
		}

		public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			Debug.Log((object)"Hey");
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Renderer[] componentsInChildren = cloth.GetComponentsInChildren<Renderer>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].materials = (Material[])(object)new Material[1] { (Material)SLMALoader.SDic["materials"]["Glow_Neon_Green_143734"] };
				}
			}
		}

		public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Transform transform = proj.transform;
				transform.localScale *= 3f;
			}
		}

		public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db)
		{
		}

		public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db)
		{
			//IL_0028: 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)
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Transform head = unit.data.head;
				head.localScale *= 2f;
			}
		}

		public static void Init(LandfallContentDatabase db)
		{
		}

		public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
		{
		}
	}
	[BepInPlugin("SW", "SW", "1.0.0")]
	internal class Loader : BaseUnityPlugin
	{
		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine("call");
		}

		private IEnumerator call()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
			yield return (object)new WaitForSecondsRealtime(0.3f);
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			UManager.Init(landfallContentDatabase);
			new Harmony(UManager.modname).PatchAll();
			GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons), GOSLMA.EditWeapons)));
			GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes), GOSLMA.EditClothes)));
			GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
			GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
			GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles), GOSLMA.EditProjectiles)));
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int i = 0; i < array.Length; i++)
			{
				UManager.EditBlueprint(array[i], landfallContentDatabase);
			}
			Debug.Log((object)("Loaded " + UManager.modname + " Successfully"));
			Debug.Log((object)(UManager.modname + "strengtheningandweakening"));
			Debug.Log((object)(UManager.modder + "aaa"));
		}
	}
}
public class Item : MonoBehaviour
{
	public enum kind
	{
		Weapon,
		Cloth,
		Skill,
		Unit,
		Projectile,
		Other
	}

	public string name;

	public kind Kind;
}
namespace STAWE
{
	public class MyModItems : MonoBehaviour
	{
		private static Dictionary<string, Item> items;

		private static MyModItems instance { get; set; }

		public static MyModItems GetInstance()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)instance == (Object)null)
			{
				instance = new GameObject("MyModItems").AddComponent<MyModItems>();
				Object.DontDestroyOnLoad((Object)(object)instance);
			}
			return instance;
		}

		public void AddItem(Item item)
		{
			items.Add(item.name, item);
		}

		public Item GetItem(string name)
		{
			Item value = new Item
			{
				name = null,
				Kind = Item.kind.Other
			};
			items.TryGetValue(name, out value);
			return value;
		}
	}
}