using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x02000189 RID: 393
[Token(Token = "0x2000189")]
public class CrystalBall : AttackableObject
{
	// Token: 0x170000BA RID: 186
	// (get) Token: 0x0600125E RID: 4702 RVA: 0x00029F0C File Offset: 0x0002810C
	[Token(Token = "0x170000BA")]
	private StageFlagData Flags
	{
		[Token(Token = "0x600125E")]
		[Address(RVA = "0x13C2000", Offset = "0x13C0E00", VA = "0x1813C2000")]
		get
		{
			return Game.GameSave.flags;
		}
	}

	// Token: 0x0600125F RID: 4703 RVA: 0x00029F2C File Offset: 0x0002812C
	[Token(Token = "0x600125F")]
	[Address(RVA = "0x13C0DA0", Offset = "0x13BFBA0", VA = "0x1813C0DA0", 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: 0x06001260 RID: 4704 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001260")]
	[Address(RVA = "0x13C1C90", Offset = "0x13C0A90", VA = "0x1813C1C90", Slot = "6")]
	protected override void Update()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001261 RID: 4705 RVA: 0x0002A0BC File Offset: 0x000282BC
	[Token(Token = "0x6001261")]
	[Address(RVA = "0x13C1030", Offset = "0x13BFE30", VA = "0x1813C1030", Slot = "8")]
	protected override void LateUpdate()
	{
		base.LateUpdate();
		float hp = this.HP;
		this.g_fHPBefore = hp;
	}

	// Token: 0x06001262 RID: 4706 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001262")]
	[Address(RVA = "0x13C15F0", Offset = "0x13C03F0", VA = "0x1813C15F0")]
	public void SetReceiveLight(float fDistance)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001263 RID: 4707 RVA: 0x0002A0E0 File Offset: 0x000282E0
	[Token(Token = "0x6001263")]
	[Address(RVA = "0x13C0D40", Offset = "0x13BFB40", VA = "0x1813C0D40")]
	public bool GetIsReceiveLight()
	{
		return this.g_bIsReceiveLight;
	}

	// Token: 0x06001264 RID: 4708 RVA: 0x0002A0F4 File Offset: 0x000282F4
	[Token(Token = "0x6001264")]
	[Address(RVA = "0x13C0D50", Offset = "0x13BFB50", VA = "0x1813C0D50", 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: 0x06001265 RID: 4709 RVA: 0x0002A128 File Offset: 0x00028328
	[Token(Token = "0x6001265")]
	[Address(RVA = "0x13C0D50", Offset = "0x13BFB50", VA = "0x1813C0D50", 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: 0x06001266 RID: 4710 RVA: 0x0002A15C File Offset: 0x0002835C
	[Token(Token = "0x6001266")]
	[Address(RVA = "0x13C1360", Offset = "0x13C0160", VA = "0x1813C1360")]
	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: 0x06001267 RID: 4711 RVA: 0x0002A25C File Offset: 0x0002845C
	[Token(Token = "0x6001267")]
	[Address(RVA = "0x13C1C40", Offset = "0x13C0A40", VA = "0x1813C1C40", 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: 0x06001268 RID: 4712 RVA: 0x0002A290 File Offset: 0x00028490
	[Token(Token = "0x6001268")]
	[Address(RVA = "0x13C1050", Offset = "0x13BFE50", VA = "0x1813C1050")]
	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)
			{
				goto Block_6;
			}
		}
		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_6:
		this.g_SECompleteLoop.PlayRandom(1f, 1f);
		throw new NullReferenceException();
	}

	// Token: 0x06001269 RID: 4713 RVA: 0x0002A3D4 File Offset: 0x000285D4
	[Token(Token = "0x6001269")]
	[Address(RVA = "0x13C1FF0", Offset = "0x13C0DF0", VA = "0x1813C1FF0")]
	public CrystalBall()
	{
	}

	// Token: 0x04001C77 RID: 7287
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4001C77")]
	public Light PLight;

	// Token: 0x04001C78 RID: 7288
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4001C78")]
	private float g_fLightDefIntensity;

	// Token: 0x04001C79 RID: 7289
	[FieldOffset(Offset = "0x74")]
	[Token(Token = "0x4001C79")]
	private float g_fLightRandomIntensity;

	// Token: 0x04001C7A RID: 7290
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4001C7A")]
	public ParticleSystem PS_BlackSmoke;

	// Token: 0x04001C7B RID: 7291
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4001C7B")]
	public ParticleSystem PS_ReceiveLight;

	// Token: 0x04001C7C RID: 7292
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4001C7C")]
	public ParticleSystem PS_Complete;

	// Token: 0x04001C7D RID: 7293
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4001C7D")]
	public GameObject SE_BlackSmoke;

	// Token: 0x04001C7E RID: 7294
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4001C7E")]
	public GameObject SE_ReceiveLight;

	// Token: 0x04001C7F RID: 7295
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4001C7F")]
	public GameObject SE_Complete;

	// Token: 0x04001C80 RID: 7296
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4001C80")]
	public GameObject SE_CompleteLoop;

	// Token: 0x04001C81 RID: 7297
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x4001C81")]
	private SoundEffect g_SEBlackSmoke;

	// Token: 0x04001C82 RID: 7298
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x4001C82")]
	private SoundEffect g_SEReceiveLight;

	// Token: 0x04001C83 RID: 7299
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x4001C83")]
	private SoundEffect g_SEComplete;

	// Token: 0x04001C84 RID: 7300
	[FieldOffset(Offset = "0xC8")]
	[Token(Token = "0x4001C84")]
	private SoundEffect g_SECompleteLoop;

	// Token: 0x04001C85 RID: 7301
	[FieldOffset(Offset = "0xD0")]
	[Token(Token = "0x4001C85")]
	public SceneEvent[] ReleaseSceneEvent;

	// Token: 0x04001C86 RID: 7302
	[FieldOffset(Offset = "0xD8")]
	[Token(Token = "0x4001C86")]
	public SceneEvent[] OpenSceneEvent;

	// Token: 0x04001C87 RID: 7303
	[FieldOffset(Offset = "0xE0")]
	[Token(Token = "0x4001C87")]
	public ParticleSystem[] ReleasePSFog;

	// Token: 0x04001C88 RID: 7304
	[FieldOffset(Offset = "0xE8")]
	[Token(Token = "0x4001C88")]
	private float g_fHPBefore;

	// Token: 0x04001C89 RID: 7305
	[Token(Token = "0x4001C89")]
	private const float g_AutoCureHP = 0.45f;

	// Token: 0x04001C8A RID: 7306
	[FieldOffset(Offset = "0xEC")]
	[Token(Token = "0x4001C8A")]
	private bool g_bIsReceiveLight = true;

	// Token: 0x04001C8B RID: 7307
	[FieldOffset(Offset = "0xF0")]
	[Token(Token = "0x4001C8B")]
	private float g_fRLVolume;

	// Token: 0x04001C8C RID: 7308
	[FieldOffset(Offset = "0xF4")]
	[Token(Token = "0x4001C8C")]
	private float g_fRLPitch;

	// Token: 0x04001C8D RID: 7309
	[FieldOffset(Offset = "0xF8")]
	[Token(Token = "0x4001C8D")]
	public CrystalBall.CystalBallPos ScriptEventType;

	// Token: 0x04001C8E RID: 7310
	[FieldOffset(Offset = "0xFC")]
	[Token(Token = "0x4001C8E")]
	private bool g_bSwitch;

	// Token: 0x0200018A RID: 394
	[Token(Token = "0x200018A")]
	public enum CystalBallPos
	{
		// Token: 0x04001C90 RID: 7312
		[Token(Token = "0x4001C90")]
		CrystalBall01To02,
		// Token: 0x04001C91 RID: 7313
		[Token(Token = "0x4001C91")]
		CrystalBall03,
		// Token: 0x04001C92 RID: 7314
		[Token(Token = "0x4001C92")]
		CrystalBall01To04,
		// Token: 0x04001C93 RID: 7315
		[Token(Token = "0x4001C93")]
		CrystalBall04,
		// Token: 0x04001C94 RID: 7316
		[Token(Token = "0x4001C94")]
		CrystalBall05
	}
}
