Decompiled source of AlternateVoices v1.0.5

GDWeave/mods/RAYTRAC3R.ExtraVoiceMod/RAYTRAC3R.ExtraVoiceMod.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text.Json.Serialization;
using GDWeave;
using GDWeave.Godot;
using GDWeave.Godot.Variants;
using GDWeave.Modding;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("ExtraVoiceMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0+37555ee603528d12e66b9dff310f16fced5998be")]
[assembly: AssemblyProduct("ExtraVoiceMod")]
[assembly: AssemblyTitle("ExtraVoiceMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace ExtraVoiceMod;

public class Config
{
	[JsonInclude]
	public string Options = "Base Options are: OldVoice, NewVoice, Minty, Dhama";

	[JsonInclude]
	public string VoiceOption = "NewVoice";

	[JsonInclude]
	public string ModlessVoiceOption = "NewVoice";
}
public class ExtraVoiceMod : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__3 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		private MultiTokenWaiter <starttalkwaiter>5__2;

		private MultiTokenWaiter <synctalkwaiter>5__3;

		private MultiTokenWaiter <dotalkwaiter>5__4;

		private MultiTokenWaiter <voicewaiter>5__5;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap5;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Modify>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 18u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Expected O, but got Unknown
			//IL_044f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Expected O, but got Unknown
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Expected O, but got Unknown
			//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Expected O, but got Unknown
			//IL_0500: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Expected O, but got Unknown
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_0530: Expected O, but got Unknown
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Expected O, but got Unknown
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Expected O, but got Unknown
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Expected O, but got Unknown
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Expected O, but got Unknown
			//IL_062e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0638: Expected O, but got Unknown
			//IL_0655: Unknown result type (might be due to invalid IL or missing references)
			//IL_065f: Expected O, but got Unknown
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Expected O, but got Unknown
			//IL_06a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b3: Expected O, but got Unknown
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ea: Expected O, but got Unknown
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Expected O, but got Unknown
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Expected O, but got Unknown
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Expected O, but got Unknown
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<starttalkwaiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[8]
					{
						delegate(Token t)
						{
							//IL_0001: Unknown result type (might be due to invalid IL or missing references)
							//IL_0008: Invalid comparison between Unknown and I4
							bool num = (int)t.Type == 89;
							uint? associatedData = t.AssociatedData;
							return num & (associatedData.HasValue && associatedData.GetValueOrDefault() == 1);
						},
						delegate(Token t)
						{
							IdentifierToken val14 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val14 != null && val14.Name == "_talk";
						},
						(Token t) => (int)t.Type == 80,
						delegate(Token t)
						{
							IdentifierToken val13 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val13 != null && val13.Name == "letter";
						},
						(Token t) => (int)t.Type == 82,
						delegate(Token t)
						{
							IdentifierToken val12 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val12 != null && val12.Name == "PlayerData";
						},
						(Token t) => (int)t.Type == 84,
						delegate(Token t)
						{
							IdentifierToken val11 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val11 != null && val11.Name == "voice_pitch";
						}
					}, false, false);
					<synctalkwaiter>5__3 = new MultiTokenWaiter(new Func<Token, bool>[6]
					{
						(Token t) => (int)t.Type == 76,
						delegate(Token t)
						{
							IdentifierToken val10 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val10 != null && val10.Name == "letter";
						},
						(Token t) => (int)t.Type == 82,
						delegate(Token t)
						{
							IdentifierToken val9 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val9 != null && val9.Name == "PlayerData";
						},
						(Token t) => (int)t.Type == 84,
						delegate(Token t)
						{
							IdentifierToken val8 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val8 != null && val8.Name == "voice_pitch";
						}
					}, false, false);
					<dotalkwaiter>5__4 = new MultiTokenWaiter(new Func<Token, bool>[8]
					{
						(Token t) => (int)t.Type == 48,
						delegate(Token t)
						{
							IdentifierToken val7 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val7 != null && val7.Name == "_talk";
						},
						(Token t) => (int)t.Type == 80,
						delegate(Token t)
						{
							IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val6 != null && val6.Name == "letter";
						},
						(Token t) => (int)t.Type == 82,
						delegate(Token t)
						{
							IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val5 != null && val5.Name == "pitch";
						},
						(Token t) => (int)t.Type == 23,
						delegate(Token t)
						{
							ConstantToken val3 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							if (val3 != null)
							{
								Variant value2 = val3.Value;
								RealVariant val4 = (RealVariant)(object)((value2 is RealVariant) ? value2 : null);
								if (val4 != null)
								{
									return val4.Value == 1.5;
								}
							}
							return false;
						}
					}, false, false);
					<voicewaiter>5__5 = new MultiTokenWaiter(new Func<Token, bool>[1]
					{
						delegate(Token t)
						{
							ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							if (val != null)
							{
								Variant value = val.Value;
								StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
								if (val2 != null)
								{
									return val2.Value == "NewVoice";
								}
							}
							return false;
						}
					}, false, false);
					<>7__wrap5 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("PlayerData");
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("player_voicebank");
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					break;
				case 6:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("PlayerData");
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("player_voicebank");
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					break;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("voicebank");
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("PlayerData");
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("peer_voicebank");
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					break;
				case 18:
					<>1__state = -3;
					break;
				case 19:
					<>1__state = -3;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap5).MoveNext())
				{
					Token current = <>7__wrap5.Current;
					if (<starttalkwaiter>5__2.Check(current))
					{
						<>2__current = current;
						<>1__state = 1;
						return true;
					}
					if (<synctalkwaiter>5__3.Check(current))
					{
						<>2__current = current;
						<>1__state = 6;
						return true;
					}
					if (<dotalkwaiter>5__4.Check(current))
					{
						<>2__current = current;
						<>1__state = 11;
						return true;
					}
					if (<voicewaiter>5__5.Check(current))
					{
						<>2__current = (Token)new IdentifierToken("voicebank");
						<>1__state = 18;
						return true;
					}
					<>2__current = current;
					<>1__state = 19;
					return true;
				}
				<>m__Finally1();
				<>7__wrap5 = null;
				return false;
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap5 != null)
			{
				((global::System.IDisposable)<>7__wrap5).Dispose();
			}
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<Modify>d__3 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__3(0);
			}
			<Modify>d__.tokens = <>3__tokens;
			return <Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	private readonly Config _config;

	public ExtraVoiceMod(Config config)
	{
		_config = config;
		base..ctor();
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Entities/Player/player.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__3))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter starttalkwaiter = new MultiTokenWaiter(new Func<Token, bool>[8]
		{
			delegate(Token t)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Invalid comparison between Unknown and I4
				bool num = (int)t.Type == 89;
				uint? associatedData = t.AssociatedData;
				return num & (associatedData.HasValue && associatedData.GetValueOrDefault() == 1);
			},
			delegate(Token t)
			{
				IdentifierToken val14 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val14 != null && val14.Name == "_talk";
			},
			(Token t) => (int)t.Type == 80,
			delegate(Token t)
			{
				IdentifierToken val13 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val13 != null && val13.Name == "letter";
			},
			(Token t) => (int)t.Type == 82,
			delegate(Token t)
			{
				IdentifierToken val12 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val12 != null && val12.Name == "PlayerData";
			},
			(Token t) => (int)t.Type == 84,
			delegate(Token t)
			{
				IdentifierToken val11 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val11 != null && val11.Name == "voice_pitch";
			}
		}, false, false);
		MultiTokenWaiter synctalkwaiter = new MultiTokenWaiter(new Func<Token, bool>[6]
		{
			(Token t) => (int)t.Type == 76,
			delegate(Token t)
			{
				IdentifierToken val10 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val10 != null && val10.Name == "letter";
			},
			(Token t) => (int)t.Type == 82,
			delegate(Token t)
			{
				IdentifierToken val9 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val9 != null && val9.Name == "PlayerData";
			},
			(Token t) => (int)t.Type == 84,
			delegate(Token t)
			{
				IdentifierToken val8 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val8 != null && val8.Name == "voice_pitch";
			}
		}, false, false);
		MultiTokenWaiter dotalkwaiter = new MultiTokenWaiter(new Func<Token, bool>[8]
		{
			(Token t) => (int)t.Type == 48,
			delegate(Token t)
			{
				IdentifierToken val7 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val7 != null && val7.Name == "_talk";
			},
			(Token t) => (int)t.Type == 80,
			delegate(Token t)
			{
				IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val6 != null && val6.Name == "letter";
			},
			(Token t) => (int)t.Type == 82,
			delegate(Token t)
			{
				IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val5 != null && val5.Name == "pitch";
			},
			(Token t) => (int)t.Type == 23,
			delegate(Token t)
			{
				ConstantToken val3 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val3 != null)
				{
					Variant value2 = val3.Value;
					RealVariant val4 = (RealVariant)(object)((value2 is RealVariant) ? value2 : null);
					if (val4 != null)
					{
						return val4.Value == 1.5;
					}
				}
				return false;
			}
		}, false, false);
		MultiTokenWaiter voicewaiter = new MultiTokenWaiter(new Func<Token, bool>[1]
		{
			delegate(Token t)
			{
				ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val != null)
				{
					Variant value = val.Value;
					StringVariant val2 = (StringVariant)(object)((value is StringVariant) ? value : null);
					if (val2 != null)
					{
						return val2.Value == "NewVoice";
					}
				}
				return false;
			}
		}, false, false);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token current = enumerator.Current;
				if (starttalkwaiter.Check(current))
				{
					yield return current;
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("PlayerData");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("player_voicebank");
				}
				else if (synctalkwaiter.Check(current))
				{
					yield return current;
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("PlayerData");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("player_voicebank");
				}
				else if (dotalkwaiter.Check(current))
				{
					yield return current;
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new IdentifierToken("voicebank");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new IdentifierToken("PlayerData");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("peer_voicebank");
				}
				else if (voicewaiter.Check(current))
				{
					yield return (Token)new IdentifierToken("voicebank");
				}
				else
				{
					yield return current;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class Mod : IMod, global::System.IDisposable
{
	public Config Config;

	public Mod(IModInterface modInterface)
	{
		Config = modInterface.ReadConfig<Config>();
		modInterface.RegisterScriptMod((IScriptMod)(object)new ExtraVoiceMod(Config));
		modInterface.RegisterScriptMod((IScriptMod)(object)new PlayerDataMod(Config));
		modInterface.Logger.Information("ExtraVoice's DLL has loaded!");
	}

	public void Dispose()
	{
	}
}
public class PlayerDataMod : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__3 : global::System.Collections.Generic.IEnumerable<Token>, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerator<Token>, global::System.Collections.IEnumerator, global::System.IDisposable
	{
		private int <>1__state;

		private Token <>2__current;

		private int <>l__initialThreadId;

		private global::System.Collections.Generic.IEnumerable<Token> tokens;

		public global::System.Collections.Generic.IEnumerable<Token> <>3__tokens;

		public PlayerDataMod <>4__this;

		private MultiTokenWaiter <waiter>5__2;

		private global::System.Collections.Generic.IEnumerator<Token> <>7__wrap2;

		private string <voiceOption>5__4;

		private string <peerVoiceOption>5__5;

		Token global::System.Collections.Generic.IEnumerator<Token>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object global::System.Collections.IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <Modify>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
			<>l__initialThreadId = Environment.CurrentManagedThreadId;
		}

		[DebuggerHidden]
		void global::System.IDisposable.Dispose()
		{
			int num = <>1__state;
			if (num == -3 || (uint)(num - 1) <= 12u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Expected O, but got Unknown
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Expected O, but got Unknown
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Expected O, but got Unknown
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Expected O, but got Unknown
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Expected O, but got Unknown
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Expected O, but got Unknown
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Expected O, but got Unknown
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Expected O, but got Unknown
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Expected O, but got Unknown
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Expected O, but got Unknown
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Expected O, but got Unknown
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Expected O, but got Unknown
			try
			{
				int num = <>1__state;
				PlayerDataMod playerDataMod = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<waiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[5]
					{
						(Token t) => (int)t.Type == 59,
						delegate(Token t)
						{
							IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val != null && val.Name == "guitar_shapes";
						},
						(Token t) => (int)t.Type == 23,
						(Token t) => (int)t.Type == 76,
						(Token t) => (int)t.Type == 77
					}, false, false);
					<>7__wrap2 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -3;
					<>2__current = new Token((TokenType)59, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("player_voicebank");
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant(<voiceOption>5__4));
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)59, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("peer_voicebank");
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant(<peerVoiceOption>5__5));
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 12;
					return true;
				case 12:
					<>1__state = -3;
					<voiceOption>5__4 = null;
					<peerVoiceOption>5__5 = null;
					break;
				case 13:
					<>1__state = -3;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap2).MoveNext())
				{
					Token current = <>7__wrap2.Current;
					if (<waiter>5__2.Check(current))
					{
						<voiceOption>5__4 = playerDataMod._config.VoiceOption;
						<peerVoiceOption>5__5 = playerDataMod._config.ModlessVoiceOption;
						<>2__current = current;
						<>1__state = 1;
						return true;
					}
					<>2__current = current;
					<>1__state = 13;
					return true;
				}
				<>m__Finally1();
				<>7__wrap2 = null;
				return false;
			}
			catch
			{
				//try-fault
				((global::System.IDisposable)this).Dispose();
				throw;
			}
		}

		bool global::System.Collections.IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		private void <>m__Finally1()
		{
			<>1__state = -1;
			if (<>7__wrap2 != null)
			{
				((global::System.IDisposable)<>7__wrap2).Dispose();
			}
		}

		[DebuggerHidden]
		void global::System.Collections.IEnumerator.Reset()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotSupportedException();
		}

		[DebuggerHidden]
		global::System.Collections.Generic.IEnumerator<Token> global::System.Collections.Generic.IEnumerable<Token>.GetEnumerator()
		{
			<Modify>d__3 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__3(0)
				{
					<>4__this = <>4__this
				};
			}
			<Modify>d__.tokens = <>3__tokens;
			return <Modify>d__;
		}

		[DebuggerHidden]
		global::System.Collections.IEnumerator global::System.Collections.IEnumerable.GetEnumerator()
		{
			return (global::System.Collections.IEnumerator)((global::System.Collections.Generic.IEnumerable<Token>)this).GetEnumerator();
		}
	}

	private readonly Config _config;

	public PlayerDataMod(Config config)
	{
		_config = config;
		base..ctor();
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Singletons/playerdata.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__3))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter waiter = new MultiTokenWaiter(new Func<Token, bool>[5]
		{
			(Token t) => (int)t.Type == 59,
			delegate(Token t)
			{
				IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val != null && val.Name == "guitar_shapes";
			},
			(Token t) => (int)t.Type == 23,
			(Token t) => (int)t.Type == 76,
			(Token t) => (int)t.Type == 77
		}, false, false);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token current = enumerator.Current;
				if (waiter.Check(current))
				{
					string voiceOption = _config.VoiceOption;
					string peerVoiceOption = _config.ModlessVoiceOption;
					yield return current;
					yield return new Token((TokenType)89, (uint?)null);
					yield return new Token((TokenType)59, (uint?)null);
					yield return (Token)new IdentifierToken("player_voicebank");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant(voiceOption));
					yield return new Token((TokenType)89, (uint?)null);
					yield return new Token((TokenType)59, (uint?)null);
					yield return (Token)new IdentifierToken("peer_voicebank");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant(peerVoiceOption));
					yield return new Token((TokenType)89, (uint?)null);
				}
				else
				{
					yield return current;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}