using System;
using System.Collections;
using System.Collections.Generic;
using LOS;
using TheVegetationEngine;
using TMPro;
using ToonyColorsPro.Runtime;
using UnityEngine;
using UnityEngine.Scripting;

// Token: 0x02000087 RID: 135
public class Links : MonoBehaviour
{
	// Token: 0x06000D74 RID: 3444 RVA: 0x001019D4 File Offset: 0x000FFBD4
	private void Awake()
	{
		Links.x = base.gameObject.GetComponent<Links>();
		Links.origin = base.gameObject;
		this.gaia = Links.origin.GetComponent<Gaia>();
		this.partyColorHex = ColorUtility.ToHtmlStringRGB(this.partyColor);
		this.peacefulColorHex = ColorUtility.ToHtmlStringRGB(this.peacefulColor);
		this.hostileColorHex = ColorUtility.ToHtmlStringRGB(this.hostileColor);
		for (int i = 0; i < this.partyColors.Length; i++)
		{
			this.partyColorsHex[i] = ColorUtility.ToHtmlStringRGB(this.partyColors[i]);
			this.partyColorsHexRichText[i] = "<color #" + this.partyColorsHex[i] + ">";
		}
		this.openPartyColors.Add(0);
		this.openPartyColors.Add(1);
		this.openPartyColors.Add(2);
		this.openPartyColors.Add(3);
		this.openPartyColors.Add(4);
		GarbageCollector.GCMode = GarbageCollector.Mode.Enabled;
		this.characterSheet.canvas.enabled = true;
		if (this.creation)
		{
			this.creation.gameObject.SetActive(false);
		}
		this.menuCamera.enabled = true;
		Shader.SetGlobalFloat("_Pocket", 0f);
		this.mainCameraMask = this.worldCamera.cullingMask;
		Links.x.camera3D.enabled = true;
	}

	// Token: 0x06000D75 RID: 3445 RVA: 0x00101B3C File Offset: 0x000FFD3C
	private void Update()
	{
		Links.x.gameplay.mk = true;
		Links.x.gameplay.joy = false;
		if (Records.x.usingController && Links.x.gameplay.currentControllerCount > 0)
		{
			Links.x.gameplay.mk = false;
			Links.x.gameplay.joy = true;
		}
		this.mk = Links.x.gameplay.mk;
		this.joy = Links.x.gameplay.joy;
		bool flag = this.hasMain;
		if (this.main)
		{
			this.hasMain = true;
		}
		else
		{
			this.hasMain = false;
		}
		if (AstarPath.active != null)
		{
			this.gaia.noAstar = false;
			return;
		}
		this.gaia.noAstar = true;
	}

	// Token: 0x06000D76 RID: 3446 RVA: 0x00101C1C File Offset: 0x000FFE1C
	public int GetPartyID(Character obj)
	{
		int count = this.party.Count;
		for (int i = 0; i < count; i++)
		{
			if (obj == this.party[i])
			{
				return i;
			}
		}
		return -1;
	}

	// Token: 0x06000D77 RID: 3447 RVA: 0x00101C58 File Offset: 0x000FFE58
	public Character GetCreationID(int x)
	{
		int count = this.party.Count;
		for (int i = 0; i < count; i++)
		{
			if (this.party[i] && this.party[i].party && this.party[i].stats.partyID == x)
			{
				return this.party[i];
			}
		}
		return null;
	}

	// Token: 0x06000D78 RID: 3448 RVA: 0x00101CCC File Offset: 0x000FFECC
	public int GetPortraitIndex(Character obj, bool ignoreNull)
	{
		int count = this.portraitOrder.Count;
		if (!ignoreNull)
		{
			for (int i = 0; i < count; i++)
			{
				if (obj == this.party[i])
				{
					return i;
				}
			}
		}
		else
		{
			int num = 0;
			for (int j = 0; j < count; j++)
			{
				if (obj == this.portraitOrder[j])
				{
					return num;
				}
				if (this.portraitOrder[j] && this.portraitOrder[j].selected)
				{
					num++;
				}
			}
		}
		return -1;
	}

	// Token: 0x06000D79 RID: 3449 RVA: 0x00101D5C File Offset: 0x000FFF5C
	public int GetPortraitIndexWaypoints(Character obj)
	{
		int count = this.portraitOrder.Count;
		if (obj == this.main)
		{
			return 0;
		}
		int num = 1;
		for (int i = 0; i < count; i++)
		{
			if (obj == this.portraitOrder[i])
			{
				return num;
			}
			if (this.portraitOrder[i] && !this.portraitOrder[i].mainSelected)
			{
				num++;
			}
		}
		return -1;
	}

	// Token: 0x06000D7A RID: 3450 RVA: 0x00101DD4 File Offset: 0x000FFFD4
	public int GetPartyIDReal(Character obj)
	{
		int count = this.party.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (obj == this.party[i])
			{
				return num;
			}
			if (this.party[i] && this.party[i].selected)
			{
				num++;
			}
		}
		return -1;
	}

	// Token: 0x06000D7B RID: 3451 RVA: 0x00101E3C File Offset: 0x0010003C
	public bool InParty(Character c)
	{
		return this.portraitOrder.Contains(c);
	}

	// Token: 0x06000D7C RID: 3452 RVA: 0x00101E50 File Offset: 0x00100050
	public int GetPartySummonsIDReal(Character obj)
	{
		int count = this.party.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (obj == this.party[i])
			{
				return num;
			}
			if (this.party[i] && this.party[i].summoned)
			{
				num++;
			}
		}
		return -1;
	}

	// Token: 0x06000D7D RID: 3453 RVA: 0x00101EB8 File Offset: 0x001000B8
	public Character GetPortraitID(int id)
	{
		if (id < this.portraitOrder.Count)
		{
			return this.portraitOrder[id];
		}
		return null;
	}

	// Token: 0x06000D7E RID: 3454 RVA: 0x00101ED8 File Offset: 0x001000D8
	public Character GetHotKeyCharacter(int key)
	{
		int count = this.portraitOrder.Count;
		this.tempPortraitOrder.Clear();
		for (int i = 0; i < count; i++)
		{
			if (i == 0)
			{
				this.tempPortraitOrder.Add(this.portraitOrder[i]);
			}
			else
			{
				bool flag = false;
				for (int j = 0; j < this.tempPortraitOrder.Count; j++)
				{
					if (!flag && this.portraitOrder[i].stats.partyID < this.tempPortraitOrder[j].stats.partyID)
					{
						flag = true;
						this.tempPortraitOrder.Insert(j, this.portraitOrder[i]);
					}
				}
				if (!flag)
				{
					this.tempPortraitOrder.Add(this.portraitOrder[i]);
				}
			}
		}
		for (int k = 0; k < this.tempPortraitOrder.Count; k++)
		{
			if (k == key)
			{
				return this.tempPortraitOrder[k];
			}
		}
		return null;
	}

	// Token: 0x06000D7F RID: 3455 RVA: 0x00101FD5 File Offset: 0x001001D5
	public int GetPortraitCount()
	{
		return this.portraitOrder.Count;
	}

	// Token: 0x06000D80 RID: 3456 RVA: 0x00101FE4 File Offset: 0x001001E4
	public int GetPortraitOrder(Character obj)
	{
		int count = this.portraitOrder.Count;
		for (int i = 0; i < count; i++)
		{
			if (obj == this.portraitOrder[i])
			{
				return i;
			}
		}
		return -1;
	}

	// Token: 0x06000D81 RID: 3457 RVA: 0x00102020 File Offset: 0x00100220
	public void OrderPortraitList()
	{
		int count = this.portraitOrder.Count;
		this.tempPortraitOrder.Clear();
		for (int i = 0; i < count; i++)
		{
			if (i == 0)
			{
				this.tempPortraitOrder.Add(this.portraitOrder[i]);
			}
			else
			{
				bool flag = false;
				for (int j = 0; j < this.tempPortraitOrder.Count; j++)
				{
					if (!flag && this.portraitOrder[i].stats.formationGroup < this.tempPortraitOrder[j].stats.formationGroup)
					{
						flag = true;
						this.tempPortraitOrder.Insert(j, this.portraitOrder[i]);
					}
				}
				if (!flag)
				{
					this.tempPortraitOrder.Add(this.portraitOrder[i]);
				}
			}
		}
		for (int k = 0; k < count; k++)
		{
			this.portraitOrder[k] = this.tempPortraitOrder[k];
		}
	}

	// Token: 0x06000D82 RID: 3458 RVA: 0x0010211C File Offset: 0x0010031C
	public int GetSelectedCount()
	{
		int count = this.party.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (this.party[i] && this.party[i].selected)
			{
				num++;
			}
		}
		return num;
	}

	// Token: 0x06000D83 RID: 3459 RVA: 0x00102170 File Offset: 0x00100370
	public int GetSummonsCount(int type)
	{
		int count = this.party.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (this.party[i].summoned && !this.party[i].dead && !this.party[i].missing)
			{
				string xmlName = this.party[i].stats.xmlName;
				bool flag = false;
				if (xmlName.Contains("Summon"))
				{
					flag = true;
				}
				string race = this.party[i].stats.race;
				if (!flag && ((type == 0 && race != "Vol") || (type == 1 && race == "Vol")))
				{
					num++;
				}
			}
		}
		return num;
	}

	// Token: 0x06000D84 RID: 3460 RVA: 0x00102244 File Offset: 0x00100444
	public Character GetFirstInFormation()
	{
		for (int i = 0; i < this.formationOrder.Count; i++)
		{
			if (this.formationOrder[i] && this.formationOrder[i].IsSentient())
			{
				return this.formationOrder[i];
			}
		}
		return null;
	}

	// Token: 0x06000D85 RID: 3461 RVA: 0x0010229C File Offset: 0x0010049C
	public void SetFormationOrder()
	{
		this.formationOrder.Clear();
		for (int i = 0; i < this.portraitOrder.Count; i++)
		{
			if (i == 0)
			{
				this.formationOrder.Add(this.portraitOrder[i]);
			}
			else
			{
				bool flag = false;
				for (int j = 0; j < this.formationOrder.Count; j++)
				{
					if (!flag && this.portraitOrder[i].stats.formationGroup < this.formationOrder[j].stats.formationGroup)
					{
						this.formationOrder.Insert(j, this.portraitOrder[i]);
						flag = true;
					}
				}
				if (!flag)
				{
					this.formationOrder.Add(this.portraitOrder[i]);
				}
			}
		}
	}

	// Token: 0x06000D86 RID: 3462 RVA: 0x00102369 File Offset: 0x00100569
	public int GetOpenPartyColor()
	{
		if (this.openPartyColors.Count > 0)
		{
			int num = this.openPartyColors[0];
			this.openPartyColors.RemoveAt(0);
			return num;
		}
		return 5;
	}

	// Token: 0x06000D87 RID: 3463 RVA: 0x00102394 File Offset: 0x00100594
	public int MatchTerrainColors(Color32 singleColor)
	{
		Color color = this.terrainColors[0];
		for (int i = 0; i < this.terrainColors.Length; i++)
		{
			color = this.terrainColors[i];
			float num = (float)singleColor.r / 255f - color.r;
			if (num < 0f)
			{
				num *= -1f;
			}
			if (num < 0.01f)
			{
				float num2 = (float)singleColor.g / 255f - color.g;
				if (num2 < 0f)
				{
					num2 *= -1f;
				}
				if (num2 < 0.01f)
				{
					float num3 = (float)singleColor.b / 255f - color.b;
					if (num3 < 0f)
					{
						num3 *= -1f;
					}
					if (num3 < 0.01f)
					{
						return i;
					}
				}
			}
		}
		return 0;
	}

	// Token: 0x06000D88 RID: 3464 RVA: 0x00102480 File Offset: 0x00100680
	public Vector3 GetMainPosition()
	{
		if (this.hasMain)
		{
			return Links.x.main.torsoPosition;
		}
		return Vector3.zero;
	}

	// Token: 0x06000D89 RID: 3465 RVA: 0x001024A0 File Offset: 0x001006A0
	public void GetOpenPartyColorFromSave(int id)
	{
		if (this.openPartyColors.Count > 0)
		{
			int num = this.openPartyColors.IndexOf(id);
			if (num >= 0)
			{
				this.openPartyColors.RemoveAt(num);
			}
		}
	}

	// Token: 0x06000D8A RID: 3466 RVA: 0x001024D8 File Offset: 0x001006D8
	public void ReturnPartyColor(int id)
	{
		if (id < 5)
		{
			this.openPartyColors.Add(id);
		}
	}

	// Token: 0x06000D8B RID: 3467 RVA: 0x001024EC File Offset: 0x001006EC
	public int GetPartyCount()
	{
		int count = this.portraitOrder.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (this.portraitOrder[i])
			{
				num++;
			}
		}
		return num;
	}

	// Token: 0x06000D8C RID: 3468 RVA: 0x0010252C File Offset: 0x0010072C
	public int GetFreePartyNode()
	{
		int count = this.portraitOrder.Count;
		for (int i = 0; i < 14; i++)
		{
			int num = i;
			bool flag = true;
			for (int j = 0; j < count; j++)
			{
				if (this.portraitOrder[j] && this.portraitOrder[j].nodeStationaryID == num)
				{
					flag = false;
				}
			}
			if (flag)
			{
				return num;
			}
		}
		return 6;
	}

	// Token: 0x06000D8D RID: 3469 RVA: 0x00102598 File Offset: 0x00100798
	public int SentientPartyCount()
	{
		int count = this.portraitOrder.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (this.portraitOrder[i] && !this.portraitOrder[i].isBoro && this.portraitOrder[i].IsSentient())
			{
				num++;
			}
		}
		return num;
	}

	// Token: 0x06000D8E RID: 3470 RVA: 0x00102600 File Offset: 0x00100800
	public Character GetFirstAvailableParty(Vector3 point)
	{
		int count = this.portraitOrder.Count;
		for (int i = 0; i < count; i++)
		{
			if (this.portraitOrder[i] && !this.portraitOrder[i].isBoro && this.portraitOrder[i].IsSentient())
			{
				return this.portraitOrder[i];
			}
		}
		return null;
	}

	// Token: 0x06000D8F RID: 3471 RVA: 0x0010266C File Offset: 0x0010086C
	public Character GetSecondAvailableParty(Vector3 point, Character firstCharacter)
	{
		int count = this.portraitOrder.Count;
		if (firstCharacter)
		{
			for (int i = 0; i < count; i++)
			{
				if (this.portraitOrder[i] && this.portraitOrder[i] != firstCharacter && !this.portraitOrder[i].isBoro)
				{
					return this.portraitOrder[i];
				}
			}
		}
		return null;
	}

	// Token: 0x06000D90 RID: 3472 RVA: 0x001026E4 File Offset: 0x001008E4
	public Character GetThirdAvailableParty(Vector3 point, Character firstCharacter, Character secondCharacter)
	{
		int count = this.portraitOrder.Count;
		if (firstCharacter)
		{
			point = firstCharacter.tr.position;
			for (int i = 0; i < count; i++)
			{
				if (this.portraitOrder[i] && this.portraitOrder[i] != firstCharacter && this.portraitOrder[i] != secondCharacter && !this.portraitOrder[i].isBoro)
				{
					return this.portraitOrder[i];
				}
			}
		}
		return null;
	}

	// Token: 0x06000D91 RID: 3473 RVA: 0x0010277C File Offset: 0x0010097C
	public Character GetFourthAvailableParty(Vector3 point, Character firstCharacter, Character secondCharacter, Character thirdCharacter)
	{
		int count = this.portraitOrder.Count;
		if (firstCharacter)
		{
			point = firstCharacter.tr.position;
			for (int i = 0; i < count; i++)
			{
				if (this.portraitOrder[i] && this.portraitOrder[i] != firstCharacter && this.portraitOrder[i] != secondCharacter && this.portraitOrder[i] != thirdCharacter && !this.portraitOrder[i].isBoro)
				{
					return this.portraitOrder[i];
				}
			}
		}
		return null;
	}

	// Token: 0x06000D92 RID: 3474 RVA: 0x0010282C File Offset: 0x00100A2C
	public int GetPartyCountNoSummons()
	{
		int count = this.party.Count;
		int num = 0;
		for (int i = 0; i < count; i++)
		{
			if (this.party[i] && this.party[i].party && this.party[i].IsSentient())
			{
				num++;
			}
		}
		return num;
	}

	// Token: 0x06000D93 RID: 3475 RVA: 0x00102894 File Offset: 0x00100A94
	public Character GetNonLeader()
	{
		int count = this.party.Count;
		for (int i = 0; i < count; i++)
		{
			if (this.party[i] && this.party[i].party && this.party[i].IsSentient() && !this.party[i].mainSelected)
			{
				return this.party[i];
			}
		}
		return null;
	}

	// Token: 0x06000D94 RID: 3476 RVA: 0x00102914 File Offset: 0x00100B14
	public Character GetPartyFromName(string n)
	{
		int count = this.party.Count;
		for (int i = 0; i < count; i++)
		{
			if (this.party[i] && this.party[i].party && n == this.party[i].stats.GetName())
			{
				return this.party[i];
			}
		}
		return null;
	}

	// Token: 0x06000D95 RID: 3477 RVA: 0x0010298C File Offset: 0x00100B8C
	public Vector3 NearestIncense(Vector3 point)
	{
		float num = float.PositiveInfinity;
		int num2 = -1;
		for (int i = 0; i < this.party.Count; i++)
		{
			Character character = this.party[i];
			if (character && character.party && character.hasIncenseTorch)
			{
				float sqrMagnitude = this.SubtractVectors(character.tr.position, point).sqrMagnitude;
				if (sqrMagnitude < num)
				{
					num = sqrMagnitude;
					num2 = i;
				}
			}
		}
		if (num2 > -1)
		{
			return this.party[num2].currentPosition;
		}
		return Links.x.main.currentPosition;
	}

	// Token: 0x06000D96 RID: 3478 RVA: 0x00102A34 File Offset: 0x00100C34
	public Character GetNearestParty(Vector3 point)
	{
		float num = float.PositiveInfinity;
		int num2 = -1;
		for (int i = 0; i < this.party.Count; i++)
		{
			Character character = this.party[i];
			if (character && !character.dead && character.party)
			{
				float sqrMagnitude = this.SubtractVectors(character.tr.position, point).sqrMagnitude;
				if (sqrMagnitude < num)
				{
					num = sqrMagnitude;
					num2 = i;
				}
			}
		}
		if (num2 > -1)
		{
			return this.party[num2];
		}
		return null;
	}

	// Token: 0x06000D97 RID: 3479 RVA: 0x00102AC8 File Offset: 0x00100CC8
	public Character GetNearestParty(Vector3 point, Character exclude, float max)
	{
		float num = float.PositiveInfinity;
		int num2 = -1;
		for (int i = 0; i < this.party.Count; i++)
		{
			Character character = this.party[i];
			if (character && !character.dead && character != exclude)
			{
				float sqrMagnitude = this.SubtractVectors(character.tr.position, point).sqrMagnitude;
				if (sqrMagnitude < num && sqrMagnitude < max)
				{
					num = sqrMagnitude;
					num2 = i;
				}
			}
		}
		if (num2 > -1)
		{
			return this.party[num2];
		}
		return null;
	}

	// Token: 0x06000D98 RID: 3480 RVA: 0x00102B64 File Offset: 0x00100D64
	public Character GetNearestPartyInRoom(Vector3 point, Character exclude, float max, string area, bool sentient)
	{
		float num = float.PositiveInfinity;
		int num2 = -1;
		for (int i = 0; i < this.party.Count; i++)
		{
			Character character = this.party[i];
			if (character && !character.dead && character != exclude && character.indoorID == area)
			{
				float sqrMagnitude = this.SubtractVectors(character.tr.position, point).sqrMagnitude;
				if (sqrMagnitude < num && sqrMagnitude < max && (!sentient || (sentient && character.IsSentient())))
				{
					num = sqrMagnitude;
					num2 = i;
				}
			}
		}
		if (num2 > -1)
		{
			return this.party[num2];
		}
		return null;
	}

	// Token: 0x06000D99 RID: 3481 RVA: 0x00102C20 File Offset: 0x00100E20
	public Vector3 SubtractVectors(Vector3 a, Vector3 b)
	{
		Vector3 vector;
		vector.x = a.x - b.x;
		vector.y = a.y - b.y;
		vector.z = a.z - b.z;
		return vector;
	}

	// Token: 0x06000D9A RID: 3482 RVA: 0x00102C6C File Offset: 0x00100E6C
	public Character GetNearestPortraitParty(Vector3 point)
	{
		float num = float.PositiveInfinity;
		int num2 = -1;
		for (int i = 0; i < this.portraitOrder.Count; i++)
		{
			if (this.portraitOrder[i] && !this.portraitOrder[i].dead)
			{
				float sqrMagnitude = (this.portraitOrder[i].tr.position - point).sqrMagnitude;
				if (sqrMagnitude < num)
				{
					num = sqrMagnitude;
					num2 = i;
				}
			}
		}
		if (num2 > -1)
		{
			return this.portraitOrder[num2];
		}
		return null;
	}

	// Token: 0x06000D9B RID: 3483 RVA: 0x00102D04 File Offset: 0x00100F04
	public Character GetCharacterWithAction()
	{
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && this.party[i].IsSentient() && this.party[i].CanChooseActions())
			{
				return this.party[i];
			}
		}
		return null;
	}

	// Token: 0x06000D9C RID: 3484 RVA: 0x00102D6E File Offset: 0x00100F6E
	public Character GetPartyFromID(int n)
	{
		if (n < this.party.Count)
		{
			return this.party[n];
		}
		return null;
	}

	// Token: 0x06000D9D RID: 3485 RVA: 0x00102D8C File Offset: 0x00100F8C
	public void RemoveOtherLeaders(Character leader)
	{
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && this.party[i] != leader)
			{
				this.party[i].mainSelected = false;
				if (this.party[i].circleAnimator)
				{
					this.party[i].circleAnimator.SetBool("Main", false);
					this.party[i].circleAnimator.enabled = true;
				}
			}
		}
	}

	// Token: 0x06000D9E RID: 3486 RVA: 0x00102E39 File Offset: 0x00101039
	public Character GetPartyAtIndex(int n)
	{
		if (n < this.portraitOrder.Count)
		{
			return this.portraitOrder[n];
		}
		return null;
	}

	// Token: 0x06000D9F RID: 3487 RVA: 0x00102E58 File Offset: 0x00101058
	public Character GetProtagonist()
	{
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && this.party[i].protagonist)
			{
				return this.party[i];
			}
		}
		return null;
	}

	// Token: 0x06000DA0 RID: 3488 RVA: 0x00102EB0 File Offset: 0x001010B0
	public bool AllDead()
	{
		bool flag = true;
		for (int i = 0; i < this.portraitOrder.Count; i++)
		{
			if (this.portraitOrder[i] && !this.portraitOrder[i].dead)
			{
				flag = false;
			}
		}
		return flag;
	}

	// Token: 0x06000DA1 RID: 3489 RVA: 0x00102F00 File Offset: 0x00101100
	public int PartyMembersAlive()
	{
		int num = 0;
		for (int i = 0; i < this.portraitOrder.Count; i++)
		{
			if (this.portraitOrder[i] && !this.portraitOrder[i].dead)
			{
				num++;
			}
		}
		return num;
	}

	// Token: 0x06000DA2 RID: 3490 RVA: 0x00102F50 File Offset: 0x00101150
	public int PartySummonsAlive()
	{
		int num = 0;
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && !this.party[i].dead)
			{
				num++;
			}
		}
		return num;
	}

	// Token: 0x06000DA3 RID: 3491 RVA: 0x00102FA0 File Offset: 0x001011A0
	public bool AllStunned()
	{
		bool flag = true;
		for (int i = 0; i < this.portraitOrder.Count; i++)
		{
			if (this.portraitOrder[i] && !this.portraitOrder[i].stunned)
			{
				flag = false;
			}
		}
		return flag;
	}

	// Token: 0x06000DA4 RID: 3492 RVA: 0x00102FF0 File Offset: 0x001011F0
	public void ChangePartyList(Character obj, bool adding, bool mainParty)
	{
		int num = this.party.IndexOf(obj);
		if (num == -1 && adding)
		{
			if (mainParty)
			{
				this.portraitOrder.Add(obj);
				int num2 = this.portraitOrder.IndexOf(obj);
				this.party.Insert(num2, obj);
			}
			else
			{
				this.party.Add(obj);
			}
			if (this.main && this.main.inCircle)
			{
				this.fellowship.AddPartyToCircle(obj);
			}
		}
		if (num > -1 && !adding)
		{
			if (obj.inCircle)
			{
				this.fellowship.RemovePartyFromCircle(obj);
			}
			this.party.RemoveAt(num);
			if (mainParty)
			{
				num = this.portraitOrder.IndexOf(obj);
				this.portraitOrder.RemoveAt(num);
			}
		}
		this.party.RemoveAll((Character item) => item == null);
		this.UpdatePartyColors();
	}

	// Token: 0x06000DA5 RID: 3493 RVA: 0x001030E4 File Offset: 0x001012E4
	public void ChangeBoatList(Boat obj, bool adding)
	{
		int num = this.boats.IndexOf(obj);
		if (num == -1 && adding)
		{
			this.boats.Add(obj);
		}
		if (num > -1 && !adding)
		{
			this.boats.RemoveAt(num);
		}
		this.boats.RemoveAll((Boat item) => item == null);
	}

	// Token: 0x06000DA6 RID: 3494 RVA: 0x00103150 File Offset: 0x00101350
	public void UpdatePartyColors()
	{
		foreach (Character character in this.party)
		{
			if (character && !character.dead)
			{
				character.UpdateArrowColor();
				character.CircleAnimation("");
			}
		}
	}

	// Token: 0x06000DA7 RID: 3495 RVA: 0x001031C0 File Offset: 0x001013C0
	public void ChangeNPCList(Character obj, bool adding)
	{
		int num = this.npcs.IndexOf(obj);
		if (num == -1 && adding)
		{
			this.npcs.Add(obj);
		}
		if (num > -1 && !adding)
		{
			this.npcs.RemoveAt(num);
		}
	}

	// Token: 0x06000DA8 RID: 3496 RVA: 0x00103201 File Offset: 0x00101401
	public void ClearNPCs()
	{
		this.npcs.RemoveAll((Character item) => item == null);
	}

	// Token: 0x06000DA9 RID: 3497 RVA: 0x00103230 File Offset: 0x00101430
	public void ChangeDeadList(Character obj, bool adding)
	{
		int num = this.deads.IndexOf(obj);
		if (num == -1 && adding)
		{
			this.deads.Add(obj);
		}
		if (num > -1 && !adding)
		{
			this.deads.RemoveAt(num);
		}
	}

	// Token: 0x06000DAA RID: 3498 RVA: 0x00103271 File Offset: 0x00101471
	public void ClearDeads()
	{
		this.deads.RemoveAll((Character item) => item == null);
	}

	// Token: 0x06000DAB RID: 3499 RVA: 0x0010329E File Offset: 0x0010149E
	public void AddRemovedCompanion(Character character)
	{
		this.removedParty.Add(character);
		this.UpdatePartyColors();
	}

	// Token: 0x06000DAC RID: 3500 RVA: 0x001032B2 File Offset: 0x001014B2
	public void AddQuad(Culling quad)
	{
		if (!this.quads.Contains(quad))
		{
			this.quads.Add(quad);
		}
	}

	// Token: 0x06000DAD RID: 3501 RVA: 0x001032D0 File Offset: 0x001014D0
	public void ChangeTimeOfDay()
	{
		for (int i = 0; i < this.boats.Count; i++)
		{
			this.boats[i].ChangeTimeOfDay();
		}
		if (Links.x.gaia.boat)
		{
			Links.x.gaia.boat.ChangeTimeOfDay();
		}
	}

	// Token: 0x06000DAE RID: 3502 RVA: 0x0010332E File Offset: 0x0010152E
	public void RemoveScene()
	{
		base.StartCoroutine(this.RemovingScene());
	}

	// Token: 0x06000DAF RID: 3503 RVA: 0x0010333D File Offset: 0x0010153D
	private IEnumerator RemovingScene()
	{
		if (this.sensory)
		{
			this.sensory.SwitchingScenes();
		}
		this.gaia.gameSecondCounter.RemoveAllTimeEffects();
		this.diorama.RemoveResourcePrefabs();
		this.diorama.ReturnItemsPrefabs();
		this.critters.RemoveScene();
		int num = 0;
		this.tempCharacters.Clear();
		for (int j = 0; j < this.party.Count; j++)
		{
			this.tempCharacters.Add(this.party[j]);
		}
		int count = this.tempCharacters.Count;
		int num2;
		for (int i = 0; i < this.tempCharacters.Count; i = num2 + 1)
		{
			this.tempCharacters[i].RemovingScene();
			num++;
			if (num > 20)
			{
				yield return new WaitForSecondsRealtime(0.0001f);
				num = 0;
			}
			num2 = i;
		}
		this.tempCharacters.Clear();
		for (int k = 0; k < this.npcs.Count; k++)
		{
			this.tempCharacters.Add(this.npcs[k]);
		}
		int count2 = this.tempCharacters.Count;
		for (int i = 0; i < this.tempCharacters.Count; i = num2 + 1)
		{
			this.tempCharacters[i].RemovingScene();
			if (num > 20)
			{
				yield return new WaitForSecondsRealtime(0.0001f);
				num = 0;
			}
			num2 = i;
		}
		this.tempCharacters.Clear();
		for (int l = 0; l < this.deads.Count; l++)
		{
			this.tempCharacters.Add(this.deads[l]);
		}
		int count3 = this.tempCharacters.Count;
		for (int i = 0; i < this.tempCharacters.Count; i = num2 + 1)
		{
			this.tempCharacters[i].RemovingScene();
			if (num > 20)
			{
				yield return new WaitForSecondsRealtime(0.0001f);
				num = 0;
			}
			num2 = i;
		}
		for (int m = 0; m < this.boats.Count; m++)
		{
			this.boats[m].RemoveBoat();
		}
		if (Links.x.gaia.partyBoat)
		{
			Links.x.gaia.boat.RemoveBoatNode();
		}
		this.cellar.ReturnGorePiles();
		Links.x.gaia.waitingToRemoveScene = false;
		yield break;
	}

	// Token: 0x06000DB0 RID: 3504 RVA: 0x0010334C File Offset: 0x0010154C
	public void ClearSceneLists()
	{
		this.quads.Clear();
		this.npcs.Clear();
		this.removedParty.Clear();
	}

	// Token: 0x06000DB1 RID: 3505 RVA: 0x0010336F File Offset: 0x0010156F
	public void ClearQuads()
	{
		this.quads.Clear();
	}

	// Token: 0x06000DB2 RID: 3506 RVA: 0x0010337C File Offset: 0x0010157C
	public void ReorderPortraits()
	{
		for (int i = this.party.Count - 1; i >= 0; i--)
		{
			if (this.party[i])
			{
				Portrait portrait = this.party[i].portrait;
				if (portrait)
				{
					portrait.gameObject.transform.SetAsFirstSibling();
					this.party[i].characterSheetPortrait.gameObject.transform.SetAsFirstSibling();
				}
			}
		}
		this.UpdatePartyColors();
	}

	// Token: 0x06000DB3 RID: 3507 RVA: 0x00103404 File Offset: 0x00101604
	public void SetFormationParty()
	{
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && this.party[i].party)
			{
				this.party[i].stats.FormationTactics();
			}
		}
	}

	// Token: 0x06000DB4 RID: 3508 RVA: 0x00103464 File Offset: 0x00101664
	public Character SharingFormation(Character character, int formationGroup)
	{
		bool flag = false;
		Character character2 = null;
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && this.party[i] != character && this.party[i].party && this.party[i].stats.formationGroup == formationGroup)
			{
				if (character.stats.isLeader)
				{
					return character;
				}
				if (this.party[i].stats.isLeader)
				{
					return this.party[i];
				}
				character2 = this.party[i];
				flag = true;
			}
		}
		if (flag)
		{
			return character2;
		}
		return null;
	}

	// Token: 0x06000DB5 RID: 3509 RVA: 0x00103530 File Offset: 0x00101730
	public void ChangePartyPosition(Transform portraitParent)
	{
		List<Character> list = new List<Character>();
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i])
			{
				list.Add(this.party[i]);
			}
		}
		this.party.Clear();
		Character character = null;
		foreach (object obj in portraitParent)
		{
			Portrait component = ((Transform)obj).gameObject.GetComponent<Portrait>();
			if (component && component.character)
			{
				this.party.Add(component.character);
				Debug.Log(component.character);
				component.SetSelection();
				if (!character)
				{
					character = component.character;
				}
			}
		}
		this.UpdatePartyColors();
	}

	// Token: 0x06000DB6 RID: 3510 RVA: 0x0010362C File Offset: 0x0010182C
	public void ChangePartyPositionFromLeader(Character leader)
	{
		List<Character> list = new List<Character>();
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i])
			{
				list.Add(this.party[i]);
			}
		}
		this.party.Clear();
		this.party.Add(leader);
		for (int j = 0; j < list.Count; j++)
		{
			if (list[j] != leader)
			{
				this.party.Add(list[j]);
			}
		}
		this.UpdatePartyColors();
	}

	// Token: 0x06000DB7 RID: 3511 RVA: 0x001036C9 File Offset: 0x001018C9
	public TMP_SpriteAsset GetSpriteSheetAsset(int index)
	{
		return this.spriteAssets[index];
	}

	// Token: 0x06000DB8 RID: 3512 RVA: 0x001036D7 File Offset: 0x001018D7
	public string GetCharacterTextColor(Character character)
	{
		if (!character.npc)
		{
			return this.partyColorHex;
		}
		if (character.hostility < 2 && !character.attackingUntilBribe)
		{
			return this.peacefulColorHex;
		}
		return this.hostileColorHex;
	}

	// Token: 0x06000DB9 RID: 3513 RVA: 0x00103706 File Offset: 0x00101906
	public string GetPartyColor(int num)
	{
		return this.partyColorsHexRichText[num];
	}

	// Token: 0x06000DBA RID: 3514 RVA: 0x00103710 File Offset: 0x00101910
	public Material GetPartyMaterial(int num, int type)
	{
		if (!Records.x.coloredCircles)
		{
			num = 5;
		}
		if (type == 4)
		{
			return this.partyArrows[num];
		}
		if (type == 0)
		{
			return this.partyCirclesUnselected[num];
		}
		if (type == 1)
		{
			return this.partyCirclesUnselectedHover[num];
		}
		if (type == 2)
		{
			return this.partyCirclesSelected[num];
		}
		if (type == 3)
		{
			return this.partyCirclesSelectedHover[num];
		}
		return null;
	}

	// Token: 0x06000DBB RID: 3515 RVA: 0x0010376D File Offset: 0x0010196D
	public Color GetPortraitColor(int num)
	{
		return this.partyPortraitColors[num];
	}

	// Token: 0x06000DBC RID: 3516 RVA: 0x0010377C File Offset: 0x0010197C
	public Color GetPartyColorRGB(Character character)
	{
		for (int i = 0; i < this.party.Count; i++)
		{
			if (character == this.party[i])
			{
				return this.partyColors[i];
			}
		}
		return this.partyColors[0];
	}

	// Token: 0x06000DBD RID: 3517 RVA: 0x001037CC File Offset: 0x001019CC
	public void SetCursor(string type, bool cursor2D)
	{
		Texture2D texture2D = null;
		if (!cursor2D)
		{
			if (Links.x.rtsCamera.inspecting)
			{
				type = "Point";
			}
			else if (Links.x.rtsCamera.panning)
			{
				type = "EmptyCursor";
				type = "Point";
			}
		}
		if (Links.x.joy)
		{
			type = "EmptyCursor";
		}
		Vector2 vector = new Vector2(0f, 0f);
		for (int i = 0; i < this.cursors.Length; i++)
		{
			if (this.cursorNames[i] == type)
			{
				texture2D = this.cursors[i];
			}
		}
		if (texture2D)
		{
			string text = type;
			if (texture2D && this.previousCursor != text)
			{
				float num = 32f;
				if (type.Contains("Beach"))
				{
					vector = new Vector2(num / 2f, num / 2f);
				}
				if (type.Contains("UIInteract"))
				{
					vector = new Vector2(num / 4f, 0f);
				}
				if (type.Contains("Resize"))
				{
					vector = new Vector2(num / 2f, num / 2f);
				}
				if (Records.x.filming)
				{
					Cursor.SetCursor(texture2D, vector, CursorMode.ForceSoftware);
				}
				else
				{
					Cursor.SetCursor(texture2D, vector, CursorMode.Auto);
				}
				this.previousCursor = text;
			}
		}
	}

	// Token: 0x06000DBE RID: 3518 RVA: 0x00103928 File Offset: 0x00101B28
	public int PartyNeedsSpiritPickup()
	{
		int num = 0;
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && !this.party[i].isBoro && !this.party[i].summoned && this.party[i].party && this.party[i].stats.HasSpellbook() && this.party[i].stats.magicPoints < 80)
			{
				if (this.party[i].stats.magicPoints < 40)
				{
					num++;
					num++;
				}
				else
				{
					num++;
				}
			}
		}
		return num;
	}

	// Token: 0x06000DBF RID: 3519 RVA: 0x00103A00 File Offset: 0x00101C00
	public Character GetBinder(string type)
	{
		Character character = null;
		float num = -1f;
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && !this.party[i].isBoro && !this.party[i].summoned && this.party[i].party)
			{
				float num2 = this.party[i].stats.GetSkill(23);
				if (this.party[i].stats.GetSkill(24) > num2 && type == "Forest")
				{
					num2 = this.party[i].stats.GetSkill(24);
				}
				if (this.party[i].stats.GetSkill(25) > num2 && type == "Shroom")
				{
					num2 = this.party[i].stats.GetSkill(25);
				}
				if (num2 > num)
				{
					character = this.party[i];
					num = num2;
				}
			}
		}
		return character;
	}

	// Token: 0x06000DC0 RID: 3520 RVA: 0x00103B40 File Offset: 0x00101D40
	public Character GetPagan()
	{
		Character character = null;
		float num = -1f;
		for (int i = 0; i < this.party.Count; i++)
		{
			if (this.party[i] && !this.party[i].isBoro && !this.party[i].summoned && this.party[i].party)
			{
				int num3;
				float num2 = this.party[i].stats.Stat("Pagan", true, out num3);
				if (num2 > num)
				{
					character = this.party[i];
					num = num2;
				}
			}
		}
		return character;
	}

	// Token: 0x06000DC1 RID: 3521 RVA: 0x00103BF8 File Offset: 0x00101DF8
	public Character HasCompanion(string companionName, Vector3 point)
	{
		if (companionName == "Leader")
		{
			return Links.x.main;
		}
		float num = 30f;
		if (companionName == null)
		{
			return null;
		}
		if (companionName == "Tank")
		{
			Character character = null;
			float num2 = -1f;
			for (int i = 0; i < this.party.Count; i++)
			{
				if (this.party[i] && !this.party[i].isBoro && !this.party[i].summoned && this.party[i].party && this.PartyClose(this.party[i], point, num))
				{
					int num4;
					float num3 = this.party[i].stats.Stat("Strength", true, out num4);
					if (num3 > num2)
					{
						character = this.party[i];
						num2 = num3;
					}
				}
			}
			return character;
		}
		if (companionName == "Pagan")
		{
			Character character2 = null;
			float num5 = -1f;
			for (int j = 0; j < this.party.Count; j++)
			{
				if (this.party[j] && !this.party[j].isBoro && !this.party[j].summoned && this.party[j].party && this.PartyClose(this.party[j], point, num))
				{
					int num7;
					float num6 = this.party[j].stats.Stat("Pagan", true, out num7);
					if (num6 > num5)
					{
						character2 = this.party[j];
						num5 = num6;
					}
				}
			}
			return character2;
		}
		if (companionName == "Ranger")
		{
			Character character3 = null;
			float num8 = -1f;
			for (int k = 0; k < this.party.Count; k++)
			{
				if (this.party[k] && !this.party[k].isBoro && !this.party[k].summoned && this.party[k].party && this.PartyClose(this.party[k], point, num))
				{
					float num9 = this.party[k].stats.GetSkill(32);
					if (this.party[k].stats.GetSkill(31) > num9)
					{
						num9 = this.party[k].stats.GetSkill(31);
					}
					if (this.party[k].stats.GetSkill(30) > num9)
					{
						num9 = this.party[k].stats.GetSkill(30);
					}
					if (this.party[k].stats.GetSkill(33) > num9)
					{
						num9 = this.party[k].stats.GetSkill(33);
					}
					if (this.party[k].stats.GetSkill(34) > num9)
					{
						num9 = this.party[k].stats.GetSkill(34);
					}
					if (num9 > num8)
					{
						character3 = this.party[k];
						num8 = num9;
					}
				}
			}
			return character3;
		}
		if (companionName == "Barterer")
		{
			Character character4 = null;
			float num10 = -1f;
			for (int l = 0; l < this.party.Count; l++)
			{
				if (this.party[l] && !this.party[l].isBoro && !this.party[l].summoned && this.party[l].party && this.PartyClose(this.party[l], point, num))
				{
					float skill = this.party[l].stats.GetSkill(22);
					if (skill > num10)
					{
						character4 = this.party[l];
						num10 = skill;
					}
				}
			}
			return character4;
		}
		if (companionName == "Divine")
		{
			Character character5 = null;
			float num11 = -1f;
			for (int m = 0; m < this.party.Count; m++)
			{
				if (this.party[m] && !this.party[m].isBoro && !this.party[m].summoned && this.party[m].party && this.PartyClose(this.party[m], point, num))
				{
					float skill2 = this.party[m].stats.GetSkill(16);
					if (skill2 > num11)
					{
						character5 = this.party[m];
						num11 = skill2;
					}
				}
			}
			return character5;
		}
		if (companionName == "Thief")
		{
			Character character6 = null;
			float num12 = -1f;
			for (int n = 0; n < this.party.Count; n++)
			{
				if (this.party[n] && !this.party[n].isBoro && !this.party[n].summoned && this.party[n].party && this.PartyClose(this.party[n], point, num))
				{
					float skill3 = this.party[n].stats.GetSkill(21);
					if (skill3 > num12)
					{
						character6 = this.party[n];
						num12 = skill3;
					}
				}
			}
			return character6;
		}
		if (companionName == "DumbDumb")
		{
			Character character7 = null;
			float num13 = -1f;
			for (int num14 = 0; num14 < this.party.Count; num14++)
			{
				if (this.party[num14] && !this.party[num14].isBoro && !this.party[num14].summoned && this.party[num14].party && this.PartyClose(this.party[num14], point, num))
				{
					int num16;
					float num15 = this.party[num14].stats.Stat("Sensory", true, out num16);
					if (num15 < num13)
					{
						character7 = this.party[num14];
						num13 = num15;
					}
				}
			}
			return character7;
		}
		if (companionName == "Intellect")
		{
			Character character8 = null;
			float num17 = -1f;
			for (int num18 = 0; num18 < this.party.Count; num18++)
			{
				if (this.party[num18] && !this.party[num18].isBoro && !this.party[num18].summoned && this.party[num18].party && this.PartyClose(this.party[num18], point, num))
				{
					int num20;
					float num19 = this.party[num18].stats.Stat("Sensory", true, out num20);
					if (num19 > num17)
					{
						character8 = this.party[num18];
						num17 = num19;
					}
				}
			}
			return character8;
		}
		if (companionName == "Musician")
		{
			Character character9 = null;
			float num21 = -1f;
			for (int num22 = 0; num22 < this.party.Count; num22++)
			{
				if (this.party[num22] && !this.party[num22].isBoro && !this.party[num22].summoned && this.party[num22].party && this.PartyClose(this.party[num22], point, num))
				{
					float num23 = this.party[num22].stats.GetSkill(26);
					if (this.party[num22].stats.GetSkill(27) > num23)
					{
						num23 = this.party[num22].stats.GetSkill(27);
					}
					if (this.party[num22].stats.GetSkill(28) > num23)
					{
						num23 = this.party[num22].stats.GetSkill(28);
					}
					if (this.party[num22].stats.GetSkill(29) > num23)
					{
						num23 = this.party[num22].stats.GetSkill(29);
					}
					if (num23 > num21)
					{
						character9 = this.party[num22];
						num21 = num23;
					}
				}
			}
			return character9;
		}
		if (companionName == "Charmer")
		{
			Character character10 = null;
			float num24 = -1f;
			for (int num25 = 0; num25 < this.party.Count; num25++)
			{
				if (this.party[num25] && !this.party[num25].isBoro && !this.party[num25].summoned && this.party[num25].party && this.PartyClose(this.party[num25], point, num))
				{
					float num26 = this.party[num25].stats.GetSkill(23);
					if (this.party[num25].stats.GetSkill(24) > num26)
					{
						num26 = this.party[num25].stats.GetSkill(24);
					}
					if (this.party[num25].stats.GetSkill(25) > num26)
					{
						num26 = this.party[num25].stats.GetSkill(25);
					}
					if (num26 > num24)
					{
						character10 = this.party[num25];
						num24 = num26;
					}
				}
			}
			return character10;
		}
		if (companionName == "Taratorith" || companionName == "Ameythevian" || companionName == "Varuchov" || companionName == "Pasaaren" || companionName == "Yeti")
		{
			for (int num27 = 0; num27 < this.party.Count; num27++)
			{
				if (!this.party[num27].isBoro && !this.party[num27].summoned && this.party[num27].party && this.party[num27].stats.race == companionName)
				{
					return this.party[num27];
				}
			}
		}
		if (companionName == "Male")
		{
			for (int num28 = 0; num28 < this.party.Count; num28++)
			{
				if (!this.party[num28].isBoro && !this.party[num28].summoned && this.party[num28].party && this.PartyClose(this.party[num28], point, num) && this.party[num28].stats.sex >= 0.5f)
				{
					return this.party[num28];
				}
			}
		}
		if (companionName == "Female")
		{
			for (int num29 = 0; num29 < this.party.Count; num29++)
			{
				if (!this.party[num29].isBoro && !this.party[num29].summoned && this.party[num29].party && this.PartyClose(this.party[num29], point, num) && this.party[num29].stats.sex < 0.5f)
				{
					return this.party[num29];
				}
			}
		}
		return null;
	}

	// Token: 0x06000DC2 RID: 3522 RVA: 0x0010494C File Offset: 0x00102B4C
	public bool PartyClose(Character character, Vector3 point, float dist)
	{
		point.y = character.tr.position.y;
		return (character.tr.position - point).sqrMagnitude < dist * dist;
	}

	// Token: 0x0400155A RID: 5466
	public static GameObject origin;

	// Token: 0x0400155B RID: 5467
	public static Links x;

	// Token: 0x0400155C RID: 5468
	[Header("LISTS")]
	public List<Character> party = new List<Character>();

	// Token: 0x0400155D RID: 5469
	public List<Character> npcs = new List<Character>();

	// Token: 0x0400155E RID: 5470
	public List<Culling> quads = new List<Culling>();

	// Token: 0x0400155F RID: 5471
	public List<Character> removedParty = new List<Character>();

	// Token: 0x04001560 RID: 5472
	public List<Character> deads = new List<Character>();

	// Token: 0x04001561 RID: 5473
	public List<float> deadTimes = new List<float>();

	// Token: 0x04001562 RID: 5474
	public List<int> deadStates = new List<int>();

	// Token: 0x04001563 RID: 5475
	private List<Character> tempCharacters = new List<Character>();

	// Token: 0x04001564 RID: 5476
	public List<Character> portraitOrder = new List<Character>();

	// Token: 0x04001565 RID: 5477
	public List<Character> formationOrder = new List<Character>();

	// Token: 0x04001566 RID: 5478
	public List<string> summons = new List<string>();

	// Token: 0x04001567 RID: 5479
	public List<Boat> boats = new List<Boat>();

	// Token: 0x04001568 RID: 5480
	private List<Character> tempPortraitOrder = new List<Character>();

	// Token: 0x04001569 RID: 5481
	[Header("REFERENCE OBJECTS")]
	public AllSounds allSounds;

	// Token: 0x0400156A RID: 5482
	public Archives archives;

	// Token: 0x0400156B RID: 5483
	public Cellar cellar;

	// Token: 0x0400156C RID: 5484
	public SaveKeeper saveKeeper;

	// Token: 0x0400156D RID: 5485
	public Gaia gaia;

	// Token: 0x0400156E RID: 5486
	public CameraControls cameraControls;

	// Token: 0x0400156F RID: 5487
	public Fellowship fellowship;

	// Token: 0x04001570 RID: 5488
	public Library library;

	// Token: 0x04001571 RID: 5489
	public Sensory sensory;

	// Token: 0x04001572 RID: 5490
	public CameraEffects cameraEffects;

	// Token: 0x04001573 RID: 5491
	public Merchant merchant;

	// Token: 0x04001574 RID: 5492
	public PlanarReflection reflection;

	// Token: 0x04001575 RID: 5493
	public Combat combat;

	// Token: 0x04001576 RID: 5494
	public Manual manual;

	// Token: 0x04001577 RID: 5495
	public InputControls inputControls;

	// Token: 0x04001578 RID: 5496
	public CharacterQuips quips;

	// Token: 0x04001579 RID: 5497
	public Soundtrack soundtrack;

	// Token: 0x0400157A RID: 5498
	public MainMenu mainMenu;

	// Token: 0x0400157B RID: 5499
	[Header("SCENE OBJECTS")]
	public Light directionalLight;

	// Token: 0x0400157C RID: 5500
	public Light pointLight;

	// Token: 0x0400157D RID: 5501
	public FOWSystem fogOfWar;

	// Token: 0x0400157E RID: 5502
	public FOWSystemInterior fogOfWarInterior;

	// Token: 0x0400157F RID: 5503
	public Diorama diorama;

	// Token: 0x04001580 RID: 5504
	public Camera worldCamera;

	// Token: 0x04001581 RID: 5505
	public RtsCamera rtsCamera;

	// Token: 0x04001582 RID: 5506
	public OverworldMap overworldMap;

	// Token: 0x04001583 RID: 5507
	[Header("GAMEPLAY OBJECTS")]
	public Transform follow;

	// Token: 0x04001584 RID: 5508
	public Character protagonist;

	// Token: 0x04001585 RID: 5509
	public Character main;

	// Token: 0x04001586 RID: 5510
	public bool hasMain;

	// Token: 0x04001587 RID: 5511
	public Gameplay gameplay;

	// Token: 0x04001588 RID: 5512
	public Bag secondaryBag;

	// Token: 0x04001589 RID: 5513
	public Animator domeAnimator;

	// Token: 0x0400158A RID: 5514
	public Material domeMaterial;

	// Token: 0x0400158B RID: 5515
	public Transform domeTr;

	// Token: 0x0400158C RID: 5516
	public GameObject domeColliders;

	// Token: 0x0400158D RID: 5517
	public MeshRenderer domeRenderer;

	// Token: 0x0400158E RID: 5518
	public CollectCharacters characterCollector;

	// Token: 0x0400158F RID: 5519
	public Critters critters;

	// Token: 0x04001590 RID: 5520
	public Transform lineOfSightCone;

	// Token: 0x04001591 RID: 5521
	public Transform attackCone1;

	// Token: 0x04001592 RID: 5522
	public Transform attackCone2;

	// Token: 0x04001593 RID: 5523
	public LineOfSightCone coneEffects;

	// Token: 0x04001594 RID: 5524
	public AttackShapes attackConeEffects;

	// Token: 0x04001595 RID: 5525
	public Camera lineOfSightCamera;

	// Token: 0x04001596 RID: 5526
	public TVEElement element;

	// Token: 0x04001597 RID: 5527
	public GameObject attackDome;

	// Token: 0x04001598 RID: 5528
	public GameObject attackDomeMinimum;

	// Token: 0x04001599 RID: 5529
	public GameObject beachCollider;

	// Token: 0x0400159A RID: 5530
	public GameObject hoverObject;

	// Token: 0x0400159B RID: 5531
	public PartyCollider partyColliderCombat;

	// Token: 0x0400159C RID: 5532
	public PartyCollider partyColliderAdventure;

	// Token: 0x0400159D RID: 5533
	public GameObject tileEffects;

	// Token: 0x0400159E RID: 5534
	public QuestEnd questEnd;

	// Token: 0x0400159F RID: 5535
	public RallyStage rallyStage;

	// Token: 0x040015A0 RID: 5536
	public GameObject footstep;

	// Token: 0x040015A1 RID: 5537
	public GameObject prewarm;

	// Token: 0x040015A2 RID: 5538
	[Header("UI OBJECTS")]
	public GameObject hud;

	// Token: 0x040015A3 RID: 5539
	public HUD hudControl;

	// Token: 0x040015A4 RID: 5540
	public Canvas hudCanvas;

	// Token: 0x040015A5 RID: 5541
	public Canvas miscCanvas;

	// Token: 0x040015A6 RID: 5542
	public Transform quipHolder;

	// Token: 0x040015A7 RID: 5543
	public Transform timelineHolder;

	// Token: 0x040015A8 RID: 5544
	public GameObject fps;

	// Token: 0x040015A9 RID: 5545
	public Camera menuCamera;

	// Token: 0x040015AA RID: 5546
	public Camera camera3D;

	// Token: 0x040015AB RID: 5547
	public Inventory inventory;

	// Token: 0x040015AC RID: 5548
	public Material walkLine;

	// Token: 0x040015AD RID: 5549
	public SaveLoad saveLoad;

	// Token: 0x040015AE RID: 5550
	public Formation formation;

	// Token: 0x040015AF RID: 5551
	public GameFeed gameFeed;

	// Token: 0x040015B0 RID: 5552
	public RoleSheet characterSheet;

	// Token: 0x040015B1 RID: 5553
	public Options options;

	// Token: 0x040015B2 RID: 5554
	public Tooltip tooltip;

	// Token: 0x040015B3 RID: 5555
	public Tooltip characterTooltip;

	// Token: 0x040015B4 RID: 5556
	public Tooltip mapTooltip;

	// Token: 0x040015B5 RID: 5557
	public Tooltip warbookTooltip;

	// Token: 0x040015B6 RID: 5558
	public Tooltip spellbookTooltip;

	// Token: 0x040015B7 RID: 5559
	public Tooltip formationTooltip;

	// Token: 0x040015B8 RID: 5560
	public RectTransform canvasRT;

	// Token: 0x040015B9 RID: 5561
	public KeyControl keyControl;

	// Token: 0x040015BA RID: 5562
	public SceneMap sceneMap;

	// Token: 0x040015BB RID: 5563
	public Animator fadeAnimator;

	// Token: 0x040015BC RID: 5564
	public Dialogue dialogue;

	// Token: 0x040015BD RID: 5565
	public Creation creation;

	// Token: 0x040015BE RID: 5566
	public Journal journal;

	// Token: 0x040015BF RID: 5567
	public Rest rest;

	// Token: 0x040015C0 RID: 5568
	public GameCard gameCard;

	// Token: 0x040015C1 RID: 5569
	public ItemCard itemCard;

	// Token: 0x040015C2 RID: 5570
	public MapConfirm mapConfirm;

	// Token: 0x040015C3 RID: 5571
	public OverworldMapMenu mapMenu;

	// Token: 0x040015C4 RID: 5572
	public SkillButton currentSkillHover;

	// Token: 0x040015C5 RID: 5573
	public RenderPortraits renderPortraits;

	// Token: 0x040015C6 RID: 5574
	public RenderPortraits renderPortraitsHud;

	// Token: 0x040015C7 RID: 5575
	public ArrowKit arrowKit;

	// Token: 0x040015C8 RID: 5576
	public Spellcrafting spellcrafting;

	// Token: 0x040015C9 RID: 5577
	public RectTransform itemPickupFX;

	// Token: 0x040015CA RID: 5578
	public RectTransform itemPickupFX2;

	// Token: 0x040015CB RID: 5579
	public RectTransform removeFX;

	// Token: 0x040015CC RID: 5580
	public RectTransform repairFX;

	// Token: 0x040015CD RID: 5581
	public RectTransform cinematicFX;

	// Token: 0x040015CE RID: 5582
	public GameObject saveVisual;

	// Token: 0x040015CF RID: 5583
	public GameObject deathScreen;

	// Token: 0x040015D0 RID: 5584
	public Forfeits forfeits;

	// Token: 0x040015D1 RID: 5585
	public Animator inspectTextAnimator;

	// Token: 0x040015D2 RID: 5586
	public KeyboardScript keyboardScript;

	// Token: 0x040015D3 RID: 5587
	public MenuCameraCrossFade cameraCrossfade;

	// Token: 0x040015D4 RID: 5588
	public Pocket pocketWheel;

	// Token: 0x040015D5 RID: 5589
	public PlayVideo cinematicVideos;

	// Token: 0x040015D6 RID: 5590
	public Minigame minigame;

	// Token: 0x040015D7 RID: 5591
	public QTE qte;

	// Token: 0x040015D8 RID: 5592
	[Header("CULLING MASKS")]
	public LayerMask geometry = 4260609;

	// Token: 0x040015D9 RID: 5593
	public LayerMask allObstacles = 4260673;

	// Token: 0x040015DA RID: 5594
	public LayerMask sightBlockers = 197121;

	// Token: 0x040015DB RID: 5595
	public LayerMask dialogueBlockers = 197185;

	// Token: 0x040015DC RID: 5596
	public LayerMask walls = 197120;

	// Token: 0x040015DD RID: 5597
	public LayerMask floor = 4194433;

	// Token: 0x040015DE RID: 5598
	public LayerMask mainCameraMask;

	// Token: 0x040015DF RID: 5599
	[Header("GRAPHICS")]
	public Mesh cubeMesh;

	// Token: 0x040015E0 RID: 5600
	public Mesh capsuleMesh;

	// Token: 0x040015E1 RID: 5601
	public Mesh sphereMesh;

	// Token: 0x040015E2 RID: 5602
	public Material hoverMaterial1;

	// Token: 0x040015E3 RID: 5603
	public Material hoverMaterial2;

	// Token: 0x040015E4 RID: 5604
	public Material hoverMaterial3;

	// Token: 0x040015E5 RID: 5605
	public Material hoverMaterial4;

	// Token: 0x040015E6 RID: 5606
	public Material lineOfSightBlockerMaterial;

	// Token: 0x040015E7 RID: 5607
	public Material hoverCharacterMaterial;

	// Token: 0x040015E8 RID: 5608
	public Material stealthMaterial;

	// Token: 0x040015E9 RID: 5609
	public Material selectionCircleParty;

	// Token: 0x040015EA RID: 5610
	public Material selectionCirclePartyUnseletedHover;

	// Token: 0x040015EB RID: 5611
	public Material selectionCirclePartySelected;

	// Token: 0x040015EC RID: 5612
	public Material selectionCirclePartyHover;

	// Token: 0x040015ED RID: 5613
	public Material selectionCircleEnemy;

	// Token: 0x040015EE RID: 5614
	public Material selectionCircleEnemyHover;

	// Token: 0x040015EF RID: 5615
	public Material selectionCircleNeutral;

	// Token: 0x040015F0 RID: 5616
	public Material selectionCircleNeutralHover;

	// Token: 0x040015F1 RID: 5617
	public Material selectionCircleNeutralTarget;

	// Token: 0x040015F2 RID: 5618
	public Material selectionCircleEnemyAction;

	// Token: 0x040015F3 RID: 5619
	public Material selectionCircleEnemyTarget;

	// Token: 0x040015F4 RID: 5620
	public Material selectionCircleLargeParty;

	// Token: 0x040015F5 RID: 5621
	public Material selectionCircleLargePartyUnseletedHover;

	// Token: 0x040015F6 RID: 5622
	public Material selectionCircleLargePartySelected;

	// Token: 0x040015F7 RID: 5623
	public Material selectionCircleLargePartyHover;

	// Token: 0x040015F8 RID: 5624
	public Material selectionCircleLargeEnemy;

	// Token: 0x040015F9 RID: 5625
	public Material selectionCircleLargeEnemyHover;

	// Token: 0x040015FA RID: 5626
	public Material selectionCircleLargeEnemyTarget;

	// Token: 0x040015FB RID: 5627
	public Material selectionCircleFlee;

	// Token: 0x040015FC RID: 5628
	public Material selectionCircleFleeTarget;

	// Token: 0x040015FD RID: 5629
	public Material equippedMaterial;

	// Token: 0x040015FE RID: 5630
	public Material mapIconMaterial;

	// Token: 0x040015FF RID: 5631
	public Material itemGroundMaterial;

	// Token: 0x04001600 RID: 5632
	public Material groundItemSprite;

	// Token: 0x04001601 RID: 5633
	public Material groundItemSpriteHover;

	// Token: 0x04001602 RID: 5634
	public Material groundItemSpriteInRange;

	// Token: 0x04001603 RID: 5635
	public RuntimeAnimatorController characterAnimatorController;

	// Token: 0x04001604 RID: 5636
	public Texture emptyTexture;

	// Token: 0x04001605 RID: 5637
	public List<TMP_SpriteAsset> spriteAssets = new List<TMP_SpriteAsset>();

	// Token: 0x04001606 RID: 5638
	public Shader characterMenu;

	// Token: 0x04001607 RID: 5639
	public Shader characterGame;

	// Token: 0x04001608 RID: 5640
	public Shader characterPortrait;

	// Token: 0x04001609 RID: 5641
	public Shader quadShader;

	// Token: 0x0400160A RID: 5642
	public Shader backgroundShader;

	// Token: 0x0400160B RID: 5643
	public Shader backgroundShaderGhosts;

	// Token: 0x0400160C RID: 5644
	public Shader crossfadeShader;

	// Token: 0x0400160D RID: 5645
	public Material healthNPC;

	// Token: 0x0400160E RID: 5646
	public Material healthPC;

	// Token: 0x0400160F RID: 5647
	public Material healthFlee;

	// Token: 0x04001610 RID: 5648
	public Material bracketColor1;

	// Token: 0x04001611 RID: 5649
	public Material bracketColor2;

	// Token: 0x04001612 RID: 5650
	public Material bracketColor3;

	// Token: 0x04001613 RID: 5651
	public Material spriteEffectMaterial;

	// Token: 0x04001614 RID: 5652
	public Material doorIconHover;

	// Token: 0x04001615 RID: 5653
	public Material doorIconNormal;

	// Token: 0x04001616 RID: 5654
	public Sprite doorIconLocal;

	// Token: 0x04001617 RID: 5655
	public Sprite doorIconGlobal;

	// Token: 0x04001618 RID: 5656
	public Sprite doorIconLocked;

	// Token: 0x04001619 RID: 5657
	public Sprite doorIconWater;

	// Token: 0x0400161A RID: 5658
	[Header("GRAPHICS")]
	public Texture2D cinematicLachoTextureSwap1;

	// Token: 0x0400161B RID: 5659
	public Texture2D cinematicLachoTextureSwap2;

	// Token: 0x0400161C RID: 5660
	public Texture2D cinematicLachoTextureSwap3;

	// Token: 0x0400161D RID: 5661
	[Header("COLORS")]
	public Color partyColor;

	// Token: 0x0400161E RID: 5662
	public Color peacefulColor;

	// Token: 0x0400161F RID: 5663
	public Color hostileColor;

	// Token: 0x04001620 RID: 5664
	private string partyColorHex;

	// Token: 0x04001621 RID: 5665
	private string peacefulColorHex;

	// Token: 0x04001622 RID: 5666
	private string hostileColorHex;

	// Token: 0x04001623 RID: 5667
	public Color[] partyColors = new Color[5];

	// Token: 0x04001624 RID: 5668
	public Color[] partyPortraitColors = new Color[5];

	// Token: 0x04001625 RID: 5669
	public string[] partyColorsHex = new string[5];

	// Token: 0x04001626 RID: 5670
	public string[] partyColorsHexRichText = new string[5];

	// Token: 0x04001627 RID: 5671
	public Material[] partyArrows = new Material[5];

	// Token: 0x04001628 RID: 5672
	public Material[] partyCirclesUnselected = new Material[5];

	// Token: 0x04001629 RID: 5673
	public Material[] partyCirclesUnselectedHover = new Material[5];

	// Token: 0x0400162A RID: 5674
	public Material[] partyCirclesSelected = new Material[5];

	// Token: 0x0400162B RID: 5675
	public Material[] partyCirclesSelectedHover = new Material[5];

	// Token: 0x0400162C RID: 5676
	public List<int> openPartyColors = new List<int>();

	// Token: 0x0400162D RID: 5677
	public Color32[] terrainColors = new Color32[0];

	// Token: 0x0400162E RID: 5678
	public Color torchColor;

	// Token: 0x0400162F RID: 5679
	public Color partyLightColor;

	// Token: 0x04001630 RID: 5680
	public Color incenseTorchColor;

	// Token: 0x04001631 RID: 5681
	public Color currentPartyLightColor;

	// Token: 0x04001632 RID: 5682
	[Header("CURSORS")]
	public Texture2D[] cursors = new Texture2D[0];

	// Token: 0x04001633 RID: 5683
	public string[] cursorNames = new string[0];

	// Token: 0x04001634 RID: 5684
	public string previousCursor;

	// Token: 0x04001635 RID: 5685
	public bool mk;

	// Token: 0x04001636 RID: 5686
	public bool joy;

	// Token: 0x04001637 RID: 5687
	public bool pathfind;

	// Token: 0x04001638 RID: 5688
	[Header("PHYSICS")]
	public PhysicsMaterial zeroFriction;

	// Token: 0x04001639 RID: 5689
	public PhysicsMaterial heavyFriction;

	// Token: 0x0400163A RID: 5690
	public PhysicsMaterial bounceFriction;
}
