Decompiled source of MoreWagOptions v1.0.1

GDWeave/mods/MoreWag/MoreWag.dll

Decompiled a week 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("MoreWag")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+afaa7a5c1e62ef6d06db914f3c77db60892069c7")]
[assembly: AssemblyProduct("MoreWag")]
[assembly: AssemblyTitle("MoreWag")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace MoreWag;

public class Config
{
	[JsonInclude]
	public double SpeedStep = 0.005;
}
public class Mod : IMod, global::System.IDisposable
{
	public Config Config;

	public Mod(IModInterface modInterface)
	{
		Config = modInterface.ReadConfig<Config>();
		modInterface.RegisterScriptMod((IScriptMod)(object)new TailRootPatch(Config));
	}

	public void Dispose()
	{
	}
}
public class TailRootPatch : 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;

		public TailRootPatch <>4__this;

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

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

		private MultiTokenWaiter <rotWaiter>5__2;

		private MultiTokenWaiter <wagWaiter>5__3;

		private double <stepAmount>5__4;

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

		private Token <token>5__6;

		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) <= 90u)
			{
				try
				{
				}
				finally
				{
					<>m__Finally1();
				}
			}
		}

		private bool MoveNext()
		{
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Expected O, but got Unknown
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Expected O, but got Unknown
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Expected O, but got Unknown
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_041a: Expected O, but got Unknown
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Expected O, but got Unknown
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Expected O, but got Unknown
			//IL_046d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Expected O, but got Unknown
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_049d: Expected O, but got Unknown
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Expected O, but got Unknown
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Expected O, but got Unknown
			//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Expected O, but got Unknown
			//IL_055e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0568: Expected O, but got Unknown
			//IL_0585: Unknown result type (might be due to invalid IL or missing references)
			//IL_058f: Expected O, but got Unknown
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bc: Expected O, but got Unknown
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e3: Expected O, but got Unknown
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Expected O, but got Unknown
			//IL_0633: Unknown result type (might be due to invalid IL or missing references)
			//IL_063d: Expected O, but got Unknown
			//IL_0660: Unknown result type (might be due to invalid IL or missing references)
			//IL_066a: Expected O, but got Unknown
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Expected O, but got Unknown
			//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06be: Expected O, but got Unknown
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Expected O, but got Unknown
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e9: Expected O, but got Unknown
			//IL_070c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0716: Expected O, but got Unknown
			//IL_0736: Unknown result type (might be due to invalid IL or missing references)
			//IL_0740: Expected O, but got Unknown
			//IL_075d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0767: Expected O, but got Unknown
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0794: Expected O, but got Unknown
			//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bb: Expected O, but got Unknown
			//IL_07de: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e8: Expected O, but got Unknown
			//IL_0805: Unknown result type (might be due to invalid IL or missing references)
			//IL_080f: Expected O, but got Unknown
			//IL_0832: Unknown result type (might be due to invalid IL or missing references)
			//IL_083c: Expected O, but got Unknown
			//IL_085f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0869: Expected O, but got Unknown
			//IL_0889: Unknown result type (might be due to invalid IL or missing references)
			//IL_0893: Expected O, but got Unknown
			//IL_08b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c0: Expected O, but got Unknown
			//IL_08dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e7: Expected O, but got Unknown
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0914: Expected O, but got Unknown
			//IL_0931: Unknown result type (might be due to invalid IL or missing references)
			//IL_093b: Expected O, but got Unknown
			//IL_095e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0968: Expected O, but got Unknown
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_098f: Expected O, but got Unknown
			//IL_098a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0994: Expected O, but got Unknown
			//IL_09b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c1: Expected O, but got Unknown
			//IL_09e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ee: Expected O, but got Unknown
			//IL_0a0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a15: Expected O, but got Unknown
			//IL_0a38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a42: Expected O, but got Unknown
			//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6c: Expected O, but got Unknown
			//IL_0a8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a99: Expected O, but got Unknown
			//IL_0ab6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac0: Expected O, but got Unknown
			//IL_0ae3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aed: Expected O, but got Unknown
			//IL_0b0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b16: Expected O, but got Unknown
			//IL_0b11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1b: Expected O, but got Unknown
			//IL_0b3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b48: Expected O, but got Unknown
			//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6d: Expected O, but got Unknown
			//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b72: Expected O, but got Unknown
			//IL_0b95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9f: Expected O, but got Unknown
			//IL_0bba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc4: Expected O, but got Unknown
			//IL_0bbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc9: Expected O, but got Unknown
			//IL_0bec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf6: Expected O, but got Unknown
			//IL_0c16: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c20: Expected O, but got Unknown
			//IL_0c43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4d: Expected O, but got Unknown
			//IL_0c6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c74: Expected O, but got Unknown
			//IL_0c97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca1: Expected O, but got Unknown
			//IL_0cbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc8: Expected O, but got Unknown
			//IL_0ceb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf5: Expected O, but got Unknown
			//IL_0d12: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1c: Expected O, but got Unknown
			//IL_0d17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d21: Expected O, but got Unknown
			//IL_0d44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4e: Expected O, but got Unknown
			//IL_0d71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7b: Expected O, but got Unknown
			//IL_0d98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da2: Expected O, but got Unknown
			//IL_0dc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dcf: Expected O, but got Unknown
			//IL_0def: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df9: Expected O, but got Unknown
			//IL_0e1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e26: Expected O, but got Unknown
			//IL_0e43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4d: Expected O, but got Unknown
			//IL_0e70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e7a: Expected O, but got Unknown
			//IL_0e99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea3: Expected O, but got Unknown
			//IL_0e9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea8: Expected O, but got Unknown
			//IL_0ecb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed5: Expected O, but got Unknown
			//IL_0ef0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0efa: Expected O, but got Unknown
			//IL_0ef5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eff: Expected O, but got Unknown
			//IL_0f22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f2c: Expected O, but got Unknown
			//IL_0f47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f51: Expected O, but got Unknown
			//IL_0f4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f56: Expected O, but got Unknown
			//IL_0f79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f83: Expected O, but got Unknown
			//IL_0fa3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fad: Expected O, but got Unknown
			//IL_0fd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fda: Expected O, but got Unknown
			//IL_0ff7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1001: Expected O, but got Unknown
			//IL_1024: Unknown result type (might be due to invalid IL or missing references)
			//IL_102e: Expected O, but got Unknown
			//IL_104b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1055: Expected O, but got Unknown
			//IL_1078: Unknown result type (might be due to invalid IL or missing references)
			//IL_1082: Expected O, but got Unknown
			//IL_10a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ab: Expected O, but got Unknown
			//IL_10ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d8: Expected O, but got Unknown
			//IL_10f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ff: Expected O, but got Unknown
			//IL_1122: Unknown result type (might be due to invalid IL or missing references)
			//IL_112c: Expected O, but got Unknown
			//IL_1149: Unknown result type (might be due to invalid IL or missing references)
			//IL_1153: Expected O, but got Unknown
			//IL_1176: Unknown result type (might be due to invalid IL or missing references)
			//IL_1180: Expected O, but got Unknown
			//IL_11a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ad: Expected O, but got Unknown
			//IL_11d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_11da: Expected O, but got Unknown
			//IL_11f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1201: Expected O, but got Unknown
			//IL_1224: Unknown result type (might be due to invalid IL or missing references)
			//IL_122e: Expected O, but got Unknown
			//IL_1251: Unknown result type (might be due to invalid IL or missing references)
			//IL_125b: Expected O, but got Unknown
			//IL_127a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1284: Expected O, but got Unknown
			//IL_127f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1289: Expected O, but got Unknown
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Expected O, but got Unknown
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: 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_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Expected O, but got Unknown
			try
			{
				int num = <>1__state;
				TailRootPatch tailRootPatch = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<rotWaiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[5]
					{
						delegate(Token t)
						{
							IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val6 != null && val6.Name == "rot";
						},
						(Token t) => (int)t.Type == 84,
						delegate(Token t)
						{
							IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val5 != null && val5.Name == "rotation_degrees";
						},
						(Token t) => (int)t.Type == 23,
						delegate(Token t)
						{
							IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val4 != null && val4.Name == "des_rot";
						}
					}, false, false);
					<wagWaiter>5__3 = new MultiTokenWaiter(new Func<Token, bool>[4]
					{
						(Token t) => (int)t.Type == 59,
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "wag";
						},
						(Token t) => (int)t.Type == 23,
						delegate(Token t)
						{
							ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							if (val != null)
							{
								Variant value = val.Value;
								RealVariant val2 = (RealVariant)(object)((value is RealVariant) ? value : null);
								if (val2 != null)
								{
									return val2.Value == 0.0;
								}
							}
							return false;
						}
					}, false, false);
					<stepAmount>5__4 = tailRootPatch._config.SpeedStep;
					<>7__wrap4 = tokens.GetEnumerator();
					<>1__state = -3;
					break;
				case 1:
					<>1__state = -3;
					if (<wagWaiter>5__3.Check(<token>5__6))
					{
						<>2__current = new Token((TokenType)89, (uint?)null);
						<>1__state = 2;
						return true;
					}
					goto IL_0512;
				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("lastStepTime");
					<>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 IntVariant(0L, false));
					<>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("multiplier");
					<>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 RealVariant(0.014, false));
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					goto IL_0512;
				case 12:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("OS");
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("get_ticks_msec");
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -3;
					<>2__current = new Token((TokenType)17, (uint?)null);
					<>1__state = 19;
					return true;
				case 19:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("lastStepTime");
					<>1__state = 20;
					return true;
				case 20:
					<>1__state = -3;
					<>2__current = new Token((TokenType)11, (uint?)null);
					<>1__state = 21;
					return true;
				case 21:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new IntVariant(100L, false));
					<>1__state = 22;
					return true;
				case 22:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 23;
					return true;
				case 23:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 24;
					return true;
				case 24:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("lastStepTime");
					<>1__state = 25;
					return true;
				case 25:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 26;
					return true;
				case 26:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("OS");
					<>1__state = 27;
					return true;
				case 27:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 28;
					return true;
				case 28:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("get_ticks_msec");
					<>1__state = 29;
					return true;
				case 29:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 30;
					return true;
				case 30:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 31;
					return true;
				case 31:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 32;
					return true;
				case 32:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 33;
					return true;
				case 33:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("Input");
					<>1__state = 34;
					return true;
				case 34:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 35;
					return true;
				case 35:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("is_action_pressed");
					<>1__state = 36;
					return true;
				case 36:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 37;
					return true;
				case 37:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("wag_faster"));
					<>1__state = 38;
					return true;
				case 38:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 39;
					return true;
				case 39:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 40;
					return true;
				case 40:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("multiplier");
					<>1__state = 41;
					return true;
				case 41:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 42;
					return true;
				case 42:
					<>1__state = -3;
					<>2__current = new Token((TokenType)5, (uint?)53u);
					<>1__state = 43;
					return true;
				case 43:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 44;
					return true;
				case 44:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("multiplier");
					<>1__state = 45;
					return true;
				case 45:
					<>1__state = -3;
					<>2__current = new Token((TokenType)16, (uint?)null);
					<>1__state = 46;
					return true;
				case 46:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new RealVariant(<stepAmount>5__4, false));
					<>1__state = 47;
					return true;
				case 47:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 48;
					return true;
				case 48:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new IntVariant(0L, false));
					<>1__state = 49;
					return true;
				case 49:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 50;
					return true;
				case 50:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new IntVariant(1L, false));
					<>1__state = 51;
					return true;
				case 51:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 52;
					return true;
				case 52:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 53;
					return true;
				case 53:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 54;
					return true;
				case 54:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("Input");
					<>1__state = 55;
					return true;
				case 55:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 56;
					return true;
				case 56:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("is_action_pressed");
					<>1__state = 57;
					return true;
				case 57:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 58;
					return true;
				case 58:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("wag_slower"));
					<>1__state = 59;
					return true;
				case 59:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 60;
					return true;
				case 60:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 61;
					return true;
				case 61:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("multiplier");
					<>1__state = 62;
					return true;
				case 62:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 63;
					return true;
				case 63:
					<>1__state = -3;
					<>2__current = new Token((TokenType)5, (uint?)53u);
					<>1__state = 64;
					return true;
				case 64:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 65;
					return true;
				case 65:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("multiplier");
					<>1__state = 66;
					return true;
				case 66:
					<>1__state = -3;
					<>2__current = new Token((TokenType)17, (uint?)null);
					<>1__state = 67;
					return true;
				case 67:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new RealVariant(<stepAmount>5__4, false));
					<>1__state = 68;
					return true;
				case 68:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 69;
					return true;
				case 69:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new IntVariant(0L, false));
					<>1__state = 70;
					return true;
				case 70:
					<>1__state = -3;
					<>2__current = new Token((TokenType)82, (uint?)null);
					<>1__state = 71;
					return true;
				case 71:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new IntVariant(1L, false));
					<>1__state = 72;
					return true;
				case 72:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 73;
					return true;
				case 73:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 74;
					return true;
				case 74:
					<>1__state = -3;
					<>2__current = new Token((TokenType)38, (uint?)null);
					<>1__state = 75;
					return true;
				case 75:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("wagging");
					<>1__state = 76;
					return true;
				case 76:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 77;
					return true;
				case 77:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("wag");
					<>1__state = 78;
					return true;
				case 78:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 79;
					return true;
				case 79:
					<>1__state = -3;
					<>2__current = new Token((TokenType)5, (uint?)0u);
					<>1__state = 80;
					return true;
				case 80:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 81;
					return true;
				case 81:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("OS");
					<>1__state = 82;
					return true;
				case 82:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 83;
					return true;
				case 83:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("get_ticks_msec");
					<>1__state = 84;
					return true;
				case 84:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 85;
					return true;
				case 85:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 86;
					return true;
				case 86:
					<>1__state = -3;
					<>2__current = new Token((TokenType)18, (uint?)null);
					<>1__state = 87;
					return true;
				case 87:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("multiplier");
					<>1__state = 88;
					return true;
				case 88:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 89;
					return true;
				case 89:
					<>1__state = -3;
					<>2__current = new Token((TokenType)18, (uint?)null);
					<>1__state = 90;
					return true;
				case 90:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new RealVariant(1.0, false));
					<>1__state = 91;
					return true;
				case 91:
					{
						<>1__state = -3;
						goto IL_129d;
					}
					IL_0512:
					if (<rotWaiter>5__2.Check(<token>5__6))
					{
						<>2__current = new Token((TokenType)89, (uint?)1u);
						<>1__state = 12;
						return true;
					}
					goto IL_129d;
					IL_129d:
					<token>5__6 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>7__wrap4).MoveNext())
				{
					<token>5__6 = <>7__wrap4.Current;
					<>2__current = <token>5__6;
					<>1__state = 1;
					return true;
				}
				<>m__Finally1();
				<>7__wrap4 = 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__wrap4 != null)
			{
				((global::System.IDisposable)<>7__wrap4).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 TailRootPatch(Config config)
	{
		_config = config;
		base..ctor();
	}

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

	[IteratorStateMachine(typeof(<Modify>d__3))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		MultiTokenWaiter rotWaiter = new MultiTokenWaiter(new Func<Token, bool>[5]
		{
			delegate(Token t)
			{
				IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val6 != null && val6.Name == "rot";
			},
			(Token t) => (int)t.Type == 84,
			delegate(Token t)
			{
				IdentifierToken val5 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val5 != null && val5.Name == "rotation_degrees";
			},
			(Token t) => (int)t.Type == 23,
			delegate(Token t)
			{
				IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val4 != null && val4.Name == "des_rot";
			}
		}, false, false);
		MultiTokenWaiter wagWaiter = new MultiTokenWaiter(new Func<Token, bool>[4]
		{
			(Token t) => (int)t.Type == 59,
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "wag";
			},
			(Token t) => (int)t.Type == 23,
			delegate(Token t)
			{
				ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				if (val != null)
				{
					Variant value = val.Value;
					RealVariant val2 = (RealVariant)(object)((value is RealVariant) ? value : null);
					if (val2 != null)
					{
						return val2.Value == 0.0;
					}
				}
				return false;
			}
		}, false, false);
		double stepAmount = _config.SpeedStep;
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				yield return token;
				if (wagWaiter.Check(token))
				{
					yield return new Token((TokenType)89, (uint?)null);
					yield return new Token((TokenType)59, (uint?)null);
					yield return (Token)new IdentifierToken("lastStepTime");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new IntVariant(0L, false));
					yield return new Token((TokenType)89, (uint?)null);
					yield return new Token((TokenType)59, (uint?)null);
					yield return (Token)new IdentifierToken("multiplier");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new RealVariant(0.014, false));
				}
				if (rotWaiter.Check(token))
				{
					yield return new Token((TokenType)89, (uint?)1u);
					yield return new Token((TokenType)38, (uint?)null);
					yield return (Token)new IdentifierToken("OS");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("get_ticks_msec");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)17, (uint?)null);
					yield return (Token)new IdentifierToken("lastStepTime");
					yield return new Token((TokenType)11, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new IntVariant(100L, false));
					yield return new Token((TokenType)86, (uint?)null);
					yield return new Token((TokenType)89, (uint?)2u);
					yield return (Token)new IdentifierToken("lastStepTime");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new IdentifierToken("OS");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("get_ticks_msec");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)2u);
					yield return new Token((TokenType)38, (uint?)null);
					yield return (Token)new IdentifierToken("Input");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("is_action_pressed");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("wag_faster"));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)86, (uint?)null);
					yield return (Token)new IdentifierToken("multiplier");
					yield return new Token((TokenType)23, (uint?)null);
					yield return new Token((TokenType)5, (uint?)53u);
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new IdentifierToken("multiplier");
					yield return new Token((TokenType)16, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new RealVariant(stepAmount, false));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new IntVariant(0L, false));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new IntVariant(1L, false));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)2u);
					yield return new Token((TokenType)38, (uint?)null);
					yield return (Token)new IdentifierToken("Input");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("is_action_pressed");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("wag_slower"));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)86, (uint?)null);
					yield return (Token)new IdentifierToken("multiplier");
					yield return new Token((TokenType)23, (uint?)null);
					yield return new Token((TokenType)5, (uint?)53u);
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new IdentifierToken("multiplier");
					yield return new Token((TokenType)17, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new RealVariant(stepAmount, false));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new IntVariant(0L, false));
					yield return new Token((TokenType)82, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new IntVariant(1L, false));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)1u);
					yield return new Token((TokenType)38, (uint?)null);
					yield return (Token)new IdentifierToken("wagging");
					yield return new Token((TokenType)86, (uint?)null);
					yield return (Token)new IdentifierToken("wag");
					yield return new Token((TokenType)23, (uint?)null);
					yield return new Token((TokenType)5, (uint?)0u);
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new IdentifierToken("OS");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("get_ticks_msec");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)18, (uint?)null);
					yield return (Token)new IdentifierToken("multiplier");
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)18, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new RealVariant(1.0, false));
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}