using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

// Token: 0x020000E2 RID: 226
public class Vine : MonoBehaviour
{
	// Token: 0x060014E3 RID: 5347 RVA: 0x00192F80 File Offset: 0x00191180
	private void Start()
	{
	}

	// Token: 0x060014E4 RID: 5348 RVA: 0x00192F84 File Offset: 0x00191184
	public void UpdateVine()
	{
		int num = this.portrait.character.stats.SpiritMax();
		this.portrait.character.stats.SpiritCurrent();
		float num2 = (float)this.portrait.character.stats.SpiritCurrent() / (float)this.portrait.character.stats.SpiritMax();
		num2 *= 100f;
		num2 *= 0.5f;
		Mathf.RoundToInt((float)num / 50f);
		for (int i = 0; i < 10; i++)
		{
			if (i == 0)
			{
				this.flowers = this.flowers10;
				this.flowersEnabled = this.flowers10Enabled;
			}
			if (i == 1)
			{
				this.flowers = this.flowers20;
				this.flowersEnabled = this.flowers20Enabled;
			}
			if (i == 2)
			{
				this.flowers = this.flowers30;
				this.flowersEnabled = this.flowers30Enabled;
			}
			if (i == 3)
			{
				this.flowers = this.flowers40;
				this.flowersEnabled = this.flowers40Enabled;
			}
			if (i == 4)
			{
				this.flowers = this.flowers50;
				this.flowersEnabled = this.flowers50Enabled;
			}
			if (i == 5)
			{
				this.flowers = this.flowers60;
				this.flowersEnabled = this.flowers60Enabled;
			}
			if (i == 6)
			{
				this.flowers = this.flowers70;
				this.flowersEnabled = this.flowers70Enabled;
			}
			if (i == 7)
			{
				this.flowers = this.flowers80;
				this.flowersEnabled = this.flowers80Enabled;
			}
			if (i == 8)
			{
				this.flowers = this.flowers90;
				this.flowersEnabled = this.flowers90Enabled;
			}
			if (i == 9)
			{
				this.flowers = this.flowers100;
				this.flowersEnabled = this.flowers100Enabled;
			}
			for (int j = 0; j < this.flowers.Count; j++)
			{
				this.flowersEnabled[j] = false;
			}
		}
		for (int k = 0; k < 10; k++)
		{
			bool flag = false;
			float num3 = 0f;
			if (k == 0)
			{
				this.flowers = this.flowers10;
				this.flowersEnabled = this.flowers10Enabled;
				if (num2 > 0f)
				{
					num3 = 0f;
					flag = true;
				}
			}
			if (k == 1)
			{
				this.flowers = this.flowers20;
				this.flowersEnabled = this.flowers20Enabled;
				if (num2 > 10f)
				{
					num3 = 10f;
					flag = true;
				}
			}
			if (k == 2)
			{
				this.flowers = this.flowers30;
				this.flowersEnabled = this.flowers30Enabled;
				if (num2 > 20f)
				{
					num3 = 20f;
					flag = true;
				}
			}
			if (k == 3)
			{
				this.flowers = this.flowers40;
				this.flowersEnabled = this.flowers40Enabled;
				if (num2 > 30f)
				{
					num3 = 30f;
					flag = true;
				}
			}
			if (k == 4)
			{
				this.flowers = this.flowers50;
				this.flowersEnabled = this.flowers50Enabled;
				if (num2 > 40f)
				{
					num3 = 40f;
					flag = true;
				}
			}
			if (k == 5)
			{
				this.flowers = this.flowers60;
				this.flowersEnabled = this.flowers60Enabled;
				if (num2 > 50f)
				{
					num3 = 50f;
					flag = true;
				}
			}
			if (k == 6)
			{
				this.flowers = this.flowers70;
				this.flowersEnabled = this.flowers70Enabled;
				if (num2 > 60f)
				{
					num3 = 60f;
					flag = true;
				}
			}
			if (k == 7)
			{
				this.flowers = this.flowers80;
				this.flowersEnabled = this.flowers80Enabled;
				if (num2 > 70f)
				{
					num3 = 70f;
					flag = true;
				}
			}
			if (k == 8)
			{
				this.flowers = this.flowers90;
				this.flowersEnabled = this.flowers90Enabled;
				if (num2 > 80f)
				{
					num3 = 80f;
					flag = true;
				}
			}
			if (k == 9)
			{
				this.flowers = this.flowers100;
				this.flowersEnabled = this.flowers100Enabled;
				if (num2 > 90f)
				{
					num3 = 90f;
					flag = true;
				}
			}
			if (flag)
			{
				for (int l = 0; l < this.flowers.Count; l++)
				{
					bool flag2 = false;
					if (l == 0 && num2 > num3)
					{
						flag2 = true;
					}
					if (l == 2 && num2 > num3 + 5f)
					{
						flag2 = true;
					}
					if (flag2)
					{
						this.flowersEnabled[l] = true;
					}
				}
			}
		}
		for (int m = 2; m < this.vinePieces.Count; m++)
		{
			if (this.vinePieces[m].enabled)
			{
				this.vinePieces[m].enabled = false;
			}
		}
		if (num2 <= 20f)
		{
			this.vinePieces[2].enabled = true;
			this.vinePieces[1].enabled = true;
		}
		if (num2 > 10f && num2 <= 20f)
		{
			this.vinePieces[3].enabled = true;
		}
		if (num2 > 20f && num2 <= 30f)
		{
			this.vinePieces[4].enabled = true;
		}
		if (num2 > 30f && num2 <= 40f)
		{
			this.vinePieces[5].enabled = true;
		}
		if (num2 > 40f && num2 <= 50f)
		{
			this.vinePieces[6].enabled = true;
		}
		if (num2 > 50f && num2 <= 60f)
		{
			this.vinePieces[7].enabled = true;
		}
		if (num2 > 60f && num2 <= 70f)
		{
			this.vinePieces[8].enabled = true;
		}
		if (num2 > 70f && num2 <= 80f)
		{
			this.vinePieces[9].enabled = true;
		}
		if (num2 > 80f && num2 <= 90f)
		{
			this.vinePieces[9].enabled = true;
		}
		if (num2 > 90f)
		{
			this.vinePieces[10].enabled = true;
		}
		for (int n = 0; n < 10; n++)
		{
			if (n == 0)
			{
				this.flowers = this.flowers10;
				this.flowersEnabled = this.flowers10Enabled;
			}
			if (n == 1)
			{
				this.flowers = this.flowers20;
				this.flowersEnabled = this.flowers20Enabled;
			}
			if (n == 2)
			{
				this.flowers = this.flowers30;
				this.flowersEnabled = this.flowers30Enabled;
			}
			if (n == 3)
			{
				this.flowers = this.flowers40;
				this.flowersEnabled = this.flowers40Enabled;
			}
			if (n == 4)
			{
				this.flowers = this.flowers50;
				this.flowersEnabled = this.flowers50Enabled;
			}
			if (n == 5)
			{
				this.flowers = this.flowers60;
				this.flowersEnabled = this.flowers60Enabled;
			}
			if (n == 6)
			{
				this.flowers = this.flowers70;
				this.flowersEnabled = this.flowers70Enabled;
			}
			if (n == 7)
			{
				this.flowers = this.flowers80;
				this.flowersEnabled = this.flowers80Enabled;
			}
			if (n == 8)
			{
				this.flowers = this.flowers90;
				this.flowersEnabled = this.flowers90Enabled;
			}
			if (n == 9)
			{
				this.flowers = this.flowers100;
				this.flowersEnabled = this.flowers100Enabled;
			}
			for (int num4 = 0; num4 < this.flowers.Count; num4++)
			{
				if (this.flowersEnabled[num4] && !this.flowers[num4].enabled)
				{
					this.flowers[num4].enabled = true;
				}
				if (!this.flowersEnabled[num4] && this.flowers[num4].enabled)
				{
					this.flowers[num4].enabled = false;
				}
			}
		}
	}

	// Token: 0x0400243B RID: 9275
	public List<Image> vinePieces = new List<Image>();

	// Token: 0x0400243C RID: 9276
	public List<Image> flowers10 = new List<Image>();

	// Token: 0x0400243D RID: 9277
	public List<Image> flowers20 = new List<Image>();

	// Token: 0x0400243E RID: 9278
	public List<Image> flowers30 = new List<Image>();

	// Token: 0x0400243F RID: 9279
	public List<Image> flowers40 = new List<Image>();

	// Token: 0x04002440 RID: 9280
	public List<Image> flowers50 = new List<Image>();

	// Token: 0x04002441 RID: 9281
	public List<Image> flowers60 = new List<Image>();

	// Token: 0x04002442 RID: 9282
	public List<Image> flowers70 = new List<Image>();

	// Token: 0x04002443 RID: 9283
	public List<Image> flowers80 = new List<Image>();

	// Token: 0x04002444 RID: 9284
	public List<Image> flowers90 = new List<Image>();

	// Token: 0x04002445 RID: 9285
	public List<Image> flowers100 = new List<Image>();

	// Token: 0x04002446 RID: 9286
	private List<Image> flowers;

	// Token: 0x04002447 RID: 9287
	private List<bool> flowersEnabled;

	// Token: 0x04002448 RID: 9288
	public List<bool> flowers10Enabled = new List<bool>();

	// Token: 0x04002449 RID: 9289
	public List<bool> flowers20Enabled = new List<bool>();

	// Token: 0x0400244A RID: 9290
	public List<bool> flowers30Enabled = new List<bool>();

	// Token: 0x0400244B RID: 9291
	public List<bool> flowers40Enabled = new List<bool>();

	// Token: 0x0400244C RID: 9292
	public List<bool> flowers50Enabled = new List<bool>();

	// Token: 0x0400244D RID: 9293
	public List<bool> flowers60Enabled = new List<bool>();

	// Token: 0x0400244E RID: 9294
	public List<bool> flowers70Enabled = new List<bool>();

	// Token: 0x0400244F RID: 9295
	public List<bool> flowers80Enabled = new List<bool>();

	// Token: 0x04002450 RID: 9296
	public List<bool> flowers90Enabled = new List<bool>();

	// Token: 0x04002451 RID: 9297
	public List<bool> flowers100Enabled = new List<bool>();

	// Token: 0x04002452 RID: 9298
	public Portrait portrait;
}
