Decompiled source of ButtPlugIO v1.3.0

GDWeave/mods/ButtPlugIO/ButtPlugIO.dll

Decompiled 2 years 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("ButtPlugIO")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0+821a2e23042cd9786d7390477fa299aa4b25cac8")]
[assembly: AssemblyProduct("ButtPlugIO")]
[assembly: AssemblyTitle("ButtPlugIO")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Buttplug;

public class Config
{
	[JsonInclude]
	public bool SomeSetting = true;
}
public class FishingInject : IScriptMod
{
	[CompilerGenerated]
	private sealed class <Modify>d__4 : 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 string path;

		public string <>3__path;

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

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

		public FishingInject <>4__this;

		private MultiTokenWaiter <extendsWaiter>5__1;

		private MultiTokenWaiter <clickHook>5__2;

		private MultiTokenWaiter <yankHook>5__3;

		private FunctionWaiter <ready>5__4;

		private FunctionWaiter <end>5__5;

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

		private Token <token>5__7;

		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__4(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) > 48u)
			{
				return;
			}
			try
			{
			}
			finally
			{
				<>m__Finally1();
			}
		}

		private bool MoveNext()
		{
			//IL_050d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Expected O, but got Unknown
			//IL_0539: Unknown result type (might be due to invalid IL or missing references)
			//IL_0543: Expected O, but got Unknown
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Expected O, but got Unknown
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Expected O, but got Unknown
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c1: Expected O, but got Unknown
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Expected O, but got Unknown
			//IL_0609: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Expected O, but got Unknown
			//IL_062f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Expected O, but got Unknown
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Expected O, but got Unknown
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Expected O, but got Unknown
			//IL_068e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0698: Expected O, but got Unknown
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: 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_0763: Unknown result type (might be due to invalid IL or missing references)
			//IL_076d: Expected O, but got Unknown
			//IL_0790: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Expected O, but got Unknown
			//IL_07b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c1: Expected O, but got Unknown
			//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Expected O, but got Unknown
			//IL_080e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0818: Expected O, but got Unknown
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_083f: Expected O, but got Unknown
			//IL_0862: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: 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_0934: Unknown result type (might be due to invalid IL or missing references)
			//IL_093e: Expected O, but got Unknown
			//IL_09bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c9: Expected O, but got Unknown
			//IL_09ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f6: Expected O, but got Unknown
			//IL_0a13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1d: Expected O, but got Unknown
			//IL_0a40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4a: Expected O, but got Unknown
			//IL_0a6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a77: Expected O, but got Unknown
			//IL_0a97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa1: Expected O, but got Unknown
			//IL_0b22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2c: Expected O, but got Unknown
			//IL_0b4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b59: Expected O, but got Unknown
			//IL_0b76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b80: Expected O, but got Unknown
			//IL_0ba3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bad: Expected O, but got Unknown
			//IL_0bd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bda: Expected O, but got Unknown
			//IL_0bfa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c04: Expected O, but got Unknown
			//IL_0c85: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8f: Expected O, but got Unknown
			//IL_0cb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbc: Expected O, but got Unknown
			//IL_0cd9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce3: Expected O, but got Unknown
			//IL_0d06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d10: Expected O, but got Unknown
			//IL_0d33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3d: Expected O, but got Unknown
			//IL_0d5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d67: Expected O, but got Unknown
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Expected O, but got Unknown
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Expected O, but got Unknown
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Expected O, but got Unknown
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Expected O, but got Unknown
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.modInterface.Logger.Information("In injection function");
					<extendsWaiter>5__1 = new MultiTokenWaiter(new Func<Token, bool>[2]
					{
						(Token t) => (int)t.Type == 51,
						(Token t) => (int)t.Type == 89
					}, false, true);
					<clickHook>5__2 = new MultiTokenWaiter(new Func<Token, bool>[5]
					{
						(Token t) => (int)t.Type == 59,
						delegate(Token t)
						{
							IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val6 != null && val6.Name == "reel_sound";
						},
						(Token t) => (int)t.Type == 7,
						delegate(Token t)
						{
							ConstantToken val5 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							return val5 != null && val5.Value is BoolVariant;
						},
						(Token t) => (int)t.Type == 89
					}, false, true);
					<yankHook>5__3 = new MultiTokenWaiter(new Func<Token, bool>[9]
					{
						delegate(Token t)
						{
							IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val4 != null && val4.Name == "ys";
						},
						(Token t) => (int)t.Type == 84,
						delegate(Token t)
						{
							IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val3 != null && val3.Name == "health";
						},
						(Token t) => (int)t.Type == 25,
						delegate(Token t)
						{
							IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
							return val2 != null && val2.Name == "params";
						},
						(Token t) => (int)t.Type == 76,
						delegate(Token t)
						{
							ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
							return val != null && val.Value is StringVariant;
						},
						(Token t) => (int)t.Type == 77,
						(Token t) => (int)t.Type == 89
					}, false, true);
					<ready>5__4 = new FunctionWaiter("_ready", false);
					<end>5__5 = new FunctionWaiter("_reached_end", false);
					<>4__this.modInterface.Logger.Information("Parsing tokens");
					<>s__6 = 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)53, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = new Token((TokenType)59, (uint?)null);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("get_node");
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/ButtPlugIO"));
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					goto IL_0da1;
				case 12:
				{
					<>1__state = -3;
					bool flag4 = false;
					goto IL_0da1;
				}
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)15, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("over");
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = new Token((TokenType)13, (uint?)null);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = new Token((TokenType)15, (uint?)null);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("at_yank");
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -3;
					<>2__current = new Token((TokenType)86, (uint?)null);
					<>1__state = 19;
					return true;
				case 19:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)2u);
					<>1__state = 20;
					return true;
				case 20:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 21;
					return true;
				case 21:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 22;
					return true;
				case 22:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_reel_hook");
					<>1__state = 23;
					return true;
				case 23:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 24;
					return true;
				case 24:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("reeling");
					<>1__state = 25;
					return true;
				case 25:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 26;
					return true;
				case 26:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 27;
					return true;
				case 27:
					<>1__state = -3;
					goto IL_0da1;
				case 28:
				{
					<>1__state = -3;
					bool flag3 = true;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 29;
					return true;
				}
				case 29:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 30;
					return true;
				case 30:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_yank_hook");
					<>1__state = 31;
					return true;
				case 31:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 32;
					return true;
				case 32:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 33;
					return true;
				case 33:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 34;
					return true;
				case 34:
					<>1__state = -3;
					goto IL_0da1;
				case 35:
				{
					<>1__state = -3;
					bool flag2 = true;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 36;
					return true;
				}
				case 36:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 37;
					return true;
				case 37:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_start_hook");
					<>1__state = 38;
					return true;
				case 38:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 39;
					return true;
				case 39:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 40;
					return true;
				case 40:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 41;
					return true;
				case 41:
					<>1__state = -3;
					goto IL_0da1;
				case 42:
				{
					<>1__state = -3;
					bool flag = true;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 43;
					return true;
				}
				case 43:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 44;
					return true;
				case 44:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_end_hook");
					<>1__state = 45;
					return true;
				case 45:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 46;
					return true;
				case 46:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 47;
					return true;
				case 47:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 48;
					return true;
				case 48:
					<>1__state = -3;
					goto IL_0da1;
				case 49:
					{
						<>1__state = -3;
						goto IL_0da1;
					}
					IL_0da1:
					<token>5__7 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>s__6).MoveNext())
				{
					<token>5__7 = <>s__6.Current;
					if (<extendsWaiter>5__1.Check(<token>5__7))
					{
						<>2__current = <token>5__7;
						<>1__state = 1;
						return true;
					}
					if (<clickHook>5__2.Check(<token>5__7))
					{
						<>2__current = <token>5__7;
						<>1__state = 12;
						return true;
					}
					if (<yankHook>5__3.Check(<token>5__7))
					{
						<>4__this.modInterface.Logger.Information("Injecting yank hook");
						<>2__current = <token>5__7;
						<>1__state = 28;
						return true;
					}
					if (<ready>5__4.Check(<token>5__7))
					{
						<>4__this.modInterface.Logger.Information("Injecting start hook");
						<>2__current = <token>5__7;
						<>1__state = 35;
						return true;
					}
					if (<end>5__5.Check(<token>5__7))
					{
						<>4__this.modInterface.Logger.Information("Injecting end hook");
						<>2__current = <token>5__7;
						<>1__state = 42;
						return true;
					}
					<>2__current = <token>5__7;
					<>1__state = 49;
					return true;
				}
				<>m__Finally1();
				<>s__6 = 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 (<>s__6 != null)
			{
				((global::System.IDisposable)<>s__6).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__4 <Modify>d__;
			if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
			{
				<>1__state = 0;
				<Modify>d__ = this;
			}
			else
			{
				<Modify>d__ = new <Modify>d__4(0)
				{
					<>4__this = <>4__this
				};
			}
			<Modify>d__.path = <>3__path;
			<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();
		}
	}

	public IModInterface modInterface;

	private const bool go = true;

	public FishingInject(IModInterface mi)
	{
		modInterface = mi;
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Minigames/Fishing3/fishing3.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__4))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		modInterface.Logger.Information("In injection function");
		MultiTokenWaiter extendsWaiter = new MultiTokenWaiter(new Func<Token, bool>[2]
		{
			(Token t) => (int)t.Type == 51,
			(Token t) => (int)t.Type == 89
		}, false, true);
		MultiTokenWaiter clickHook = new MultiTokenWaiter(new Func<Token, bool>[5]
		{
			(Token t) => (int)t.Type == 59,
			delegate(Token t)
			{
				IdentifierToken val6 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val6 != null && val6.Name == "reel_sound";
			},
			(Token t) => (int)t.Type == 7,
			delegate(Token t)
			{
				ConstantToken val5 = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				return val5 != null && val5.Value is BoolVariant;
			},
			(Token t) => (int)t.Type == 89
		}, false, true);
		MultiTokenWaiter yankHook = new MultiTokenWaiter(new Func<Token, bool>[9]
		{
			delegate(Token t)
			{
				IdentifierToken val4 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val4 != null && val4.Name == "ys";
			},
			(Token t) => (int)t.Type == 84,
			delegate(Token t)
			{
				IdentifierToken val3 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val3 != null && val3.Name == "health";
			},
			(Token t) => (int)t.Type == 25,
			delegate(Token t)
			{
				IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
				return val2 != null && val2.Name == "params";
			},
			(Token t) => (int)t.Type == 76,
			delegate(Token t)
			{
				ConstantToken val = (ConstantToken)(object)((t is ConstantToken) ? t : null);
				return val != null && val.Value is StringVariant;
			},
			(Token t) => (int)t.Type == 77,
			(Token t) => (int)t.Type == 89
		}, false, true);
		FunctionWaiter ready = new FunctionWaiter("_ready", false);
		FunctionWaiter end = new FunctionWaiter("_reached_end", false);
		modInterface.Logger.Information("Parsing tokens");
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (extendsWaiter.Check(token))
				{
					yield return token;
					yield return new Token((TokenType)89, (uint?)null);
					yield return new Token((TokenType)53, (uint?)null);
					yield return new Token((TokenType)59, (uint?)null);
					yield return (Token)new IdentifierToken("ButtPlugIO");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new IdentifierToken("get_node");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/ButtPlugIO"));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)null);
				}
				else if (clickHook.Check(token))
				{
					yield return token;
				}
				else if (yankHook.Check(token))
				{
					modInterface.Logger.Information("Injecting yank hook");
					yield return token;
					yield return (Token)new IdentifierToken("ButtPlugIO");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_yank_hook");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)1u);
				}
				else if (ready.Check(token))
				{
					modInterface.Logger.Information("Injecting start hook");
					yield return token;
					yield return (Token)new IdentifierToken("ButtPlugIO");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_start_hook");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)1u);
				}
				else if (end.Check(token))
				{
					modInterface.Logger.Information("Injecting end hook");
					yield return token;
					yield return (Token)new IdentifierToken("ButtPlugIO");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_end_hook");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)1u);
				}
				else
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}
public class Mod : IMod, global::System.IDisposable
{
	public Mod(IModInterface modInterface)
	{
		modInterface.Logger.Information("Loaded Buttplug");
		modInterface.Logger.Information("Injecting fishing hooks");
		modInterface.RegisterScriptMod((IScriptMod)(object)new FishingInject(modInterface));
		modInterface.Logger.Information("Injecting scratch-off hooks");
		modInterface.RegisterScriptMod((IScriptMod)(object)new ScratchOffInject(modInterface));
	}

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

		public string <>3__path;

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

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

		public ScratchOffInject <>4__this;

		private MultiTokenWaiter <extendsWaiter>5__1;

		private FunctionWaiter <scratched>5__2;

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

		private Token <token>5__4;

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

		private bool MoveNext()
		{
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Expected O, but got Unknown
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Expected O, but got Unknown
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Expected O, but got Unknown
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Expected O, but got Unknown
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Expected O, but got Unknown
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fb: Expected O, but got Unknown
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Expected O, but got Unknown
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: Expected O, but got Unknown
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Expected O, but got Unknown
			//IL_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Expected O, but got Unknown
			//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b3: Expected O, but got Unknown
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Expected O, but got Unknown
			try
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>4__this.modInterface.Logger.Information("In injection function");
					<extendsWaiter>5__1 = new MultiTokenWaiter(new Func<Token, bool>[2]
					{
						(Token t) => (int)t.Type == 51,
						(Token t) => (int)t.Type == 89
					}, false, true);
					<scratched>5__2 = new FunctionWaiter("_slot_scratched", false);
					<>s__3 = 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)53, (uint?)null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -3;
					<>2__current = new Token((TokenType)59, (uint?)null);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -3;
					<>2__current = new Token((TokenType)23, (uint?)null);
					<>1__state = 6;
					return true;
				case 6:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("get_node");
					<>1__state = 7;
					return true;
				case 7:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 8;
					return true;
				case 8:
					<>1__state = -3;
					<>2__current = (Token)new ConstantToken((Variant)new StringVariant("/root/ButtPlugIO"));
					<>1__state = 9;
					return true;
				case 9:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 10;
					return true;
				case 10:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)null);
					<>1__state = 11;
					return true;
				case 11:
					<>1__state = -3;
					goto IL_04ec;
				case 12:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("ButtPlugIO");
					<>1__state = 13;
					return true;
				case 13:
					<>1__state = -3;
					<>2__current = new Token((TokenType)84, (uint?)null);
					<>1__state = 14;
					return true;
				case 14:
					<>1__state = -3;
					<>2__current = (Token)new IdentifierToken("_scratch");
					<>1__state = 15;
					return true;
				case 15:
					<>1__state = -3;
					<>2__current = new Token((TokenType)80, (uint?)null);
					<>1__state = 16;
					return true;
				case 16:
					<>1__state = -3;
					<>2__current = new Token((TokenType)81, (uint?)null);
					<>1__state = 17;
					return true;
				case 17:
					<>1__state = -3;
					<>2__current = new Token((TokenType)89, (uint?)1u);
					<>1__state = 18;
					return true;
				case 18:
					<>1__state = -3;
					goto IL_04ec;
				case 19:
					{
						<>1__state = -3;
						goto IL_04ec;
					}
					IL_04ec:
					<token>5__4 = null;
					break;
				}
				if (((global::System.Collections.IEnumerator)<>s__3).MoveNext())
				{
					<token>5__4 = <>s__3.Current;
					if (<extendsWaiter>5__1.Check(<token>5__4))
					{
						<>2__current = <token>5__4;
						<>1__state = 1;
						return true;
					}
					if (<scratched>5__2.Check(<token>5__4))
					{
						<>4__this.modInterface.Logger.Information("Injecting scratch-off hook");
						<>2__current = <token>5__4;
						<>1__state = 12;
						return true;
					}
					<>2__current = <token>5__4;
					<>1__state = 19;
					return true;
				}
				<>m__Finally1();
				<>s__3 = 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 (<>s__3 != null)
			{
				((global::System.IDisposable)<>s__3).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__.path = <>3__path;
			<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();
		}
	}

	public IModInterface modInterface;

	public ScratchOffInject(IModInterface mi)
	{
		modInterface = mi;
	}

	public bool ShouldRun(string path)
	{
		return path == "res://Scenes/Minigames/ScratchTicket/scratch_ticket.gdc";
	}

	[IteratorStateMachine(typeof(<Modify>d__3))]
	public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
	{
		modInterface.Logger.Information("In injection function");
		MultiTokenWaiter extendsWaiter = new MultiTokenWaiter(new Func<Token, bool>[2]
		{
			(Token t) => (int)t.Type == 51,
			(Token t) => (int)t.Type == 89
		}, false, true);
		FunctionWaiter scratched = new FunctionWaiter("_slot_scratched", false);
		global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
		try
		{
			while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
			{
				Token token = enumerator.Current;
				if (extendsWaiter.Check(token))
				{
					yield return token;
					yield return new Token((TokenType)89, (uint?)null);
					yield return new Token((TokenType)53, (uint?)null);
					yield return new Token((TokenType)59, (uint?)null);
					yield return (Token)new IdentifierToken("ButtPlugIO");
					yield return new Token((TokenType)23, (uint?)null);
					yield return (Token)new IdentifierToken("get_node");
					yield return new Token((TokenType)80, (uint?)null);
					yield return (Token)new ConstantToken((Variant)new StringVariant("/root/ButtPlugIO"));
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)null);
				}
				else if (scratched.Check(token))
				{
					modInterface.Logger.Information("Injecting scratch-off hook");
					yield return token;
					yield return (Token)new IdentifierToken("ButtPlugIO");
					yield return new Token((TokenType)84, (uint?)null);
					yield return (Token)new IdentifierToken("_scratch");
					yield return new Token((TokenType)80, (uint?)null);
					yield return new Token((TokenType)81, (uint?)null);
					yield return new Token((TokenType)89, (uint?)1u);
				}
				else
				{
					yield return token;
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator)?.Dispose();
		}
	}
}