Decompiled source of blush v1.0.0

GDWeave/mods/macrottie.blush/macrottie.blush.dll

Decompiled 2 months 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 GDWeave;
using GDWeave.Godot;
using GDWeave.Godot.Variants;
using GDWeave.Modding;
using macrottie.blush.Patches;

[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("macrottie.blush")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0+806f004b4d7d17ef04813c75468fc2ac8f74c5fd")]
[assembly: AssemblyProduct("macrottie.blush")]
[assembly: AssemblyTitle("macrottie.blush")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace macrottie.blush
{
	public class Config
	{
	}
	public class Mod : IMod, global::System.IDisposable
	{
		public Config Config;

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

		public void Dispose()
		{
		}
	}
}
namespace macrottie.blush.Patches
{
	public class PlayerPatcher : IScriptMod
	{
		[CompilerGenerated]
		private sealed class <Modify>d__1 : 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 <beginningWaiter>5__2;

			private MultiTokenWaiter <spoofAnimationDataWaiter>5__3;

			private MultiTokenWaiter <drunkBubblesWaiter>5__4;

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

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

			private bool MoveNext()
			{
				//IL_0288: Unknown result type (might be due to invalid IL or missing references)
				//IL_0292: Expected O, but got Unknown
				//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02be: Expected O, but got Unknown
				//IL_02da: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e4: Expected O, but got Unknown
				//IL_0306: Unknown result type (might be due to invalid IL or missing references)
				//IL_0310: Expected O, but got Unknown
				//IL_0328: Unknown result type (might be due to invalid IL or missing references)
				//IL_0332: Expected O, but got Unknown
				//IL_032d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0337: Expected O, but got Unknown
				//IL_0389: Unknown result type (might be due to invalid IL or missing references)
				//IL_0393: Expected O, but got Unknown
				//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bf: Expected O, but got Unknown
				//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e6: Expected O, but got Unknown
				//IL_0409: Unknown result type (might be due to invalid IL or missing references)
				//IL_0413: Expected O, but got Unknown
				//IL_0430: Unknown result type (might be due to invalid IL or missing references)
				//IL_043a: Expected O, but got Unknown
				//IL_045d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0467: Expected O, but got Unknown
				//IL_0482: Unknown result type (might be due to invalid IL or missing references)
				//IL_048c: Expected O, but got Unknown
				//IL_0487: Unknown result type (might be due to invalid IL or missing references)
				//IL_0491: Expected O, but got Unknown
				//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_04be: Expected O, but got Unknown
				//IL_04db: Unknown result type (might be due to invalid IL or missing references)
				//IL_04e5: Expected O, but got Unknown
				//IL_0508: Unknown result type (might be due to invalid IL or missing references)
				//IL_0512: Expected O, but got Unknown
				//IL_052f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0539: Expected O, but got Unknown
				//IL_0534: Unknown result type (might be due to invalid IL or missing references)
				//IL_053e: Expected O, but got Unknown
				//IL_0561: Unknown result type (might be due to invalid IL or missing references)
				//IL_056b: Expected O, but got Unknown
				//IL_058e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0598: Expected O, but got Unknown
				//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_05be: Expected O, but got Unknown
				//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_05c3: Expected O, but got Unknown
				//IL_061a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0624: Expected O, but got Unknown
				//IL_0641: Unknown result type (might be due to invalid IL or missing references)
				//IL_064b: Expected O, but got Unknown
				//IL_066e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0678: Expected O, but got Unknown
				//IL_0695: Unknown result type (might be due to invalid IL or missing references)
				//IL_069f: Expected O, but got Unknown
				//IL_069a: Unknown result type (might be due to invalid IL or missing references)
				//IL_06a4: Expected O, but got Unknown
				//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d1: Expected O, but got Unknown
				//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_06fe: Expected O, but got Unknown
				//IL_0716: Unknown result type (might be due to invalid IL or missing references)
				//IL_0720: Expected O, but got Unknown
				//IL_071b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0725: Expected O, but got Unknown
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: Expected O, but got Unknown
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Expected O, but got Unknown
				//IL_021a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0224: Expected O, but got Unknown
				try
				{
					switch (<>1__state)
					{
					default:
						return false;
					case 0:
						<>1__state = -1;
						<beginningWaiter>5__2 = new MultiTokenWaiter(new Func<Token, bool>[2]
						{
							(Token t) => (int)t.Type == 51,
							(Token t) => (int)t.Type == 1
						}, false, false);
						<spoofAnimationDataWaiter>5__3 = new MultiTokenWaiter(new Func<Token, bool>[2]
						{
							(Token t) => (int)t.Type == 23,
							delegate(Token t)
							{
								IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val2 != null && val2.Name == "drunk_tier";
							}
						}, false, false);
						<drunkBubblesWaiter>5__4 = new MultiTokenWaiter(new Func<Token, bool>[6]
						{
							delegate(Token t)
							{
								IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
								return val != null && val.Name == "animation_data";
							},
							(Token t) => (int)t.Type == 76,
							(Token t) => (int)t.Type == 2,
							(Token t) => (int)t.Type == 77,
							(Token t) => (int)t.Type == 11,
							(Token t) => (int)t.Type == 2
						}, false, false);
						<>7__wrap4 = 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("spoof_blush");
						<>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 BoolVariant(false));
						<>1__state = 6;
						return true;
					case 6:
						<>1__state = -3;
						break;
					case 7:
						<>1__state = -3;
						<>2__current = new Token((TokenType)89, (uint?)1u);
						<>1__state = 8;
						return true;
					case 8:
						<>1__state = -3;
						<>2__current = new Token((TokenType)38, (uint?)null);
						<>1__state = 9;
						return true;
					case 9:
						<>1__state = -3;
						<>2__current = (Token)new IdentifierToken("spoof_blush");
						<>1__state = 10;
						return true;
					case 10:
						<>1__state = -3;
						<>2__current = new Token((TokenType)13, (uint?)null);
						<>1__state = 11;
						return true;
					case 11:
						<>1__state = -3;
						<>2__current = (Token)new IdentifierToken("drunk_tier");
						<>1__state = 12;
						return true;
					case 12:
						<>1__state = -3;
						<>2__current = new Token((TokenType)10, (uint?)null);
						<>1__state = 13;
						return true;
					case 13:
						<>1__state = -3;
						<>2__current = (Token)new ConstantToken((Variant)new IntVariant(1L, false));
						<>1__state = 14;
						return true;
					case 14:
						<>1__state = -3;
						<>2__current = new Token((TokenType)86, (uint?)null);
						<>1__state = 15;
						return true;
					case 15:
						<>1__state = -3;
						<>2__current = (Token)new IdentifierToken("animation_data");
						<>1__state = 16;
						return true;
					case 16:
						<>1__state = -3;
						<>2__current = new Token((TokenType)76, (uint?)null);
						<>1__state = 17;
						return true;
					case 17:
						<>1__state = -3;
						<>2__current = (Token)new ConstantToken((Variant)new StringVariant("drunk_tier"));
						<>1__state = 18;
						return true;
					case 18:
						<>1__state = -3;
						<>2__current = new Token((TokenType)77, (uint?)null);
						<>1__state = 19;
						return true;
					case 19:
						<>1__state = -3;
						<>2__current = new Token((TokenType)23, (uint?)null);
						<>1__state = 20;
						return true;
					case 20:
						<>1__state = -3;
						<>2__current = (Token)new ConstantToken((Variant)new IntVariant(10L, false));
						<>1__state = 21;
						return true;
					case 21:
						<>1__state = -3;
						break;
					case 22:
						<>1__state = -3;
						<>2__current = new Token((TokenType)13, (uint?)null);
						<>1__state = 23;
						return true;
					case 23:
						<>1__state = -3;
						<>2__current = (Token)new IdentifierToken("animation_data");
						<>1__state = 24;
						return true;
					case 24:
						<>1__state = -3;
						<>2__current = new Token((TokenType)76, (uint?)null);
						<>1__state = 25;
						return true;
					case 25:
						<>1__state = -3;
						<>2__current = (Token)new ConstantToken((Variant)new StringVariant("drunk_tier"));
						<>1__state = 26;
						return true;
					case 26:
						<>1__state = -3;
						<>2__current = new Token((TokenType)77, (uint?)null);
						<>1__state = 27;
						return true;
					case 27:
						<>1__state = -3;
						<>2__current = new Token((TokenType)9, (uint?)null);
						<>1__state = 28;
						return true;
					case 28:
						<>1__state = -3;
						<>2__current = (Token)new ConstantToken((Variant)new IntVariant(5L, false));
						<>1__state = 29;
						return true;
					case 29:
						<>1__state = -3;
						break;
					case 30:
						<>1__state = -3;
						break;
					}
					if (((global::System.Collections.IEnumerator)<>7__wrap4).MoveNext())
					{
						Token current = <>7__wrap4.Current;
						if (<beginningWaiter>5__2.Check(current))
						{
							<>2__current = current;
							<>1__state = 1;
							return true;
						}
						if (<spoofAnimationDataWaiter>5__3.Check(current))
						{
							<>2__current = current;
							<>1__state = 7;
							return true;
						}
						if (<drunkBubblesWaiter>5__4.Check(current))
						{
							<>2__current = current;
							<>1__state = 22;
							return true;
						}
						<>2__current = current;
						<>1__state = 30;
						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__1 <Modify>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<Modify>d__ = this;
				}
				else
				{
					<Modify>d__ = new <Modify>d__1(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();
			}
		}

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

		[IteratorStateMachine(typeof(<Modify>d__1))]
		public global::System.Collections.Generic.IEnumerable<Token> Modify(string path, global::System.Collections.Generic.IEnumerable<Token> tokens)
		{
			MultiTokenWaiter beginningWaiter = new MultiTokenWaiter(new Func<Token, bool>[2]
			{
				(Token t) => (int)t.Type == 51,
				(Token t) => (int)t.Type == 1
			}, false, false);
			MultiTokenWaiter spoofAnimationDataWaiter = new MultiTokenWaiter(new Func<Token, bool>[2]
			{
				(Token t) => (int)t.Type == 23,
				delegate(Token t)
				{
					IdentifierToken val2 = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val2 != null && val2.Name == "drunk_tier";
				}
			}, false, false);
			MultiTokenWaiter drunkBubblesWaiter = new MultiTokenWaiter(new Func<Token, bool>[6]
			{
				delegate(Token t)
				{
					IdentifierToken val = (IdentifierToken)(object)((t is IdentifierToken) ? t : null);
					return val != null && val.Name == "animation_data";
				},
				(Token t) => (int)t.Type == 76,
				(Token t) => (int)t.Type == 2,
				(Token t) => (int)t.Type == 77,
				(Token t) => (int)t.Type == 11,
				(Token t) => (int)t.Type == 2
			}, false, false);
			global::System.Collections.Generic.IEnumerator<Token> enumerator = tokens.GetEnumerator();
			try
			{
				while (((global::System.Collections.IEnumerator)enumerator).MoveNext())
				{
					Token current = enumerator.Current;
					if (beginningWaiter.Check(current))
					{
						yield return current;
						yield return new Token((TokenType)89, (uint?)null);
						yield return new Token((TokenType)59, (uint?)null);
						yield return (Token)new IdentifierToken("spoof_blush");
						yield return new Token((TokenType)23, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new BoolVariant(false));
					}
					else if (spoofAnimationDataWaiter.Check(current))
					{
						yield return current;
						yield return new Token((TokenType)89, (uint?)1u);
						yield return new Token((TokenType)38, (uint?)null);
						yield return (Token)new IdentifierToken("spoof_blush");
						yield return new Token((TokenType)13, (uint?)null);
						yield return (Token)new IdentifierToken("drunk_tier");
						yield return new Token((TokenType)10, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new IntVariant(1L, false));
						yield return new Token((TokenType)86, (uint?)null);
						yield return (Token)new IdentifierToken("animation_data");
						yield return new Token((TokenType)76, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new StringVariant("drunk_tier"));
						yield return new Token((TokenType)77, (uint?)null);
						yield return new Token((TokenType)23, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new IntVariant(10L, false));
					}
					else if (drunkBubblesWaiter.Check(current))
					{
						yield return current;
						yield return new Token((TokenType)13, (uint?)null);
						yield return (Token)new IdentifierToken("animation_data");
						yield return new Token((TokenType)76, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new StringVariant("drunk_tier"));
						yield return new Token((TokenType)77, (uint?)null);
						yield return new Token((TokenType)9, (uint?)null);
						yield return (Token)new ConstantToken((Variant)new IntVariant(5L, false));
					}
					else
					{
						yield return current;
					}
				}
			}
			finally
			{
				((global::System.IDisposable)enumerator)?.Dispose();
			}
		}
	}
}