Decompiled source of WinterFest v1.0.3

Winterfest.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
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 System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.AI.Components.Modifiers;
using Landfall.TABS.GameState;
using Landfall.TABS.UnitEditor;
using SLMA;
using TFBGames;
using UnityEngine;
using UnityEngine.SceneManagement;
using WinterfestFunctions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("WinterFest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("GeeztJeez")]
[assembly: AssemblyProduct("WinterFest")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7acfaef0-7669-4401-8bff-5a9a02e18c75")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace WinterFest
{
	public static class UManager
	{
		public class Utility : MonoBehaviour
		{
			public static class ItemCategorizer
			{
				public static void SetTag(GameObject item, string categoryName = "Winterfest", TagType tagType = 0)
				{
					//IL_0018: 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_0021: 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)
					try
					{
						CharacterItem componentInChildren = item.GetComponentInChildren<CharacterItem>();
						if (Object.op_Implicit((Object)(object)componentInChildren))
						{
							componentInChildren.tags = new List<Tag>
							{
								new Tag
								{
									tagType = tagType,
									value = categoryName
								}
							};
						}
					}
					catch (Exception ex)
					{
						Debug.Log((object)ex);
					}
				}
			}

			public static GameObject LoadBundleGameObject(string name)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (GameObject)bundle.LoadAsset(name);
			}

			public static Material LoadBundleMaterial(string name)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return (Material)bundle.LoadAsset(name);
			}

			public static Sprite LoadBundleTextureToSprite(string name)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				Texture2D val = (Texture2D)bundle.LoadAsset(name);
				((Texture)val).filterMode = (FilterMode)0;
				return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
			}
		}

		private static string comment;

		public static AssetBundle bundle;

		public static void SetBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
		{
			//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_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Expected O, but got Unknown
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Expected O, but got Unknown
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Expected O, but got Unknown
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Expected O, but got Unknown
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Expected O, but got Unknown
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Expected O, but got Unknown
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Expected O, but got Unknown
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Expected O, but got Unknown
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Expected O, but got Unknown
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Expected O, but got Unknown
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Expected O, but got Unknown
			//IL_0532: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Expected O, but got Unknown
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_0559: Expected O, but got Unknown
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Expected O, but got Unknown
			//IL_0595: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Expected O, but got Unknown
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bc: Expected O, but got Unknown
			//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Expected O, but got Unknown
			//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: Expected O, but got Unknown
			//IL_061a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Expected O, but got Unknown
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0642: Expected O, but got Unknown
			//IL_0666: Unknown result type (might be due to invalid IL or missing references)
			//IL_066d: Expected O, but got Unknown
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Expected O, but got Unknown
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0720: Unknown result type (might be due to invalid IL or missing references)
			//IL_0725: Unknown result type (might be due to invalid IL or missing references)
			//IL_0730: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Expected O, but got Unknown
			//IL_076d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0772: Unknown result type (might be due to invalid IL or missing references)
			//IL_0788: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Unknown result type (might be due to invalid IL or missing references)
			//IL_079f: Expected O, but got Unknown
			//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Expected O, but got Unknown
			//IL_0836: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0851: Unknown result type (might be due to invalid IL or missing references)
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_0861: Unknown result type (might be due to invalid IL or missing references)
			//IL_0868: Expected O, but got Unknown
			//IL_0898: Unknown result type (might be due to invalid IL or missing references)
			//IL_089d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ca: Expected O, but got Unknown
			//IL_08fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0915: Unknown result type (might be due to invalid IL or missing references)
			//IL_091a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Expected O, but got Unknown
			//IL_0961: Unknown result type (might be due to invalid IL or missing references)
			//IL_0966: Unknown result type (might be due to invalid IL or missing references)
			//IL_097c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0981: Unknown result type (might be due to invalid IL or missing references)
			//IL_098c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0993: Expected O, but got Unknown
			//IL_09c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fb: Expected O, but got Unknown
			//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a64: Expected O, but got Unknown
			//IL_0aa2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afe: Expected O, but got Unknown
			//IL_0b54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5a: Unknown result type (might be due to invalid IL or missing references)
			if (unit.Entity.Name == "Miraculus")
			{
				SLMATool.UnitCost(unit, 20000);
				unit.UnitBase = UPool.MyPool.GetObject("Miraculus_Base");
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Farmer Attack Vocals/Halfling");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Farmer Death Vocals/Halfling");
				s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Skeleton");
				s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.5f);
				unit.health = 6000f;
				unit.minSizeRandom = 1f;
				unit.maxSizeRandom = 1f;
				unit.sizeMultiplier = 1f;
				unit.stepMultiplier = 1.4f;
				unit.massMultiplier = 100f;
				unit.balanceMultiplier = 1.4f;
				unit.animationMultiplier = 1.2f;
				unit.balanceForceMultiplier = 1.2f;
				unit.movementSpeedMuiltiplier = 1.2f;
				unit.holdinigWithTwoHands = true;
				unit.RightWeapon = UPool.MyPool.GetObject("JoyousBlade");
				unit.m_props = (GameObject[])(object)new GameObject[7]
				{
					(GameObject)SLMALoader.SDic["clothes"]["VikingHelmet001"],
					(GameObject)SLMALoader.SDic["clothes"]["Viking_Ullr_Shirt001"],
					(GameObject)SLMALoader.SDic["clothes"]["misc_shirt002"],
					(GameObject)SLMALoader.SDic["clothes"]["Western_gloves002"],
					(GameObject)SLMALoader.SDic["clothes"]["Ottoman_pants002"],
					(GameObject)SLMALoader.SDic["clothes"]["Pirate_Shoes001"],
					UPool.MyPool.GetObject("ContagiousSmile")
				};
				PropItemData[] array = (PropItemData[])(object)new PropItemData[6];
				int num = 0;
				PropItemData val = new PropItemData();
				val.m_colors = new int[3] { 76, 58, 0 };
				val.m_isTeamColor = new bool[3] { false, false, true };
				array[num] = val;
				PropItemData val2 = new PropItemData();
				val2.m_colors = new int[5] { 63, 53, 63, -1, 76 };
				val2.m_isTeamColor = new bool[5];
				array[1] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[2] { 73, 63 };
				val2.m_isTeamColor = new bool[2];
				array[2] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[1] { 62 };
				val2.m_isTeamColor = new bool[1];
				array[3] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[1];
				val2.m_isTeamColor = new bool[1] { true };
				array[4] = val2;
				int num2 = 5;
				val = new PropItemData();
				val.m_colors = new int[4] { 0, -1, 76, 76 };
				val.m_isTeamColor = new bool[4] { true, false, false, false };
				array[num2] = val;
				unit.m_propData = array;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5]
				{
					(GameObject)SLMALoader.SDic["moves"]["Small_Hover"],
					UPool.MyPool.GetObject("Move_ShiningStar"),
					UPool.MyPool.GetObject("Move_MarchingPressure"),
					UPool.MyPool.GetObject("Move_Masochist"),
					UPool.MyPool.GetObject("Move_DopamineOverdose")
				};
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
			}
			if (unit.Entity.Name == "Cryobomination")
			{
				SLMATool.UnitCost(unit, 35000);
				unit.Entity.SetUnlockKey("SECRET_CRYOBOMINATION");
				unit.UnitBase = UPool.MyPool.GetObject("Cryobomination_Base");
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Halloween Attack Vocals/Reaper");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Halloween Death Vocals/Reaper");
				s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Skeleton");
				s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
				unit.health = 40000f;
				unit.minSizeRandom = 1f;
				unit.maxSizeRandom = 1f;
				unit.sizeMultiplier = 1f;
				unit.stepMultiplier = 0.75f;
				unit.massMultiplier = 800f;
				unit.animationMultiplier = 0.75f;
				unit.movementSpeedMuiltiplier = 0.5f;
				unit.LeftWeapon = UPool.MyPool.GetObject("WinternSpear");
				unit.RightWeapon = UPool.MyPool.GetObject("UndeadLordGreatsword");
				unit.m_props = (GameObject[])(object)new GameObject[12]
				{
					(GameObject)SLMALoader.SDic["clothes"]["halloween_Shirt003"],
					(GameObject)SLMALoader.SDic["clothes"]["Medieval_Cape004"],
					(GameObject)SLMALoader.SDic["clothes"]["halloween_pants001"],
					(GameObject)SLMALoader.SDic["clothes"]["Farmer_Skirt001"],
					(GameObject)SLMALoader.SDic["clothes"]["Asia_ShoulderPad002"],
					(GameObject)SLMALoader.SDic["clothes"]["spooky_banshee_armbands_001"],
					(GameObject)SLMALoader.SDic["clothes"]["spooky_necromancer_armband_001"],
					(GameObject)SLMALoader.SDic["clothes"]["Halloween_legguard001"],
					(GameObject)SLMALoader.SDic["clothes"]["Crusader_KneeArmor001"],
					(GameObject)SLMALoader.SDic["clothes"]["Crusader_Knight_Boots"],
					(GameObject)SLMALoader.SDic["clothes"]["Ancient_ShoulderPad001"],
					UPool.MyPool.GetObject("CryobominationHead")
				};
				PropItemData[] array2 = (PropItemData[])(object)new PropItemData[11];
				PropItemData val2 = new PropItemData();
				val2.m_colors = new int[1] { 49 };
				val2.m_isTeamColor = new bool[1];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[0] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[3] { 49, 76, 46 };
				val2.m_isTeamColor = new bool[3];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[1] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[3] { 45, 49, 49 };
				val2.m_isTeamColor = new bool[3];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[2] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[1] { 48 };
				val2.m_isTeamColor = new bool[1];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[3] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[2] { 49, 76 };
				val2.m_isTeamColor = new bool[2];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[4] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[1] { 76 };
				val2.m_isTeamColor = new bool[1];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[5] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[1] { 76 };
				val2.m_isTeamColor = new bool[1];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[6] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[2] { 49, 76 };
				val2.m_isTeamColor = new bool[2];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[7] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[2] { 76, 47 };
				val2.m_isTeamColor = new bool[2];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[8] = val2;
				val2 = new PropItemData();
				val2.m_colors = new int[4] { 76, -1, 76, 45 };
				val2.m_isTeamColor = new bool[4];
				val2.m_positionOffset = new Vector3(0f, 0f, 0f);
				val2.m_scale = new Vector3(1f, 1f, 1f);
				array2[9] = val2;
				int num3 = 10;
				PropItemData val3 = new PropItemData();
				val3.m_colors = new int[3] { 0, 76, 49 };
				val3.m_isTeamColor = new bool[3] { true, false, false };
				val3.m_positionOffset = new Vector3(0f, 0f, 0f);
				val3.m_scale = new Vector3(1f, 1f, 1f);
				array2[num3] = val3;
				unit.m_propData = array2;
				unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5]
				{
					(GameObject)SLMALoader.SDic["moves"]["Small_Hover"],
					UPool.MyPool.GetObject("Move_FrostyStorm"),
					UPool.MyPool.GetObject("Move_WinterlandSpirit"),
					UPool.MyPool.GetObject("Move_Cryopathic"),
					UPool.MyPool.GetObject("Move_WinterStormFog")
				};
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
			}
		}

		public static void SetMoves(GameObject move, LandfallContentDatabase db)
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_ShiningStar"))
			{
				move.GetComponentInChildren<SpawnObject>().objectToSpawn = UPool.MyPool.GetObject("P_UltiStarr");
			}
			if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_WinterlandSpirit"))
			{
				SkeletalRemains skeletalRemains = move.AddComponent<SkeletalRemains>();
				skeletalRemains.halfStiffy = Utility.LoadBundleGameObject("StiffyRemains");
				skeletalRemains.trailMaterial = (Material)SLMALoader.SDic["materials"]["EmberBrighter_Dark"];
				skeletalRemains.effectBase = (UnitEffectBase)(object)((GameObject)SLMALoader.SDic["effects"]["E_IceUllrEffect"]).GetComponentInChildren<Effect_IceArrow>();
			}
			if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Cryopathic"))
			{
				move.AddComponent<AddCryopathic>();
			}
			if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_MarchingPressure"))
			{
				move.AddComponent<MarchingPressureMovement>().tracker = Utility.LoadBundleGameObject("MarchingPressureMarker");
			}
			if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Masochist"))
			{
				move.AddComponent<Masochist>();
			}
			if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_DopamineOverdose"))
			{
				move.AddComponent<DopamineOverdose>();
			}
		}

		public static void SetUnits(Unit unit, LandfallContentDatabase db)
		{
			//IL_0026: 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_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: 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_0085: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Expected O, but got Unknown
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Expected O, but got Unknown
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			if (unit.Entity.Name == "Miraculus_Base")
			{
				Transform transform = ((Component)unit).gameObject.transform;
				transform.localScale *= 1.5f;
				unit.neverStopRunning = true;
				unit.data.takeFallDamage = false;
				unit.targetingPriorityMultiplier = 2f;
				((Component)unit).GetComponentInChildren<RigidbodyHolder>().randomizeRigidbodySizes = false;
				TeamColor[] componentsInChildren = ((Component)unit).GetComponentsInChildren<TeamColor>();
				foreach (TeamColor obj in componentsInChildren)
				{
					obj.redMaterial = new Material(obj.redMaterial);
					obj.blueMaterial = new Material(obj.blueMaterial);
					obj.redMaterial.color = new Color(0.5f, 0.3f, 0.3f);
					obj.blueMaterial.color = new Color(0.3f, 0.3f, 0.5f);
				}
				Material val = new Material(Shader.Find("Standard"))
				{
					color = new Color(2f, 2f, 2f)
				};
				GameObject val2 = UPool.MyPool.AddObject("Miraculus_Eye", ((Component)unit).GetComponentInChildren<EyeSpawner>().eyeObject, true, (HideFlags)52, (Sprite)null, 0, false);
				((Renderer)val2.GetComponentsInChildren<MeshRenderer>()[0]).material = val;
				((Component)val2.GetComponentsInChildren<MeshRenderer>()[1]).gameObject.SetActive(false);
				val2.AddComponent<RandomEyeSizes>();
				((Component)unit).GetComponentInChildren<EyeSpawner>().randomizeEyes = false;
				((Component)unit).GetComponentInChildren<EyeSpawner>().eyeObject = val2;
				ParticleTeamColor[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren<ParticleTeamColor>();
				foreach (ParticleTeamColor obj2 in componentsInChildren2)
				{
					obj2.redMat = val;
					obj2.blueMat = val;
					obj2.redColor = new Color(2f, 2f, 2f);
					obj2.blueColor = new Color(2f, 2f, 2f);
				}
				ParticleSystem[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren<ParticleSystem>();
				foreach (ParticleSystem obj3 in componentsInChildren3)
				{
					obj3.startSize *= 10f;
					obj3.startColor = new Color(2f, 2f, 2f);
				}
				ParticleSystemRenderer[] componentsInChildren4 = ((Component)unit).GetComponentsInChildren<ParticleSystemRenderer>();
				for (int j = 0; j < componentsInChildren4.Length; j++)
				{
					((Renderer)componentsInChildren4[j]).material = val;
				}
			}
			if (!(((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("Cryobomination_Base")).name))
			{
				return;
			}
			Transform transform2 = ((Component)unit).transform;
			transform2.localScale *= 1.5f;
			Renderer[] componentsInChildren5 = ((Component)unit).GetComponentsInChildren<Renderer>();
			foreach (Renderer val3 in componentsInChildren5)
			{
				List<Material> list = new List<Material>();
				Material[] materials = val3.materials;
				for (int k = 0; k < materials.Length; k++)
				{
					_ = materials[k];
					list.Add(new Material((Material)SLMALoader.SDic["materials"]["Axemetal"])
					{
						color = Color.black
					});
				}
				val3.materials = list.ToArray();
			}
			unit.targetingPriorityMultiplier = 50f;
			unit.data.canFall = false;
			OnDeathFreeze onDeathFreeze = ((Component)unit).gameObject.AddComponent<OnDeathFreeze>();
			onDeathFreeze.material = (Material)SLMALoader.SDic["materials"]["IceArrowIce"];
			onDeathFreeze.color = ((GameObject)SLMALoader.SDic["effects"]["E_IceArrowEffect"]).GetComponentInChildren<Effect_IceArrow>().color;
			onDeathFreeze.soundEffect = "Effects/IceArrowEffect";
			((Component)unit).GetComponentInChildren<RigidbodyHolder>().randomizeRigidbodySizes = false;
			Object.Destroy((Object)(object)((Component)unit).GetComponentInChildren<EyeSpawner>());
		}

		public static void Init(LandfallContentDatabase db)
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Expected O, but got Unknown
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Expected O, but got Unknown
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Expected O, but got Unknown
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Expected O, but got Unknown
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Expected O, but got Unknown
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ee: Expected O, but got Unknown
			//IL_061c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0630: Expected O, but got Unknown
			LoadBundle("winterfestbundle");
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Create Custom Object";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Sprite val = Utility.LoadBundleTextureToSprite("icon_miraculus");
			Sprite val2 = Utility.LoadBundleTextureToSprite("icon_iceabomination");
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Create Custom Faction";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Faction val3 = SLMATool.CreateFaction("Winterland", (UnitBlueprint[])null, Utility.LoadBundleTextureToSprite("factionicon_winterland"), 4123212);
			val3.m_FactionColor = new Color(0.5f, 0.5f, 0.8f);
			val3.index = 4;
			val3.m_FactionCatagory = (FactionCatagory)0;
			s.SetField<Faction>(val3, "m_isSecret", (object)true);
			s.SetField<Faction>(val3, "m_lockSecrets", (object)true);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Create Custom Units";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			SLMATool.CreateUnit("Miraculus", (UnitBlueprint)null, val3, val);
			SLMATool.CreateUnit("Cryobomination", (UnitBlueprint)null, val3, val2);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Weapons";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("WinternSpear", Utility.LoadBundleGameObject("WinternSpear"), true, (HideFlags)52, val2, 6443242, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("UndeadLordGreatsword", Utility.LoadBundleGameObject("UndeadLordGreatsword"), true, (HideFlags)52, val2, 6546546, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("JoyousBlade", Utility.LoadBundleGameObject("JoyousBlade"), true, (HideFlags)52, val, 76324151, true), "Winterfest", (TagType)0);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Clothing";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("CryobominationHead", Utility.LoadBundleGameObject("CryobominationHead"), true, (HideFlags)52, val2, 432324321, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("ContagiousSmile", Utility.LoadBundleGameObject("ContagiousSmile"), true, (HideFlags)52, val, 605284341, true), "Winterfest", (TagType)0);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Abilities";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_FrostyStorm", Utility.LoadBundleGameObject("Move_FrostyStorm"), true, (HideFlags)52, val2, 8567634, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_WinterlandSpirit", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val2, 6542432, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_Cryopathic", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val2, 6546542, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_WinterStormFog", Utility.LoadBundleGameObject("Move_WinterStormFog"), true, (HideFlags)52, val2, 43534532, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_ShiningStar", Utility.LoadBundleGameObject("Move_ShiningStar"), true, (HideFlags)52, val, 123132412, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_MarchingPressure", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, 432453231, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_Masochist", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, 542343242, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Move_DopamineOverdose", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, 532443223, true), "Winterfest", (TagType)0);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Projectiles";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("P_WinternSpear", Utility.LoadBundleGameObject("P_WinternSpear"), true, (HideFlags)52, val2, 65463452, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("P_UltiStarr", Utility.LoadBundleGameObject("P_UltiStarr"), true, (HideFlags)52, val, 313241232, true), "Winterfest", (TagType)0);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Effect";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Eff_StarrFire", Utility.LoadBundleGameObject("Eff_StarrFire"), true, (HideFlags)52, val, 0, true), "Winterfest", (TagType)0);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Explosions";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("E_FrostyTornado", Utility.LoadBundleGameObject("E_FrostyTornado"), true, (HideFlags)52, val2, 0, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("E_Vanish", Utility.LoadBundleGameObject("E_Vanish"), true, (HideFlags)52, val, 0, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("E_ToTheMoon", Utility.LoadBundleGameObject("E_ToTheMoon"), true, (HideFlags)52, val, 0, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("E_StarrRapture", Utility.LoadBundleGameObject("E_StarrRapture"), true, (HideFlags)52, val, 0, true), "Winterfest", (TagType)0);
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			comment = "Custom Unit Bases";
			comment = "----------------------------------------------------------------------------------------------------------------------------";
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Miraculus_Base", (GameObject)SLMALoader.SDic["bases"]["Humanoid"], true, (HideFlags)52, val, 78216192, true), "Winterfest", (TagType)0);
			Utility.ItemCategorizer.SetTag(UPool.MyPool.AddObject("Cryobomination_Base", (GameObject)SLMALoader.SDic["bases"]["Stiffy"], true, (HideFlags)52, val2, 6543421, true), "Winterfest", (TagType)0);
		}

		public static void SetWeapon(GameObject weapon, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
		{
			if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("WinternSpear"))
			{
				range.ObjectToSpawn = UPool.MyPool.GetObject("P_WinternSpear");
			}
			if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("JoyousBlade"))
			{
				weapon.AddComponent<SwingStarrFall>().explosion = UPool.MyPool.GetObject("E_ToTheMoon");
			}
		}

		public static void LoadBundle(string assetBundleName)
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assetBundleName);
			bundle = AssetBundle.LoadFromStream(stream);
		}

		public static void SetExplosion(GameObject explosion)
		{
		}

		public static void SetProjectile(GameObject proj, ProjectileHit projhit, LandfallContentDatabase db)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			IceSplatter iceSplatter = default(IceSplatter);
			if ((Object)(object)proj == (Object)(object)UPool.MyPool.GetObject("P_WinternSpear") && !proj.TryGetComponent<IceSplatter>(ref iceSplatter))
			{
				proj.AddComponent<IceSplatter>().projectile = (GameObject)SLMALoader.SDic["projectiles"]["P_Icicle"];
			}
			StarrProjFunctionality starrProjFunctionality = default(StarrProjFunctionality);
			if ((Object)(object)proj == (Object)(object)UPool.MyPool.GetObject("P_UltiStarr") && !proj.TryGetComponent<StarrProjFunctionality>(ref starrProjFunctionality))
			{
				proj.AddComponent<StarrProjFunctionality>().explosion = UPool.MyPool.GetObject("E_StarrRapture");
			}
		}
	}
	[BepInPlugin("GeeztJeez.winterfest", "WinterFest", "1.0.3")]
	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));
			Debug.Log((object)"Loading WinterFest!");
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			UManager.Init(landfallContentDatabase);
			new Harmony("WinterFest").PatchAll();
			GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
			for (int i = 0; i < array.Length; i++)
			{
				if (Object.op_Implicit((Object)(object)array[i].GetComponent<Unit>()))
				{
					UManager.SetUnits(array[i].GetComponent<Unit>(), landfallContentDatabase);
				}
				if (Object.op_Implicit((Object)(object)array[i].GetComponent<Explosion>()))
				{
					UManager.SetExplosion(array[i]);
				}
				if (Object.op_Implicit((Object)(object)array[i].GetComponent<ProjectileHit>()))
				{
					UManager.SetProjectile(array[i], array[i].GetComponent<ProjectileHit>(), landfallContentDatabase);
				}
				if (Object.op_Implicit((Object)(object)array[i].GetComponent<WeaponItem>()))
				{
					UManager.SetWeapon(array[i], array[i].GetComponent<MeleeWeapon>(), array[i].GetComponent<RangeWeapon>(), landfallContentDatabase);
				}
				if (Object.op_Implicit((Object)(object)array[i].GetComponent<SpecialAbility>()))
				{
					UManager.SetMoves(array[i], landfallContentDatabase);
				}
			}
			UnitBlueprint[] array2 = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int j = 0; j < array2.Length; j++)
			{
				UManager.SetBlueprint(array2[j], landfallContentDatabase);
				array2[j].Validate();
			}
			SceneManager.sceneLoaded += SceneLoaded;
			Debug.Log((object)"Loaded WinterFest Successfully!");
		}

		public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
		{
			if (((Scene)(ref scene)).name == "04_Sandbox_Viking_VC")
			{
				Object.Instantiate<GameObject>(UManager.Utility.LoadBundleGameObject("CryobominationSecretProp"));
			}
		}
	}
}
namespace WinterfestFunctions
{
	public class SwingStarrFall : MonoBehaviour
	{
		private MeleeWeapon weapon;

		private Unit unit;

		private float counter;

		public Vector3 position;

		public GameObject explosion;

		public void Start()
		{
			weapon = ((Component)this).GetComponentInChildren<MeleeWeapon>();
			unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
		}

		public void Update()
		{
			//IL_0044: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_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)
			counter += Time.deltaTime;
			if (weapon.isSwinging && counter >= 0.3f)
			{
				counter = 0f;
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, RandomVector3Strike(), Quaternion.identity), ((Component)this).gameObject);
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, RandomVector3Strike(), Quaternion.identity), ((Component)this).gameObject);
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, RandomVector3Strike(), Quaternion.identity), ((Component)this).gameObject);
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, RandomVector3Strike(), Quaternion.identity), ((Component)this).gameObject);
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, RandomVector3Strike(), Quaternion.identity), ((Component)this).gameObject);
			}
		}

		private Vector3 RandomVector3Strike()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			float num = unit.data.mainRig.position.x + Random.Range(-40f, 40f);
			float num2 = unit.data.mainRig.position.y + Random.Range(15f, 20f);
			float num3 = unit.data.mainRig.position.z + Random.Range(-40f, 40f);
			return new Vector3(num, num2, num3);
		}
	}
	public class StormLineEditor : MonoBehaviour
	{
		public float highestY = 6000000f;

		public float lowestY = -6000000f;

		private void Update()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			((Component)((Component)((Component)((Component)this).transform.FindChild("Storm")).gameObject.transform.FindChild("LineEffect")).gameObject.transform.FindChild("T1")).gameObject.transform.localPosition = new Vector3(0f, 0f, highestY);
			((Component)((Component)((Component)((Component)this).transform.FindChild("Storm")).gameObject.transform.FindChild("LineEffect")).gameObject.transform.FindChild("T2")).gameObject.transform.localPosition = new Vector3(0f, 0f, lowestY);
		}
	}
	public class StarrProjFunctionality : MonoBehaviour
	{
		public GameObject explosion;

		private float delay = 1f;

		public void Update()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			Enlarge();
			ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/VoidMonarchTransformation", 1f, ((Component)this).transform.position, (MaterialType)0, ((Component)this).gameObject.transform, 1f);
		}

		private void Enlarge()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)this).gameObject.transform;
			transform.localScale += Vector3.one * 0.1f * Time.deltaTime;
		}

		public IEnumerator<WaitForSeconds> StarrShatterExplosion(float delay, GameObject explosion)
		{
			yield return new WaitForSeconds(delay);
			TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, ((Component)this).transform.position, Quaternion.identity), ((Component)this).gameObject);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public void Start()
		{
			((MonoBehaviour)this).StartCoroutine((IEnumerator)StarrShatterExplosion(delay, explosion));
		}
	}
	public class DopamineOverdose : MonoBehaviour
	{
		private Unit unit;

		private float counter;

		public void Start()
		{
			unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
		}

		public void Update()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			counter += Time.deltaTime;
			if (counter >= 1f)
			{
				counter = 0f;
				((Damagable)unit.data.healthHandler).TakeDamage(0f - (unit.data.maxHealth - unit.data.health) * 0.1f, Vector3.zero, (Unit)null, (DamageType)0);
			}
		}
	}
	public class Masochist : MonoBehaviour
	{
		private Unit unit;

		private MeleeWeapon[] meleeWeapons;

		private float minSpeed = 1f;

		public float extraOffset = 2500f;

		public float maxDamage = 5000f;

		public void Start()
		{
			unit = ((Component)((Component)this).gameObject.transform.root).GetComponent<Unit>();
			meleeWeapons = ((Component)unit).gameObject.GetComponentsInChildren<MeleeWeapon>();
		}

		public void Update()
		{
			float num = (unit.data.maxHealth - unit.data.health) / extraOffset;
			if (num < minSpeed)
			{
				num = minSpeed;
			}
			MeleeWeapon[] array = meleeWeapons;
			foreach (MeleeWeapon obj in array)
			{
				((Weapon)obj).attackSpeedM = num;
				CollisionWeapon componentInChildren = ((Component)obj).GetComponentInChildren<CollisionWeapon>();
				if (componentInChildren.damage <= maxDamage)
				{
					componentInChildren.damage += num;
				}
			}
		}
	}
	public class RandomEyeSizes : MonoBehaviour
	{
		private void Start()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).gameObject.transform.localScale = Vector3.one * Random.Range(0.8f, 1.2f);
		}
	}
	public class MarchingPressureMovement : GameStateListener
	{
		private Unit unit;

		private float counter;

		private bool onBattle;

		public GameObject tracker;

		public float cooldown = 20f;

		public void Start()
		{
			unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		}

		protected override void Awake()
		{
			((GameStateListener)this).Awake();
		}

		public override void OnEnterBattleState()
		{
			onBattle = true;
		}

		public override void OnEnterPlacementState()
		{
		}

		public MarchingPressureMovement()
		{
			counter = 20f;
		}

		public void Update()
		{
			if (onBattle && !unit.data.Dead)
			{
				counter += Time.deltaTime;
				if (counter > cooldown && unit.data.groundedThisFrame && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)tracker))
				{
					counter = 0f;
					((MonoBehaviour)this).StartCoroutine((IEnumerator)DoMove(unit.data.targetData.unit));
				}
			}
		}

		private Vector3 RandomVector3Strike(Unit unit)
		{
			//IL_000b: 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_0056: 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)
			float num = unit.data.mainRig.position.x + Random.Range(-40f, 40f);
			float num2 = unit.data.mainRig.position.y + Random.Range(15f, 20f);
			float num3 = unit.data.mainRig.position.z + Random.Range(-40f, 40f);
			return new Vector3(num, num2, num3);
		}

		public void TeleportUnit(Unit unit, Vector3 position, bool useGravity, string soundEffect, float volume = 1f, float pitch = 1f)
		{
			//IL_0014: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(soundEffect, volume, unit.data.mainRig.position, (MaterialType)0, (Transform)null, pitch);
			for (int i = 0; i < unit.data.allRigs.AllRigs.Length; i++)
			{
				unit.data.allRigs.AllRigs[i].position = position;
			}
			for (int j = 0; j < unit.data.allRigs.AllRigs.Length; j++)
			{
				unit.data.allRigs.AllRigs[j].useGravity = useGravity;
			}
			ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(soundEffect, volume, unit.data.mainRig.position, (MaterialType)0, (Transform)null, pitch);
		}

		public IEnumerator<WaitForSeconds> DoMove(Unit target)
		{
			TeamHolder teamHolder = new TeamHolder();
			teamHolder.team = unit.Team;
			SpawnExplosion(UPool.MyPool.GetObject("E_ToTheMoon"), unit.data.mainRig.position, 1, teamHolder);
			SpawnExplosion(UPool.MyPool.GetObject("E_Vanish"), unit.data.mainRig.position, 1, teamHolder);
			GameObject tracker = Object.Instantiate<GameObject>(this.tracker, unit.data.mainRig.position, Quaternion.identity, (Transform)null);
			MarkerTracker markerTracker = tracker.AddComponent<MarkerTracker>();
			markerTracker.target = target;
			markerTracker.unit = unit;
			TeleportUnit(unit, unit.data.mainRig.position + Vector3.up * 500f, useGravity: false, "Effects/HammerUp", 2f, 0.8f);
			yield return new WaitForSeconds(5f);
			TeleportUnit(unit, tracker.transform.position, useGravity: true, "Effects/HammerExplosion", 2f, 0.6f);
			Object.Destroy((Object)(object)tracker);
			SpawnExplosion(UPool.MyPool.GetObject("E_StarrRapture"), unit.data.mainRig.position, 1, teamHolder);
			SpawnExplosion(UPool.MyPool.GetObject("E_Vanish"), unit.data.mainRig.position, 1, teamHolder);
			SpawnExplosion(UPool.MyPool.GetObject("E_ToTheMoon"), unit.data.mainRig.position, 1, teamHolder);
			for (int i = 0; i < 25; i++)
			{
				SpawnExplosion(UPool.MyPool.GetObject("E_ToTheMoon"), RandomVector3Strike(unit), 1, teamHolder);
			}
		}

		public void SpawnExplosion(GameObject explosion, Vector3 position, int amount, TeamHolder teamHolder)
		{
			//IL_0005: 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)
			for (int i = 0; i < amount; i++)
			{
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(explosion, position, Quaternion.identity, (Transform)null), unit, teamHolder);
			}
		}
	}
	public class SkeletalRemains : MonoBehaviour
	{
		private Unit unit;

		public GameObject halfStiffy;

		public Material trailMaterial;

		public float widthMultiplier = 0.25f;

		public float time = 0.75f;

		public UnitEffectBase effectBase;

		public void Start()
		{
			unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
			Rigidbody[] allRigs = unit.data.allRigs.AllRigs;
			for (int i = 0; i < allRigs.Length; i++)
			{
				AddTrail(((Component)allRigs[i]).gameObject);
				if (Object.op_Implicit((Object)(object)halfStiffy))
				{
					SummonRemains(allRigs[i]);
				}
			}
		}

		public void SummonRemains(Rigidbody rigidbody)
		{
			//IL_0007: 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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			GameObject obj = Object.Instantiate<GameObject>(halfStiffy, rigidbody.position, rigidbody.rotation, ((Component)rigidbody).transform);
			obj.AddComponent<FollowTransform>().target = ((Component)rigidbody).transform;
			SkeletalDamageCollision skeletalDamageCollision = obj.AddComponent<SkeletalDamageCollision>();
			skeletalDamageCollision.EffectPrefab = effectBase;
			skeletalDamageCollision.damage *= Random.Range(0.8f, 1.1f);
			skeletalDamageCollision.unit = unit;
			Collider[] componentsInChildren = obj.GetComponentsInChildren<Collider>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				((Component)componentsInChildren[i]).gameObject.AddComponent<ProjToIce>().iceMaterial = (Material)SLMALoader.SDic["materials"]["IceArrowIce"];
			}
		}

		public void AddTrail(GameObject targetObject)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			TrailRenderer obj = s.DeepCopyOf<TrailRenderer>(targetObject.AddComponent<TrailRenderer>(), ((GameObject)SLMALoader.SDic["weapons"]["Leg_SuperBoxer_W"]).GetComponentInChildren<TrailRenderer>());
			obj.time = time;
			obj.widthMultiplier = widthMultiplier;
			((Renderer)obj).material = trailMaterial;
		}
	}
	public class SkeletalDamageCollision : MonoBehaviour
	{
		public Unit unit;

		public float damage = 100f;

		public UnitEffectBase EffectPrefab;

		public void OnCollisionEnter(Collision collision)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)collision.gameObject) || !Object.op_Implicit((Object)(object)unit))
			{
				return;
			}
			Unit componentInChildren = ((Component)collision.gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
			if (!Object.op_Implicit((Object)(object)componentInChildren) || componentInChildren.Team == unit.Team || !((Object)(object)componentInChildren != (Object)(object)unit))
			{
				return;
			}
			((Damagable)componentInChildren.data.healthHandler).TakeDamage(damage, collision.gameObject.transform.position, unit, (DamageType)0);
			if (!Object.op_Implicit((Object)(object)EffectPrefab))
			{
				return;
			}
			Type type = ((object)EffectPrefab).GetType();
			UnitEffectBase val = (UnitEffectBase)((Component)((Component)componentInChildren).transform).GetComponentInChildren(type);
			if ((Object)(object)val == (Object)null)
			{
				GameObject val2 = Object.Instantiate<GameObject>(((Component)EffectPrefab).gameObject, ((Component)componentInChildren).transform);
				val2.transform.position = componentInChildren.data.mainRig.position;
				if (Object.op_Implicit((Object)(object)val2.GetComponentInChildren<UnitEffectBase>()))
				{
					val2.GetComponentInChildren<UnitEffectBase>().Ping();
					val2.GetComponentInChildren<UnitEffectBase>().DoEffect();
				}
			}
			else
			{
				val.Ping();
			}
		}
	}
	public class CryopathicCollision : MonoBehaviour
	{
		private Unit unit;

		public Material iceMaterial;

		public string soundEffect;

		public string nameDetection = "CryopathicCarnageEffectNameTection";

		public Material frozenWaterMaterial;

		public void OnCollisionEnter(Collision collision)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)collision.gameObject.transform.root).gameObject;
			if (!Object.op_Implicit((Object)(object)collision.gameObject) || !Object.op_Implicit((Object)(object)gameObject) || ((Object)gameObject).name.Contains(nameDetection) || !Object.op_Implicit((Object)(object)unit))
			{
				return;
			}
			Unit componentInChildren = gameObject.gameObject.GetComponentInChildren<Unit>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				if (componentInChildren.Team != unit.Team && (Object)(object)componentInChildren != (Object)(object)unit && !componentInChildren.data.Dead)
				{
					((Damagable)componentInChildren.data.healthHandler).TakeDamage(Random.Range(150f, 230f), Vector3.zero, unit, (DamageType)3);
					FrostCarnage(((Component)componentInChildren).gameObject);
					Rigidbody[] allRigs = componentInChildren.data.allRigs.AllRigs;
					for (int i = 0; i < allRigs.Length; i++)
					{
						allRigs[i].isKinematic = true;
					}
				}
			}
			else
			{
				FrostCarnage(gameObject);
			}
		}

		public void FrostCarnage(GameObject targetObject)
		{
			//IL_0008: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: 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_011b: Expected O, but got Unknown
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Expected O, but got Unknown
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Expected O, but got Unknown
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Expected O, but got Unknown
			Color[] array = (Color[])(object)new Color[3]
			{
				Color.white,
				new Color(0.75f, 0.75f, 0.9f),
				new Color(0.65f, 0.65f, 0.8f)
			};
			Water[] componentsInChildren = targetObject.GetComponentsInChildren<Water>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				CarnageColdWaterModifier carnageColdWaterModifier = ((Component)componentsInChildren[i]).gameObject.AddComponent<CarnageColdWaterModifier>();
				carnageColdWaterModifier.force = componentsInChildren[i].force;
				carnageColdWaterModifier.waterSinkOffset = componentsInChildren[i].waterSinkOffset;
				carnageColdWaterModifier.streamForce = componentsInChildren[i].streamForce;
				carnageColdWaterModifier.m_killMask = (LayerMask)s.GetField<Water>(componentsInChildren[i], "m_killMask");
				carnageColdWaterModifier.effectBase = (UnitEffectBase)(object)((GameObject)SLMALoader.SDic["effects"]["E_IceUllrEffect"]).GetComponentInChildren<Effect_IceArrow>();
			}
			Collider[] componentsInChildren2 = targetObject.GetComponentsInChildren<Collider>();
			for (int j = 0; j < componentsInChildren2.Length; j++)
			{
				componentsInChildren2[j].material = new PhysicMaterial
				{
					dynamicFriction = 0.1f,
					staticFriction = 0.1f,
					frictionCombine = (PhysicMaterialCombine)2
				};
			}
			Renderer[] componentsInChildren3 = targetObject.GetComponentsInChildren<Renderer>();
			for (int k = 0; k < componentsInChildren3.Length; k++)
			{
				if (componentsInChildren3[k] is ParticleSystemRenderer)
				{
					continue;
				}
				List<Material> list = new List<Material>();
				Material[] materials = componentsInChildren3[k].materials;
				for (int l = 0; l < materials.Length; l++)
				{
					if (materials[l].renderQueue == 2450)
					{
						((Component)componentsInChildren3[k]).gameObject.SetActive(false);
					}
					else if (Object.op_Implicit((Object)(object)((Component)componentsInChildren3[k]).gameObject.GetComponent<Water>()))
					{
						list.Add(new Material(frozenWaterMaterial));
					}
					else if (Random.value < 0.5f)
					{
						int num = Random.Range(0, array.Length);
						list.Add(new Material(iceMaterial)
						{
							color = array[num]
						});
					}
					else
					{
						list.Add(new Material(iceMaterial));
					}
				}
				componentsInChildren3[k].materials = list.ToArray();
			}
			((Object)targetObject).name = ((Object)targetObject).name + "_" + nameDetection;
			ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(soundEffect, 1.2f, ((Component)unit.data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f);
		}

		public void Start()
		{
			if (Object.op_Implicit((Object)(object)MapSettings.Instance))
			{
				MapSettings.Instance.mapGroundMaterial = iceMaterial;
			}
			unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		}
	}
	public class OnDeathFreeze : MonoBehaviour
	{
		private Unit unit;

		public Material material;

		public UnitColorInstance color;

		private UnitColorHandler colorHandler;

		public string soundEffect;

		public void Start()
		{
			unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
			colorHandler = ((Component)unit).gameObject.GetComponentInChildren<UnitColorHandler>();
			unit.data.healthHandler.AddDieAction((Action)delegate
			{
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				((Component)unit).gameObject.AddComponent<SinkOnDeath>().Sink();
				colorHandler.SetColor(color, 100f);
				colorHandler.SetMaterial(material);
				for (int i = 0; i < unit.data.allRigs.AllRigs.Length; i++)
				{
					unit.data.allRigs.AllRigs[i].isKinematic = true;
				}
				ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(soundEffect, 1.2f, unit.data.mainRig.position, (MaterialType)0, (Transform)null, 1f);
			});
		}
	}
	public class ProjToIce : ProjectileSurfaceEffect
	{
		public Material iceMaterial;

		public override bool DoEffect(HitData hit, GameObject projectile)
		{
			projectile.GetComponentInChildren<Renderer>();
			Renderer[] componentsInChildren = projectile.GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				List<Material> list = new List<Material>();
				Material[] materials = val.materials;
				for (int j = 0; j < materials.Length; j++)
				{
					_ = materials[j];
					list.Add(iceMaterial);
				}
				val.materials = list.ToArray();
			}
			RemoveAfterSeconds val2 = default(RemoveAfterSeconds);
			if (((Component)this).TryGetComponent<RemoveAfterSeconds>(ref val2))
			{
				RemoveAfterSeconds componentInChildren = projectile.GetComponentInChildren<RemoveAfterSeconds>();
				componentInChildren.seconds *= 5f;
			}
			return false;
		}
	}
	public class CarnageColdWaterModifier : GameStateListener
	{
		public float force = 1000f;

		public float streamForce;

		public float damage = 10f;

		public float waterSinkOffset;

		public LayerMask m_killMask;

		public UnitEffectBase effectBase;

		private bool onBattle;

		private void Start()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			m_killMask = LayerMask.op_Implicit(LayerMask.NameToLayer("MainRig"));
			Collider component = ((Component)this).GetComponent<Collider>();
			if (Object.op_Implicit((Object)(object)WaterPost.instance) && Object.op_Implicit((Object)(object)component))
			{
				WaterPost.instance.AddWaterCollider(component);
			}
		}

		private void OnDisable()
		{
			Collider component = ((Component)this).GetComponent<Collider>();
			if (Object.op_Implicit((Object)(object)WaterPost.instance) && Object.op_Implicit((Object)(object)component))
			{
				WaterPost.instance.AddWaterCollider(component);
			}
		}

		private void OnTriggerStay(Collider other)
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_00e5: 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)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			if (!onBattle)
			{
				return;
			}
			_ = ((Component)((Component)other).transform.root).gameObject;
			Unit componentInChildren = ((Component)((Component)other).transform.root).GetComponentInChildren<Unit>();
			HealthHandler componentInChildren2 = ((Component)((Component)other).transform.root).GetComponentInChildren<HealthHandler>();
			DataHandler componentInChildren3 = ((Component)((Component)other).transform.root).GetComponentInChildren<DataHandler>();
			if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)componentInChildren2) || !Object.op_Implicit((Object)(object)componentInChildren3))
			{
				return;
			}
			float num = Mathf.Clamp((((Component)this).transform.position.y + waterSinkOffset - ((Component)other).transform.position.y) * 10f, 0f, 10f) * Time.deltaTime;
			if (!componentInChildren3.Dead && ((Component)other).gameObject.layer == LayerMask.op_Implicit(m_killMask))
			{
				((Damagable)componentInChildren.data.healthHandler).TakeDamage(damage, Vector3.zero, (Unit)null, (DamageType)0);
			}
			componentInChildren3.sinceGrounded = Mathf.Clamp(componentInChildren3.sinceGrounded, float.NegativeInfinity, 1f);
			Rigidbody[] componentsInChildren = ((Component)componentInChildren).GetComponentsInChildren<Rigidbody>();
			foreach (Rigidbody obj in componentsInChildren)
			{
				obj.AddForce(force * num * Vector3.up, (ForceMode)5);
				obj.AddForce(streamForce * num * ((Component)this).transform.forward, (ForceMode)5);
				obj.angularVelocity *= 0.1f;
				obj.velocity *= 0.1f;
			}
			if (!Object.op_Implicit((Object)(object)effectBase))
			{
				return;
			}
			Type type = ((object)effectBase).GetType();
			UnitEffectBase val = (UnitEffectBase)((Component)((Component)componentInChildren).transform).GetComponentInChildren(type);
			if ((Object)(object)val == (Object)null)
			{
				GameObject val2 = Object.Instantiate<GameObject>(((Component)effectBase).gameObject, ((Component)componentInChildren).transform);
				val2.transform.position = ((Component)componentInChildren).gameObject.transform.position;
				if (Object.op_Implicit((Object)(object)val2.GetComponentInChildren<UnitEffectBase>()))
				{
					val2.GetComponentInChildren<UnitEffectBase>().Ping();
					val2.GetComponentInChildren<UnitEffectBase>().DoEffect();
				}
			}
			else
			{
				val.Ping();
			}
		}

		protected override void Awake()
		{
			((GameStateListener)this).Awake();
		}

		public override void OnEnterBattleState()
		{
			onBattle = true;
		}

		public override void OnEnterPlacementState()
		{
		}

		public override void OnExitBattleState()
		{
			onBattle = false;
		}
	}
	public class AddCryopathic : MonoBehaviour
	{
		private Unit unit;

		public void Start()
		{
			unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
		}

		public void Update()
		{
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)unit))
			{
				return;
			}
			Collider[] componentsInChildren = ((Component)unit).GetComponentsInChildren<Collider>();
			ProjToIce projToIce = default(ProjToIce);
			CryopathicCollision cryopathicCollision = default(CryopathicCollision);
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if (!((Component)componentsInChildren[i]).gameObject.TryGetComponent<ProjToIce>(ref projToIce))
				{
					((Component)componentsInChildren[i]).gameObject.AddComponent<ProjToIce>().iceMaterial = (Material)SLMALoader.SDic["materials"]["IceArrowIce"];
				}
				if (Object.op_Implicit((Object)(object)((Component)componentsInChildren[i]).transform.parent) && !((Component)((Component)componentsInChildren[i]).transform.parent).gameObject.TryGetComponent<CryopathicCollision>(ref cryopathicCollision))
				{
					CryopathicCollision cryopathicCollision2 = ((Component)((Component)componentsInChildren[i]).transform.parent).gameObject.AddComponent<CryopathicCollision>();
					cryopathicCollision2.frozenWaterMaterial = (Material)SLMALoader.SDic["materials"]["M_viking_ice_Transparent"];
					cryopathicCollision2.iceMaterial = (Material)SLMALoader.SDic["materials"]["IceArrowIce"];
					cryopathicCollision2.soundEffect = "Effects/IceArrowEffect";
				}
			}
		}
	}
	public class IceSplatter : ProjectileHitEffect
	{
		public int amount = 20;

		public TeamHolder team;

		public GameObject projectile;

		public ProjectilesSpawnManager spawnManager;

		public override bool DoEffect(HitData hit)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < amount; i++)
			{
				Shoot(hit.point);
			}
			return false;
		}

		public void Start()
		{
			team = ((Component)this).GetComponentInChildren<TeamHolder>();
			if (!Object.op_Implicit((Object)(object)spawnManager))
			{
				spawnManager = ServiceLocator.GetService<ProjectilesSpawnManager>();
			}
		}

		public Vector3 RandomProjRot()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			float num = Random.Range(0f, 359f);
			float num2 = Random.Range(0f, 359f);
			float num3 = Random.Range(0f, 359f);
			return new Vector3(num, num2, num3);
		}

		public GameObject Shoot(Vector3 position)
		{
			//IL_000c: 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_0029: 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)
			GameObject obj = spawnManager.SpawnProjectile(projectile, position, Quaternion.Euler(RandomProjRot()));
			obj.AddComponent<TeamHolder>().team = team.team;
			return obj;
		}
	}
	public class MarkerTracker : MonoBehaviour
	{
		public Unit unit;

		public float speed = 50f;

		private float size;

		public Unit target;

		public float chaseSpeed = 50f;

		public void Start()
		{
			((Component)this).gameObject.transform.Rotate(-90f, 0f, 0f, (Space)1);
		}

		public void Update()
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: 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_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)target) && !unit.data.Dead)
			{
				size += size * Time.deltaTime;
				speed += speed / 1.5f * Time.deltaTime;
				chaseSpeed -= chaseSpeed * Time.deltaTime;
				((Component)this).gameObject.transform.localScale = new Vector3(size, size, 0.01f);
				((Component)this).gameObject.transform.Rotate(0f, 0f, speed * Time.deltaTime, (Space)1);
				ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/Candlehead", 0.4f, ((Component)this).transform.position, (MaterialType)0, ((Component)this).gameObject.transform, 0.3f);
				((Component)this).gameObject.transform.position = Vector3.MoveTowards(((Component)this).gameObject.transform.position, target.data.mainRig.position, chaseSpeed * Time.deltaTime);
			}
			else
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		public MarkerTracker()
		{
			size = 3f;
		}
	}
}