using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x02000167 RID: 359
[Token(Token = "0x2000167")]
public class Level04LightMagic : PassiveEvent
{
	// Token: 0x170000B3 RID: 179
	// (get) Token: 0x060011ED RID: 4589 RVA: 0x00028EEC File Offset: 0x000270EC
	[Token(Token = "0x170000B3")]
	private StageFlagData Flags
	{
		[Token(Token = "0x60011ED")]
		[Address(RVA = "0x10E6480", Offset = "0x10E5280", VA = "0x1810E6480")]
		get
		{
			return Game.GameSave.flags;
		}
	}

	// Token: 0x060011EE RID: 4590 RVA: 0x00028F0C File Offset: 0x0002710C
	[Token(Token = "0x60011EE")]
	[Address(RVA = "0x10E5E20", Offset = "0x10E4C20", VA = "0x1810E5E20", Slot = "5")]
	public override void Init()
	{
		this.Reset();
		BoxCollider bc = this.BC;
		int num = 0;
		if (!(bc == num))
		{
			this.BC.isTrigger = true;
		}
		Debug.LogError("找不到碰撞");
		this.PS_Shell.Play(true);
		GameObject se_Remove = this.SE_Remove;
		Transform transform = base.transform;
		SoundEffect soundEffectOfPrefabs = Common.GetSoundEffectOfPrefabs(se_Remove, transform);
		this.g_SERemove = soundEffectOfPrefabs;
		Game.BindStageTimeScale(this.g_SERemove);
		GameObject se_Shell = this.SE_Shell;
		Transform transform2 = base.transform;
		SoundEffect soundEffectOfPrefabs2 = Common.GetSoundEffectOfPrefabs(se_Shell, transform2);
		this.g_SEShell = soundEffectOfPrefabs2;
		Game.BindStageTimeScale(this.g_SEShell);
		GameObject se_StartRemove = this.SE_StartRemove;
		Transform transform3 = base.transform;
		SoundEffect soundEffectOfPrefabs3 = Common.GetSoundEffectOfPrefabs(se_StartRemove, transform3);
		this.g_SEStartRemove = soundEffectOfPrefabs3;
		Game.BindStageTimeScale(this.g_SEStartRemove);
		GameObject se_StartShell = this.SE_StartShell;
		Transform transform4 = base.transform;
		SoundEffect soundEffectOfPrefabs4 = Common.GetSoundEffectOfPrefabs(se_StartShell, transform4);
		this.g_SEStartShell = soundEffectOfPrefabs4;
		Game.BindStageTimeScale(this.g_SEStartShell);
	}

	// Token: 0x060011EF RID: 4591 RVA: 0x00029010 File Offset: 0x00027210
	[Token(Token = "0x60011EF")]
	[Address(RVA = "0x10E62B0", Offset = "0x10E50B0", VA = "0x1810E62B0")]
	public void StartUp()
	{
		Level04LightMagicController.LMSTATUS g_Status = this.LMC.g_Status;
		if (g_Status == Level04LightMagicController.LMSTATUS.UNACTIVE)
		{
			this.g_SEStartRemove.PlayRandom(1f, 1f);
			this.PS_ShellRemove.Play(true);
			Level04LightMagicController lmc = this.LMC;
			lmc.g_Status = (Level04LightMagicController.LMSTATUS)((ulong)1L);
			lmc.g_fWaitTime = 2f;
			return;
		}
		while (g_Status != Level04LightMagicController.LMSTATUS.ACTIVE)
		{
		}
		this.g_SEStartShell.PlayRandom(1f, 1f);
		this.PS_ShellCreate.Play(true);
		Level04LightMagicController lmc2 = this.LMC;
		int num = this.g_iIndex;
		Level04LightMagic[] lightMagic = lmc2.LightMagic;
		Debug.LogError("LightMagic編號錯誤");
		Level04LightMagic[] lightMagic2 = lmc2.LightMagic;
		lmc2.g_Status = (Level04LightMagicController.LMSTATUS)((ulong)3L);
		lmc2.g_fWaitTime = 1.2f;
		Transform transform = lightMagic2[num].transform;
		lmc2.TargetPos = transform;
		throw new NullReferenceException();
	}

	// Token: 0x060011F0 RID: 4592 RVA: 0x000290E8 File Offset: 0x000272E8
	[Token(Token = "0x60011F0")]
	[Address(RVA = "0x10E6130", Offset = "0x10E4F30", VA = "0x1810E6130")]
	public void SetLightMagicController(Level04LightMagicController LightMagicController, int iIndex)
	{
		this.LMC = LightMagicController;
		this.g_iIndex = iIndex;
	}

	// Token: 0x060011F1 RID: 4593 RVA: 0x00029104 File Offset: 0x00027304
	[Token(Token = "0x60011F1")]
	[Address(RVA = "0x10E6160", Offset = "0x10E4F60", VA = "0x1810E6160")]
	public void SetRemoveShell()
	{
		if (base.gameObject.activeInHierarchy)
		{
			this.PS_Shell.Stop(true);
			SphereCollider sc_Shell = this.SC_Shell;
			int num = 0;
			sc_Shell.enabled = num != 0;
			this.g_SERemove.PlayRandom(1f, 1f);
			return;
		}
	}

	// Token: 0x060011F2 RID: 4594 RVA: 0x00029158 File Offset: 0x00027358
	[Token(Token = "0x60011F2")]
	[Address(RVA = "0x10E61E0", Offset = "0x10E4FE0", VA = "0x1810E61E0")]
	public void SetShell()
	{
		if (base.gameObject.activeInHierarchy)
		{
			this.PS_Shell.Play(true);
			this.SC_Shell.enabled = true;
			this.g_SEShell.PlayRandom(1f, 1f);
			return;
		}
	}

	// Token: 0x060011F3 RID: 4595 RVA: 0x000291A8 File Offset: 0x000273A8
	[Token(Token = "0x60011F3")]
	[Address(RVA = "0x10E6260", Offset = "0x10E5060", VA = "0x1810E6260", Slot = "7")]
	public override void SetTimeScale(float fScaleTime)
	{
		Common.SetEffectTimeScale(this.PS_Shell, fScaleTime);
		Common.SetEffectTimeScale(this.PS_ShellCreate, fScaleTime);
		Common.SetEffectTimeScale(this.PS_ShellRemove, fScaleTime);
	}

	// Token: 0x060011F4 RID: 4596 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60011F4")]
	[Address(RVA = "0x10E5D50", Offset = "0x10E4B50", VA = "0x1810E5D50")]
	public bool GetIsEnable()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060011F5 RID: 4597 RVA: 0x000291DC File Offset: 0x000273DC
	[Token(Token = "0x60011F5")]
	[Address(RVA = "0x10E6030", Offset = "0x10E4E30", VA = "0x1810E6030")]
	private void OnEnable()
	{
		Level04LightMagicController lmc = this.LMC;
		int num = 0;
		if (lmc != num && this.LMC.g_Status == Level04LightMagicController.LMSTATUS.UNACTIVE)
		{
			if (!this.Special || this.Flags.stage04Room01HatGet)
			{
				this.PS_Shell.Play(true);
				this.SC_Shell.enabled = true;
				return;
			}
			this.PS_Shell.Stop(true);
			SphereCollider sc_Shell = this.SC_Shell;
			int num2 = 0;
			sc_Shell.enabled = num2 != 0;
		}
	}

	// Token: 0x060011F6 RID: 4598 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60011F6")]
	[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00")]
	public void Reset()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060011F7 RID: 4599 RVA: 0x0002925C File Offset: 0x0002745C
	[Token(Token = "0x60011F7")]
	[Address(RVA = "0x10E5C30", Offset = "0x10E4A30", VA = "0x1810E5C30")]
	public void Check()
	{
		if (base.gameObject.activeInHierarchy)
		{
			Level04LightMagicController lmc = this.LMC;
			int num = 0;
			if (lmc != num && this.LMC.g_Status == Level04LightMagicController.LMSTATUS.UNACTIVE)
			{
				if (this.Special && !this.Flags.stage04Room01HatGet)
				{
					this.PS_Shell.Stop(true);
					SphereCollider sc_Shell = this.SC_Shell;
					int num2 = 0;
					sc_Shell.enabled = num2 != 0;
					return;
				}
				this.PS_Shell.Play(true);
				this.SC_Shell.enabled = true;
				return;
			}
		}
	}

	// Token: 0x060011F8 RID: 4600 RVA: 0x000292EC File Offset: 0x000274EC
	[Token(Token = "0x60011F8")]
	[Address(RVA = "0x10E6460", Offset = "0x10E5260", VA = "0x1810E6460")]
	public Level04LightMagic()
	{
	}

	// Token: 0x04001BB3 RID: 7091
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001BB3")]
	private Level04LightMagicController LMC;

	// Token: 0x04001BB4 RID: 7092
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001BB4")]
	public BoxCollider BC;

	// Token: 0x04001BB5 RID: 7093
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4001BB5")]
	public ParticleSystem PS_Shell;

	// Token: 0x04001BB6 RID: 7094
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4001BB6")]
	public ParticleSystem PS_ShellCreate;

	// Token: 0x04001BB7 RID: 7095
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4001BB7")]
	public ParticleSystem PS_ShellRemove;

	// Token: 0x04001BB8 RID: 7096
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4001BB8")]
	public SphereCollider SC_Shell;

	// Token: 0x04001BB9 RID: 7097
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4001BB9")]
	public GameObject SE_Remove;

	// Token: 0x04001BBA RID: 7098
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4001BBA")]
	public GameObject SE_Shell;

	// Token: 0x04001BBB RID: 7099
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4001BBB")]
	public GameObject SE_StartRemove;

	// Token: 0x04001BBC RID: 7100
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4001BBC")]
	public GameObject SE_StartShell;

	// Token: 0x04001BBD RID: 7101
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4001BBD")]
	private SoundEffect g_SERemove;

	// Token: 0x04001BBE RID: 7102
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4001BBE")]
	private SoundEffect g_SEShell;

	// Token: 0x04001BBF RID: 7103
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4001BBF")]
	private SoundEffect g_SEStartRemove;

	// Token: 0x04001BC0 RID: 7104
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4001BC0")]
	private SoundEffect g_SEStartShell;

	// Token: 0x04001BC1 RID: 7105
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4001BC1")]
	public bool Special;

	// Token: 0x04001BC2 RID: 7106
	[FieldOffset(Offset = "0x94")]
	[Token(Token = "0x4001BC2")]
	private int g_iIndex = (int)((ulong)4294967295L);
}
