Decompiled source of SweetkinBackOnTrack v1.0.2

plugins/SweetkinBackOnTrack.Plugin.dll

Decompiled 2 weeks 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 BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using TrainworksReloaded.Core;
using TrainworksReloaded.Core.Extensions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SweetkinBackOnTrack.Plugin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+5dee25aeb9e4a8450fcbc449d39e51806dc9bf8e")]
[assembly: AssemblyProduct("SweetkinBackOnTrack.Plugin")]
[assembly: AssemblyTitle("SweetkinBackOnTrack.Plugin")]
[assembly: AssemblyVersion("1.0.2.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SweetkinBackOnTrack.Plugin
{
	[BepInPlugin("SweetkinBackOnTrack.Plugin", "SweetkinBackOnTrack.Plugin", "1.0.2")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger = new ManualLogSource("SweetkinBackOnTrack.Plugin");

		public void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Railhead.GetBuilder().Configure("SweetkinBackOnTrack.Plugin", (Action<IConfigurationBuilder>)delegate(IConfigurationBuilder c)
			{
				ConfigurationExtensions.AddMergedJsonFile(c, new List<string>(72)
				{
					"json/plugin.json", "json/champions/champion_sally.json", "json/champions/champion_evergreen.json", "json/cards/Sw_allYouCan.json", "json/cards/Sw_care.json", "json/cards/Sw_dineDash.json", "json/cards/Sw_Expulsion.json", "json/cards/Sw_Fullcourse.json", "json/cards/Sw_GrumpyPatron.json", "json/cards/Sw_Hospitality.json",
					"json/cards/Sw_Leftovers.json", "json/cards/Sw_portalMaster.json", "json/cards/Sw_punish.json", "json/cards/Sw_seconds.json", "json/cards/Sw_Snakification.json", "json/cards/Sw_Spectacle.json", "json/cards/Sw_SummerWildfire.json", "json/cards/Sw_tillLastDrop.json", "json/cards/Sw_Veil.json", "json/cards/Sw_WinterSnowstorms.json",
					"json/cards/Sw_Workshift.json", "json/characters/Sw_Butler.json", "json/characters/Sw_crab.json", "json/characters/Sw_Delivery.json", "json/characters/Sw_EvergreenSprout.json", "json/characters/Sw_FastFood.json", "json/characters/Sw_FrontClerk.json", "json/characters/Sw_Lime.json", "json/characters/Sw_Mint.json", "json/characters/Sw_noodles.json",
					"json/characters/Sw_Pyretatoe.json", "json/characters/Sw_Sherbetrus.json", "json/characters/Sw_Sours.json", "json/characters/Sw_SpiceCook.json", "json/characters/Sw_Sweetling.json", "json/characters/Sw_Teamaid.json", "json/characters/Sw_VIPcookie.json", "json/characters/Sw_VIPcritic.json", "json/characters/Sw_VIPimp.json", "json/characters/Sw_VIPlatebloomer.json",
					"json/characters/Sw_VIPnugget.json", "json/characters/Sw_VIProsette.json", "json/characters/Sw_VIPsocialite.json", "json/characters/Sw_VIPTemaki.json", "json/characters/Sw_VIPvirologist.json", "json/equipments/Sw_BookCook.json", "json/equipments/Sw_BookMint.json", "json/equipments/Sw_ButlerSuit.json", "json/equipments/Sw_CombatKnife.json", "json/equipments/Sw_CrabBib.json",
					"json/equipments/Sw_Dovelivery.json", "json/equipments/Sw_LilSpoon.json", "json/equipments/Sw_LimeBook.json", "json/equipments/Sw_MaidSuit.json", "json/equipments/Sw_Sparelimb.json", "json/equipments/Sw_TuningFork.json", "json/rooms/Sw_RoomGrav.json", "json/rooms/Sw_RoomKitchen.json", "json/rooms/Sw_RoomLobby.json", "json/rooms/Sw_RoomRestaurant.json",
					"json/rooms/Sw_RoomSpa.json", "json/relics/Sw_Dispenser.json", "json/relics/Sw_FirstClass.json", "json/relics/Sw_Flavour.json", "json/relics/Sw_GoldenKernel.json", "json/relics/Sw_MintDough.json", "json/relics/Sw_Mucus.json", "json/relics/Sw_Pamphlet.json", "json/relics/Sw_Paste.json", "json/relics/Sw_Photo.json",
					"json/relics/Sw_SilverPlater.json", "json/relics/Sw_Tailor.json"
				});
			});
			Logger.LogInfo((object)"Plugin SweetkinBackOnTrack.Plugin is loaded!");
		}
	}
	public sealed class RoomStateCapacityModifierGrav : RoomStateModifierBase, IRoomStateCapacityModifier
	{
		private int capacityDelta;

		public override void Initialize(RoomModifierData roomModifierData, ICoreGameManagers coreGameManagers)
		{
			((RoomStateModifierBase)this).Initialize(roomModifierData, coreGameManagers);
			capacityDelta = roomModifierData.GetParamInt();
		}

		public int GetModifiedCapacity()
		{
			return capacityDelta;
		}
	}
	public sealed class RoomStateAddEffectPostCombatLobby : RoomStateModifierBase, IRoomStatePostCombatModifier, IRoomStateModifier, ILocalizationParamInt, ILocalizationParameterContext
	{
		[CompilerGenerated]
		private sealed class <PostCombat>d__3 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ICoreGameManagers coreGameManagers;

			public RoomStateAddEffectPostCombatLobby <>4__this;

			public RoomState room;

			private CombatManager <combatManager>5__2;

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

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

			[DebuggerHidden]
			public <PostCombat>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<combatManager>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				RoomStateAddEffectPostCombatLobby roomStateAddEffectPostCombatLobby = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<combatManager>5__2 = coreGameManagers.GetCombatManager();
					<>2__current = ((RoomStateModifierBase)roomStateAddEffectPostCombatLobby).ShowTriggeredVFX(room, coreGameManagers);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = <combatManager>5__2.ApplyEffects(roomStateAddEffectPostCombatLobby._effects, room.GetRoomIndex(), (CardState)null, false, (RelicState)null, (CharacterState)null, (SpawnPoint)null, true, (ApplyPreEffectsVfxAction)null, (ApplyEffectsAction)null, false, (CharacterState)null, (CharacterState)null, 1, (CharacterState)null, false, (CardTriggerType)2, (CharacterState)null, false);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private List<CardEffectState> _effects = new List<CardEffectState>();

		public bool CanApplyInPreviewMode => false;

		public override void Initialize(RoomModifierData roomModifierData, ICoreGameManagers coreGameManagers)
		{
			((RoomStateModifierBase)this).Initialize(roomModifierData, coreGameManagers);
			foreach (CardEffectData paramCardEffectDatum in roomModifierData.GetParamCardEffectData())
			{
				CardEffectState val = Activator.CreateInstance<CardEffectState>();
				val.Setup(paramCardEffectDatum, (CardState)null, (SaveManager)null);
				_effects.Add(val);
			}
		}

		[IteratorStateMachine(typeof(<PostCombat>d__3))]
		public IEnumerator PostCombat(RoomState room, ICoreGameManagers coreGameManagers)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PostCombat>d__3(0)
			{
				<>4__this = this,
				room = room,
				coreGameManagers = coreGameManagers
			};
		}
	}
	public sealed class RoomStateAddEffectPostCombatKitchen : RoomStateModifierBase, IRoomStatePostCombatModifier, IRoomStateModifier, ILocalizationParamInt, ILocalizationParameterContext
	{
		[CompilerGenerated]
		private sealed class <PostCombat>d__3 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ICoreGameManagers coreGameManagers;

			public RoomStateAddEffectPostCombatKitchen <>4__this;

			public RoomState room;

			private CombatManager <combatManager>5__2;

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

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

			[DebuggerHidden]
			public <PostCombat>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<combatManager>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				RoomStateAddEffectPostCombatKitchen roomStateAddEffectPostCombatKitchen = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<combatManager>5__2 = coreGameManagers.GetCombatManager();
					<>2__current = ((RoomStateModifierBase)roomStateAddEffectPostCombatKitchen).ShowTriggeredVFX(room, coreGameManagers);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = <combatManager>5__2.ApplyEffects(roomStateAddEffectPostCombatKitchen._effects, room.GetRoomIndex(), (CardState)null, false, (RelicState)null, (CharacterState)null, (SpawnPoint)null, true, (ApplyPreEffectsVfxAction)null, (ApplyEffectsAction)null, false, (CharacterState)null, (CharacterState)null, 1, (CharacterState)null, false, (CardTriggerType)2, (CharacterState)null, false);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private List<CardEffectState> _effects = new List<CardEffectState>();

		public bool CanApplyInPreviewMode => false;

		public override void Initialize(RoomModifierData roomModifierData, ICoreGameManagers coreGameManagers)
		{
			((RoomStateModifierBase)this).Initialize(roomModifierData, coreGameManagers);
			foreach (CardEffectData paramCardEffectDatum in roomModifierData.GetParamCardEffectData())
			{
				CardEffectState val = Activator.CreateInstance<CardEffectState>();
				val.Setup(paramCardEffectDatum, (CardState)null, (SaveManager)null);
				_effects.Add(val);
			}
		}

		[IteratorStateMachine(typeof(<PostCombat>d__3))]
		public IEnumerator PostCombat(RoomState room, ICoreGameManagers coreGameManagers)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PostCombat>d__3(0)
			{
				<>4__this = this,
				room = room,
				coreGameManagers = coreGameManagers
			};
		}
	}
	public sealed class RoomStateAddEffectPostCombatSpa : RoomStateModifierBase, IRoomStatePostCombatModifier, IRoomStateModifier, ILocalizationParamInt, ILocalizationParameterContext
	{
		[CompilerGenerated]
		private sealed class <PostCombat>d__3 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ICoreGameManagers coreGameManagers;

			public RoomStateAddEffectPostCombatSpa <>4__this;

			public RoomState room;

			private CombatManager <combatManager>5__2;

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

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

			[DebuggerHidden]
			public <PostCombat>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<combatManager>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				RoomStateAddEffectPostCombatSpa roomStateAddEffectPostCombatSpa = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<combatManager>5__2 = coreGameManagers.GetCombatManager();
					<>2__current = ((RoomStateModifierBase)roomStateAddEffectPostCombatSpa).ShowTriggeredVFX(room, coreGameManagers);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = <combatManager>5__2.ApplyEffects(roomStateAddEffectPostCombatSpa._effects, room.GetRoomIndex(), (CardState)null, false, (RelicState)null, (CharacterState)null, (SpawnPoint)null, true, (ApplyPreEffectsVfxAction)null, (ApplyEffectsAction)null, false, (CharacterState)null, (CharacterState)null, 1, (CharacterState)null, false, (CardTriggerType)2, (CharacterState)null, false);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					return false;
				}
			}

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

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private List<CardEffectState> _effects = new List<CardEffectState>();

		public bool CanApplyInPreviewMode => false;

		public override void Initialize(RoomModifierData roomModifierData, ICoreGameManagers coreGameManagers)
		{
			((RoomStateModifierBase)this).Initialize(roomModifierData, coreGameManagers);
			foreach (CardEffectData paramCardEffectDatum in roomModifierData.GetParamCardEffectData())
			{
				CardEffectState val = Activator.CreateInstance<CardEffectState>();
				val.Setup(paramCardEffectDatum, (CardState)null, (SaveManager)null);
				_effects.Add(val);
			}
		}

		[IteratorStateMachine(typeof(<PostCombat>d__3))]
		public IEnumerator PostCombat(RoomState room, ICoreGameManagers coreGameManagers)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PostCombat>d__3(0)
			{
				<>4__this = this,
				room = room,
				coreGameManagers = coreGameManagers
			};
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SweetkinBackOnTrack.Plugin";

		public const string PLUGIN_NAME = "SweetkinBackOnTrack.Plugin";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}