using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x020001C0 RID: 448
[Token(Token = "0x20001C0")]
public class CrystalBall : AttackableObject
{
	// Token: 0x170000B1 RID: 177
	// (get) Token: 0x060013F8 RID: 5112 RVA: 0x0002D570 File Offset: 0x0002B770
	[Token(Token = "0x170000B1")]
	private StageFlagData Flags
	{
		[Token(Token = "0x60013F8")]
		[Address(RVA = "0x12F2C80", Offset = "0x12F1C80", VA = "0x1812F2C80")]
		get
		{
			return Game.GameSave.flags;
		}
	}

	// Token: 0x060013F9 RID: 5113 RVA: 0x0002D590 File Offset: 0x0002B790
	[Token(Token = "0x60013F9")]
	[Address(RVA = "0x12F1950", Offset = "0x12F0950", VA = "0x1812F1950", Slot = "4")]
	public override void Init()
	{
		base.Init();
		float intensity = this.PLight.intensity;
		Light plight = this.PLight;
		this.g_fLightDefIntensity = intensity;
		this.g_fLightRandomIntensity = 0f;
		int num = 0;
		plight.intensity = (float)num;
		Shake g_Shake = this.g_Shake;
		Transform transform = base.transform;
		ulong num2;
		g_Shake.Start(transform, num2 != 0UL);
		ulong num3;
		this.PS_BlackSmoke.Play(num3 != 0UL);
		GameObject se_BlackSmoke = this.SE_BlackSmoke;
		Transform transform2 = base.transform;
		SoundEffect soundEffectOfPrefabs = Common.GetSoundEffectOfPrefabs(se_BlackSmoke, transform2);
		this.g_SEBlackSmoke = soundEffectOfPrefabs;
		Game.BindStageTimeScale(this.g_SEBlackSmoke);
		GameObject se_ReceiveLight = this.SE_ReceiveLight;
		Transform transform3 = base.transform;
		SoundEffect soundEffectOfPrefabs2 = Common.GetSoundEffectOfPrefabs(se_ReceiveLight, transform3);
		this.g_SEReceiveLight = soundEffectOfPrefabs2;
		Game.BindStageTimeScale(this.g_SEReceiveLight);
		GameObject se_Complete = this.SE_Complete;
		Transform transform4 = base.transform;
		SoundEffect soundEffectOfPrefabs3 = Common.GetSoundEffectOfPrefabs(se_Complete, transform4);
		this.g_SEComplete = soundEffectOfPrefabs3;
		Game.BindStageTimeScale(this.g_SEComplete);
		GameObject se_CompleteLoop = this.SE_CompleteLoop;
		Transform transform5 = base.transform;
		SoundEffect soundEffectOfPrefabs4 = Common.GetSoundEffectOfPrefabs(se_CompleteLoop, transform5);
		this.g_SECompleteLoop = soundEffectOfPrefabs4;
		Game.BindStageTimeScale(this.g_SECompleteLoop);
		CrystalBall.CystalBallPos scriptEventType = this.ScriptEventType;
		this.g_fRLVolume = 0f;
		this.g_fRLPitch = 0.6f;
		if (scriptEventType != CrystalBall.CystalBallPos.CrystalBall01To02)
		{
			if (scriptEventType != CrystalBall.CystalBallPos.CrystalBall01To02)
			{
				if (scriptEventType != CrystalBall.CystalBallPos.CrystalBall01To02)
				{
					if (scriptEventType != CrystalBall.CystalBallPos.CrystalBall01To02)
					{
						if (scriptEventType != CrystalBall.CystalBallPos.CrystalBall03)
						{
							return;
						}
						StageFlagData flags = this.Flags;
					}
					StageFlagData flags2 = this.Flags;
				}
				StageFlagData flags3 = this.Flags;
			}
			StageFlagData flags4 = this.Flags;
		}
		if (this.Flags.stage04Room01To02CrystalBall)
		{
			this.SaveClose();
		}
	}

	// Token: 0x060013FA RID: 5114 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60013FA")]
	[Address(RVA = "0x12F2910", Offset = "0x12F1910", VA = "0x1812F2910", Slot = "6")]
	protected override void Update()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060013FB RID: 5115 RVA: 0x0002D720 File Offset: 0x0002B920
	[Token(Token = "0x60013FB")]
	[Address(RVA = "0x12F1BE0", Offset = "0x12F0BE0", VA = "0x1812F1BE0", Slot = "8")]
	protected override void LateUpdate()
	{
		base.LateUpdate();
		float hp = this.HP;
		this.g_fHPBefore = hp;
	}

	// Token: 0x060013FC RID: 5116 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60013FC")]
	[Address(RVA = "0x12F2270", Offset = "0x12F1270", VA = "0x1812F2270")]
	public void SetReceiveLight(float fDistance)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060013FD RID: 5117 RVA: 0x0002D744 File Offset: 0x0002B944
	[Token(Token = "0x60013FD")]
	[Address(RVA = "0x12F18F0", Offset = "0x12F08F0", VA = "0x1812F18F0")]
	public bool GetIsReceiveLight()
	{
		return this.g_bIsReceiveLight;
	}

	// Token: 0x060013FE RID: 5118 RVA: 0x0002D758 File Offset: 0x0002B958
	[Token(Token = "0x60013FE")]
	[Address(RVA = "0x12F1900", Offset = "0x12F0900", VA = "0x1812F1900", Slot = "9")]
	public override void HitPhysical(AttackData AD)
	{
		Shake g_Shake = this.g_Shake;
		int num = 0;
		ulong num2;
		g_Shake.SetRandomShake(0.2f, 6f, 0.6f, (float)num, num2 != 0UL);
	}

	// Token: 0x060013FF RID: 5119 RVA: 0x0002D78C File Offset: 0x0002B98C
	[Token(Token = "0x60013FF")]
	[Address(RVA = "0x12F1900", Offset = "0x12F0900", VA = "0x1812F1900", Slot = "10")]
	public override void HitMagic(AttackData AD)
	{
		Shake g_Shake = this.g_Shake;
		int num = 0;
		ulong num2;
		g_Shake.SetRandomShake(0.2f, 6f, 0.6f, (float)num, num2 != 0UL);
	}

	// Token: 0x06001400 RID: 5120 RVA: 0x0002D7C0 File Offset: 0x0002B9C0
	[Token(Token = "0x6001400")]
	[Address(RVA = "0x12F1FE0", Offset = "0x12F0FE0", VA = "0x1812F1FE0")]
	public void SaveClose()
	{
		Light plight = this.PLight;
		float num = this.g_fLightDefIntensity;
		plight.intensity = num;
		ParticleSystem ps_BlackSmoke = this.PS_BlackSmoke;
		this.g_bIsReceiveLight = false;
		ps_BlackSmoke.Stop(true);
		this.PS_ReceiveLight.Stop(true);
		this.PS_Complete.Play(true);
		int length = this.ReleaseSceneEvent.Length;
		int num2 = 0;
		if (length > 0)
		{
			SceneEvent sceneEvent = this.ReleaseSceneEvent[num2];
			int num3 = 0;
			if (sceneEvent != num3)
			{
				GameObject gameObject = this.ReleaseSceneEvent[num2].gameObject;
				int num4 = 0;
				gameObject.SetActive(num4 != 0);
			}
			num2++;
		}
		if (this.ReleasePSFog.Length > 0)
		{
			ParticleSystem particleSystem = this.ReleasePSFog[num2];
			int num5 = 0;
			if (particleSystem != num5)
			{
				GameObject gameObject2 = this.ReleasePSFog[num2].gameObject;
				int num6 = 0;
				gameObject2.SetActive(num6 != 0);
			}
			num2++;
		}
	}

	// Token: 0x06001401 RID: 5121 RVA: 0x0002D8C0 File Offset: 0x0002BAC0
	[Token(Token = "0x6001401")]
	[Address(RVA = "0x12F28C0", Offset = "0x12F18C0", VA = "0x1812F28C0", Slot = "11")]
	public override void SetTimeScale(float fTimeScale)
	{
		Common.SetEffectTimeScale(this.PS_BlackSmoke, fTimeScale);
		Common.SetEffectTimeScale(this.PS_ReceiveLight, fTimeScale);
		Common.SetEffectTimeScale(this.PS_Complete, fTimeScale);
	}

	// Token: 0x06001402 RID: 5122 RVA: 0x0002D8F4 File Offset: 0x0002BAF4
	[Token(Token = "0x6001402")]
	[Address(RVA = "0x12F1C00", Offset = "0x12F0C00", VA = "0x1812F1C00")]
	private new void OnEnable()
	{
		ParticleSystem ps_BlackSmoke;
		for (;;)
		{
			ps_BlackSmoke = this.PS_BlackSmoke;
			if (this.g_bIsReceiveLight)
			{
				break;
			}
			ps_BlackSmoke.Stop(true);
			this.PS_ReceiveLight.Stop(true);
			this.PS_Complete.Play(true);
			SoundEffect soundEffect = this.g_SEBlackSmoke;
			int num = 0;
			if (soundEffect != num)
			{
				this.g_SEBlackSmoke.Stop();
			}
			SoundEffect soundEffect2 = this.g_SECompleteLoop;
			int num2 = 0;
			if (soundEffect2 != num2)
			{
				this.g_SECompleteLoop.PlayRandom(1f, 1f);
			}
			if (this.ReleasePSFog.Length > 0)
			{
				goto Block_7;
			}
		}
		ps_BlackSmoke.Play(true);
		this.PS_ReceiveLight.Stop(true);
		this.PS_Complete.Stop(true);
		if (this.ReleasePSFog.Length > 0)
		{
			int num3 = 0;
			ParticleSystem particleSystem = this.ReleasePSFog[num3];
			int num4 = 0;
			if (particleSystem != num4)
			{
				this.ReleasePSFog[num3].Play(true);
			}
			num3++;
		}
		SoundEffect soundEffect3 = this.g_SEBlackSmoke;
		int num5 = 0;
		if (soundEffect3 != num5)
		{
			this.g_SEBlackSmoke.PlayRandom(1f, 1f);
		}
		SoundEffect soundEffect4 = this.g_SECompleteLoop;
		int num6 = 0;
		if (soundEffect4 != num6)
		{
			this.g_SECompleteLoop.Stop();
		}
		return;
		Block_7:
		int num7 = 0;
		ParticleSystem particleSystem2 = this.ReleasePSFog[num7];
		int num8 = 0;
		if (particleSystem2 != num8)
		{
			this.ReleasePSFog[num7].Stop(true);
		}
		num7++;
		throw new NullReferenceException();
	}

	// Token: 0x06001403 RID: 5123 RVA: 0x0002DA80 File Offset: 0x0002BC80
	[Token(Token = "0x6001403")]
	[Address(RVA = "0x12F2C70", Offset = "0x12F1C70", VA = "0x1812F2C70")]
	public CrystalBall()
	{
	}

	// Token: 0x04001E38 RID: 7736
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4001E38")]
	public Light PLight;

	// Token: 0x04001E39 RID: 7737
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4001E39")]
	private float g_fLightDefIntensity;

	// Token: 0x04001E3A RID: 7738
	[FieldOffset(Offset = "0x74")]
	[Token(Token = "0x4001E3A")]
	private float g_fLightRandomIntensity;

	// Token: 0x04001E3B RID: 7739
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4001E3B")]
	public ParticleSystem PS_BlackSmoke;

	// Token: 0x04001E3C RID: 7740
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4001E3C")]
	public ParticleSystem PS_ReceiveLight;

	// Token: 0x04001E3D RID: 7741
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4001E3D")]
	public ParticleSystem PS_Complete;

	// Token: 0x04001E3E RID: 7742
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4001E3E")]
	public GameObject SE_BlackSmoke;

	// Token: 0x04001E3F RID: 7743
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4001E3F")]
	public GameObject SE_ReceiveLight;

	// Token: 0x04001E40 RID: 7744
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4001E40")]
	public GameObject SE_Complete;

	// Token: 0x04001E41 RID: 7745
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4001E41")]
	public GameObject SE_CompleteLoop;

	// Token: 0x04001E42 RID: 7746
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x4001E42")]
	private SoundEffect g_SEBlackSmoke;

	// Token: 0x04001E43 RID: 7747
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x4001E43")]
	private SoundEffect g_SEReceiveLight;

	// Token: 0x04001E44 RID: 7748
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x4001E44")]
	private SoundEffect g_SEComplete;

	// Token: 0x04001E45 RID: 7749
	[FieldOffset(Offset = "0xC8")]
	[Token(Token = "0x4001E45")]
	private SoundEffect g_SECompleteLoop;

	// Token: 0x04001E46 RID: 7750
	[FieldOffset(Offset = "0xD0")]
	[Token(Token = "0x4001E46")]
	public SceneEvent[] ReleaseSceneEvent;

	// Token: 0x04001E47 RID: 7751
	[FieldOffset(Offset = "0xD8")]
	[Token(Token = "0x4001E47")]
	public SceneEvent[] OpenSceneEvent;

	// Token: 0x04001E48 RID: 7752
	[FieldOffset(Offset = "0xE0")]
	[Token(Token = "0x4001E48")]
	public ParticleSystem[] ReleasePSFog;

	// Token: 0x04001E49 RID: 7753
	[FieldOffset(Offset = "0xE8")]
	[Token(Token = "0x4001E49")]
	private float g_fHPBefore;

	// Token: 0x04001E4A RID: 7754
	[Token(Token = "0x4001E4A")]
	private const float g_AutoCureHP = 0.45f;

	// Token: 0x04001E4B RID: 7755
	[FieldOffset(Offset = "0xEC")]
	[Token(Token = "0x4001E4B")]
	private bool g_bIsReceiveLight = true;

	// Token: 0x04001E4C RID: 7756
	[FieldOffset(Offset = "0xF0")]
	[Token(Token = "0x4001E4C")]
	private float g_fRLVolume;

	// Token: 0x04001E4D RID: 7757
	[FieldOffset(Offset = "0xF4")]
	[Token(Token = "0x4001E4D")]
	private float g_fRLPitch;

	// Token: 0x04001E4E RID: 7758
	[FieldOffset(Offset = "0xF8")]
	[Token(Token = "0x4001E4E")]
	public CrystalBall.CystalBallPos ScriptEventType;

	// Token: 0x04001E4F RID: 7759
	[FieldOffset(Offset = "0xFC")]
	[Token(Token = "0x4001E4F")]
	private bool g_bSwitch;

	// Token: 0x020001C1 RID: 449
	[Token(Token = "0x20001C1")]
	public enum CystalBallPos
	{
		// Token: 0x04001E51 RID: 7761
		[Token(Token = "0x4001E51")]
		CrystalBall01To02,
		// Token: 0x04001E52 RID: 7762
		[Token(Token = "0x4001E52")]
		CrystalBall03,
		// Token: 0x04001E53 RID: 7763
		[Token(Token = "0x4001E53")]
		CrystalBall01To04,
		// Token: 0x04001E54 RID: 7764
		[Token(Token = "0x4001E54")]
		CrystalBall04,
		// Token: 0x04001E55 RID: 7765
		[Token(Token = "0x4001E55")]
		CrystalBall05
	}
}
