using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x020001A0 RID: 416
[Token(Token = "0x20001A0")]
public class Level04LightMagicController : MonoBehaviour
{
	// Token: 0x060012C3 RID: 4803 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60012C3")]
	[Address(RVA = "0x10E4080", Offset = "0x10E2E80", VA = "0x1810E4080")]
	private void Start()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060012C4 RID: 4804 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60012C4")]
	[Address(RVA = "0x10E47F0", Offset = "0x10E35F0", VA = "0x1810E47F0")]
	private void Update()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060012C5 RID: 4805 RVA: 0x0002B068 File Offset: 0x00029268
	[Token(Token = "0x60012C5")]
	[Address(RVA = "0x10E4550", Offset = "0x10E3350", VA = "0x1810E4550")]
	private void UpdateFlashing(float fDeltaTime)
	{
		float num = this.g_fLightFrequencyVal;
		Light plight = this.PLight;
		if (num <= 0.09f)
		{
			if (plight.enabled)
			{
				Light plight2 = this.PLight;
				float intensity = plight2.intensity;
				float num2 = this.g_fPLightChangeIntensity;
				float num3 = fDeltaTime * 2.4f;
				num2 = Mathf.Lerp(intensity, num2, num3);
				plight2.intensity = num2;
			}
			float num4 = fDeltaTime * 2.4f;
			if (!this.SLight.enabled)
			{
				goto IL_EE;
			}
			Light slight = this.SLight;
			float intensity2 = slight.intensity;
			float num5 = this.g_fSLightChangeIntensity;
			num5 = Mathf.Lerp(intensity2, num5, num4);
			slight.intensity = num5;
		}
		this.g_fLightFrequencyVal = num;
		if (plight.enabled)
		{
			float num6 = UnityEngine.Random.Range(-0.6f, 0.6f);
			this.g_fPLightChangeIntensity = num6;
		}
		if (this.SLight.enabled)
		{
			float num7 = UnityEngine.Random.Range(-0.6f, 0.6f);
			this.g_fSLightChangeIntensity = num7;
		}
		IL_EE:
		this.g_fLightFrequencyVal = fDeltaTime;
	}

	// Token: 0x060012C6 RID: 4806 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60012C6")]
	[Address(RVA = "0x10E4700", Offset = "0x10E3500", VA = "0x1810E4700")]
	private void UpdateFloat(float fDeltaTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060012C7 RID: 4807 RVA: 0x0002B170 File Offset: 0x00029370
	[Token(Token = "0x60012C7")]
	[Address(RVA = "0x10E4060", Offset = "0x10E2E60", VA = "0x1810E4060")]
	public void SetStartActive()
	{
		this.g_Status = (Level04LightMagicController.LMSTATUS)((ulong)1L);
		this.g_fWaitTime = 2f;
	}

	// Token: 0x060012C8 RID: 4808 RVA: 0x0002B194 File Offset: 0x00029394
	[Token(Token = "0x60012C8")]
	[Address(RVA = "0x10E3F80", Offset = "0x10E2D80", VA = "0x1810E3F80")]
	public void SetDeactivate(int iIndex)
	{
		Level04LightMagic[] lightMagic = this.LightMagic;
		Debug.LogError("LightMagic編號錯誤");
		Level04LightMagic[] lightMagic2 = this.LightMagic;
		this.g_Status = (Level04LightMagicController.LMSTATUS)((ulong)3L);
		this.g_fWaitTime = 1.2f;
		Transform transform = lightMagic2[iIndex].transform;
		this.TargetPos = transform;
		throw new NullReferenceException();
	}

	// Token: 0x060012C9 RID: 4809 RVA: 0x0002B1E8 File Offset: 0x000293E8
	[Token(Token = "0x60012C9")]
	[Address(RVA = "0x10E3F00", Offset = "0x10E2D00", VA = "0x1810E3F00")]
	public Level04LightMagicController.LMSTATUS GetStatus()
	{
		return this.g_Status;
	}

	// Token: 0x060012CA RID: 4810 RVA: 0x0002B1FC File Offset: 0x000293FC
	[Token(Token = "0x60012CA")]
	[Address(RVA = "0x10E3D10", Offset = "0x10E2B10", VA = "0x1810E3D10")]
	public void EventUnactive()
	{
		int num = 0;
		if (this.g_Status == Level04LightMagicController.LMSTATUS.ACTIVE)
		{
			this.g_Status = (Level04LightMagicController.LMSTATUS)num;
		}
		Level04LightMagic[] lightMagic = this.LightMagic;
		if (num < lightMagic.Length)
		{
			Level04LightMagic level04LightMagic = lightMagic[num];
			if (level04LightMagic.gameObject.activeInHierarchy)
			{
				Level04LightMagicController lmc = level04LightMagic.LMC;
				int num2 = 0;
				if (lmc != num2 && level04LightMagic.LMC.g_Status == Level04LightMagicController.LMSTATUS.UNACTIVE)
				{
					if (level04LightMagic.Special && !Game.GameSave.flags.stage04Room01HatGet)
					{
						level04LightMagic.PS_Shell.Stop(true);
						SphereCollider sc_Shell = level04LightMagic.SC_Shell;
					}
					level04LightMagic.PS_Shell.Play(true);
					level04LightMagic.SC_Shell.enabled = true;
				}
			}
			Level04LightMagic[] lightMagic2 = this.LightMagic;
			num++;
		}
	}

	// Token: 0x060012CB RID: 4811 RVA: 0x0002B2C4 File Offset: 0x000294C4
	[Token(Token = "0x60012CB")]
	[Address(RVA = "0x10E3F10", Offset = "0x10E2D10", VA = "0x1810E3F10")]
	private void OnTriggerEnter(Collider other)
	{
		if (this.g_Status == Level04LightMagicController.LMSTATUS.ACTIVE && other.CompareTag("Player"))
		{
			this.g_Status = (Level04LightMagicController.LMSTATUS)((ulong)0L);
		}
	}

	// Token: 0x060012CC RID: 4812 RVA: 0x0002B2F8 File Offset: 0x000294F8
	[Token(Token = "0x60012CC")]
	[Address(RVA = "0x10E5C10", Offset = "0x10E4A10", VA = "0x1810E5C10")]
	public Level04LightMagicController()
	{
	}

	// Token: 0x04001D1A RID: 7450
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4001D1A")]
	public Level04LightMagic[] LightMagic;

	// Token: 0x04001D1B RID: 7451
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001D1B")]
	public CrystalBall[] Crystal;

	// Token: 0x04001D1C RID: 7452
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001D1C")]
	public Transform Pos_LightBall;

	// Token: 0x04001D1D RID: 7453
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4001D1D")]
	public Transform Pos_LerpTarget;

	// Token: 0x04001D1E RID: 7454
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4001D1E")]
	private Transform TargetPos;

	// Token: 0x04001D1F RID: 7455
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4001D1F")]
	private Transform PlayerPos;

	// Token: 0x04001D20 RID: 7456
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4001D20")]
	private Transform AimPos;

	// Token: 0x04001D21 RID: 7457
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4001D21")]
	private Vector3 g_v3MovePos;

	// Token: 0x04001D22 RID: 7458
	[Token(Token = "0x4001D22")]
	private const float g_fPosHeight = 2.7f;

	// Token: 0x04001D23 RID: 7459
	[FieldOffset(Offset = "0x5C")]
	[Token(Token = "0x4001D23")]
	private Vector3 g_v3Float;

	// Token: 0x04001D24 RID: 7460
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4001D24")]
	private float g_fFloatX;

	// Token: 0x04001D25 RID: 7461
	[FieldOffset(Offset = "0x6C")]
	[Token(Token = "0x4001D25")]
	private float g_fFloatY;

	// Token: 0x04001D26 RID: 7462
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4001D26")]
	private float g_fFloatZ;

	// Token: 0x04001D27 RID: 7463
	[FieldOffset(Offset = "0x74")]
	[Token(Token = "0x4001D27")]
	private float g_fFloatSpeedX;

	// Token: 0x04001D28 RID: 7464
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4001D28")]
	private float g_fFloatSpeedY;

	// Token: 0x04001D29 RID: 7465
	[FieldOffset(Offset = "0x7C")]
	[Token(Token = "0x4001D29")]
	private float g_fFloatSpeedZ;

	// Token: 0x04001D2A RID: 7466
	[Token(Token = "0x4001D2A")]
	private const float g_fFloatRange = 0.3f;

	// Token: 0x04001D2B RID: 7467
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4001D2B")]
	private float g_fPI2;

	// Token: 0x04001D2C RID: 7468
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4001D2C")]
	public ParticleSystem PS_LightBall;

	// Token: 0x04001D2D RID: 7469
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4001D2D")]
	public Light PLight;

	// Token: 0x04001D2E RID: 7470
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4001D2E")]
	private float g_fPLightDefaultIntensity;

	// Token: 0x04001D2F RID: 7471
	[FieldOffset(Offset = "0x9C")]
	[Token(Token = "0x4001D2F")]
	private float g_fPLightChangeIntensity;

	// Token: 0x04001D30 RID: 7472
	[Token(Token = "0x4001D30")]
	private const float g_fLightFrequency = 0.09f;

	// Token: 0x04001D31 RID: 7473
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4001D31")]
	private float g_fLightFrequencyVal;

	// Token: 0x04001D32 RID: 7474
	[FieldOffset(Offset = "0xA4")]
	[Token(Token = "0x4001D32")]
	private float g_fPLightDefaultRange;

	// Token: 0x04001D33 RID: 7475
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4001D33")]
	private float g_fPLightRange;

	// Token: 0x04001D34 RID: 7476
	[Token(Token = "0x4001D34")]
	private const float g_fLightSpeed = 2.4f;

	// Token: 0x04001D35 RID: 7477
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x4001D35")]
	public Light SLight;

	// Token: 0x04001D36 RID: 7478
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x4001D36")]
	private float g_fSLightDefaultIntensity;

	// Token: 0x04001D37 RID: 7479
	[FieldOffset(Offset = "0xBC")]
	[Token(Token = "0x4001D37")]
	private float g_fSLightChangeIntensity;

	// Token: 0x04001D38 RID: 7480
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x4001D38")]
	private float g_fSLightDefaultRange;

	// Token: 0x04001D39 RID: 7481
	[FieldOffset(Offset = "0xC4")]
	[Token(Token = "0x4001D39")]
	private float g_fSLightRange;

	// Token: 0x04001D3A RID: 7482
	[FieldOffset(Offset = "0xC8")]
	[Token(Token = "0x4001D3A")]
	public Light CLight;

	// Token: 0x04001D3B RID: 7483
	[FieldOffset(Offset = "0xD0")]
	[Token(Token = "0x4001D3B")]
	private float g_fCLightDefaultIntensity;

	// Token: 0x04001D3C RID: 7484
	[FieldOffset(Offset = "0xD4")]
	[Token(Token = "0x4001D3C")]
	public float PlayerLightRange = 24f;

	// Token: 0x04001D3D RID: 7485
	[FieldOffset(Offset = "0xD8")]
	[Token(Token = "0x4001D3D")]
	public GameObject SE_LightBallLoop;

	// Token: 0x04001D3E RID: 7486
	[FieldOffset(Offset = "0xE0")]
	[Token(Token = "0x4001D3E")]
	private SoundEffect g_SELightBallLoop;

	// Token: 0x04001D3F RID: 7487
	[FieldOffset(Offset = "0xE8")]
	[Token(Token = "0x4001D3F")]
	private float g_fWaitTime;

	// Token: 0x04001D40 RID: 7488
	[FieldOffset(Offset = "0xEC")]
	[Token(Token = "0x4001D40")]
	private Level04LightMagicController.LMSTATUS g_Status;

	// Token: 0x020001A1 RID: 417
	[Token(Token = "0x20001A1")]
	public enum LMSTATUS
	{
		// Token: 0x04001D42 RID: 7490
		[Token(Token = "0x4001D42")]
		UNACTIVE,
		// Token: 0x04001D43 RID: 7491
		[Token(Token = "0x4001D43")]
		STARTACTIVE,
		// Token: 0x04001D44 RID: 7492
		[Token(Token = "0x4001D44")]
		ACTIVE,
		// Token: 0x04001D45 RID: 7493
		[Token(Token = "0x4001D45")]
		DEACTIVATE
	}
}
