using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x020001E8 RID: 488
[Token(Token = "0x20001E8")]
public class ScriptMode
{
	// Token: 0x060013DE RID: 5086 RVA: 0x0002D3EC File Offset: 0x0002B5EC
	[Token(Token = "0x60013DE")]
	[Address(RVA = "0x43D4B0", Offset = "0x43C2B0", VA = "0x18043D4B0")]
	public void Init()
	{
		NobetaAnimatorController animatorController = Game.GetPlayerManager().GetAnimatorController();
		this.g_PlayerAni = animatorController;
		PlayerCamera camera = Game.GetPlayerManager().GetCamera();
		this.g_CameraEff = camera;
		this.g_bSwitchScene = false;
		this.g_iSkipID = (int)((ulong)0L);
		this.g_iVoiceIndex = (int)((ulong)4294967294L);
	}

	// Token: 0x060013DF RID: 5087 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60013DF")]
	[Address(RVA = "0x440640", Offset = "0x43F440", VA = "0x180440640")]
	public void Update(float fDeltaTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060013E0 RID: 5088 RVA: 0x0002D448 File Offset: 0x0002B648
	[Token(Token = "0x60013E0")]
	[Address(RVA = "0x43DAD0", Offset = "0x43C8D0", VA = "0x18043DAD0")]
	public void ReceiveConfirm()
	{
		int num = this.g_iStepMax;
		if (this.g_iStep >= num || this.g_bAutoStep)
		{
			return;
		}
		if (!this.g_bDialog)
		{
			Game.SetDialogArrowEnable(false);
			int num2 = this.g_iStep;
			num2++;
			this.g_iStep = num2;
			this.RunStep(num2);
			return;
		}
		string text = this.g_sDialogText;
		int stringLength = text.m_stringLength;
		int num3 = 0;
		string text2 = this.g_sDialogSpeaker;
		this.g_sDialogTextNum = stringLength;
		string text3 = text.Substring(num3, stringLength);
		Game.SetDialogText(text2, text3);
		this.g_bDialog = false;
		while (this.g_bAutoStep)
		{
		}
		Game.SetDialogArrowEnable(true);
	}

	// Token: 0x060013E1 RID: 5089 RVA: 0x0002D4E8 File Offset: 0x0002B6E8
	[Token(Token = "0x60013E1")]
	[Address(RVA = "0x4405A0", Offset = "0x43F3A0", VA = "0x1804405A0")]
	public void SkipScript()
	{
		int num = this.g_iSkipID;
		if (num > 1)
		{
			this.g_iStep = num;
			this.RunStep(num);
			return;
		}
	}

	// Token: 0x060013E2 RID: 5090 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60013E2")]
	[Address(RVA = "0x43DC00", Offset = "0x43CA00", VA = "0x18043DC00")]
	public void RunStep(int iStep)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060013E3 RID: 5091 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60013E3")]
	[Address(RVA = "0x4405C0", Offset = "0x43F3C0", VA = "0x1804405C0")]
	private void UpdateDialogueContents(string[] content)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060013E4 RID: 5092 RVA: 0x0002D510 File Offset: 0x0002B710
	[Token(Token = "0x60013E4")]
	[Address(RVA = "0x43D570", Offset = "0x43C370", VA = "0x18043D570")]
	public bool LoadScript(LoadScript LS)
	{
		string scriptName = LS.ScriptName;
		string text = "Script/" + scriptName;
		SceneEvent[] @event = LS.Event;
		this.g_Event = @event;
		Transform[] camera = LS.Camera;
		this.g_Camera = camera;
		Transform[] playerPosition = LS.PlayerPosition;
		this.g_Position = playerPosition;
		CSVData csvdata = new CSVData(text);
		this.g_ScriptData = csvdata;
		CSVData csvdata2 = this.g_ScriptData;
		if (csvdata2.loadDataCompleted)
		{
			int columnLength = csvdata2.GetColumnLength();
			this.g_iStepMax = columnLength;
			if (columnLength > 1)
			{
				CSVData csvdata3 = this.g_ScriptData;
				int num = 0;
				int num2 = 0;
				string @string = csvdata3.GetString(num2, num);
				string text2 = this.g_sVersionText;
				if (!(@string != text2))
				{
					if (string.IsNullOrEmpty(LS.ScriptLanugageFileName))
					{
					}
					GameTextDataAdvance storyText = Game.GetStoryText(LS.ScriptLanugageFileName);
					this.dialogueText = storyText;
					this.g_iStep = (int)((ulong)1L);
					this.g_bStop = false;
					this.RunStep(1);
					return true;
				}
			}
		}
		Debug.LogError("無法讀取腳本:" + text);
		throw new NullReferenceException();
	}

	// Token: 0x060013E5 RID: 5093 RVA: 0x0002D618 File Offset: 0x0002B818
	[Token(Token = "0x60013E5")]
	[Address(RVA = "0x413D20", Offset = "0x412B20", VA = "0x180413D20")]
	public void GetVoice(VoiceController Voice)
	{
		/*
An exception occurred when decompiling this method (060013E5)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void ScriptMode::GetVoice(VoiceController)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stfld:VoiceController(ScriptMode::g_Voice, ldloc:ScriptMode(this), ldloc:VoiceController(Voice)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x060013E6 RID: 5094 RVA: 0x0002D62C File Offset: 0x0002B82C
	[Token(Token = "0x60013E6")]
	[Address(RVA = "0x43D4A0", Offset = "0x43C2A0", VA = "0x18043D4A0")]
	public bool GetIsSkip()
	{
		return this.g_iSkipID > 0;
	}

	// Token: 0x060013E7 RID: 5095 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60013E7")]
	[Address(RVA = "0x43D7B0", Offset = "0x43C5B0", VA = "0x18043D7B0")]
	private float ParseFloat(string content)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060013E8 RID: 5096 RVA: 0x0002D644 File Offset: 0x0002B844
	[Token(Token = "0x60013E8")]
	[Address(RVA = "0x440B50", Offset = "0x43F950", VA = "0x180440B50")]
	public ScriptMode()
	{
	}

	// Token: 0x04001ED7 RID: 7895
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x4001ED7")]
	private NobetaAnimatorController g_PlayerAni;

	// Token: 0x04001ED8 RID: 7896
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4001ED8")]
	private VoiceController g_Voice;

	// Token: 0x04001ED9 RID: 7897
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001ED9")]
	private PlayerCamera g_CameraEff;

	// Token: 0x04001EDA RID: 7898
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001EDA")]
	private SceneEvent[] g_Event;

	// Token: 0x04001EDB RID: 7899
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4001EDB")]
	private Transform[] g_Camera;

	// Token: 0x04001EDC RID: 7900
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4001EDC")]
	private Transform[] g_Position;

	// Token: 0x04001EDD RID: 7901
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4001EDD")]
	private CSVData g_ScriptData;

	// Token: 0x04001EDE RID: 7902
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4001EDE")]
	private GameTextDataAdvance dialogueText;

	// Token: 0x04001EDF RID: 7903
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4001EDF")]
	private int g_iStep;

	// Token: 0x04001EE0 RID: 7904
	[FieldOffset(Offset = "0x54")]
	[Token(Token = "0x4001EE0")]
	private int g_iStepMax;

	// Token: 0x04001EE1 RID: 7905
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4001EE1")]
	private bool g_bAutoStep;

	// Token: 0x04001EE2 RID: 7906
	[FieldOffset(Offset = "0x5C")]
	[Token(Token = "0x4001EE2")]
	private float g_fAutoStep;

	// Token: 0x04001EE3 RID: 7907
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4001EE3")]
	private bool g_bMove;

	// Token: 0x04001EE4 RID: 7908
	[FieldOffset(Offset = "0x64")]
	[Token(Token = "0x4001EE4")]
	private int g_iMoveSpeed;

	// Token: 0x04001EE5 RID: 7909
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4001EE5")]
	private Vector3 g_v3MovePosition;

	// Token: 0x04001EE6 RID: 7910
	[FieldOffset(Offset = "0x74")]
	[Token(Token = "0x4001EE6")]
	private bool g_bDialog;

	// Token: 0x04001EE7 RID: 7911
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4001EE7")]
	private string g_sDialogText;

	// Token: 0x04001EE8 RID: 7912
	[FieldOffset(Offset = "0x80")]
	[Token(Token = "0x4001EE8")]
	private string g_sDialogSpeaker;

	// Token: 0x04001EE9 RID: 7913
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4001EE9")]
	private int g_sDialogTextNum;

	// Token: 0x04001EEA RID: 7914
	[FieldOffset(Offset = "0x8C")]
	[Token(Token = "0x4001EEA")]
	private float g_fDialogSpeed;

	// Token: 0x04001EEB RID: 7915
	[FieldOffset(Offset = "0x90")]
	[Token(Token = "0x4001EEB")]
	private float g_fDialogSpeedVal;

	// Token: 0x04001EEC RID: 7916
	[FieldOffset(Offset = "0x98")]
	[Token(Token = "0x4001EEC")]
	private NPCManage[] g_EnemySpeak;

	// Token: 0x04001EED RID: 7917
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4001EED")]
	private int g_iVoiceIndex;

	// Token: 0x04001EEE RID: 7918
	[FieldOffset(Offset = "0xA4")]
	[Token(Token = "0x4001EEE")]
	private int g_iSkipID;

	// Token: 0x04001EEF RID: 7919
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4001EEF")]
	private bool g_bSwitchScene;

	// Token: 0x04001EF0 RID: 7920
	[FieldOffset(Offset = "0xA9")]
	[Token(Token = "0x4001EF0")]
	private bool g_bStop;

	// Token: 0x04001EF1 RID: 7921
	[FieldOffset(Offset = "0xAA")]
	[Token(Token = "0x4001EF1")]
	private bool g_bAniSpeak;

	// Token: 0x04001EF2 RID: 7922
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x4001EF2")]
	private AudioSource g_asSpeakVoice;

	// Token: 0x04001EF3 RID: 7923
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x4001EF3")]
	private string g_sVersionText = "V011";
}
