Decompiled source of AbilityCreator v2.5.1

AbilityCreator.dll

Decompiled 2 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BitCode.Debug;
using BitCode.Debug.Commands;
using BitCode.Extensions;
using DM;
using EMPTY;
using HarmonyLib;
using IDK;
using IDK.ExampleAbilites;
using IDK.Help_Componets;
using IDK.NodeScripts;
using IDK.Node_Related_Scripts;
using IDK.Node_Related_Scripts.connection_stuff;
using Landfall.TABC;
using Landfall.TABS;
using Landfall.TABS.AI;
using Landfall.TABS.AI.Components;
using Landfall.TABS.AI.Systems;
using Landfall.TABS.GameMode;
using Landfall.TABS.GameState;
using Landfall.TABS.UnitEditor;
using Landfall.TABS.Workshop;
using LevelCreator;
using MonoMod.Utils;
using Newtonsoft.Json;
using ProGrids;
using Sirenix.Utilities;
using TFBGames;
using TMPro;
using Unity.Entities;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Ability Creator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Yipe")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266b11")]
[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.0.0.0")]
[module: UnverifiableCode]
public class AbilityCreatorSavePatch : ISaveUnit
{
	public override ExtraSerializedUnit AddData(ExtraSerializedUnit serializedUnitBlueprint, UnitBlueprint unitBlueprint)
	{
		List<NodeScene> list = new List<NodeScene>();
		for (int i = 0; i < unitBlueprint.objectsToSpawnAsChildren.Length; i++)
		{
			Debug.Log((object)("Checking if abiltiy is custom :" + (object)unitBlueprint.objectsToSpawnAsChildren[i]));
			if (Object.op_Implicit((Object)(object)unitBlueprint.objectsToSpawnAsChildren[i].GetComponent<NodeRunner>()))
			{
				Debug.Log((object)"It is custom!");
				NodeRunner component = unitBlueprint.objectsToSpawnAsChildren[i].GetComponent<NodeRunner>();
				if (!list.Contains(component.nodeScene))
				{
					list.Add(component.nodeScene);
					Debug.Log((object)("Added field name:" + component.nodeScene.sceneName));
					string s = component.nodeScene.Jsonify((Formatting)1);
					byte[] bytes = Encoding.UTF8.GetBytes(s);
					string data = Convert.ToBase64String(bytes);
					serializedUnitBlueprint.AddData(component.nodeScene.sceneName, data);
					Debug.Log((object)"Added Json!");
				}
			}
		}
		return serializedUnitBlueprint;
	}
}
public static class EnumerableHelper
{
	public static object[] ToArrayIfEnumerable(object obj)
	{
		if (obj is IEnumerable source && !(obj is string))
		{
			return source.Cast<object>().ToArray();
		}
		return null;
	}
}
public class NodeSceneMovement : MonoBehaviour, IDragHandler, IEventSystemHandler
{
	public RectTransform dragRectTransform;

	public NodeManager nodeman;

	private void Awake()
	{
		nodeman = Object.FindObjectOfType<NodeManager>();
	}

	public void OnDrag(PointerEventData eventData)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Invalid comparison between Unknown and I4
		//IL_0038: 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_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		if (nodeman.CanMove && (int)eventData.button == 2)
		{
			Node[] array = Object.FindObjectsOfType<Node>();
			for (int i = 0; i < array.Length; i++)
			{
				RectTransform component = ((Component)array[i]).GetComponent<RectTransform>();
				component.anchoredPosition += eventData.delta / 2f;
			}
		}
	}
}
public class NodeWindow : MonoBehaviour, IDragHandler, IEventSystemHandler
{
	public RectTransform dragRectTransform;

	public NodeManager nodeman;

	private void Awake()
	{
		nodeman = Object.FindObjectOfType<NodeManager>();
	}

	public void OnDrag(PointerEventData eventData)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Invalid comparison between Unknown and I4
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		if (!nodeman.CanMove || (int)eventData.button != 0)
		{
			return;
		}
		if (nodeman.SelectedNodes.Contains(((Component)this).GetComponent<Node>()))
		{
			for (int i = 0; i < nodeman.SelectedNodes.Length; i++)
			{
				try
				{
					RectTransform obj = ((Component)nodeman.SelectedNodes[i]).GetComponent<NodeWindow>().dragRectTransform;
					obj.anchoredPosition += eventData.delta / 2f;
				}
				catch (Exception)
				{
				}
			}
		}
		else
		{
			RectTransform obj2 = dragRectTransform;
			obj2.anchoredPosition += eventData.delta / 2f;
		}
	}
}
[Serializable]
public class InnerListWrapper<T> : IEquatable<InnerListWrapper<T>>
{
	public List<T> innerList = new List<T>();

	public InnerListWrapper(List<T> list)
	{
		innerList = list;
	}

	public bool Equals(InnerListWrapper<T> obj)
	{
		return base.Equals(obj);
	}

	public override int GetHashCode()
	{
		return base.GetHashCode();
	}

	public override string ToString()
	{
		return base.ToString();
	}
}
[Serializable]
public class ListOfListsWrapper<T> : IEquatable<ListOfListsWrapper<T>>
{
	public List<InnerListWrapper<T>> listOfLists = new List<InnerListWrapper<T>>();

	public bool Equals(ListOfListsWrapper<T> obj)
	{
		return base.Equals(obj);
	}

	public override int GetHashCode()
	{
		return base.GetHashCode();
	}

	public override string ToString()
	{
		return base.ToString();
	}
}
namespace EMPTY
{
	public class ExtraSerializedUnit : SerializedUnitBlueprint
	{
		public List<string> extraFieldNames = new List<string>();

		public List<string> extraFieldValues = new List<string>();

		public void AddData(string field, string data)
		{
			if (extraFieldNames.Contains(field))
			{
				int index = extraFieldNames.FindIndex((string n) => n == field);
				extraFieldNames.RemoveAt(index);
				extraFieldValues.RemoveAt(index);
			}
			extraFieldNames.Add(field);
			extraFieldValues.Add(data);
		}
	}
	public static class Helper
	{
		public static ExtraSerializedUnit TurnExtra(this SerializedUnitBlueprint serializedUnitBlueprint)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			return new ExtraSerializedUnit
			{
				attackSpeedMultiplier = serializedUnitBlueprint.attackSpeedMultiplier,
				customCost = serializedUnitBlueprint.customCost,
				damageMultiplier = serializedUnitBlueprint.damageMultiplier,
				leftProjectile = serializedUnitBlueprint.leftProjectile,
				m_animationMultiplier = serializedUnitBlueprint.m_animationMultiplier,
				m_armLimitMultiplier = serializedUnitBlueprint.m_armLimitMultiplier,
				m_attackDistanceCurve = serializedUnitBlueprint.m_attackDistanceCurve,
				m_combatMoves = serializedUnitBlueprint.m_combatMoves,
				m_faction = serializedUnitBlueprint.m_faction,
				m_fistRef = serializedUnitBlueprint.m_fistRef,
				m_hasRider = serializedUnitBlueprint.m_hasRider,
				m_health = serializedUnitBlueprint.m_health,
				m_holdingWithTwoHands = serializedUnitBlueprint.m_holdingWithTwoHands,
				m_icon = serializedUnitBlueprint.m_icon,
				m_id = serializedUnitBlueprint.m_id,
				m_leftWeapon = serializedUnitBlueprint.m_leftWeapon,
				m_leftWeaponData = serializedUnitBlueprint.m_leftWeaponData,
				m_massMultiplier = serializedUnitBlueprint.m_massMultiplier,
				m_movementSpeedMuiltiplier = serializedUnitBlueprint.m_movementSpeedMuiltiplier,
				m_movementTypes = serializedUnitBlueprint.m_movementTypes,
				m_name = serializedUnitBlueprint.m_name,
				m_propData = serializedUnitBlueprint.m_propData,
				m_props = serializedUnitBlueprint.m_props,
				m_rider = serializedUnitBlueprint.m_rider,
				m_rightWeapon = serializedUnitBlueprint.m_rightWeapon,
				m_rightWeaponData = serializedUnitBlueprint.m_rightWeaponData,
				m_sizeMultiplier = serializedUnitBlueprint.m_sizeMultiplier,
				m_stepMultiplier = serializedUnitBlueprint.m_stepMultiplier,
				m_targetingPriorityMultiplier = serializedUnitBlueprint.m_targetingPriorityMultiplier,
				m_targetingType = serializedUnitBlueprint.m_targetingType,
				m_turningData = serializedUnitBlueprint.m_turningData,
				m_turnSpeed = serializedUnitBlueprint.m_turnSpeed,
				m_turnSpeedCurve = serializedUnitBlueprint.m_turnSpeedCurve,
				m_unitBase = serializedUnitBlueprint.m_unitBase,
				m_weaponSeparation = serializedUnitBlueprint.m_weaponSeparation,
				rightProjectile = serializedUnitBlueprint.rightProjectile,
				unitDescription = serializedUnitBlueprint.unitDescription,
				useCustomCost = serializedUnitBlueprint.useCustomCost,
				voiceBundle = serializedUnitBlueprint.voiceBundle,
				voicePitch = serializedUnitBlueprint.voicePitch,
				voiceVolume = serializedUnitBlueprint.voiceVolume
			};
		}
	}
	public abstract class ISaveUnit : MonoBehaviour
	{
		public ISaveUnit()
		{
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		public abstract ExtraSerializedUnit AddData(ExtraSerializedUnit serializedUnitBlueprint, UnitBlueprint unitBlueprint);
	}
	[HarmonyPatch(typeof(CustomUnitHandler))]
	[HarmonyPatch("SaveUnit")]
	public class UnitEditorHarmonyPatch
	{
		private static bool Prefix(UnitBlueprint unitBlueprint, DatabaseID id = default(DatabaseID), Action refreshDoneCallback = null)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"LETS GO THE METHOD HAS BEEN PATCHEDDDDDD");
			try
			{
				DatabaseID val = default(DatabaseID);
				if (id == val)
				{
					unitBlueprint.Entity.GenerateNewID();
				}
				else
				{
					unitBlueprint.Entity.GUID = id;
				}
				MethodInfo method = typeof(CustomUnitHandler).GetMethod("SaveIcon", (BindingFlags)(-1));
				Action<Exception> action = delegate
				{
					ServiceLocator.GetService<CustomContentLoaderModIO>().QuickRefresh((WorkshopContentType)0, refreshDoneCallback);
				};
				ContentDatabase.Instance().AddUserUnitBlueprint(unitBlueprint);
				val = unitBlueprint.Entity.GUID;
				string text = ((object)(DatabaseID)(ref val)).ToString();
				string customUnitPath = UnitBlueprint.GetCustomUnitPath(text);
				string iconPath = CustomContentFilePaths.UnitDirectoryPath + "/" + text + "/icon.png";
				UnitBlueprint obj = unitBlueprint;
				val = default(DatabaseID);
				ExtraSerializedUnit extraSerializedUnit = obj.SerializedUnit(val).TurnExtra();
				ISaveUnit[] array = Object.FindObjectsOfType<ISaveUnit>();
				Debug.Log((object)(array.Length + "patches to load!"));
				for (int i = 0; i < array.Length; i++)
				{
					extraSerializedUnit = array[i].AddData(extraSerializedUnit, unitBlueprint);
					Debug.Log((object)("Added patch of type:" + (object)array[i]));
				}
				string text2 = JsonUtility.ToJson((object)extraSerializedUnit, true);
				ServiceLocator.GetService<FileIOWrapper>().WriteAllText(customUnitPath, text2, (FileHandlingFileType)2, (Action<Exception>)delegate
				{
					method.Invoke(null, new object[3]
					{
						unitBlueprint.Entity.SpriteIcon.texture,
						iconPath,
						action
					});
				});
				GlobalSettings.SaveAbilites = false;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Failed to Save Unit with exception " + ex));
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(CustomContentLoaderModIO))]
	[HarmonyPatch("ReadUnit")]
	public class LoadSerializedUnitPatch
	{
		public static bool Prefix(FileInfo file, int modID, Action<LoadedCustomUnitWrapper> doneCallback)
		{
			FileIOWrapper service = ServiceLocator.GetService<FileIOWrapper>();
			ContentDatabase contentDatabase = ContentDatabase.Instance();
			string path = file.FullName;
			service.ReadAllText(path, (FileHandlingFileType)2, (Action<string, Exception>)delegate(string json, Exception readException)
			{
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Expected O, but got Unknown
				if (string.IsNullOrEmpty(json))
				{
					Debug.LogFormat("Failed to load: {0}", new object[1] { path });
					doneCallback?.Invoke(null);
				}
				else
				{
					UnitBlueprint val;
					try
					{
						val = UnitBlueprint.DeserializedUnit((SerializedUnitBlueprint)(object)JsonUtility.FromJson<ExtraSerializedUnit>(json), contentDatabase.AssetLoader, contentDatabase.LandfallContentDatabase);
					}
					catch
					{
						val = UnitBlueprint.DeserializedUnit(JsonUtility.FromJson<SerializedUnitBlueprint>(json), contentDatabase.AssetLoader, contentDatabase.LandfallContentDatabase);
					}
					val.SetCustomUnit(modID, path);
					string iconPath = Path.Combine(file.Directory.FullName, "icon.png");
					val.SetIconPath(iconPath);
					doneCallback?.Invoke(new LoadedCustomUnitWrapper(val, Path.GetDirectoryName(path), path, 0L));
				}
			});
			return false;
		}
	}
	[HarmonyPatch(typeof(UnitBlueprint))]
	[HarmonyPatch("DeserializedUnit")]
	public class UnitLoaderHarmonyPatch
	{
		private static bool Prefix(SerializedUnitBlueprint data, AssetLoader assetLoader, LandfallContentDatabase landfallContentDatabase)
		{
			try
			{
				if (data is ExtraSerializedUnit extraSerializedUnit)
				{
					List<NodeScene> nodeScenes = Main.nodeScenes;
					Debug.Log((object)("Extra serialized unit detected! " + data.m_name));
					for (int i = 0; i < extraSerializedUnit.extraFieldNames.Count; i++)
					{
						Debug.Log((object)("Field's name: " + extraSerializedUnit.extraFieldNames[i]));
						string s = extraSerializedUnit.extraFieldValues[i];
						byte[] bytes = Convert.FromBase64String(s);
						string decodedText = Encoding.UTF8.GetString(bytes);
						SavedNodeScene savedNodeScene = Main.DeserializeAbility(decodedText);
						Debug.Log((object)"Deserialized ability!");
						if (!Main.IsAbilityWritten(savedNodeScene) && !BundledAbilitesManager.bundledAbilities.Exists((BundledAbilitesManager.BundledAbility n) => n.abilityData == decodedText))
						{
							BundledAbilitesManager.BundledAbility bundledAbility = BundledAbilitesManager.BundleAbility(extraSerializedUnit, savedNodeScene, decodedText);
							Debug.Log((object)"Bundled ability!");
							Debug.Log((object)$"Adding ability {bundledAbility}");
							BundledAbilitesManager.bundledAbilities.Add(bundledAbility);
						}
					}
				}
			}
			catch
			{
			}
			return true;
		}
	}
}
namespace IDK
{
	public static class Bundle_Manager
	{
		public static GameObject Node;

		public static GameObject Empty;

		public static GameObject ConnecterTrig;

		public static GameObject ConnecterUnit;

		public static GameObject ConnecterGameObject;

		public static GameObject ConnectorComponent;

		public static GameObject ConnecterVar;

		public static GameObject ConnecterAnything;

		public static GameObject Popup;

		public static AssetBundle scenes;

		public static AssetBundle AbilityPrefabs;

		public static void Setup()
		{
			scenes = LoadBundle("IDK.Bundle__butt__Stuff.scenes");
			AbilityPrefabs = LoadBundle("IDK.Bundle__butt__Stuff.ability");
			Node = AbilityPrefabs.LoadAsset<GameObject>("Node");
			Empty = AbilityPrefabs.LoadAsset<GameObject>("Empty");
			ConnecterTrig = AbilityPrefabs.LoadAsset<GameObject>("Assets/Connecter_Trig.prefab");
			ConnecterUnit = AbilityPrefabs.LoadAsset<GameObject>("Assets/Connector_Unit.prefab");
			ConnecterGameObject = AbilityPrefabs.LoadAsset<GameObject>("Assets/Connector_GameObject.prefab");
			ConnecterVar = AbilityPrefabs.LoadAsset<GameObject>("Assets/Connector_Variable.prefab");
			ConnectorComponent = AbilityPrefabs.LoadAsset<GameObject>("Assets/Connector_Component.prefab");
			ConnecterAnything = AbilityPrefabs.LoadAsset<GameObject>("Assets/Connector_Anything.prefab");
			Popup = AbilityPrefabs.LoadAsset<GameObject>("Assets/CANSAVE.prefab");
			ConnecterTrig.AddComponent<NodeConnector>();
			ConnecterUnit.AddComponent<NodeConnector>();
			ConnecterGameObject.AddComponent<NodeConnector>();
			ConnecterVar.AddComponent<NodeConnector>();
			ConnectorComponent.AddComponent<NodeConnector>();
			ConnecterAnything.AddComponent<NodeConnector>();
		}

		public static AssetBundle LoadBundle(string assetBundleName)
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assetBundleName);
			return AssetBundle.LoadFromStream(stream);
		}
	}
	public class BundledAbilitesManager : MonoBehaviour
	{
		public class BundledAbility : MonoBehaviour
		{
			public string unitName;

			public string abilityName;

			public Sprite sprite;

			public string abilityData;

			public override string ToString()
			{
				return unitName + " + " + abilityName;
			}

			public void Awake()
			{
				Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			}

			private void Start()
			{
				((Object)((Component)this).gameObject).name = unitName + " - " + abilityName;
			}
		}

		public static List<BundledAbility> bundledAbilities = new List<BundledAbility>();

		public static BundledAbility BundleAbility(ExtraSerializedUnit unit, SavedNodeScene savedNodeScene, string data)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			BundledAbility bundledAbility = new GameObject("Bundledability").AddComponent<BundledAbility>();
			bundledAbility.abilityData = data;
			bundledAbility.abilityName = savedNodeScene.sceneName;
			bundledAbility.unitName = ((SerializedUnitBlueprint)unit).m_name;
			bundledAbility.sprite = Main.GetSprite(savedNodeScene);
			return bundledAbility;
		}
	}
	public class Code : GameStateListener
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<bool> <>9__3_0;

			public static UnityAction <>9__3_1;

			internal bool <SpawnButton_Internal>b__3_0()
			{
				return Object.op_Implicit((Object)(object)GameObject.Find("Quit"));
			}

			internal void <SpawnButton_Internal>b__3_1()
			{
				Main.sceneManager.EnterNodeChanger();
			}
		}

		public static GameObject button;

		public static string commnet;

		public void Begin()
		{
			SceneManager.activeSceneChanged += SpawnButtonFIXXXX;
		}

		public void SpawnButtonFIXXXX(Scene s, Scene s2)
		{
			if (((Scene)(ref s2)).name == "MainMenu")
			{
				((MonoBehaviour)this).StartCoroutine(SpawnButton_Internal());
			}
		}

		public IEnumerator SpawnButton_Internal()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => Object.op_Implicit((Object)(object)GameObject.Find("Quit"))));
			button = Object.Instantiate<GameObject>(GameObject.Find("Quit"), GameObject.Find("Quit").transform.parent);
			((Object)button).name = "Ability Creator";
			((UnityEventBase)button.GetComponent<Button>().onClick).RemoveAllListeners();
			Object.Destroy((Object)(object)button.GetComponentInChildren<LocalizeText>());
			((TMP_Text)((Component)button.transform.Find("Text")).GetComponent<TextMeshProUGUI>()).text = "Ability Creator";
			button.transform.SetSiblingIndex(4);
			ButtonClickedEvent onClick = button.GetComponent<Button>().onClick;
			object obj = <>c.<>9__3_1;
			if (obj == null)
			{
				UnityAction val = delegate
				{
					Main.sceneManager.EnterNodeChanger();
				};
				<>c.<>9__3_1 = val;
				obj = (object)val;
			}
			((UnityEvent)onClick).AddListener((UnityAction)obj);
		}

		public override void OnEnterBattleState()
		{
		}

		public override void OnEnterPlacementState()
		{
		}
	}
	public class DestroySelfWhenObjectDestroyed : MonoBehaviour
	{
		public GameObject obj;

		private void Update()
		{
			if ((Object)(object)obj == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class DontDestroyOnLoad
	{
		public Object gameObject;

		public DontDestroyOnLoad(Object target)
		{
			Object.DontDestroyOnLoad(target);
			gameObject = target;
		}
	}
	public static class ExampleManager
	{
		public static void WriteAll()
		{
			string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
			for (int i = 0; i < manifestResourceNames.Length; i++)
			{
				if (manifestResourceNames[i].EndsWith("abilityEncoded"))
				{
					using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(manifestResourceNames[i]);
					StreamReader streamReader = new StreamReader(stream);
					string s = streamReader.ReadToEnd();
					string @string = Encoding.UTF8.GetString(Convert.FromBase64String(s));
					SavedNodeScene savedNodeScene = Main.DeserializeAbility(@string);
					Directory.CreateDirectory(Main.abilitespath + "/" + Main.CleanNodeName(savedNodeScene.sceneName));
					File.WriteAllText(Main.GetPath(savedNodeScene), @string);
				}
			}
			for (int j = 0; j < manifestResourceNames.Length; j++)
			{
				if (!manifestResourceNames[j].EndsWith("png"))
				{
					continue;
				}
				using Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream(manifestResourceNames[j]);
				string path = Main.abilitespath + "/size=8Examplesize=13#00AAFFCat Lives/icon.png";
				using FileStream destination = new FileStream(path, FileMode.CreateNew, FileAccess.Write);
				stream2.CopyTo(destination);
			}
		}

		public static void WriteExample(string json)
		{
			NodeManager.WriteAbility(Main.DeserializeAbility(json), json);
		}

		public static void TurnIntoExample(string json, string name)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(json);
			string contents = Convert.ToBase64String(bytes);
			File.WriteAllText(Main.abilitespath + "/" + Main.CleanNodeName(name) + ".abilityEncoded", contents);
		}

		public static void TurnAllIntoExample()
		{
			for (int i = 0; i < Main.nodeScenes.Count; i++)
			{
				TurnIntoExample(Main.nodeScenes[i].Jsonify((Formatting)1), Main.nodeScenes[i].sceneName);
			}
		}
	}
	public class FixNodeSystem : MonoBehaviour
	{
		public static bool IsValid(SavedNodeScene nodeScene)
		{
			for (int i = 0; i < nodeScene.blueprints2.Count; i++)
			{
				if (!Main.nodeDatabase.ContainsKey(nodeScene.blueprints2[i]))
				{
					return false;
				}
				string[] array = nodeScene.fields2[i].Split(new string[1] { "###" }, StringSplitOptions.RemoveEmptyEntries);
				if (Main.nodeDatabase[nodeScene.blueprints2[i]].fields.Count != array.Length)
				{
					return false;
				}
			}
			return true;
		}
	}
	public class GlobalSettings
	{
		public static bool SaveAbilites;
	}
	public class ObjectStorer : MonoBehaviour
	{
		public Dictionary<string, object> store = new Dictionary<string, object>();
	}
	public class RemoveAfterSecondsObject : MonoBehaviour
	{
		public Object other;

		public float time;

		private IEnumerator Start()
		{
			yield return (object)new WaitForSeconds(time);
			Object.Destroy(other);
		}
	}
	public class KillYourself : MonoBehaviour
	{
		public GameObject other;

		private void Update()
		{
			if ((Object)(object)other == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class AbilityCreator
	{
		public static void Log(object log)
		{
			Console.WriteLine("Abiltiy Creator:" + log);
		}
	}
	public class NodeRunner : MonoBehaviour
	{
		public NodeScene nodeScene;

		public List<ITriggerNode> triggerNodes = new List<ITriggerNode>();

		public void Begin()
		{
			nodeScene = nodeScene.CreateCopy();
			for (int i = 0; i < nodeScene.everyNode.Length; i++)
			{
				nodeScene.everyNode[i].valuePools = new Dictionary<Unit, ValuePool>();
			}
			if (Object.op_Implicit((Object)(object)((Component)((Component)this).transform.root).GetComponent<Unit>()))
			{
				((MonoBehaviour)this).StartCoroutine(BeginInternal());
			}
		}

		public IEnumerator BeginInternal()
		{
			yield return null;
			yield return null;
			SavedNode[] savedNodes = nodeScene.everyNode;
			Unit unit = ((Component)((Component)this).transform.root).GetComponent<Unit>();
			SavedNode[] array = savedNodes;
			foreach (SavedNode savedNode in array)
			{
				savedNode.nodeRunners.Add(unit, this);
				if (!(savedNode.blueprint.nodeFunction != null))
				{
					continue;
				}
				if (savedNode.blueprint.nodeFunction.BaseType == typeof(ITriggerNode))
				{
					ITriggerNode triggerNode = (ITriggerNode)savedNode.InstanceFunction;
					triggerNode.StartFrame(savedNode, unit, savedNode.connections, savedNode.fields.ToArray(), this);
					triggerNodes.Add(triggerNode);
				}
				if (savedNode.blueprint.nodeFunction == typeof(ReDie))
				{
					Unit[] units = savedNode.connections.GetNode(NodeBlueprint.ConnectionType.ReciveUnit).GetValuePoolSmart(unit).GetValues<Unit>();
					for (int i = 0; i < units.Length; i++)
					{
					}
				}
			}
		}

		public IEnumerator TriggerConnection(SavedNode savedNode)
		{
			try
			{
				SavedNode node = savedNode.connections.GetNode(NodeBlueprint.ConnectionType.Trigger);
				((MonoBehaviour)this).StartCoroutine(RunNode(node));
			}
			catch (Exception ex)
			{
				Debug.Log((object)("(NodeRunner TriggerConnection) Something went wrong! exception:" + ex));
			}
			yield return null;
		}

		public IEnumerator RunNode(SavedNode node)
		{
			yield return null;
			Debug.Log((object)("Running node " + node?.blueprint?.Name + "..."));
			if ((Object)(object)node == (Object)null)
			{
				Debug.Log((object)"nvm this node is null \ud83d\ude23");
				yield break;
			}
			try
			{
				GetValueOfConnections(node);
				IBehaviorNode behaviorNode = (IBehaviorNode)node.InstanceFunction;
				((MonoBehaviour)this).StartCoroutine(behaviorNode.RunNode(node, ((Component)((Component)this).transform.root).GetComponent<Unit>(), node.connections, node.fields.ToArray(), this));
			}
			catch (Exception ex)
			{
				Debug.Log((object)("(NodeRunner RunNode) Something went wrong! exception:" + ex));
			}
		}

		public void GetValueOfConnections(SavedNode savedNode)
		{
			List<Node.Connection> connections = savedNode.connections;
			foreach (Node.Connection item in connections)
			{
				try
				{
					if (!(item?.savedNode?.blueprint?.nodeFunction == null) && !(item.savedNode.blueprint.nodeFunction.BaseType != typeof(IValueNode)))
					{
						IValueNode valueNode = (IValueNode)item.savedNode.InstanceFunction;
						valueNode.GetValuePool(item.savedNode, ((Component)((Component)this).transform.root).GetComponent<Unit>(), item.savedNode.connections, item.savedNode.fields.ToArray());
					}
				}
				catch (Exception ex)
				{
					Debug.Log((object)("(GetValueOfConnections) Something went wrong! exception:" + ex));
				}
			}
		}
	}
	public class NodeRunnerFixer : MonoBehaviour
	{
		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine(AwakeInternal());
		}

		private IEnumerator AwakeInternal()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => Object.op_Implicit((Object)(object)((Component)this).GetComponent<NodeRunner>())));
			((Component)this).GetComponent<NodeRunner>().Begin();
		}
	}
	[Serializable]
	public class NodeScene : MonoBehaviour
	{
		public SavedNode[] everyNode;

		public string sceneName = "";

		public string sceneDescription = "";

		public string sceneImage = "";

		public int id;

		public bool isFinal;

		public float zoom;

		public int NodeSceneIndex
		{
			get
			{
				try
				{
					if (Main.nodeScenes.FindIndex((NodeScene n) => (Object)(object)n == (Object)(object)this) != -1)
					{
						return Main.nodeScenes.FindIndex((NodeScene n) => (Object)(object)n == (Object)(object)this);
					}
					throw new Exception();
				}
				catch (Exception)
				{
					return Main.nodeScenes.Count;
				}
			}
		}

		public string Jsonify(Formatting formatting = 1)
		{
			//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_0016: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			SavedNodeScene savedNodeScene = SavedNodeScene.Instance(this);
			JsonSerializerSettings val = new JsonSerializerSettings
			{
				ReferenceLoopHandling = (ReferenceLoopHandling)1
			};
			return JsonConvert.SerializeObject((object)savedNodeScene, formatting, val);
		}

		public NodeScene CreateCopy()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			GameObject val = new GameObject("Node Scene (" + sceneName + ")");
			NodeScene nodeScene = val.AddComponent<NodeScene>();
			nodeScene.everyNode = everyNode;
			nodeScene.id = id;
			nodeScene.sceneDescription = sceneDescription;
			nodeScene.sceneImage = sceneImage;
			nodeScene.sceneName = sceneName;
			return nodeScene;
		}

		private void OnDestroy()
		{
			if (Main.nodeScenes.Contains(this))
			{
				Main.nodeScenes.Remove(this);
			}
			if (Object.op_Implicit((Object)(object)((Component)this).gameObject))
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		public void Awake()
		{
			if (Object.op_Implicit((Object)(object)((Component)this).gameObject))
			{
				Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			}
		}

		public void Start()
		{
			if (!Main.nodeScenes.Contains(this) && isFinal)
			{
				Main.nodeScenes.Add(this);
			}
		}
	}
	[BepInPlugin("AAC", "Alter Ability Creator", "2.5.1")]
	public class Main : BaseUnityPlugin
	{
		public static GameObject sliceEffect;

		public static Dictionary<string, GameObject> explosions = new Dictionary<string, GameObject>();

		public static Dictionary<string, GameObject> Effects = new Dictionary<string, GameObject>();

		public static Dictionary<string, GameObject> Projectiles = new Dictionary<string, GameObject>();

		public static Dictionary<string, Type> components = new Dictionary<string, Type>();

		public static Dictionary<string, UnitBlueprint> units = new Dictionary<string, UnitBlueprint>();

		public static Dictionary<string, Sprite> pepsis = new Dictionary<string, Sprite>();

		public static Dictionary<string, GameObject> particles = new Dictionary<string, GameObject>();

		public static Dictionary<string, GameObject> abilites = new Dictionary<string, GameObject>();

		public static Dictionary<string, GameObject> weapons = new Dictionary<string, GameObject>();

		public static List<string> sounds = new List<string>();

		public static List<DatabaseID> nodeIDS = new List<DatabaseID>();

		public static string path = GamePaths.DataPath + "/Abilty Creator";

		public static string Guide = "";

		public static StreamedSceneManager sceneManager;

		public static Dictionary<string, NodeBlueprint> nodeDatabase = new Dictionary<string, NodeBlueprint>();

		public static List<NodeScene> nodeScenes = new List<NodeScene>();

		public static string abilitespath = path + "/Abilites";

		private void Awake()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			if ((int)Application.platform == 1)
			{
				path = GamePaths.PersistentDataPath + "/Abilty Creator";
				abilitespath = path + "/Abilites";
			}
			Harmony val = new Harmony("Alter.AbilityCreator");
			val.PatchAll();
			Code.commnet = "Dear Code Viewer, prepare your self for the most unoptomized, evil, racist code you will ever see";
			if (!Directory.Exists(path))
			{
				Directory.CreateDirectory(path);
			}
			if (!Directory.Exists(abilitespath))
			{
				Directory.CreateDirectory(abilitespath);
			}
			((MonoBehaviour)this).StartCoroutine(Call());
			UpdateSaveManager.Handle();
			string[] files = Directory.GetFiles(abilitespath);
			for (int i = 0; i < files.Length; i++)
			{
				Debug.Log((object)("File Extension! " + Path.GetExtension(files[i])));
				if (!(Path.GetExtension(files[i]) == ".newnodescene"))
				{
					continue;
				}
				SavedNodeScene savedNodeScene = DeserializeAbility(File.ReadAllText(files[i]));
				if (FixNodeSystem.IsValid(savedNodeScene))
				{
					string text = abilitespath + "/" + savedNodeScene.sceneName + "/";
					if (!Directory.Exists(text))
					{
						Directory.CreateDirectory(text);
					}
					File.Copy(files[i], text + savedNodeScene.id + ".ability");
					if (!Directory.Exists(abilitespath + "/OldAbilites"))
					{
						Directory.CreateDirectory(abilitespath + "/OldAbilites");
					}
					File.Copy(files[i], abilitespath + "/OldAbilites/" + Path.GetFileName(files[i]));
					File.Delete(files[i]);
				}
			}
		}

		public string GetNiceName(string name)
		{
			if (Localizer.GetLanguage((Language)0).ContainsKey(name))
			{
				return Localizer.GetLanguage((Language)0)[name];
			}
			name = (name.Contains("_1 Prefabs_VB") ? name.Replace("_1 Prefabs_VB", "") : (name.Contains("_1 Weapons_VB") ? name.Replace("_1 Weapons_VB", "") : name));
			name = (name.Contains("_4 Moves_VB") ? name.Replace("_4 Moves_VB", "") : (name.Contains("_2 Projectiles_VB") ? name.Replace("_2 Projectiles_VB", "") : name));
			name = (name.Contains("_3 Effects_VB") ? name.Replace("_3 Effects_VB", "") : (name.Contains("_0 UnitBases_VB") ? name.Replace("_0 UnitBases_VB", "") : name));
			return name;
		}

		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 WaitUntil((Func<bool>)(() => (Object)(object)GameObject.Find("Quit") != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)GameObject.Find("Quit").GetComponentInChildren<LocalizeText>() != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => GameObject.Find("Quit").GetComponentInChildren<LocalizeText>().LocaleID == "BUTTON_QUIT"));
			GameObject sliceObj = ContentDatabase.Instance().LandfallContentDatabase.GetCombatMove(new DatabaseID(-1, 1998224969));
			sliceEffect = sliceObj.GetComponent<BlockMove>().sliceEffect;
			Bundle_Manager.Setup();
			sceneManager = new GameObject("Scene Manager").AddComponent<StreamedSceneManager>();
			Object.DontDestroyOnLoad((Object)(object)sceneManager);
			Code code = new GameObject("Code").AddComponent<Code>();
			new GameObject("AbilityCreatorSavePatch").AddComponent<AbilityCreatorSavePatch>();
			Object.DontDestroyOnLoad((Object)(object)((Component)code).gameObject);
			code.Begin();
			((MonoBehaviour)this).StartCoroutine(code.SpawnButton_Internal());
			Code.commnet = "------------------File stuff------------------------";
			Explosion[] allexplo = Resources.FindObjectsOfTypeAll<Explosion>();
			string Filetext = "";
			string Filetext3 = "";
			string Filetext4 = "";
			string Filetext5 = "";
			string Filetext6 = "";
			string Filetext7 = "";
			string Filetext8 = "";
			string Filetext9 = "";
			string Filetext10 = "";
			string Filetext2 = "";
			int index = 0;
			for (int i = 0; i < allexplo.Length; i++)
			{
				if (!explosions.ContainsValue(((Component)((Component)allexplo[i]).gameObject.transform.root).gameObject))
				{
					index++;
					string name4 = ((Object)((Component)((Component)allexplo[i]).gameObject.transform.root).gameObject).name;
					name4 = (name4.Contains("_1 Prefabs_VB") ? name4.Replace("_1 Prefabs_VB", "") : (name4.Contains("_1 Weapons_VB") ? name4.Replace("_1 Weapons_VB", "") : name4));
					name4 = (name4.Contains("_4 Moves_VB") ? name4.Replace("_4 Moves_VB", "") : (name4.Contains("_2 Projectiles_VB") ? name4.Replace("_2 Projectiles_VB", "") : name4));
					name4 = (name4.Contains("_3 Effects_VB") ? name4.Replace("_3 Effects_VB", "") : (name4.Contains("_0 UnitBases_VB") ? name4.Replace("_0 UnitBases_VB", "") : name4));
					while (explosions.ContainsKey(name4))
					{
						name4 += "+";
					}
					explosions.Add(name4, ((Component)((Component)allexplo[i]).gameObject.transform.root).gameObject);
					Filetext4 += $"\n {index} > {name4}";
				}
			}
			GameObject[] weps = ContentDatabase.Instance().LandfallContentDatabase.GetWeapons().ToArray();
			int index5 = 0;
			for (int j = 0; j < weps.Length; j++)
			{
				if (!weapons.ContainsValue(weps[j]))
				{
					index5++;
					string name8 = ((Object)weps[j]).name;
					name8 = (name8.Contains("_1 Prefabs_VB") ? name8.Replace("_1 Prefabs_VB", "") : (name8.Contains("_1 Weapons_VB") ? name8.Replace("_1 Weapons_VB", "") : name8));
					name8 = (name8.Contains("_4 Moves_VB") ? name8.Replace("_4 Moves_VB", "") : (name8.Contains("_2 Projectiles_VB") ? name8.Replace("_2 Projectiles_VB", "") : name8));
					name8 = (name8.Contains("_3 Effects_VB") ? name8.Replace("_3 Effects_VB", "") : (name8.Contains("_0 UnitBases_VB") ? name8.Replace("_0 UnitBases_VB", "") : name8));
					while (weapons.ContainsKey(name8))
					{
						name8 += "+";
					}
					weapons.Add(name8, weps[j]);
					Filetext2 += $"\n {index5} > {name8}";
				}
			}
			File.WriteAllText(Main.path + "/Weapons.txt", Filetext2);
			File.WriteAllText(Main.path + "/Explosions.txt", Filetext);
			List<Type> allTypes = new List<Type>();
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			for (int k = 0; k < assemblies.Length; k++)
			{
				try
				{
					allTypes.AddRange(assemblies[k].GetTypes());
				}
				catch (ReflectionTypeLoadException ex)
				{
					allTypes.AddRange(ex.Types);
				}
			}
			for (int l = 0; l < allTypes.Count; l++)
			{
				if (typeof(Component).IsAssignableFrom(allTypes[l]))
				{
					string name18 = TypeExtensions.GetCompilableNiceFullName(allTypes[l]);
					while (components.ContainsKey(name18))
					{
						name18 += "+";
					}
					Filetext7 = Filetext7 + ">" + name18 + "\n";
					components.Add(name18, allTypes[l]);
				}
			}
			File.WriteAllText(Main.path + "/Components.txt", Filetext7);
			SoundBankCategory[] catagories = ServiceLocator.GetService<SoundPlayer>().soundBank.Categories;
			for (int m = 0; m < ServiceLocator.GetService<SoundPlayer>().soundBank.Categories.Length; m++)
			{
				for (int o = 0; o < catagories[m].soundEffects.Length; o++)
				{
					Filetext3 = Filetext3 + ">" + catagories[m].categoryName + "&" + catagories[m].soundEffects[o].soundRef + "\n";
					if (ServiceLocator.GetService<SoundPlayer>().soundBank.GetSoundEffect(catagories[m].categoryName + "/" + catagories[m].soundEffects[o].soundRef) != null)
					{
						Filetext6 = Filetext6 + ">" + catagories[m].categoryName + "&" + catagories[m].soundEffects[o].soundRef + "\n";
						sounds.Add(catagories[m].categoryName + "&" + catagories[m].soundEffects[o].soundRef);
					}
				}
			}
			File.WriteAllText(Main.path + "/Sounds.txt", Filetext6);
			UnitEffectBase[] effectBases = Resources.FindObjectsOfTypeAll<UnitEffectBase>();
			index = 0;
			for (int i2 = 0; i2 < effectBases.Length; i2++)
			{
				if (!Effects.ContainsValue(((Component)((Component)effectBases[i2]).gameObject.transform.root).gameObject))
				{
					index++;
					string name12 = ((Object)((Component)((Component)effectBases[i2]).gameObject.transform.root).gameObject).name;
					name12 = (name12.Contains("_1 Prefabs_VB") ? name12.Replace("_1 Prefabs_VB", "") : (name12.Contains("_1 Weapons_VB") ? name12.Replace("_1 Weapons_VB", "") : name12));
					name12 = (name12.Contains("_4 Moves_VB") ? name12.Replace("_4 Moves_VB", "") : (name12.Contains("_2 Projectiles_VB") ? name12.Replace("_2 Projectiles_VB", "") : name12));
					name12 = (name12.Contains("_3 Effects_VB") ? name12.Replace("_3 Effects_VB", "") : (name12.Contains("_0 UnitBases_VB") ? name12.Replace("_0 UnitBases_VB", "") : name12));
					while (Filetext4.Contains(name12))
					{
						name12 += "+";
					}
					Effects.Add(name12, ((Component)((Component)effectBases[i2]).gameObject.transform.root).gameObject);
					Filetext4 = Filetext4 + "\n > " + name12;
				}
			}
			File.WriteAllText(Main.path + "/Effects.txt", Filetext4);
			ParticleSystem[] allParticles = Resources.FindObjectsOfTypeAll<ParticleSystem>();
			for (int i3 = 0; i3 < allParticles.Length; i3++)
			{
				string text = ((Object)((Component)allParticles[i3]).transform.root).name + "+" + ((Object)allParticles[i3]).name;
				while (particles.ContainsKey(text))
				{
					text += "+";
				}
				particles.Add(text, ((Component)allParticles[i3]).gameObject);
				Filetext10 = Filetext10 + "> " + text + "\n";
			}
			File.WriteAllText(Main.path + "/Particles.txt", Filetext10);
			UnitBlueprint[] allunits = ContentDatabase.Instance().GetAllUnitBlueprints().ToArray();
			Dictionary<string, string> langauge = Localizer.GetLanguage((Language)0);
			for (int i4 = 0; i4 < allunits.Length; i4++)
			{
				string name13 = ((!langauge.ContainsKey(allunits[i4].Entity.Name)) ? allunits[i4].Entity.Name : langauge[allunits[i4].Entity.Name]);
				while (units.ContainsKey(name13))
				{
					name13 += "+";
				}
				Filetext8 = Filetext8 + i4 + ">" + name13 + "\n";
				units.Add(name13, allunits[i4]);
			}
			File.WriteAllText(Main.path + "/Units.txt", Filetext8);
			List<Sprite> allsprites = new List<Sprite>();
			allsprites.AddRange(from n in ContentDatabase.Instance().GetFactionIcons()
				select n.Entity.LargeSpriteIcon);
			allsprites.AddRange(from n in ContentDatabase.Instance().GetAllCombatMoves()
				select n.GetComponent<CharacterItem>().Entity.LargeSpriteIcon);
			allsprites.AddRange(from n in ContentDatabase.Instance().GetAllUnitBlueprints()
				where n.IsCustomUnit
				select n.Entity.LargeSpriteIcon);
			int index4 = 0;
			for (int i5 = 0; i5 < allsprites.Count; i5++)
			{
				try
				{
					if (((Object)allsprites[i5]).name != string.Empty)
					{
						pepsis.Add(((Object)allsprites[i5]).name, allsprites[i5]);
						Filetext9 = Filetext9 + index4 + ">" + ((Object)allsprites[i5]).name + "\n";
					}
					index4++;
				}
				catch (Exception)
				{
				}
			}
			File.WriteAllText(Main.path + "/Sprites.txt", Filetext9);
			index = 0;
			Projectile[] projectiles = Resources.FindObjectsOfTypeAll<Projectile>();
			for (int i6 = 0; i6 < projectiles.Length; i6++)
			{
				if (!Projectiles.ContainsValue(((Component)((Component)projectiles[i6]).gameObject.transform.root).gameObject))
				{
					index++;
					string name16 = ((Object)((Component)((Component)projectiles[i6]).gameObject.transform.root).gameObject).name;
					name16 = (name16.Contains("_1 Prefabs_VB") ? name16.Replace("_1 Prefabs_VB", "") : (name16.Contains("_1 Weapons_VB") ? name16.Replace("_1 Weapons_VB", "") : name16));
					name16 = (name16.Contains("_4 Moves_VB") ? name16.Replace("_4 Moves_VB", "") : (name16.Contains("_2 Projectiles_VB") ? name16.Replace("_2 Projectiles_VB", "") : name16));
					name16 = (name16.Contains("_3 Effects_VB") ? name16.Replace("_3 Effects_VB", "") : (name16.Contains("_0 UnitBases_VB") ? name16.Replace("_0 UnitBases_VB", "") : name16));
					while (Filetext5.Contains(name16))
					{
						name16 += "+";
					}
					Projectiles.Add(name16, ((Component)((Component)projectiles[i6]).gameObject.transform.root).gameObject);
					Filetext5 += $"\n {index} > {name16}";
				}
			}
			File.WriteAllText(Main.path + "/Projectiles.txt", Filetext5);
			Code.commnet = "------------------INIT------------------------";
			CreateNodeBlueprint("BATTLE_BEGIN", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.grey, "When Battle Begins", "Triggers", longfield: false, typeof(WhenBattleBegins));
			CreateNodeBlueprint("UNIT_SPAWN", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.grey, "When unit spawns", "Triggers", longfield: false, typeof(WhenUnitSpawned));
			CreateNewNodeBlueprint("ENDBATTLE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "stupidDumbassNode",
					isDropdown = true,
					dropDowns = new string[2] { "Win", "Lose" }
				}
			}, typeof(EndBattle), NodeBlueprint.Type.Function, Color.white, "End battle", "Misc");
			CreateNewNodeBlueprint("GETMAXUNITHEALTH", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveVariable
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "valueType",
					isDropdown = true,
					dropDowns = new string[2] { "Normal", "Precentage" }
				}
			}, typeof(GetMaxUnitHealth), NodeBlueprint.Type.Function, Color.white, "Get max unit health", "Data");
			CreateNewNodeBlueprint("GETUNITHEALTH", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveVariable
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "valueType",
					isDropdown = true,
					dropDowns = new string[2] { "Normal", "Precentage" }
				}
			}, typeof(GetUnitHealth), NodeBlueprint.Type.Function, Color.white, "Get unit health", "Data");
			CreateNewNodeBlueprint("SETUNITHEALTH", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.Trigger
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("value", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "valueType",
					isDropdown = true,
					dropDowns = new string[5] { "Set", "Add", "Set (%)", "Add (%)", "Multiply" }
				}
			}, typeof(SetUnitHealth), NodeBlueprint.Type.Function, Color.white, "Set unit health", "Data");
			CreateNewNodeBlueprint("SETUNITDAMAGE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.Trigger
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("value", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "valueType",
					isDropdown = true,
					dropDowns = new string[5] { "Set", "Add", "Set (%)", "Add (%)", "Multiply" }
				}
			}, typeof(SetUnitDamage), NodeBlueprint.Type.Function, Color.white, "Set unit damage", "Data");
			CreateNewNodeBlueprint("SETUNITCOOLDOWN", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.Trigger
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("value", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "valueType",
					isDropdown = true,
					dropDowns = new string[5] { "Set", "Add", "Set (%)", "Add (%)", "Multiply" }
				}
			}, typeof(SetUnitDamage), NodeBlueprint.Type.Function, Color.white, "Set unit cooldown", "Data");
			CreateNewNodeBlueprint("QUICKBUFF", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.Trigger
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("length", (ContentType)3),
				new NodeBlueprint.Field("amount", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "mode",
					isDropdown = true,
					dropDowns = new string[5] { "All", "Heal only", "Increase damage", "Speed up", "Speed up attacks" }
				}
			}, typeof(QuickBuff), NodeBlueprint.Type.Function, Color.white, "Quick buff", "Data");
			CreateNodeBlueprint("LOG", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.ReciveVariable
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.white, "Log variable", "Variables", longfield: false, typeof(LogVariable));
			CreateNodeBlueprint("LOGANY", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.ReciveAnything
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.white, "Log anything", "Gameobjects", longfield: false, typeof(LogAnything));
			CreateNewNodeBlueprint("ABILITYACTVIATE", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Delay", (ContentType)3),
				new NodeBlueprint.Field("Range", (ContentType)3)
			}, typeof(WhenAbilityTriggered), NodeBlueprint.Type.Input, Color.grey, "When ability triggered...", "Triggers");
			CreateNewNodeBlueprint("UNITWASATTACKED", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Delay", (ContentType)3),
				new NodeBlueprint.Field("Range", (ContentType)3)
			}, typeof(UnitWasAttacked), NodeBlueprint.Type.Input, Color.grey, "When unit gets attacked...", "Triggers");
			CreateNodeBlueprint("INTERVAL", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new Dictionary<string, ContentType> { 
			{
				"Interval",
				(ContentType)3
			} }, NodeBlueprint.Type.Input, Color.grey, "Do Every...", "Triggers", longfield: false, typeof(DoEveryNode));
			CreateNodeBlueprint("WHENUNITDIE", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Input, Color.grey, "When Unit Dies...", "Triggers", longfield: false, typeof(WhenUnitDies));
			CreateNodeBlueprint("WHENUNITDAMAGED", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.GiveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Input, Color.grey, "When unit damaged...", "Triggers", longfield: false, typeof(WhenUnitDamaged));
			CreateNodeBlueprint("WHENUNITATTACKS", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.GiveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Input, Color.grey, "When unit attacks...", "Triggers", longfield: false, typeof(WhenUnitAttacks));
			CreateNewNodeBlueprint("PROJECTILERANGE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Range", (ContentType)3),
				new NodeBlueprint.Field("Block Power", (ContentType)3)
			}, typeof(WhenProjectileEntersRange), NodeBlueprint.Type.Input, Color.grey, "When projectile in range...", "Triggers");
			CreateNodeBlueprint("IS_BATTLE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.grey, "Run if in battle state", "Control", longfield: false, typeof(IsBattleState));
			CreateNodeBlueprint("IS_DEAD", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.grey, "Run if unit is dead", "Control", longfield: false, typeof(IsDead));
			CreateNodeBlueprint("IS_NOTDEAD", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.grey, "Run if unit is alive", "Control", longfield: false, typeof(IsAlive));
			CreateNodeBlueprint("PAUSE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered
			}, new Dictionary<string, ContentType> { 
			{
				"Seconds",
				(ContentType)3
			} }, NodeBlueprint.Type.Function, Color.grey, "Do after pause", "Control", longfield: false, typeof(PauseNode));
			CreateNodeBlueprint("REAPET", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered
			}, new Dictionary<string, ContentType>
			{
				{
					"Times",
					(ContentType)2
				},
				{
					"Delay",
					(ContentType)3
				}
			}, NodeBlueprint.Type.Input, Color.grey, "Repeat", "Control", longfield: false, typeof(ReapetNode));
			CreateNewNodeBlueprint("FOREACH", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Delay", (ContentType)3),
				new NodeBlueprint.Field("filter", (ContentType)0)
				{
					isDropdown = true,
					dropDowns = new string[4] { "All", "Gameobjects only", "Units only", "Components only" }
				}
			}, typeof(ForEachNode), NodeBlueprint.Type.Input, Color.grey, "Repeat for each value", "Control");
			CreateNodeBlueprint("NEWOBJ", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveGameObject }, new Dictionary<string, ContentType> { 
			{
				"Object name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.green, "Create gameObject", "Gameobjects", longfield: false, typeof(CreateGameobject));
			CreateNodeBlueprint("ENEMY", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveUnit }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "Enemy unit", "Units", longfield: false, typeof(EnemyNode));
			CreateNodeBlueprint("SELF", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveUnit }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "Self unit", "Units", longfield: false, typeof(SelfNode));
			CreateNodeBlueprint("EXPSENSIVETEAMMATE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "Most expensive teammate of unit", "Units", longfield: false, typeof(MostExspensiveTeamMateUnit));
			CreateNodeBlueprint("EXPSENSIVEENEMY", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "Most expensive enemy of unit", "Units", longfield: false, typeof(MostExspensiveEnemy));
			CreateNodeBlueprint("ALLTEAM", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveUnit }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "All units of same team", "Units", longfield: false, typeof(AllTeam));
			CreateNodeBlueprint("ALLOTHERTEAM", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveUnit }, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "All units of other team", "Units", longfield: false, typeof(AllOtherTeam));
			CreateNodeBlueprint("TEAMMATE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.GiveUnit,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.green, "Closest team mate of unit", "Unit Tools", longfield: false, typeof(ClosestTeamMateUnit));
			CreateNodeBlueprint("FREAZE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType> { 
			{
				"Length",
				(ContentType)3
			} }, NodeBlueprint.Type.Function, Color.magenta, "freeze unit for", "Unit Tools", longfield: false, typeof(FreezeNode));
			CreateNewNodeBlueprint("GAMEOBJ", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "BodyPart",
					isDropdown = true,
					dropDowns = new string[16]
					{
						"Root", "Head", "Torso", "Hip", "Right Arm", "Left Arm", "Right Hand", "Left Hand", "Right Knee", "Left Knee",
						"Right Foot", "Left Foot", "Mesh", "Both Foots", "Both Hands", "All"
					}
				}
			}, typeof(GetGameobject), NodeBlueprint.Type.Function, Color.green, "Get body part of unit", "Unit Tools");
			CreateNewNodeBlueprint("GETWEAPON", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "WEAPON",
					isDropdown = true,
					dropDowns = new string[3] { "Both", "Left Weapon", "Right Weapon" }
				}
			}, typeof(GetWeapon), NodeBlueprint.Type.Function, Color.green, "Get weapon of unit", "Weapons");
			CreateNewNodeBlueprint("SETFIST", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>(), typeof(SetFistNode), NodeBlueprint.Type.Function, Color.green, "Make unit use fists", "Weapons");
			CreateNewNodeBlueprint("GETEYE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>(), typeof(GetEye), NodeBlueprint.Type.Function, Color.green, "Get eyes of unit", "Unit Tools");
			CreateNewNodeBlueprint("GETWEAPONGLOBAL", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveGameObject }, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Weapon name", (ContentType)0)
				{
					fieldType = NodeBlueprint.Field.FieldType.Weapon
				}
			}, typeof(GetWeaponOfName), NodeBlueprint.Type.Function, Color.magenta, "Get weapon of name", "Weapons");
			CreateNewNodeBlueprint("DEAL_DAMAGE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Damage", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "Type",
					isDropdown = true,
					dropDowns = new string[2] { "Normal", "Precentage" }
				}
			}, typeof(Deal_Damage), NodeBlueprint.Type.Function, Color.red, "Deal Damage", "Unit Tools");
			CreateNodeBlueprint("DIE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.red, "Kill", "Unit Tools", longfield: false, typeof(DieNode));
			CreateNodeBlueprint("REVIVE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.red, "Revive unit", "Unit Tools", longfield: false, typeof(ReDie));
			CreateNewNodeBlueprint("REVIVEFIXER", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "WillBeRevived",
					isDropdown = true,
					dropDowns = new string[2] { "Will be revived", "Wont be revived" }
				}
			}, typeof(SetWillBeRevived), NodeBlueprint.Type.Function, Color.red, "Set will be revived", "Unit Tools");
			CreateNodeBlueprint("SWAPTEAM", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.red, "Swap unit's team", "Unit Tools", longfield: false, typeof(SwapTeam));
			CreateNewNodeBlueprint("SPAWNPROJ", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Projectile", (ContentType)0)
				{
					fieldType = NodeBlueprint.Field.FieldType.Projectile
				},
				new NodeBlueprint.Field("Spread", (ContentType)3)
			}, typeof(SpawnProjectileNode), NodeBlueprint.Type.Function, Color.red, "Spawn projectile", "Projectiles");
			CreateNewNodeBlueprint("PARRYPROJECTILE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "PlaySliceEffect",
					isDropdown = true,
					dropDowns = new string[2] { "Play Slice", "Don't" }
				},
				new NodeBlueprint.Field
				{
					name = "Reflect",
					isDropdown = true,
					dropDowns = new string[2] { "Reflect", "Don't" }
				}
			}, typeof(ParryProjectile), NodeBlueprint.Type.Function, Color.red, "Parry projectile", "Projectiles");
			CreateNewNodeBlueprint("PLAYSLICE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>(), typeof(PlaySlice), NodeBlueprint.Type.Function, Color.red, "Play slice effect", "Projectiles");
			CreateNewNodeBlueprint("EXPLOSION", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "Explosion name",
					contentType = (ContentType)0,
					fieldType = NodeBlueprint.Field.FieldType.Explosion
				},
				new NodeBlueprint.Field("Damage", (ContentType)3),
				new NodeBlueprint.Field
				{
					isDropdown = true,
					dropDowns = new string[2] { "My team", "Other team" },
					name = "Team"
				}
			}, typeof(SpawnExplosionNode), NodeBlueprint.Type.Function, Color.red, "Summon Explosion", "Misc");
			CreateNewNodeBlueprint("PARTICLE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Particle name", (ContentType)0),
				new NodeBlueprint.Field("Size", (ContentType)3),
				new NodeBlueprint.Field("Loop", (ContentType)0)
				{
					isDropdown = true,
					dropDowns = new string[2] { "Loop", "Don't" }
				},
				new NodeBlueprint.Field("Speed", (ContentType)3),
				new NodeBlueprint.Field("Length", (ContentType)3),
				new NodeBlueprint.Field("Follow", (ContentType)3)
				{
					isDropdown = true,
					dropDowns = new string[2] { "Follow", "Don't" }
				}
			}, typeof(SpawnParticleNode), NodeBlueprint.Type.Function, Color.red, "Spawn particle", "Misc");
			CreateNewNodeBlueprint("ADDEFFECT", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Effect", (ContentType)0)
				{
					fieldType = NodeBlueprint.Field.FieldType.Effect
				}
			}, typeof(AddEffectNode), NodeBlueprint.Type.Function, Color.red, "Add Effect to unit", "Unit Tools");
			CreateNodeBlueprint("STUNWEAPONS", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType> { 
			{
				"Time",
				(ContentType)3
			} }, NodeBlueprint.Type.Function, Color.red, "Stun weapons for unit", "Weapons", longfield: false, typeof(StunWeaponsNode));
			CreateNewNodeBlueprint("LETGO", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "WhichHand",
					isDropdown = true,
					dropDowns = new string[3] { "Both", "Right hand", "Left hand" }
				}
			}, typeof(LetGoNode), NodeBlueprint.Type.Function, Color.red, "Let go of stuff at hand", "Unit Tools");
			CreateNewNodeBlueprint("SETWEAPON", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "WhichHand",
					isDropdown = true,
					dropDowns = new string[3] { "Both", "Right", "Left" }
				}
			}, typeof(SetWeaponNode), NodeBlueprint.Type.Function, Color.red, "Set unit's weapon", "Weapons");
			CreateNewNodeBlueprint("SPAWNUNIT", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("unit", (ContentType)0)
				{
					fieldType = NodeBlueprint.Field.FieldType.Unit
				},
				new NodeBlueprint.Field
				{
					name = "Team",
					isDropdown = true,
					dropDowns = new string[2] { "My Team", "Other Team" }
				}
			}, typeof(SpawnUnitNode), NodeBlueprint.Type.Function, Color.red, "Spawn unit at gameobject", "Units");
			CreateNodeBlueprint("ALLABS", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.magenta, "Play all abilites", "Unit Tools", longfield: false, typeof(PlayAllAbilites));
			CreateNodeBlueprint("IMMUNE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType> { 
			{
				"Length",
				(ContentType)3
			} }, NodeBlueprint.Type.Function, Color.magenta, "Make Immune for", "Unit Tools", longfield: false, typeof(MakeUnitImmune));
			CreateNodeBlueprint("TOGGLEPROPS", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new Dictionary<string, ContentType>
			{
				{
					"From",
					(ContentType)2
				},
				{
					"To",
					(ContentType)2
				}
			}, NodeBlueprint.Type.Function, Color.magenta, "Toggle Props at indexs", "Unit Tools", longfield: false, typeof(ToggleProps));
			CreateNodeBlueprint("ADDFORCE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new Dictionary<string, ContentType>
			{
				{
					"Forward",
					(ContentType)3
				},
				{
					"Upwareds",
					(ContentType)3
				},
				{
					"Sideway",
					(ContentType)3
				}
			}, NodeBlueprint.Type.Function, Color.magenta, "Add force to gameobject", "Gameobjects", longfield: false, typeof(AddForceNode));
			CreateNodeBlueprint("ADDFORCEGLOBAL", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new Dictionary<string, ContentType>
			{
				{
					"X",
					(ContentType)3
				},
				{
					"Y",
					(ContentType)3
				},
				{
					"Z",
					(ContentType)3
				}
			}, NodeBlueprint.Type.Function, Color.magenta, "Add global force to gameobject", "Gameobjects", longfield: false, typeof(AddGlobalForceNode));
			CreateNewNodeBlueprint("PLAYSOUND", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("SoundRef", (ContentType)0)
				{
					fieldType = NodeBlueprint.Field.FieldType.Sound
				},
				new NodeBlueprint.Field("Volume", (ContentType)3),
				new NodeBlueprint.Field("Pitch", (ContentType)3)
			}, typeof(PlaySoundNode), NodeBlueprint.Type.Function, Color.magenta, "Play sound at gameobject position", "Gameobjects");
			CreateNewNodeBlueprint("GOTOUNIT", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "IDKME",
					isDropdown = true,
					dropDowns = new string[3] { "Both", "Position only", "Rotation only" }
				},
				new NodeBlueprint.Field
				{
					name = "BodyPart",
					isDropdown = true,
					dropDowns = new string[10] { "Head", "Torso", "Right Arm", "Left Arm", "Right Hand", "Left Hand", "Right Knee", "Left Knee", "Right Foot", "Left Foot" }
				}
			}, typeof(GoToUnitNode), NodeBlueprint.Type.Function, Color.magenta, "Teleport gameobject to unit", "Gameobjects");
			CreateNewNodeBlueprint("ROTATETOUNIT", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.ReciveUnit
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "BodyPart",
					isDropdown = true,
					dropDowns = new string[10] { "Head", "Torso", "Right Arm", "Left Arm", "Right Hand", "Left Hand", "Right Knee", "Left Knee", "Right Foot", "Left Foot" }
				}
			}, typeof(RotateTowardsNode), NodeBlueprint.Type.Function, Color.magenta, "Rotate gameobject towards unit", "Gameobjects");
			CreateNewNodeBlueprint("GETDISTANCE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveVariable
			}, new List<NodeBlueprint.Field>(), typeof(GetDistanceFrom), NodeBlueprint.Type.Function, Color.magenta, "Get distance from unit to gameobject", "Gameobjects");
			CreateNewNodeBlueprint("TRANSFORMPOS", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("x", (ContentType)3),
				new NodeBlueprint.Field("y", (ContentType)3),
				new NodeBlueprint.Field("z", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "TransformType",
					isDropdown = true,
					dropDowns = new string[2] { "Global", "Local" }
				},
				new NodeBlueprint.Field
				{
					name = "TransformTypeOther",
					isDropdown = true,
					dropDowns = new string[2] { "Add", "Set" }
				}
			}, typeof(TransformPositionNode), NodeBlueprint.Type.Function, Color.yellow, "Modify position of gameobj", "Animations");
			CreateNodeBlueprint("TRANSFORMSCALE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new Dictionary<string, ContentType>
			{
				{
					"x",
					(ContentType)3
				},
				{
					"y",
					(ContentType)3
				},
				{
					"z",
					(ContentType)3
				}
			}, NodeBlueprint.Type.Function, Color.yellow, "Change scale of gameobj", "Animations", longfield: false, typeof(TransformScaleNode));
			CreateNewNodeBlueprint("TRANSFORMROT", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("x", (ContentType)3),
				new NodeBlueprint.Field("y", (ContentType)3),
				new NodeBlueprint.Field("z", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "TransformType",
					isDropdown = true,
					dropDowns = new string[2] { "Global", "Local" }
				},
				new NodeBlueprint.Field
				{
					name = "TransformTypeOther",
					isDropdown = true,
					dropDowns = new string[2] { "Add", "Set" }
				}
			}, typeof(TransformRotationNode), NodeBlueprint.Type.Function, Color.yellow, "Modify rotation of gameobj", "Animations");
			CreateNewNodeBlueprint("COLOR", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("red", (ContentType)3),
				new NodeBlueprint.Field("green", (ContentType)3),
				new NodeBlueprint.Field("blue", (ContentType)3),
				new NodeBlueprint.Field("alpha", (ContentType)3),
				new NodeBlueprint.Field("index", (ContentType)2),
				new NodeBlueprint.Field
				{
					name = "Color children",
					isDropdown = true,
					dropDowns = new string[2] { "Color children", "Don't" }
				},
				new NodeBlueprint.Field
				{
					name = "SetOrMod",
					isDropdown = true,
					dropDowns = new string[2] { "Set", "Change" }
				}
			}, typeof(ColorObjectNode), NodeBlueprint.Type.Function, Color.yellow, "Color object", "Gameobjects");
			CreateNewNodeBlueprint("COLORHSV", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Hue", (ContentType)3),
				new NodeBlueprint.Field("Saturation", (ContentType)3),
				new NodeBlueprint.Field("Value", (ContentType)3),
				new NodeBlueprint.Field("alpha", (ContentType)3),
				new NodeBlueprint.Field("index", (ContentType)2),
				new NodeBlueprint.Field
				{
					name = "Color children",
					isDropdown = true,
					dropDowns = new string[2] { "Color children", "Don't" }
				},
				new NodeBlueprint.Field
				{
					name = "SetOrMod",
					isDropdown = true,
					dropDowns = new string[2] { "Set", "Change" }
				}
			}, typeof(ColorObjectNodeHSV), NodeBlueprint.Type.Function, Color.yellow, "Color object (HSV)", "Gameobjects");
			CreateNodeBlueprint("DESTROY", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.yellow, "Destroy", "Gameobjects", longfield: false, typeof(DestroyNode));
			CreateNodeBlueprint("CREATEFUNC", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.Trigger }, new Dictionary<string, ContentType> { 
			{
				"Function name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.yellow, "Create function", "Functions", longfield: false, typeof(CreateFunctionNode));
			CreateNodeBlueprint("RUNFUNC", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.Trigger
			}, new Dictionary<string, ContentType> { 
			{
				"Function name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.yellow, "Run function", "Functions", longfield: false, typeof(RunFunctionNode));
			CreateNodeBlueprint("ADDONHITACTION", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.yellow, "Add projectile hit action ", "Projectiles", longfield: false, typeof(AddProjectileOnHitAction));
			CreateNodeBlueprint("ADDONCOLLISIONACTION", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.yellow, "Add collision enter action ", "Gameobjects", longfield: false, typeof(AddOnCollisionAction));
			CreateNodeBlueprint("ADDCOMP", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveComponent
			}, new Dictionary<string, ContentType> { 
			{
				"Component name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.yellow, "Add Component to gameObj", "Gameobjects", longfield: false, typeof(AddComponentNode));
			CreateNewNodeBlueprint("GETCOMP", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveComponent
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Component name", (ContentType)0),
				new NodeBlueprint.Field
				{
					name = "Max",
					isDropdown = true,
					dropDowns = new string[2] { "First", "All" }
				},
				new NodeBlueprint.Field
				{
					name = "SearchChildren",
					isDropdown = true,
					dropDowns = new string[2] { "Search for children also", "Don't" }
				}
			}, typeof(GetComponentNode), NodeBlueprint.Type.Function, Color.yellow, "Get Component from gameObj", "Gameobjects");
			CreateNodeBlueprint("SetField", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveAnything
			}, new Dictionary<string, ContentType>
			{
				{
					"Field name",
					(ContentType)0
				},
				{
					"Value",
					(ContentType)0
				}
			}, NodeBlueprint.Type.Function, Color.yellow, "Set Field for gameObj", "Gameobjects", longfield: false, typeof(SetFieldNode));
			CreateNodeBlueprint("GETFIELD", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new Dictionary<string, ContentType> { 
			{
				"Field name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.yellow, "Get Field for gameObj", "Gameobjects", longfield: false, typeof(GetFieldNode));
			CreateNodeBlueprint("INVOKE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new Dictionary<string, ContentType> { 
			{
				"Method name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.yellow, "Invoke Method From Component", "Gameobjects", longfield: false, typeof(InvokeMethodNode));
			CreateNodeBlueprint("DUPE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.yellow, "Duplicate object", "Gameobjects", longfield: false, typeof(Duplicate));
			CreateNewNodeBlueprint("SETACTIVE", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveGameObject
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field
				{
					name = "banana",
					isDropdown = true,
					dropDowns = new string[3] { "Toggle", "False", "True" }
				}
			}, typeof(SetActive), NodeBlueprint.Type.Function, Color.yellow, "Set Active", "Gameobjects");
			CreateNodeBlueprint("VARCREATE", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveVariable }, new Dictionary<string, ContentType> { 
			{
				"variable name",
				(ContentType)0
			} }, NodeBlueprint.Type.Function, Color.white, "Get variable", "Variables", longfield: false, typeof(CreateVariableNode));
			CreateNodeBlueprint("VARADD", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveVariable
			}, new Dictionary<string, ContentType> { 
			{
				"value",
				(ContentType)3
			} }, NodeBlueprint.Type.Function, Color.white, "Change variable by", "Variables", longfield: false, typeof(ChangeVariableBy));
			CreateNodeBlueprint("VARSET", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Trigger,
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveVariable
			}, new Dictionary<string, ContentType> { 
			{
				"value",
				(ContentType)3
			} }, NodeBlueprint.Type.Function, Color.white, "Set variable to", "Variables", longfield: false, typeof(SetVariableTo));
			CreateNewNodeBlueprint("VARIF", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.Triggered,
				NodeBlueprint.ConnectionType.ReciveVariable,
				NodeBlueprint.ConnectionType.Trigger
			}, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("value", (ContentType)3),
				new NodeBlueprint.Field
				{
					name = "Operator",
					isDropdown = true,
					dropDowns = new string[5] { "=", ">", "<", "<=", ">=" }
				}
			}, typeof(IfVariableNode), NodeBlueprint.Type.Function, Color.white, "If variable", "Variables");
			CreateNewNodeBlueprint("RANDOM", new List<NodeBlueprint.ConnectionType> { NodeBlueprint.ConnectionType.GiveVariable }, new List<NodeBlueprint.Field>
			{
				new NodeBlueprint.Field("Min Value", (ContentType)2),
				new NodeBlueprint.Field("Max Value", (ContentType)2),
				new NodeBlueprint.Field
				{
					name = "TypeTarTarTart",
					isDropdown = true,
					dropDowns = new string[2] { "Static", "Dyanamic" }
				}
			}, typeof(RandomNode), NodeBlueprint.Type.Function, Color.white, "Choose Random", "Variables");
			CreateNodeBlueprint("CONVERTOBJ", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveGameObject,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.black, "Convert gameobject to anything", "Convert", longfield: false, typeof(ConvertObj));
			CreateNodeBlueprint("CONVERTUNIT", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveUnit,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.black, "Convert unit to anything", "Convert", longfield: false, typeof(ConvertUnit));
			CreateNodeBlueprint("CONVERTCOMP", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveComponent,
				NodeBlueprint.ConnectionType.GiveAnything
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.black, "Convert component to anything", "Convert", longfield: false, typeof(ConvertComp));
			CreateNodeBlueprint("CONVERTOBJ2", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveGameObject
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.black, "Convert anything to gameobject", "Convert", longfield: false, typeof(AnythingToObj));
			CreateNodeBlueprint("CONVERTUNIT2", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveUnit
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.black, "Convert anything to unit", "Convert", longfield: false, typeof(AnythingToUnit));
			CreateNodeBlueprint("CONVERTCOMP2", new List<NodeBlueprint.ConnectionType>
			{
				NodeBlueprint.ConnectionType.ReciveAnything,
				NodeBlueprint.ConnectionType.GiveComponent
			}, new Dictionary<string, ContentType>(), NodeBlueprint.Type.Function, Color.black, "Convert anything to component", "Convert", longfield: false, typeof(ConvertComp2));
			string[] directories = Directory.GetDirectories(abilitespath);
			for (int i7 = 0; i7 < directories.Length; i7++)
			{
				string[] files = Directory.GetFiles(directories[i7]);
				foreach (string path in files)
				{
					if (!(Path.GetExtension(path) != ".ability"))
					{
						SavedNodeScene n2 = DeserializeAbility(File.ReadAllText(path));
						AddAbility(n2.SavedNodeSceneToNodeScene());
					}
				}
			}
			Code.commnet = "------------------Ability------------------------";
		}

		public static GameObject CreateAbility(NodeScene nodeScene, bool isFinal = false)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if (!nodeScenes.Contains(nodeScene))
			{
				nodeScenes.Add(nodeScene);
			}
			GameObject val = new GameObject(nodeScene.sceneName);
			if (isFinal)
			{
				((Object)val).hideFlags = (HideFlags)61;
			}
			SpecialAbility val2 = val.AddComponent<SpecialAbility>();
			val2.SetField("m_entity", (object)new DatabaseEntity((WorkshopContentType)5)
			{
				GUID = new DatabaseID
				{
					m_ID = nodeScene.id,
					m_modID = -2
				},
				Name = nodeScene.sceneName
			});
			NodeRunner nodeRunner = val.AddComponent<NodeRunner>();
			nodeRunner.nodeScene = nodeScene;
			nodeScene.isFinal = isFinal;
			val.AddComponent<NodeRunnerFixer>();
			val.AddComponent<DodgeMove>();
			val.AddComponent<ConditionalEvent>();
			GoToBodyPart val3 = val.AddComponent<GoToBodyPart>();
			val3.targetPart = (TargetPart)1;
			val.AddComponent<OnlyRunWhenAddedToUnit>();
			((CharacterItem)val2).Entity.SetSpriteIcon(GetSprite(nodeScene));
			return val;
		}

		public static void AddAbility(NodeScene nodeScene)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject val = CreateAbility(nodeScene, isFinal: true);
				SpecialAbility component = val.GetComponent<SpecialAbility>();
				SavedNodeSceneStorer.gameobjs.Add(val);
				nodeIDS.Add(((CharacterItem)component).Entity.GUID);
				LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
				AssetLoader assetLoader = ContentDatabase.Instance().AssetLoader;
				Dictionary<DatabaseID, Object> field = assetLoader.GetField<Dictionary<DatabaseID, Object>>("m_nonStreamableAssets");
				Dictionary<DatabaseID, GameObject> field2 = landfallContentDatabase.GetField<Dictionary<DatabaseID, GameObject>>("m_combatMoves");
				if (!field.ContainsKey(((CharacterItem)component).Entity.GUID))
				{
					field.Add(((CharacterItem)component).Entity.GUID, (Object)(object)val);
				}
				else
				{
					field[((CharacterItem)component).Entity.GUID] = (Object)(object)val;
				}
				if (!field2.ContainsKey(((CharacterItem)component).Entity.GUID))
				{
					field2.Add(((CharacterItem)component).Entity.GUID, val);
				}
				else
				{
					field2[((CharacterItem)component).Entity.GUID] = val;
				}
				landfallContentDatabase.SetField("m_combatMoves", field2);
				assetLoader.SetField("m_nonStreamableAssets", field);
				((CharacterItem)component).tags.Add(new Tag((TagType)0, "Custom Abilites"));
				if (abilites.ContainsKey(val.GetComponent<NodeRunner>().nodeScene.sceneName))
				{
					abilites.Remove(val.GetComponent<NodeRunner>().nodeScene.sceneName);
				}
				abilites.Add(val.GetComponent<NodeRunner>().nodeScene.sceneName, val);
			}
			catch
			{
			}
		}

		private void CreateNodeBlueprint(string key, List<NodeBlueprint.ConnectionType> connectionsTypes, Dictionary<string, ContentType> fields, NodeBlueprint.Type type, Color color, string name, string Tab, bool longfield = false, Type node = null)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			if (nodeDatabase.ContainsKey(key))
			{
				key += "+";
			}
			List<NodeBlueprint.Field> list = new List<NodeBlueprint.Field>();
			KeyValuePair<string, ContentType>[] array = fields.ToArray();
			for (int i = 0; i < array.Length; i++)
			{
				list.Add(new NodeBlueprint.Field
				{
					contentType = array[i].Value,
					name = array[i].Key
				});
			}
			if (node != null)
			{
				NodeBlueprint obj = new NodeBlueprint
				{
					color = color,
					key = key,
					Name = name,
					type = type,
					fields = list,
					LongField = longfield
				};
				((Object)obj).name = name;
				obj.connections = connectionsTypes;
				obj.nodeFunction = node;
				obj.tab = Tab;
				NodeBlueprint value = obj;
				nodeDatabase.Add(key, value);
				Object.DontDestroyOnLoad((Object)(object)nodeDatabase[key]);
			}
			else
			{
				NodeBlueprint obj2 = new NodeBlueprint
				{
					color = color,
					key = key,
					Name = name,
					type = type,
					fields = list,
					LongField = longfield
				};
				((Object)obj2).name = name;
				obj2.connections = connectionsTypes;
				obj2.tab = Tab;
				NodeBlueprint value2 = obj2;
				nodeDatabase.Add(key, value2);
			}
		}

		private void CreateNewNodeBlueprint(string key, List<NodeBlueprint.ConnectionType> connectionsTypes, List<NodeBlueprint.Field> fields, Type node, NodeBlueprint.Type type, Color color, string name, string Tab, bool longfield = false)
		{
			//IL_0023: 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)
			if (nodeDatabase.ContainsKey(key))
			{
				key += "+";
			}
			NodeBlueprint obj = new NodeBlueprint
			{
				color = color,
				key = key,
				Name = name,
				type = type,
				fields = fields,
				LongField = longfield
			};
			((Object)obj).name = name;
			obj.connections = connectionsTypes;
			obj.nodeFunction = node;
			obj.tab = Tab;
			NodeBlueprint value = obj;
			nodeDatabase.Add(key, value);
			Object.DontDestroyOnLoad((Object)(object)nodeDatabase[key]);
		}

		public static void Reload()
		{
			MReload();
		}

		public static void MReload()
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			SavedNodeSceneStorer.nodeScenes.Clear();
			SavedNodeSceneStorer.m_savedNodes.Clear();
			SavedNodeSceneStorer.savedNodeScenes.Clear();
			abilites = new Dictionary<string, GameObject>();
			nodeScenes = new List<NodeScene>();
			ContentDatabase val = ContentDatabase.Instance();
			LandfallContentDatabase landfallContentDatabase = val.LandfallContentDatabase;
			Dictionary<DatabaseID, GameObject> field = landfallContentDatabase.GetField<Dictionary<DatabaseID, GameObject>>("m_combatMoves");
			KeyValuePair<DatabaseID, GameObject>[] array = field.Where((KeyValuePair<DatabaseID, GameObject> n) => !nodeIDS.Contains(n.Key)).ToArray();
			Dictionary<DatabaseID, GameObject> dictionary = new Dictionary<DatabaseID, GameObject>();
			for (int i = 0; i < array.Length; i++)
			{
				dictionary.Add(array[i].Key, array[i].Value);
			}
			landfallContentDatabase.SetField("m_combatMoves", dictionary);
			AssetLoader assetLoader = val.AssetLoader;
			Dictionary<DatabaseID, Object> field2 = assetLoader.GetField<Dictionary<DatabaseID, Object>>("m_nonStreamableAssets");
			KeyValuePair<DatabaseID, Object>[] array2 = field2.Where((KeyValuePair<DatabaseID, Object> n) => !nodeIDS.Contains(n.Key)).ToArray();
			Dictionary<DatabaseID, Object> dictionary2 = new Dictionary<DatabaseID, Object>();
			for (int j = 0; j < array2.Length; j++)
			{
				dictionary2.Add(array2[j].Key, array2[j].Value);
			}
			assetLoader.SetField("m_nonStreamableAssets", dictionary2);
			NodeScene[] array3 = Object.FindObjectsOfType<NodeScene>();
			CollectionExtensions.Do<NodeScene>((IEnumerable<NodeScene>)array3, (Action<NodeScene>)delegate(NodeScene n)
			{
				Object.Destroy((Object)(object)((Component)n).gameObject);
			});
			string[] directories = Directory.GetDirectories(abilitespath);
			for (int k = 0; k < directories.Length; k++)
			{
				string[] files = Directory.GetFiles(directories[k]);
				foreach (string text in files)
				{
					if (!(Path.GetExtension(text) != ".ability"))
					{
						SavedNodeScene savedNodeScene = DeserializeAbility(File.ReadAllText(text));
						AddAbility(savedNodeScene.SavedNodeSceneToNodeScene());
					}
				}
			}
			UnitBlueprint[] array4 = val.UserContentDatabase.GetUnitBlueprints().ToArray();
			for (int m = 0; m < array4.Length; m++)
			{
				CleanUnitblueprint(array4[m]);
			}
		}

		private static void CleanUnitblueprint(UnitBlueprint unitBlueprint)
		{
			for (int i = 0; i < unitBlueprint.objectsToSpawnAsChildren.Length; i++)
			{
				try
				{
					GameObject val = unitBlueprint.objectsToSpawnAsChildren[i];
					if (Object.op_Implicit((Object)(object)val.GetComponent<NodeRunner>()))
					{
						List<GameObject> list = unitBlueprint.objectsToSpawnAsChildren.ToList();
						list.Remove(val);
						list.Add(abilites[((Object)val).name]);
						unitBlueprint.objectsToSpawnAsChildren = list.ToArray();
					}
				}
				catch
				{
				}
			}
		}

		public static string CleanNodeName(string name)
		{
			return name.Replace("<", "").Replace(">", "").Replace("/", "")
				.Replace("\\", "")
				.Replace(":", "")
				.Replace("*", "")
				.Replace("?", "")
				.Replace("\"", "")
				.Replace("|", "");
		}

		public static string GetPath(NodeScene nodeScene)
		{
			return abilitespath + "/" + CleanNodeName(nodeScene.sceneName) + "/" + nodeScene.id + ".ability";
		}

		public static string GetPath(SavedNodeScene nodeScene)
		{
			return abilitespath + "/" + CleanNodeName(nodeScene.sceneName) + "/" + nodeScene.id + ".ability";
		}

		public static SavedNodeScene DeserializeAbility(string json)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			JsonSerializerSettings val = new JsonSerializerSettings
			{
				ReferenceLoopHandling = (ReferenceLoopHandling)1
			};
			SavedNodeScene savedNodeScene = JsonConvert.DeserializeObject<SavedNodeScene>(json, val);
			SavedNodeSceneStorer.savedNodeScenes.Add(savedNodeScene);
			return savedNodeScene;
		}

		public static Sprite GetSprite(NodeScene nodeScene)
		{
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//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)
			string text = "";
			string[] files = Directory.GetFiles(Directory.GetParent(GetPath(nodeScene)).FullName);
			for (int i = 0; i < files.Length; i++)
			{
				if ((Path.GetExtension(files[i]) == ".png") | (Path.GetExtension(files[i]) == ".bmp"))
				{
					text = files[i];
				}
			}
			if (text != "")
			{
				Texture2D val = new Texture2D(0, 0);
				ImageConversion.LoadImage(val, File.ReadAllBytes(text));
				return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero);
			}
			if (pepsis.ContainsKey(nodeScene.sceneImage))
			{
				return pepsis[nodeScene.sceneImage];
			}
			return null;
		}

		public static Sprite GetSprite(SavedNodeScene nodeScene)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				string text = "";
				string[] files = Directory.GetFiles(Directory.GetParent(GetPath(nodeScene)).FullName);
				for (int i = 0; i < files.Length; i++)
				{
					if ((Path.GetExtension(files[i]) == ".png") | (Path.GetExtension(files[i]) == ".bmp"))
					{
						text = files[i];
					}
				}
				if (text != "")
				{
					Texture2D val = new Texture2D