using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x02000194 RID: 404
[Token(Token = "0x2000194")]
public class Level04LightMagic : PassiveEvent
{
	// Token: 0x170000A9 RID: 169
	// (get) Token: 0x0600136C RID: 4972 RVA: 0x0002C03C File Offset: 0x0002A23C
	[Token(Token = "0x170000A9")]
	private StageFlagData Flags
	{
		[Token(Token = "0x600136C")]
		[Address(RVA = "0x10575A0", Offset = "0x10565A0", VA = "0x1810575A0")]
		get
		{
			return Game.GameSave.flags;
		}
	}

	// Token: 0x0600136D RID: 4973 RVA: 0x0002C05C File Offset: 0x0002A25C
	[Token(Token = "0x600136D")]
	[Address(RVA = "0x1056F40", Offset = "0x1055F40", VA = "0x181056F40", 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: 0x0600136E RID: 4974 RVA: 0x0002C160 File Offset: 0x0002A360
	[Token(Token = "0x600136E")]
	[Address(RVA = "0x10573D0", Offset = "0x10563D0", VA = "0x1810573D0")]
	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: 0x0600136F RID: 4975 RVA: 0x0002C238 File Offset: 0x0002A438
	[Token(Token = "0x600136F")]
	[Address(RVA = "0x1057250", Offset = "0x1056250", VA = "0x181057250")]
	public void SetLightMagicController(Level04LightMagicController LightMagicController, int iIndex)
	{
		this.LMC = LightMagicController;
		this.g_iIndex = iIndex;
	}

	// Token: 0x06001370 RID: 4976 RVA: 0x0002C254 File Offset: 0x0002A454
	[Token(Token = "0x6001370")]
	[Address(RVA = "0x1057280", Offset = "0x1056280", VA = "0x181057280")]
	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: 0x06001371 RID: 4977 RVA: 0x0002C2A8 File Offset: 0x0002A4A8
	[Token(Token = "0x6001371")]
	[Address(RVA = "0x1057300", Offset = "0x1056300", VA = "0x181057300")]
	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: 0x06001372 RID: 4978 RVA: 0x0002C2F8 File Offset: 0x0002A4F8
	[Token(Token = "0x6001372")]
	[Address(RVA = "0x1057380", Offset = "0x1056380", VA = "0x181057380", 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: 0x06001373 RID: 4979 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001373")]
	[Address(RVA = "0x1056E70", Offset = "0x1055E70", VA = "0x181056E70")]
	public bool GetIsEnable()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001374 RID: 4980 RVA: 0x0002C32C File Offset: 0x0002A52C
	[Token(Token = "0x6001374")]
	[Address(RVA = "0x1057150", Offset = "0x1056150", VA = "0x181057150")]
	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: 0x06001375 RID: 4981 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001375")]
	[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0")]
	public void Reset()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001376 RID: 4982 RVA: 0x0002C3AC File Offset: 0x0002A5AC
	[Token(Token = "0x6001376")]
	[Address(RVA = "0x1056D20", Offset = "0x1055D20", VA = "0x181056D20")]
	public void Check()
	{
		if (base.gameObject.activeInHierarchy)
		{
			Level04LightMagicController lmc = this.LMC;
			int num = 0;
			if (lmc != num)
			{
				Level04LightMagicController.LMSTATUS g_Status = this.LMC.g_Status;
				if (g_Status != Level04LightMagicController.LMSTATUS.UNACTIVE)
				{
					if (g_Status == Level04LightMagicController.LMSTATUS.ACTIVE && this.Special && this.Flags.stage04Room01HatGet)
					{
						this.BC.enabled = true;
						return;
					}
				}
				else
				{
					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);
					throw new NullReferenceException();
				}
			}
		}
	}

	// Token: 0x06001377 RID: 4983 RVA: 0x0002C45C File Offset: 0x0002A65C
	[Token(Token = "0x6001377")]
	[Address(RVA = "0x1057580", Offset = "0x1056580", VA = "0x181057580")]
	public Level04LightMagic()
	{
	}

	// Token: 0x04001D46 RID: 7494
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001D46")]
	private Level04LightMagicController LMC;

	// Token: 0x04001D47 RID: 7495
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001D47")]
	public BoxCollider BC;

	// Token: 0x04001D48 RID: 7496
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4001D48")]
	public ParticleSystem PS_Shell;

	// Token: 0x04001D49 RID: 7497
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4001D49")]
	public ParticleSystem PS_ShellCreate;

	// Token: 0x04001D4A RID: 7498
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4001D4A")]
	public ParticleSystem PS_ShellRemove;

	// Token: 0x04001D4B RID: 7499
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4001D4B")]
	public SphereCollider SC_Shell;

	// Token: 0x04001D4C RID: 7500
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4001D4C")]
	public GameObject SE_Remove;

	// Token: 0x04001D4D RID: 7501
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4001D4D")]
	public GameObject SE_Shell;

	// Token: 0x04001D4E RID: 7502
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4001D4E")]
	public GameObject SE_StartRemove;

	// Token: 0x04001D4F RID: 7503
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4001D4F")]
	public GameObject SE_StartShell;

	// Token: 0x04001D50 RID: 7504
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4001D50")]
	private SoundEffect g_SERemove;

	// Token: 0x04001D51 RID: 7505
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4001D51")]
	private SoundEffect g_SEShell;

	// Token: 0x04001D52 RID: 7506
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4001D52")]
	private SoundEffect g_SEStartRemove;

	// Token: 0x04001D53 RID: 7507
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4001D53")]
	private SoundEffect g_SEStartShell;

	// Token: 0x04001D54 RID: 7508
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4001D54")]
	public bool Special;

	// Token: 0x04001D55 RID: 7509
	[FieldOffset(Offset = "0x94")]
	[Token(Token = "0x4001D55")]
	private int g_iIndex = (int)((ulong)4294967295L);
}
