Decompiled source of SpecialAPIs Stuff v1.4.1

SpecialStuffPack.dll

Decompiled 2 years ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using Alexandria.ItemAPI;
using Alexandria.SoundAPI;
using BepInEx;
using BepInEx.Logging;
using Brave.BulletScript;
using Dungeonator;
using FullInspector;
using FullSerializer;
using Gungeon;
using HarmonyLib;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using InControl;
using MonoMod.RuntimeDetour;
using Pathfinding;
using SGUI;
using SpecialStuffPack.Behaviors;
using SpecialStuffPack.Behaviors.AdvancedRatMetalGear;
using SpecialStuffPack.Behaviors.Ninja;
using SpecialStuffPack.BulletScripts;
using SpecialStuffPack.BulletScripts.AdvancedHelicopter;
using SpecialStuffPack.BulletScripts.AdvancedRat;
using SpecialStuffPack.BulletScripts.AdvancedRatMetalGear;
using SpecialStuffPack.BulletScripts.Ninja;
using SpecialStuffPack.BulletScripts.UltimateDragun;
using SpecialStuffPack.ChallengeAPI;
using SpecialStuffPack.Characters;
using SpecialStuffPack.Components;
using SpecialStuffPack.Controls;
using SpecialStuffPack.CursorAPI;
using SpecialStuffPack.Enemies;
using SpecialStuffPack.EnumExtensions;
using SpecialStuffPack.GungeonAPI;
using SpecialStuffPack.ItemAPI;
using SpecialStuffPack.Items;
using SpecialStuffPack.Items.Actives;
using SpecialStuffPack.Items.Guns;
using SpecialStuffPack.Items.Passives;
using SpecialStuffPack.Items.Pickups;
using SpecialStuffPack.Placeables;
using SpecialStuffPack.PlayMakerActions;
using SpecialStuffPack.SaveAPI;
using SpecialStuffPack.StatusEffects;
using SpecialStuffPack.SynergyAPI;
using SpecialStuffPack.Tools;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("SpecialStuffPack")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SpecialStuffPack")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1e4235ec-fefd-4984-a595-a1e49f18b0db")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace SpecialStuffPack
{
	public class LogRecorder : ILogListener, IDisposable
	{
		public static List<string> lines = new List<string>();

		public void Dispose()
		{
		}

		public void LogEvent(object sender, LogEventArgs eventArgs)
		{
			lines.Add(((object)eventArgs).ToString());
		}
	}
	public class ParadoxShrine
	{
	}
	public static class AudioManager
	{
	}
	public enum Event
	{
		DimensionState,
		GullLoop,
		WolfBite,
		RatKunaiPrepare,
		ScreecherReload,
		SAAReload,
		FuseLoop,
		MachoBraceTrigger
	}
	public static class PersistentCallToolbox
	{
		public static void AddPersistentCall(this UnityEventBase self, Object obj, string methodName)
		{
			if (self != null && !(obj == (Object)null) && !string.IsNullOrEmpty(methodName))
			{
				MethodInfo method = ((object)obj).GetType().GetMethod(methodName);
				if ((object)method != null)
				{
					object value = ((object)self).GetType().GetField("m_PersistentCalls", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(self);
					Type fieldType = value.GetType().GetField("m_Calls", BindingFlags.Instance | BindingFlags.NonPublic).FieldType;
					Type type = fieldType.GetGenericArguments()[0];
					object obj2 = Activator.CreateInstance(type);
					obj2.GetType().GetMethod("RegisterPersistentListener").Invoke(obj2, new object[2] { obj, methodName });
					value.GetType().GetMethod("AddListener").Invoke(value, new object[1] { obj2 });
				}
			}
		}
	}
	[HarmonyPatch]
	public static class SPCultist
	{
		private class DisableWhenSecondDeviceConnected : MonoBehaviour
		{
			public FoyerCharacterSelectFlag flag;

			public void Update()
			{
				if (!((Object)(object)flag == (Object)null))
				{
					if (flag.m_active && InputManager.Devices.Count > 0)
					{
						flag.ToggleSelf(false);
					}
					else if (!flag.m_active && InputManager.Devices.Count == 0)
					{
						flag.ToggleSelf(true);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Foyer), "SetUpCharacterCallbacks")]
		[HarmonyPostfix]
		public static void AddSPCultist(Foyer __instance)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			FoyerCharacterSelectFlag val = (from x in Object.FindObjectsOfType<FoyerCharacterSelectFlag>()
				where !x.IsCoopCharacter && (Object)(object)((BraveBehaviour)x).transform.parent != (Object)null
				select x).FirstOrDefault();
			if (!((Object)(object)val != (Object)null))
			{
				return;
			}
			FoyerCharacterSelectFlag val2 = (from x in ((Component)((BraveBehaviour)val).transform.parent).GetComponentsInChildren<FoyerCharacterSelectFlag>(false)
				where x.IsCoopCharacter
				select x).FirstOrDefault();
			if (!((Object)(object)val2 != (Object)null))
			{
				return;
			}
			GameObject val3 = Object.Instantiate<GameObject>(((Component)val2).gameObject, ((BraveBehaviour)val2).transform.position, Quaternion.identity);
			PlayMakerFSM component = val3.GetComponent<PlayMakerFSM>();
			component.fsm = JsonUtility.FromJson<Fsm>(JsonUtility.ToJson((object)((BraveBehaviour)val).playmakerFsm.fsm));
			component.fsm.Init((MonoBehaviour)(object)component);
			CollectionExtensions.Do<FsmState>((IEnumerable<FsmState>)component.fsm.states, (Action<FsmState>)delegate(FsmState x)
			{
				CollectionExtensions.Do<FsmStateAction>((IEnumerable<FsmStateAction>)x.actions, (Action<FsmStateAction>)delegate(FsmStateAction x)
				{
					ChangeToNewCharacter val4 = (ChangeToNewCharacter)(object)((x is ChangeToNewCharacter) ? x : null);
					if (val4 != null)
					{
						val4.PlayerPrefabPath = "PlayerCoopCultist";
					}
				});
			});
			FoyerCharacterSelectFlag component2 = val3.GetComponent<FoyerCharacterSelectFlag>();
			component2.IsCoopCharacter = false;
			component2.ToggleSelf(true);
			val3.AddComponent<DisableWhenSecondDeviceConnected>().flag = component2;
			Vector3Extensions.GetAbsoluteRoom(val3.transform.position).RegisterInteractable(val3.GetComponentInChildren<IPlayerInteractable>());
			__instance.OnPlayerCharacterChanged = (Action<PlayerController>)Delegate.Combine(__instance.OnPlayerCharacterChanged, new Action<PlayerController>(component2.OnSelectedCharacterCallback));
		}

		[HarmonyPatch(typeof(PlayerController), "Start")]
		[HarmonyPrefix]
		public static void MakeCultistSP(PlayerController __instance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			if ((int)__instance.characterIdentity == 7 && (int)GameManager.Instance.CurrentGameType != 1)
			{
				__instance.m_overridePlayerSwitchState = "CoopCultist";
				__instance.characterIdentity = PlayableCharactersE.SPCultist;
				if (__instance.BosscardSprites == null || __instance.BosscardSprites.Count <= 0)
				{
					__instance.BosscardSprites = new List<Texture2D> { SpecialStuffModule.spCultistBosscard };
				}
				if (__instance.BosscardSpriteFPS < 1f)
				{
					__instance.BosscardSpriteFPS = 1f;
				}
			}
		}

		[HarmonyPatch(typeof(GameStatsManager), "SetFlag")]
		[HarmonyPostfix]
		public static void UnlockNumber2(GameStatsManager __instance, GungeonFlags flag, bool value)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (value && (int)flag == 10500 && GameManager.HasInstance && GameManager.Instance.PrimaryPlayer.characterIdentity == PlayableCharactersE.SPCultist)
			{
				__instance.SetFlag((GungeonFlags)100000, true);
			}
		}

		[HarmonyPatch(typeof(HealPlayerItem), "GetHealingAmount")]
		[HarmonyPostfix]
		public static void NegateCoopHealing(HealPlayerItem __instance, ref float __result, PlayerController user)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			if (__instance.DoesRevive && (int)GameManager.Instance.CurrentGameType == 1)
			{
				PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(user);
				if (((BraveBehaviour)otherPlayer).healthHaver.IsDead)
				{
					__result = 0f;
				}
			}
		}

		[HarmonyPatch(typeof(GameStatsManager), "GetCharacterSpecificFlag", new Type[]
		{
			typeof(PlayableCharacters),
			typeof(CharacterSpecificGungeonFlags)
		})]
		[HarmonyPostfix]
		public static void MakeCultistPastCleared(ref bool __result, PlayableCharacters character, CharacterSpecificGungeonFlags flag)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			if (character == PlayableCharactersE.SPCultist && ((int)flag == 1001 || (int)flag == 1000))
			{
				__result = true;
			}
			else if ((int)character == 7)
			{
				__result = true;
			}
		}

		[HarmonyPatch(typeof(CharacterCostumeSwapper), "Start")]
		[HarmonyPrefix]
		public static bool MakeCultistsCostumeAlwaysAppear(CharacterCostumeSwapper __instance)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			if ((int)__instance.TargetCharacter == 7)
			{
				__instance.m_active = true;
				((BraveBehaviour)__instance.AlternateCostumeSprite).renderer.enabled = true;
				((BraveBehaviour)__instance.CostumeSprite).renderer.enabled = false;
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(CharacterCostumeSwapper), "Interact")]
		[HarmonyPrefix]
		public static bool AddAltCostume(CharacterCostumeSwapper __instance, PlayerController interactor)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Invalid comparison between Unknown and I4
			if (interactor.characterIdentity != __instance.TargetCharacter && interactor.characterIdentity == PlayableCharactersE.SPCultist && (int)__instance.TargetCharacter == 7)
			{
				if (interactor.IsUsingAlternateCostume)
				{
					interactor.SwapToAlternateCostume((tk2dSpriteAnimation)null);
				}
				else
				{
					if (Object.op_Implicit((Object)(object)__instance.TargetLibrary))
					{
						interactor.AlternateCostumeLibrary = __instance.TargetLibrary;
					}
					interactor.SwapToAlternateCostume((tk2dSpriteAnimation)null);
				}
				SpriteOutlineManager.RemoveOutlineFromSprite((tk2dBaseSprite)(object)__instance.AlternateCostumeSprite, false);
				SpriteOutlineManager.RemoveOutlineFromSprite((tk2dBaseSprite)(object)__instance.CostumeSprite, false);
				((BraveBehaviour)__instance.AlternateCostumeSprite).renderer.enabled = !((BraveBehaviour)__instance.AlternateCostumeSprite).renderer.enabled;
				((BraveBehaviour)__instance.CostumeSprite).renderer.enabled = !((BraveBehaviour)__instance.CostumeSprite).renderer.enabled;
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(CharacterCostumeSwapper), "OnEnteredRange")]
		[HarmonyPrefix]
		public static bool FixOutlines1(CharacterCostumeSwapper __instance, PlayerController interactor)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			if (interactor.characterIdentity != __instance.TargetCharacter && interactor.characterIdentity == PlayableCharactersE.SPCultist && (int)__instance.TargetCharacter == 7)
			{
				if (((BraveBehaviour)__instance.AlternateCostumeSprite).renderer.enabled)
				{
					SpriteOutlineManager.AddOutlineToSprite((tk2dBaseSprite)(object)__instance.AlternateCostumeSprite, Color.white);
				}
				else
				{
					SpriteOutlineManager.AddOutlineToSprite((tk2dBaseSprite)(object)__instance.CostumeSprite, Color.white);
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(CharacterCostumeSwapper), "OnExitRange")]
		[HarmonyPrefix]
		public static bool FixOutlines2(CharacterCostumeSwapper __instance, PlayerController interactor)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			if (interactor.characterIdentity != __instance.TargetCharacter && interactor.characterIdentity == PlayableCharactersE.SPCultist && (int)__instance.TargetCharacter == 7)
			{
				if (((BraveBehaviour)__instance.AlternateCostumeSprite).renderer.enabled)
				{
					SpriteOutlineManager.RemoveOutlineFromSprite((tk2dBaseSprite)(object)__instance.AlternateCostumeSprite, false);
				}
				else
				{
					SpriteOutlineManager.RemoveOutlineFromSprite((tk2dBaseSprite)(object)__instance.CostumeSprite, false);
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(MetalGearRatDeathController), "OnDeathCR")]
		[HarmonyPostfix]
		public static IEnumerator NoPunchout(IEnumerator rat, MetalGearRatDeathController __instance)
		{
			if ((Object)(object)GameManager.Instance != (Object)null && (int)GameManager.Instance.CurrentGameType == 0 && (Object)(object)GameManager.Instance.PrimaryPlayer != (Object)null && GameManager.Instance.PrimaryPlayer.characterIdentity == PlayableCharactersE.SPCultist)
			{
				SuperReaperController.PreventShooting = true;
				PlayerController[] allPlayers = GameManager.Instance.AllPlayers;
				foreach (PlayerController val in allPlayers)
				{
					val.SetInputOverride("metal gear death");
				}
				yield return (object)new WaitForSeconds(2f);
				Pixelator.Instance.FadeToColor(0.75f, Color.white, false, 0f);
				yield return (object)new WaitForSeconds(3f);
				MetalGearRatIntroDoer component = ((Component)__instance).GetComponent<MetalGearRatIntroDoer>();
				component.ModifyCamera(false);
				yield return (object)new WaitForSeconds(0.75f);
				((GameActor)((BraveBehaviour)__instance).aiActor).StealthDeath = true;
				((BraveBehaviour)__instance).healthHaver.persistsOnDeath = true;
				((BraveBehaviour)__instance).healthHaver.DeathAnimationComplete((tk2dSpriteAnimator)null, (tk2dSpriteAnimationClip)null);
				if (Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).aiActor))
				{
					Object.Destroy((Object)(object)((BraveBehaviour)__instance).aiActor);
				}
				if (Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).healthHaver))
				{
					Object.Destroy((Object)(object)((BraveBehaviour)__instance).healthHaver);
				}
				if (Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).behaviorSpeculator))
				{
					Object.Destroy((Object)(object)((BraveBehaviour)__instance).behaviorSpeculator);
				}
				if (Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).aiAnimator.ChildAnimator))
				{
					Object.Destroy((Object)(object)((Component)((BraveBehaviour)__instance).aiAnimator.ChildAnimator).gameObject);
				}
				if (Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).aiAnimator))
				{
					Object.Destroy((Object)(object)((BraveBehaviour)__instance).aiAnimator);
				}
				if (Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).specRigidbody))
				{
					Object.Destroy((Object)(object)((BraveBehaviour)__instance).specRigidbody);
				}
				((BraveBehaviour)__instance).RegenerateCache();
				RoomHandler currentRoom = GameManager.Instance.BestActivePlayer.CurrentRoom;
				MetalGearRatRoomController room = Object.FindObjectOfType<MetalGearRatRoomController>();
				room.TransformToDestroyedRoom();
				GameManager.Instance.PrimaryPlayer.WarpToPoint(Vector2.op_Implicit(((Component)room).transform.position + new Vector3(17.25f, 14.5f)), false, false);
				if ((int)GameManager.Instance.CurrentGameType == 1 && Object.op_Implicit((Object)(object)GameManager.Instance.SecondaryPlayer))
				{
					GameManager.Instance.SecondaryPlayer.WarpToPoint(Vector2.op_Implicit(((Component)room).transform.position + new Vector3(27.5f, 14.5f)), false, false);
				}
				((BraveBehaviour)__instance).aiActor.ToggleRenderers(false);
				yield return null;
				PlayerController[] allPlayers2 = GameManager.Instance.AllPlayers;
				foreach (PlayerController val2 in allPlayers2)
				{
					val2.ClearInputOverride("metal gear death");
				}
				Pixelator.Instance.FadeToColor(1f, Color.white, true, 0f);
				GameObject gameObject = ((Component)PickupObjectDatabase.GetById(GlobalItemIds.RatKey)).gameObject;
				Vector3 position = ((Component)room).transform.position;
				RoomHandler val3 = null;
				foreach (RoomHandler room2 in GameManager.Instance.Dungeon.data.rooms)
				{
					if ((int)room2.area.PrototypeRoomCategory == 3)
					{
						val3 = room2;
						break;
					}
				}
				MetalGearRatController component2 = ((Component)__instance).GetComponent<MetalGearRatController>();
				int num = Mathf.Clamp(1 + component2.m_isTailgunDestroyed.ToInt() + component2.m_isRadomeDestroyed.ToInt() + (!currentRoom.PlayerHasTakenDamageInThisRoom).ToInt() + (!(val3?.PlayerHasTakenDamageInThisRoom).GetValueOrDefault()).ToInt() + (component2.m_isTailgunDestroyed && component2.m_isRadomeDestroyed && currentRoom.PlayerHasTakenDamageInThisRoom && (val3?.PlayerHasTakenDamageInThisRoom).GetValueOrDefault()).ToInt(), 1, 6);
				if (num >= 1)
				{
					LootEngine.SpawnItem(gameObject, position + new Vector3(14.25f, 17f), Vector2.zero, 0f, true, false, false);
				}
				if (num >= 2)
				{
					LootEngine.SpawnItem(gameObject, position + new Vector3(13.25f, 14.5f), Vector2.zero, 0f, true, false, false);
				}
				if (num >= 3)
				{
					LootEngine.SpawnItem(gameObject, position + new Vector3(14.25f, 12f), Vector2.zero, 0f, true, false, false);
				}
				if (num >= 4)
				{
					LootEngine.SpawnItem(gameObject, position + new Vector3(30.25f, 17f), Vector2.zero, 0f, true, false, false);
				}
				if (num >= 5)
				{
					LootEngine.SpawnItem(gameObject, position + new Vector3(31.25f, 14.5f), Vector2.zero, 0f, true, false, false);
				}
				if (num >= 6)
				{
					LootEngine.SpawnItem(gameObject, position + new Vector3(30.25f, 12f), Vector2.zero, 0f, true, false, false);
				}
				DungeonPlaceableBehaviour playerLostNotePrefab = __instance.PunchoutMinigamePrefab.GetComponent<PunchoutController>().PlayerLostNotePrefab;
				if ((Object)(object)playerLostNotePrefab != (Object)null)
				{
					bool flag = default(bool);
					IntVector2 centeredVisibleClearSpot = currentRoom.GetCenteredVisibleClearSpot(3, 3, ref flag, true);
					centeredVisibleClearSpot = centeredVisibleClearSpot - currentRoom.area.basePosition + IntVector2.One;
					if (flag)
					{
						GameObject val4 = DungeonPlaceableUtility.InstantiateDungeonPlaceable(((Component)playerLostNotePrefab).gameObject, currentRoom, centeredVisibleClearSpot, false, (AwakenAnimationType)0, false);
						if (Object.op_Implicit((Object)(object)val4))
						{
							IPlayerInteractable[] interfacesInChildren = GameObjectExtensions.GetInterfacesInChildren<IPlayerInteractable>(val4);
							for (int k = 0; k < interfacesInChildren.Length; k++)
							{
								currentRoom.RegisterInteractable(interfacesInChildren[k]);
							}
							NoteDoer componentInChildren = val4.GetComponentInChildren<NoteDoer>();
							if ((Object)(object)componentInChildren != (Object)null)
							{
								componentInChildren.useAdditionalStrings = false;
								componentInChildren.alreadyLocalized = false;
								componentInChildren.stringKey = "#SPAPI_RAT_NOTE_SP_CULTIST";
							}
						}
					}
				}
				yield return (object)new WaitForSeconds(1f);
				Object.Destroy((Object)(object)((Component)__instance).gameObject);
			}
			else
			{
				yield return rat;
			}
		}

		[HarmonyPatch(typeof(FoyerCharacterSelectFlag), "OnSelectedCharacterCallback")]
		[HarmonyPrefix]
		public static bool TrackException(FoyerCharacterSelectFlag __instance, PlayerController newCharacter)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)string.Concat(((Object)newCharacter).name, "|", newCharacter.characterIdentity, " <===="));
			if (((Object)((Component)newCharacter).gameObject).name.Contains(__instance.CharacterPrefabPath))
			{
				((Component)__instance).gameObject.SetActive(false);
				((Behaviour)((Component)__instance).GetComponent<SpeculativeRigidbody>()).enabled = false;
				if (__instance.IsEevee)
				{
					GameStatsManager.Instance.RegisterStatChange((TrackedStats)25, -5f);
				}
				if (__instance.IsGunslinger)
				{
					GameStatsManager.Instance.RegisterStatChange((TrackedStats)25, -7f);
				}
			}
			else if (!((Component)__instance).gameObject.activeSelf)
			{
				((Component)__instance).gameObject.SetActive(true);
				SpriteOutlineManager.RemoveOutlineFromSprite(((BraveBehaviour)__instance).sprite, true);
				((Behaviour)((BraveBehaviour)__instance).specRigidbody).enabled = true;
				PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(((BraveBehaviour)__instance).specRigidbody, (int?)null, false);
				if (!__instance.m_isAlternateCostume)
				{
					CharacterSelectIdleDoer component = ((Component)__instance).GetComponent<CharacterSelectIdleDoer>();
					if ((Object)(object)component != (Object)null)
					{
						((Behaviour)component).enabled = true;
					}
				}
			}
			return false;
		}
	}
	public class SPCultistBandana : MonoBehaviour
	{
		public List<StatModifier> cachedCoopModifiers;

		private CoopPassiveItem item;

		private int cachedCompanions;

		public void Awake()
		{
			item = ((Component)this).GetComponent<CoopPassiveItem>();
			if ((Object)(object)item != (Object)null && (cachedCoopModifiers == null || cachedCoopModifiers.Count <= 0))
			{
				cachedCoopModifiers = item.modifiers;
			}
		}

		public void Update()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)item != (Object)null && (cachedCoopModifiers == null || cachedCoopModifiers.Count <= 0))
			{
				cachedCoopModifiers = item.modifiers;
			}
			if (cachedCoopModifiers == null || cachedCoopModifiers.Count <= 0)
			{
				return;
			}
			if ((int)GameManager.Instance.CurrentGameType == 0 && (Object)(object)item != (Object)null && ((PassiveItem)item).PickedUp && (Object)(object)((PassiveItem)item).Owner != (Object)null && ((PassiveItem)item).Owner.characterIdentity == PlayableCharactersE.SPCultist)
			{
				PlayerController owner = ((PassiveItem)item).Owner;
				int num = (owner.companions?.Count).GetValueOrDefault() + (owner.trailOrbitals?.Count).GetValueOrDefault() + (owner.orbitals?.Count).GetValueOrDefault();
				if (num > 0 && cachedCompanions <= 0)
				{
					item.modifiers = new List<StatModifier>();
					owner.stats.RecalculateStats(owner, false, false);
				}
				else if (num <= 0 && cachedCompanions > 0)
				{
					item.modifiers = cachedCoopModifiers;
					owner.stats.RecalculateStats(owner, false, false);
				}
				cachedCompanions = num;
			}
			else if ((Object)(object)item != (Object)null && item.modifiers != cachedCoopModifiers)
			{
				item.modifiers = cachedCoopModifiers;
				if (((PassiveItem)item).PickedUp && (Object)(object)((PassiveItem)item).Owner != (Object)null)
				{
					((PassiveItem)item).Owner.stats.RecalculateStats(((PassiveItem)item).Owner, false, false);
				}
			}
		}
	}
	public class SpecialDungeonPrerequisite : CustomDungeonPrerequisite
	{
		public enum SpecialPrerequisiteType
		{
			NONE,
			ITEM_FLAG,
			SYNERGY,
			ALWAYS_TRUE,
			ALWAYS_FALSE
		}

		public SpecialPrerequisiteType specialPrerequisiteType;

		public Type flagToCheck;

		public string synergyToCheck;

		public bool shouldHaveSynergy = true;

		public override bool CheckConditionsFulfilled()
		{
			if (specialPrerequisiteType == SpecialPrerequisiteType.ITEM_FLAG)
			{
				return PassiveItem.IsFlagSetAtAll(flagToCheck);
			}
			if (specialPrerequisiteType == SpecialPrerequisiteType.SYNERGY)
			{
				return SynergyBuilder.AnyoneHasActiveSynergy(synergyToCheck) == shouldHaveSynergy;
			}
			if (specialPrerequisiteType == SpecialPrerequisiteType.ALWAYS_TRUE)
			{
				return true;
			}
			if (specialPrerequisiteType == SpecialPrerequisiteType.ALWAYS_FALSE)
			{
				return false;
			}
			return base.CheckConditionsFulfilled();
		}
	}
	public class SpecialOptions
	{
		private static SpecialOptions m_instance;

		[fsProperty]
		public string playerOneSpecialBindingData;

		[fsProperty]
		public string playerTwoSpecialBindingData;

		public static SaveType SpecialOptionsSave = new SaveType
		{
			filePattern = "Slot{0}.spapistuffOptions",
			legacyFilePattern = "spapistuffOptionsSlot{0}.txt"
		};

		public static SpecialOptions Instance
		{
			get
			{
				if (m_instance == null)
				{
					Load();
				}
				return m_instance;
			}
		}

		public static void Setup()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			new Hook((MethodBase)typeof(GameOptions).GetMethod("Save", BindingFlags.Static | BindingFlags.Public), typeof(SpecialOptions).GetMethod("SaveSpecialOptions", BindingFlags.Static | BindingFlags.Public));
		}

		public static bool SaveSpecialOptions(Func<bool> orig)
		{
			bool result = orig();
			if (Instance != null)
			{
				Save();
			}
			return result;
		}

		public static bool CompareSettings(SpecialOptions clone, SpecialOptions source)
		{
			if (clone == null || source == null)
			{
				Debug.LogError((object)string.Concat(clone, "|", source, " OPTIONS ARE NULL!"));
				return false;
			}
			bool flag = true;
			FieldInfo[] fields = typeof(SpecialOptions).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
			foreach (FieldInfo fieldInfo in fields)
			{
				if ((object)fieldInfo == null)
				{
					continue;
				}
				bool flag2 = false;
				if (fieldInfo.GetCustomAttributes(typeof(fsPropertyAttribute), inherit: false).Length != 0)
				{
					flag2 = true;
				}
				if (flag2)
				{
					object value = fieldInfo.GetValue(clone);
					object value2 = fieldInfo.GetValue(source);
					if (value != null && value2 != null)
					{
						bool flag3 = value.Equals(value2);
						flag = flag && flag3;
					}
				}
			}
			return flag;
		}

		public static SpecialOptions CloneOptions(SpecialOptions source)
		{
			SpecialOptions specialOptions = new SpecialOptions();
			FieldInfo[] fields = typeof(SpecialOptions).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
			foreach (FieldInfo fieldInfo in fields)
			{
				bool flag = false;
				if (fieldInfo.GetCustomAttributes(typeof(fsPropertyAttribute), inherit: false).Length != 0)
				{
					flag = true;
				}
				if (flag)
				{
					fieldInfo.SetValue(specialOptions, fieldInfo.GetValue(source));
				}
			}
			return specialOptions;
		}

		public void ApplySettings(SpecialOptions clone)
		{
			FieldInfo[] fields = typeof(SpecialOptions).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
			foreach (FieldInfo fieldInfo in fields)
			{
				if (fieldInfo.GetCustomAttributes(typeof(fsPropertyAttribute), inherit: false).Length != 0 && fieldInfo.GetValue(this) != fieldInfo.GetValue(clone))
				{
					fieldInfo.SetValue(this, fieldInfo.GetValue(clone));
				}
			}
			playerOneSpecialBindingData = clone.playerOneSpecialBindingData;
			playerTwoSpecialBindingData = clone.playerTwoSpecialBindingData;
			if (this == Instance)
			{
				SpecialInput.ForceLoadBindingInfoFromOptions();
			}
		}

		public static bool Save()
		{
			return SaveManager.Save<SpecialOptions>(Instance, SpecialOptionsSave, 0, 0u, (SaveSlot?)null);
		}

		public static void Load()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between I4 and Unknown
			SaveManager.Init();
			SpecialOptions specialOptions = default(SpecialOptions);
			bool flag = SaveManager.Load<SpecialOptions>(SpecialOptionsSave, ref specialOptions, true, 0u, (Func<string, uint, string>)null, (SaveSlot?)null);
			if (!flag)
			{
				for (int i = 0; i < 3; i++)
				{
					if (flag)
					{
						break;
					}
					if (i != (int)SaveManager.CurrentSaveSlot)
					{
						specialOptions = null;
						SaveType specialOptionsSave = SpecialOptionsSave;
						bool flag2 = true;
						SaveSlot? val = (SaveSlot)i;
						flag = SaveManager.Load<SpecialOptions>(specialOptionsSave, ref specialOptions, flag2, 0u, (Func<string, uint, string>)null, val);
						flag = flag && specialOptions != null;
					}
				}
			}
			if (!flag || specialOptions == null)
			{
				m_instance = new SpecialOptions();
				GameOptions.RequiresLanguageReinitialization = true;
			}
			else
			{
				m_instance = specialOptions;
			}
		}
	}
	public static class SpecialSynergies
	{
		public static void Init()
		{
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f15: Unknown result type (might be due to invalid IL or missing references)
			//IL_1182: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_29c1: Unknown result type (might be due to invalid IL or missing references)
			List<int> collection = new List<int>
			{
				CodeShortcuts.Plus1BulletsId,
				CodeShortcuts.AmuletOfThePitLordId
			};
			SynergyBuilder.CreateSynergy("Fufufufufu", new List<int> { ItemBuilder.ItemIds["woodentoken"] }, new List<int>
			{
				CodeShortcuts.ElimentalerId,
				CodeShortcuts.RatBootsId,
				CodeShortcuts.PartiallyEatenCheeseId,
				CodeShortcuts.ResourcefulSackId,
				CodeShortcuts.RingOfTheResourcefulRatId,
				ItemBuilder.ItemIds["ratwhistle"]
			});
			SynergyBuilder.CreateSynergy("Double the Wish!", new List<int>
			{
				ItemBuilder.ItemIds["wishorb"],
				CodeShortcuts.LifeOrbId
			});
			SynergyBuilder.CreateSynergy("Wish of Power", new List<int>
			{
				ItemBuilder.ItemIds["wishorb"],
				CodeShortcuts.SprunId
			});
			SynergyBuilder.CreateSynergy("Wish of Reflection", new List<int>
			{
				ItemBuilder.ItemIds["wishorb"],
				CodeShortcuts.RollingEyeId
			});
			SynergyBuilder.CreateSynergy("25% OFF ON ALL IN-GAME PURCHASES!", new List<int>
			{
				ItemBuilder.ItemIds["paytowin"],
				CodeShortcuts.MicrotransactionGunId
			});
			SynergyBuilder.CreateSynergy("Super Blasts", new List<int>
			{
				ItemBuilder.ItemIds["bombammolet"],
				CodeShortcuts.GoldAmmoletId
			});
			SynergyBuilder.CreateSynergy("Stunning Blasts", new List<int>
			{
				ItemBuilder.ItemIds["bombammolet"],
				CodeShortcuts.LodestoneAmmoletId
			});
			SynergyBuilder.CreateSynergy("Random Blasts", new List<int>
			{
				ItemBuilder.ItemIds["bombammolet"],
				CodeShortcuts.ChaosAmmoletId
			});
			SynergyBuilder.CreateSynergy("Poison Blasts", new List<int>
			{
				ItemBuilder.ItemIds["bombammolet"],
				CodeShortcuts.UraniumAmmoletId
			});
			SynergyBuilder.CreateSynergy("Hot Blasts", new List<int>
			{
				ItemBuilder.ItemIds["bombammolet"],
				CodeShortcuts.CopperAmmoletId
			});
			SynergyBuilder.CreateSynergy("Freezing Blasts", new List<int>
			{
				ItemBuilder.ItemIds["bombammolet"],
				CodeShortcuts.FrostAmmoletId
			});
			SynergyBuilder.CreateSynergy("v3.0 The Massive Update", new List<int> { ItemBuilder.ItemIds["boxofstuff"] }, new List<int>
			{
				CodeShortcuts.UtilityBeltId,
				CodeShortcuts.AmmoBeltId,
				CodeShortcuts.BackpackId,
				CodeShortcuts.BottleId,
				CodeShortcuts.BoxId,
				CodeShortcuts.MailboxId,
				CodeShortcuts.BriefcaseOfCashId,
				CodeShortcuts.ResourcefulSackId
			});
			SynergyBuilder.CreateSynergy("Also click that bell", new List<int> { ItemBuilder.ItemIds["subscribebutton"] }, new List<int>
			{
				CodeShortcuts.RocketPoweredBulletsId,
				CodeShortcuts.AgedBellId,
				ItemBuilder.ItemIds["glassbell"]
			});
			SynergyBuilder.CreateSynergy("Also you can leave a comment", new List<int>
			{
				ItemBuilder.ItemIds["subscribebutton"],
				CodeShortcuts.MailboxId
			}, null, activeWhenGunsUnequipped: false);
			SynergyBuilder.CreateSynergy("Chill", new List<int> { ItemBuilder.ItemIds["ratwhistle"] }, new List<int>
			{
				CodeShortcuts.IceBombId,
				CodeShortcuts.FrostGiantId,
				CodeShortcuts.FrostBulletsId,
				CodeShortcuts.FrostAmmoletId,
				CodeShortcuts.Cold45Id,
				CodeShortcuts.PolarisId,
				CodeShortcuts.HeartOfIceId,
				CodeShortcuts.IceCubeId,
				CodeShortcuts.IceBreakerId,
				CodeShortcuts.FreezeRayId
			});
			SynergyBuilder.CreateSynergy("All At Once", new List<int> { ItemBuilder.ItemIds["ratwhistle"] }, new List<int>
			{
				CodeShortcuts.ElimentalerId,
				CodeShortcuts.RatBootsId,
				CodeShortcuts.PartiallyEatenCheeseId,
				CodeShortcuts.ResourcefulSackId,
				CodeShortcuts.RingOfTheResourcefulRatId,
				ItemBuilder.ItemIds["woodentoken"]
			});
			SynergyBuilder.CreateSynergy("Shadow Mirror", new List<int>
			{
				ItemBuilder.ItemIds["truthmirror"],
				CodeShortcuts.ShadowCloneId
			});
			SynergyBuilder.CreateSynergy("Blessed Mirror", new List<int>
			{
				ItemBuilder.ItemIds["truthmirror"],
				CodeShortcuts.SilverBulletsId
			});
			SynergyBuilder.CreateSynergy("Just Your Normal Luck", new List<int>
			{
				ItemBuilder.ItemIds["badluckclover"],
				CodeShortcuts.SevenLeafCloverId
			});
			SynergyBuilder.CreateSynergy("Somehow... Luckier?", new List<int>
			{
				ItemBuilder.ItemIds["badluckclover"],
				ItemBuilder.ItemIds["truthmirror"]
			});
			SynergyBuilder.CreateSynergy("why do you keep crashing", new List<int>
			{
				ItemBuilder.ItemIds["binary_gun"],
				CodeShortcuts.MagnumId
			});
			SynergyBuilder.CreateSynergy("BURN! BUUURRRNNNN!!!", new List<int> { ItemBuilder.ItemIds["greencandle"] }, new List<int>
			{
				CodeShortcuts.GungeonPepperId,
				CodeShortcuts.RingOfFireResistanceId,
				CodeShortcuts.HotLeadId
			});
			SynergyBuilder.CreateSynergy("Ring It Twice", new List<int>
			{
				ItemBuilder.ItemIds["glassbell"],
				CodeShortcuts.AgedBellId
			});
			SynergyBuilder.CreateSynergy("Celestial Rhythm", new List<int>
			{
				ItemBuilder.ItemIds["shooting_star"],
				CodeShortcuts.CrescentCrossbowId
			}).bonusSynergies.Add(ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.specialstuffpack", "CelestialRhythm"));
			SynergyBuilder.CreateSynergy("Wishing Star", new List<int>
			{
				ItemBuilder.ItemIds["shooting_star"],
				ItemBuilder.ItemIds["wishorb"]
			});
			SynergyBuilder.CreateSynergy("The Initial Idea", new List<int>
			{
				ItemBuilder.ItemIds["shooting_star"],
				ItemBuilder.ItemIds["asteroidbelt"]
			}, null, activeWhenGunsUnequipped: false, new List<StatModifier> { StatModifier.Create((StatType)5, (ModifyMethod)1, 2f) });
			SynergyBuilder.CreateSynergy("Bouncy Throws", new List<int>
			{
				ItemBuilder.ItemIds["butter"],
				CodeShortcuts.BouncyBulletsId
			});
			SynergyBuilder.CreateSynergy("Piercing Throws", new List<int>
			{
				ItemBuilder.ItemIds["butter"],
				CodeShortcuts.GhostBulletsId
			});
			SynergyBuilder.CreateSynergy("Homing Boomerang Throws", new List<int> { ItemBuilder.ItemIds["butter"] }, new List<int>
			{
				CodeShortcuts.HomingBulletsId,
				CodeShortcuts.CrutchId
			});
			SynergyBuilder.CreateSynergy("Take It Before They Notice", new List<int> { ItemBuilder.ItemIds["legitcoupon"] }, new List<int>
			{
				CodeShortcuts.ChaffGrenadeId,
				CodeShortcuts.AgedBellId,
				CodeShortcuts.ExplosiveDecoyId,
				CodeShortcuts.DecoyId,
				CodeShortcuts.SmokeBombId,
				CodeShortcuts.BoxId,
				CodeShortcuts.GrapplingHookId,
				CodeShortcuts.RingOfEtherealFormId,
				CodeShortcuts.CharmHornId,
				CodeShortcuts.ThePredatorId,
				CodeShortcuts.GreyMauserId
			});
			SynergyBuilder.CreateSynergy("The zombies are coming", new List<int> { ItemBuilder.ItemIds["gravediggershovel"] }, new List<int>
			{
				CodeShortcuts.ZombieBulletsId,
				CodeShortcuts.Vertebraek47Id,
				CodeShortcuts.SkullSpitterId
			});
			SynergyBuilder.CreateSynergy("Armored Support", new List<int> { ItemBuilder.ItemIds["frailheart"] }, new List<int>
			{
				CodeShortcuts.BionicLegId,
				CodeShortcuts.LaserSightId,
				CodeShortcuts.ShockRoundsId,
				CodeShortcuts.NanomachinesId
			});
			SynergyBuilder.CreateSynergy("I am YesEngine", new List<int> { ItemBuilder.ItemIds["consolecontroller"] }, new List<int>
			{
				CodeShortcuts.GungineId,
				CodeShortcuts.AlienEngineId
			});
			SynergyBuilder.CreateSynergy("Super Launch", new List<int>
			{
				ItemBuilder.ItemIds["catapult"],
				ItemBuilder.ItemIds["launcher"]
			}, null, activeWhenGunsUnequipped: false, new List<StatModifier>
			{
				StatModifier.Create((StatType)6, (ModifyMethod)1, 3f),
				StatModifier.Create((StatType)5, (ModifyMethod)1, 2f)
			});
			SynergyBuilder.CreateSynergy("static readonly", new List<int> { ItemBuilder.ItemIds["staticroll"] }, new List<int>
			{
				CodeShortcuts.BookOfChestAnatomyId,
				CodeShortcuts.MagazineRackId,
				CodeShortcuts.GungeonBlueprintId,
				ItemBuilder.ItemIds["guardianbook"]
			});
			SynergyBuilder.CreateSynergy("static void", new List<int> { ItemBuilder.ItemIds["staticroll"] }, new List<int>
			{
				CodeShortcuts.VoidCoreCannonId,
				CodeShortcuts.VoidShotgunId,
				CodeShortcuts.VoidCoreAssaultRifleId,
				CodeShortcuts.VoidMarshalId
			});
			SynergyBuilder.CreateSynergy("private static", new List<int> { ItemBuilder.ItemIds["staticroll"] }, new List<int>
			{
				CodeShortcuts.GreyMauserId,
				CodeShortcuts.ThePredatorId,
				CodeShortcuts.SmokeBombId,
				CodeShortcuts.BoxId,
				CodeShortcuts.RingOfEtherealFormId
			});
			SynergyBuilder.CreateSynergy("Infinite Mirror", new List<int>
			{
				ItemBuilder.ItemIds["mirrorbullet"],
				ItemBuilder.ItemIds["truthmirror"]
			});
			SynergyBuilder.CreateSynergy("Shoulders", new List<int> { ItemBuilder.ItemIds["club"] }, new List<int>
			{
				CodeShortcuts.LichyTriggerFingerId,
				CodeShortcuts.GunknightGauntletId,
				CodeShortcuts.RobotsLeftHandId,
				CodeShortcuts.MegahandId,
				CodeShortcuts.FlameHandId,
				CodeShortcuts.LaserSightId
			});
			SynergyBuilder.CreateSynergy("Cacti Launcher II", new List<int> { ItemBuilder.ItemIds["club"] }, new List<int>
			{
				CodeShortcuts.Plus1BulletsId,
				CodeShortcuts.AmuletOfThePitLordId,
				CodeShortcuts.UtilityBeltId,
				CodeShortcuts.DuctTapeId,
				CodeShortcuts.CactusId,
				CodeShortcuts.BroccoliId
			});
			SynergyBuilder.CreateSynergy("Fully Unlocked", new List<int>
			{
				ItemBuilder.ItemIds["bosschest"],
				CodeShortcuts.ShelletonKeyId
			});
			SynergyBuilder.CreateSynergy("while(true) { }", new List<int> { ItemBuilder.ItemIds["nank"] }, new List<int>
			{
				CodeShortcuts.IceBombId,
				CodeShortcuts.FrostGiantId,
				CodeShortcuts.FrostBulletsId,
				CodeShortcuts.FrostAmmoletId,
				CodeShortcuts.Cold45Id,
				CodeShortcuts.PolarisId,
				CodeShortcuts.HeartOfIceId,
				CodeShortcuts.IceCubeId,
				CodeShortcuts.IceBreakerId,
				CodeShortcuts.FreezeRayId
			});
			SynergyBuilder.CreateSynergy("NullReferenceException", new List<int> { ItemBuilder.ItemIds["nank"] }, new List<int>
			{
				CodeShortcuts.DragunfireId,
				CodeShortcuts.FlameHandId,
				CodeShortcuts.PitchforkId,
				CodeShortcuts.DemonHeadId,
				CodeShortcuts.PhoenixId,
				CodeShortcuts.HotLeadId,
				CodeShortcuts.RingOfFireResistanceId
			});
			SynergyBuilder.CreateSynergy("Mono.dll has caused an Access Violation", new List<int> { ItemBuilder.ItemIds["nank"] }, new List<int>
			{
				CodeShortcuts.GrapplingHookId,
				CodeShortcuts.LilBomberId,
				CodeShortcuts.BombId,
				CodeShortcuts.IbombCompanionAppId
			});
			SynergyBuilder.CreateSynergy("Frogs are Friends", new List<int>
			{
				ItemBuilder.ItemIds["frogun"],
				CodeShortcuts.ReallySpecialLuteId
			});
			SynergyBuilder.CreateSynergy("Revenge", new List<int>
			{
				ItemBuilder.ItemIds["frogun"],
				CodeShortcuts.FaceMelterId
			});
			SynergyBuilder.CreateSynergy("Gun and Bullets", new List<int>
			{
				ItemBuilder.ItemIds["lichgun"],
				CodeShortcuts.LichsEyeBulletsId
			}, null, activeWhenGunsUnequipped: true, null, ignoreLichsEyeBullets: true).bonusSynergies.Add(ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.specialstuffpack", "GunAndBullets"));
			SynergyBuilder.CreateSynergy("Flatter Flat Bullets", new List<int> { ItemBuilder.ItemIds["flatbullets"] }, new List<int>(collection), activeWhenGunsUnequipped: true, new List<StatModifier> { CodeShortcuts.CreateCustomStatModifier("UnscaledFlatDamage", 1f, (ModifyMethod)1) });
			SynergyBuilder.CreateSynergy("SpecialUtils", new List<int> { ItemBuilder.ItemIds["boxofstuff"] }, new List<int>
			{
				CodeShortcuts.PeaShooterId,
				CodeShortcuts.ThirtyEightSpecialId,
				CodeShortcuts.DerringerId,
				CodeShortcuts.MakarovId,
				CodeShortcuts.DuelingPistolId,
				CodeShortcuts.TurboGunId,
				CodeShortcuts.ScreecherId,
				CodeShortcuts.NailGunId,
				CodeShortcuts.WoodBeamId,
				CodeShortcuts.TheKilnId,
				CodeShortcuts.BuzzkillId,
				CodeShortcuts.TearJerkerId,
				CodeShortcuts.QuadLaserId,
				CodeShortcuts.CactusId,
				CodeShortcuts.KlobbeId,
				CodeShortcuts.TrashcannonId
			});
			SynergyBuilder.CreateSynergy("QoL", new List<int> { ItemBuilder.ItemIds["boxofstuff"] }, new List<int>
			{
				CodeShortcuts.ArmorSynthesizerId,
				CodeShortcuts.AmmoSynthesizerId,
				CodeShortcuts.ExplosiveRoundsId,
				CodeShortcuts.SprunId,
				ItemBuilder.ItemIds["mirrorbullet"],
				CodeShortcuts.HighDragunfireId
			});
			SynergyBuilder.CreateSynergy("Hotter Kiln", new List<int>
			{
				ItemBuilder.ItemIds["hotcoal"],
				CodeShortcuts.TheKilnId
			}, null, activeWhenGunsUnequipped: false);
			SynergyBuilder.CreateSynergy("When the shotgun is sus!", new List<int> { ItemBuilder.ItemIds["sus_shotgun"] }, new List<int>
			{
				CodeShortcuts.BackpackId,
				CodeShortcuts.MoonscraperId,
				CodeShortcuts.DungeonEagleId,
				CodeShortcuts.JetpackId,
				CodeShortcuts.BlastHelmetId,
				CodeShortcuts.KnifeShieldId
			}).bonusSynergies.Add(ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.specialstuffpack", "WhenTheShotgunIsSus"));
			SynergyBuilder.CreateSynergy("Rainbuddy", new List<int> { ItemBuilder.ItemIds["sus_shotgun"] }, new List<int>
			{
				CodeShortcuts.BabyGoodShelletonId,
				CodeShortcuts.BabyGoodMimicId,
				CodeShortcuts.ChickenFluteId,
				CodeShortcuts.OwlId,
				CodeShortcuts.R2g2Id
			}, activeWhenGunsUnequipped: false, new List<StatModifier>
			{
				CodeShortcuts.CreateStatMod((StatType)5, (ModifyMethod)0, 0.25f),
				CodeShortcuts.CreateStatMod((StatType)15, (ModifyMethod)0, 0.25f)
			});
			SynergyBuilder.CreateSynergy("Bow-Bow", new List<int> { ItemBuilder.ItemIds["sus_shotgun"] }, new List<int>
			{
				CodeShortcuts.BowId,
				CodeShortcuts.CharmedBowId,
				CodeShortcuts.ShotbowId,
				CodeShortcuts.CrescentCrossbowId,
				CodeShortcuts.StickyCrossbowId,
				CodeShortcuts.TripleCrossbowId,
				CodeShortcuts.GunbowId
			}, activeWhenGunsUnequipped: false, new List<StatModifier>
			{
				CodeShortcuts.CreateStatMod((StatType)5, (ModifyMethod)0, 0.125f),
				CodeShortcuts.CreateStatMod((StatType)15, (ModifyMethod)0, 0.125f),
				CodeShortcuts.CreateStatMod((StatType)25, (ModifyMethod)0, 0.25f)
			});
			SynergyBuilder.CreateSynergy("RAINBOW!!!", new List<int> { ItemBuilder.ItemIds["sus_shotgun"] }, new List<int>
			{
				CodeShortcuts.UnicornHornId,
				CodeShortcuts.StuffedStarId,
				ItemBuilder.ItemIds["totem"],
				CodeShortcuts.ChaosBulletsId,
				ItemBuilder.ItemIds["chaos"],
				CodeShortcuts.ChaosAmmoletId
			}, activeWhenGunsUnequipped: false, new List<StatModifier>
			{
				CodeShortcuts.CreateStatMod((StatType)5, (ModifyMethod)0, 0.25f),
				CodeShortcuts.CreateStatMod((StatType)15, (ModifyMethod)0, 0.25f)
			});
			SynergyBuilder.CreateSynergy("Bane Gun", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.TheMembraneId,
				CodeShortcuts.PlaguePistolId,
				CodeShortcuts.PlungerId,
				CodeShortcuts.PoxcannonId,
				CodeShortcuts.GammaRayId,
				CodeShortcuts.RattlerId,
				CodeShortcuts.ShotgunFullOfHateId,
				CodeShortcuts.ShotgrubId,
				CodeShortcuts.PoisonVialId,
				CodeShortcuts.IrradiatedLeadId,
				CodeShortcuts.UraniumAmmoletId,
				CodeShortcuts.MonsterBloodId,
				CodeShortcuts.BugBootsId,
				CodeShortcuts.GasMaskId,
				CodeShortcuts.HazmatSuitId
			});
			SynergyBuilder.CreateSynergy("Vampiric Gun", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.BloodBroochId,
				CodeShortcuts.PinkGuonStoneId,
				ItemBuilder.ItemIds["heartpiece"],
				CodeShortcuts.AntibodyId,
				CodeShortcuts.LifeOrbId,
				CodeShortcuts.MutationId,
				CodeShortcuts.SuperMeatGunId,
				CodeShortcuts.BloodiedScarfId
			});
			SynergyBuilder.CreateSynergy("Necromantic Gun", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.Vertebraek47Id,
				CodeShortcuts.SkullSpitterId,
				CodeShortcuts.GunslingersAshesId,
				CodeShortcuts.MeltedRockId,
				CodeShortcuts.GhostBulletsId,
				CodeShortcuts.ZombieBulletsId,
				CodeShortcuts.ProtonBackpackId,
				CodeShortcuts.ShelletonKeyId,
				CodeShortcuts.BabyGoodShelletonId,
				CodeShortcuts.ShellegunId
			});
			SynergyBuilder.CreateSynergy("Zealous Gun", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.EyeOfTheBeholsterId,
				CodeShortcuts.RollingEyeId,
				CodeShortcuts.BloodyEyeId,
				CodeShortcuts.TableTechSightId,
				CodeShortcuts.GungeonBlueprintId,
				CodeShortcuts.SunglassesId,
				CodeShortcuts.MimicToothNecklaceId,
				CodeShortcuts.CharmingRoundsId,
				CodeShortcuts.LamentConfigurumId
			});
			SynergyBuilder.CreateSynergy("Merciless Gun", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.VorpalGunId,
				CodeShortcuts.VorpalBulletsId,
				CodeShortcuts.Bloody9MmId,
				CodeShortcuts.TableTechRageId,
				CodeShortcuts.AngryBulletsId,
				CodeShortcuts.CogOfBattleId,
				CodeShortcuts.ShadowBulletsId,
				CodeShortcuts.GoldAmmoletId,
				CodeShortcuts.WoodBeamId,
				CodeShortcuts.HyperLightBlasterId
			});
			SynergyBuilder.CreateSynergy("Godly Gun", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.RubensteinsMonsterId,
				CodeShortcuts.HighDragunfireId,
				CodeShortcuts.FinishedGunId,
				CodeShortcuts.CloneId
			}, activeWhenGunsUnequipped: true, null, ignoreLichsEyeBullets: true);
			SynergyBuilder.CreateSynergy("Might of the Devout", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.Plus1BulletsId,
				CodeShortcuts.BroccoliId,
				CodeShortcuts.RiddleOfLeadId,
				CodeShortcuts.RailgunId,
				CodeShortcuts.LichyTriggerFingerId,
				CodeShortcuts.AmuletOfThePitLordId,
				CodeShortcuts.MagicSweetId
			}, activeWhenGunsUnequipped: false, new List<StatModifier> { CodeShortcuts.CreateStatMod((StatType)5, (ModifyMethod)1, 1.25f) });
			SynergyBuilder.CreateSynergy("Hearts of the Faithful", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				CodeShortcuts.HeartHolsterId,
				CodeShortcuts.HeartLunchboxId,
				CodeShortcuts.HeartLocketId,
				CodeShortcuts.HeartBottleId,
				CodeShortcuts.HeartPurseId,
				CodeShortcuts.HeartOfIceId
			}, activeWhenGunsUnequipped: true, new List<StatModifier> { CodeShortcuts.CreateStatMod((StatType)3, (ModifyMethod)0, 0.5f) });
			SynergyBuilder.CreateSynergy("Cheap Rituals", new List<int> { ItemBuilder.ItemIds["red_gun"] }, new List<int>
			{
				ItemBuilder.ItemIds["legitcoupon"],
				CodeShortcuts.TurkeyId,
				CodeShortcuts.GildedBulletsId,
				CodeShortcuts.MicrotransactionGunId,
				ItemBuilder.ItemIds["paytowin"],
				CodeShortcuts.IronCoinId,
				CodeShortcuts.SmileysRevolverId,
				CodeShortcuts.RingOfMiserlyProtectionId,
				CodeShortcuts.EscapeRopeId
			});
			SynergyBuilder.CreateSynergy("Dynamite", new List<int> { ItemBuilder.ItemIds["shredder"] }, new List<int>
			{
				CodeShortcuts.ExplosiveRoundsId,
				CodeShortcuts.Com4nd0Id,
				CodeShortcuts.RpgId,
				CodeShortcuts.YariLauncherId,
				CodeShortcuts.BombId,
				CodeShortcuts.GrenadeLauncherId,
				CodeShortcuts.ClusterMineId,
				CodeShortcuts.ProximityMineId,
				CodeShortcuts.C4Id,
				CodeShortcuts.AirStrikeId
			});
			SynergyBuilder.CreateSynergy("Plastic Explosive", new List<int> { ItemBuilder.ItemIds["shredder"] }, new List<int>
			{
				CodeShortcuts.FatBulletsId,
				CodeShortcuts.BigShotgunId,
				CodeShortcuts.HeavyBulletsId,
				CodeShortcuts.BlastHelmetId,
				CodeShortcuts.SeriousCannonId,
				CodeShortcuts.RailgunId,
				CodeShortcuts.RcRocketId,
				CodeShortcuts.VulcanCannonId,
				CodeShortcuts.BigBoyId,
				CodeShortcuts.BigIronId
			});
			SynergyBuilder.CreateSynergy("Shredder II", new List<int> { ItemBuilder.ItemIds["shredder"] }, new List<int>
			{
				CodeShortcuts.Plus1BulletsId,
				CodeShortcuts.AmuletOfThePitLordId,
				CodeShortcuts.UtilityBeltId,
				CodeShortcuts.DuctTapeId,
				CodeShortcuts.BroccoliId
			});
			SynergyBuilder.CreateSynergy("Good Game Design", new List<int>
			{
				ItemBuilder.ItemIds["infinitycrystal"],
				CodeShortcuts.MicrotransactionGunId
			});
			SynergyBuilder.CreateSynergy("Enter the Gungeon 2", new List<int> { ItemBuilder.ItemIds["dlchest"] }, new List<int>
			{
				CodeShortcuts.BookOfChestAnatomyId,
				CodeShortcuts.RingOfChestFriendshipId,
				CodeShortcuts.ChestTeleporterId,
				CodeShortcuts.RingOfChestVampirismId,
				CodeShortcuts.RingOfMimicFriendshipId,
				CodeShortcuts.MicrotransactionGunId
			});
			SynergyBuilder.CreateSynergy("50% OFF ON ALL DLCHESTS!", new List<int>
			{
				ItemBuilder.ItemIds["dlchest"],
				ItemBuilder.ItemIds["paytowin"]
			});
			SynergyBuilder.CreateSynergy("True Knight", new List<int> { ItemBuilder.ItemIds["marinehelmet"] }, new List<int>
			{
				CodeShortcuts.GunknightArmorId,
				CodeShortcuts.GunknightGauntletId,
				CodeShortcuts.GunknightGreavesId,
				CodeShortcuts.GunknightHelmetId,
				CodeShortcuts.OldKnightsHelmId,
				CodeShortcuts.OldKnightsShieldId,
				CodeShortcuts.BlastHelmetId,
				CodeShortcuts.ArmorOfThornsId,
				CodeShortcuts.HeavyBootsId,
				CodeShortcuts.KnightsGunId
			});
			SynergyBuilder.CreateSynergy("A Little More", new List<int> { ItemBuilder.ItemIds["totem"] }, new List<int>
			{
				CodeShortcuts.BulletIdolId,
				CodeShortcuts.SprunId,
				CodeShortcuts.CogOfBattleId
			});
			SynergyBuilder.CreateSynergy("Wrath of the Keys", new List<int> { ItemBuilder.ItemIds["plushie"] }, new List<int>
			{
				CodeShortcuts.AngryBulletsId,
				CodeShortcuts.HomingBulletsId
			});
			SynergyBuilder.CreateSynergy("Keybag", new List<int> { ItemBuilder.ItemIds["plushie"] }, new List<int>
			{
				CodeShortcuts.LootBagId,
				CodeShortcuts.BackpackId,
				CodeShortcuts.ResourcefulSackId,
				ItemBuilder.ItemIds["magicbag"]
			});
			SynergyBuilder.CreateSynergy("Ring of Lock Friendship", new List<int> { ItemBuilder.ItemIds["plushie"] }, new List<int>
			{
				CodeShortcuts.RingOfChestFriendshipId,
				CodeShortcuts.RingOfChestVampirismId,
				CodeShortcuts.RingOfEtherealFormId,
				CodeShortcuts.RingOfFireResistanceId,
				CodeShortcuts.RingOfMiserlyProtectionId,
				CodeShortcuts.RingOfMimicFriendshipId
			});
			SynergyBuilder.CreateSynergy("Rusty Shovel", new List<int>
			{
				ItemBuilder.ItemIds["rustybullets"],
				ItemBuilder.ItemIds["gravediggershovel"]
			});
			SynergyBuilder.CreateSynergy("Rusty Iron", new List<int>
			{
				ItemBuilder.ItemIds["rustybullets"],
				CodeShortcuts.BigIronId
			}, null, activeWhenGunsUnequipped: false);
			SynergyBuilder.CreateSynergy("Rusty Coin", new List<int>
			{
				ItemBuilder.ItemIds["rustybullets"],
				CodeShortcuts.IronCoinId
			});
			SynergyBuilder.CreateSynergy("Snake Eyes", new List<int>
			{
				ItemBuilder.ItemIds["woodendice"],
				CodeShortcuts.SnakemakerId
			});
			SynergyBuilder.CreateSynergy("Gambling Addiction", new List<int>
			{
				ItemBuilder.ItemIds["woodendice"],
				CodeShortcuts.ChanceBulletsId
			});
			SynergyBuilder.CreateSynergy("Midnight", new List<int>
			{
				ItemBuilder.ItemIds["woodendice"],
				CodeShortcuts.SixthChamberId
			});
			SynergyBuilder.CreateSynergy("Recycling at its Finest", new List<int> { ItemBuilder.ItemIds["rustyammobox"] }, new List<int>
			{
				CodeShortcuts.AmmoSynthesizerId,
				CodeShortcuts.AmmoBeltId,
				CodeShortcuts.UtilityBeltId,
				CodeShortcuts.HipHolsterId
			});
			SynergyBuilder.CreateSynergy("Magnum Mox", new List<int>
			{
				ItemBuilder.ItemIds["magnificus"],
				CodeShortcuts.MagnumId
			}).bonusSynergies.Add(ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.specialstuffpack", "MagnumMox"));
			SynergyBuilder.CreateSynergy("The Goo Mage", new List<int> { ItemBuilder.ItemIds["magnificus"] }, new List<int> { CodeShortcuts.PoisonVialId });
			SynergyBuilder.CreateSynergy("The Pike Mage", new List<int> { ItemBuilder.ItemIds["magnificus"] }, new List<int> { CodeShortcuts.PitchforkId });
			SynergyBuilder.CreateSynergy("The Lonely Mage", new List<int> { ItemBuilder.ItemIds["magnificus"] }, new List<int> { CodeShortcuts.RingOfEtherealFormId });
			SynergyBuilder.CreateSynergy("Advanced, Feature-Rich Interactive", new List<int>
			{
				ItemBuilder.ItemIds["soundengine"],
				ItemBuilder.ItemIds["ugly_gun"]
			});
			SynergyBuilder.CreateSynergy("SPIN", new List<int> { ItemBuilder.ItemIds["asteroidbelt"] }, new List<int>
			{
				ItemBuilder.ItemIds["revolvever"],
				ItemBuilder.ItemIds["akpi"],
				CodeShortcuts.MrAccretionJrId
			});
			SynergyBuilder.CreateSynergy("Planetary Travel", new List<int> { ItemBuilder.ItemIds["asteroidbelt"] }, new List<int>
			{
				CodeShortcuts.MoonscraperId,
				CodeShortcuts.ElimentalerId,
				CodeShortcuts.PartiallyEatenCheeseId
			});
			SynergyBuilder.CreateSynergy("Orbital Orbit", new List<int>
			{
				ItemBuilder.ItemIds["asteroidbelt"],
				CodeShortcuts.OrbitalBulletsId
			});
			SynergyBuilder.CreateSynergy("A Modder's Worst Nightmare", new List<int> { ItemBuilder.ItemIds["consolecontroller"] }, new List<int>
			{
				CodeShortcuts.DirectionalPadId,
				CodeShortcuts.ThirdPartyControllerId
			});
			SynergyBuilder.CreateSynergy("It Guards Time!", new List<int> { ItemBuilder.ItemIds["guardianbook"] }, new List<int>
			{
				CodeShortcuts.SuperHotWatchId,
				ItemBuilder.ItemIds["calendar"],
				CodeShortcuts.SunglassesId,
				CodeShortcuts.BlueGuonStoneId,
				CodeShortcuts.TableTechSightId
			});
			SynergyBuilder.CreateSynergy("Coming Soon (tm)", new List<int>
			{
				ItemBuilder.ItemIds["plushie"],
				ItemBuilder.ItemIds["keytobeyond"]
			});
			SynergyBuilder.CreateSynergy("Extra Spicy Sauce", new List<int>
			{
				ItemBuilder.ItemIds["hotcoal"],
				ItemBuilder.ItemIds["hotsauce"]
			});
			SynergyBuilder.CreateSynergy("Ignorance", new List<int> { ItemBuilder.ItemIds["brokenmask"] }, new List<int>
			{
				CodeShortcuts.CoinCrownId,
				CodeShortcuts.GildedBulletsId,
				CodeShortcuts.GildedHydraId,
				ItemBuilder.ItemIds["brokenmask"],
				ItemBuilder.ItemIds["emerald"],
				ItemBuilder.ItemIds["diamond"],
				ItemBuilder.ItemIds["ruby"],
				ItemBuilder.ItemIds["amethyst"]
			});
			SynergyBuilder.CreateSynergy("Humour", new List<int> { ItemBuilder.ItemIds["brokenmask"] }, new List<int>
			{
				CodeShortcuts.HexagunId,
				CodeShortcuts.BundleOfWandsId,
				CodeShortcuts.MagicBulletsId,
				CodeShortcuts.WitchPistolId,
				CodeShortcuts.StaffOfFirepowerId,
				ItemBuilder.ItemIds["opal"]
			});
			SynergyBuilder.CreateSynergy("Nihilism", new List<int> { ItemBuilder.ItemIds["brokenmask"] }, new List<int>
			{
				CodeShortcuts.TheFatLineId,
				CodeShortcuts.ScienceCannonId,
				CodeShortcuts.RubeAdyneMk2Id,
				CodeShortcuts.RubeAdynePrototypeId,
				CodeShortcuts.BlackHoleGunId,
				ItemBuilder.ItemIds["aquamarine"]
			});
			SynergyBuilder.CreateSynergy("Scared", new List<int> { ItemBuilder.ItemIds["brokenmask"] }, new List<int>
			{
				CodeShortcuts.ZombieBulletsId,
				CodeShortcuts.Vertebraek47Id,
				CodeShortcuts.SkullSpitterId,
				CodeShortcuts.ShelletonKeyId,
				CodeShortcuts.ShellegunId
			});
			SynergyBuilder.CreateSynergy("Stoic", new List<int> { ItemBuilder.ItemIds["brokenmask"] }, new List<int>
			{
				ItemBuilder.ItemIds["frogun"],
				CodeShortcuts.ReallySpecialLuteId,
				CodeShortcuts.FaceMelterId,
				CodeShortcuts.MahogunyId,
				CodeShortcuts.AngryBulletsId,
				CodeShortcuts.BubbleBlasterId,
				CodeShortcuts.EvolverId
			});
			SynergyBuilder.CreateSynergy("A Better Fate", new List<int> { ItemBuilder.ItemIds["leaderdeck"] }, new List<int>
			{
				ItemBuilder.ItemIds["magnificus"],
				CodeShortcuts.SevenLeafCloverId,
				CodeShortcuts.Plus1BulletsId
			});
			SynergyBuilder.CreateSynergy("Double Anvil", new List<int> { ItemBuilder.ItemIds["anvil"] }, new List<int> { CodeShortcuts.AnvillainId });
			SynergyBuilder.CreateSynergy("Expert Blacksmith", new List<int> { ItemBuilder.ItemIds["anvil"] }, new List<int> { CodeShortcuts.CobaltHammerId });
			SynergyBuilder.CreateSynergy("Arms Dealer", new List<int> { ItemBuilder.ItemIds["anvil"] }, new List<int>
			{
				CodeShortcuts.DuelingPistolId,
				CodeShortcuts.MachinePistolId,
				CodeShortcuts.PlaguePistolId,
				CodeShortcuts.WitchPistolId,
				ItemBuilder.ItemIds["pistolwhip"]
			});
			SynergyBuilder.SetupDualWieldSynergy("Rotato Potato", ItemBuilder.Guns["revolvever"], ItemBuilder.Guns["akpi"]);
			ItemBuilder.Guns["frogun"].AddHoveringGunSynergyProcessor("Frogs are Friends", 506, usesMultipleGuns: false, null, (HoverPosition)1, (AimType)1, (FireType)3, 0.5f, -1f, onlyOnEmptyReload: false, "", "", "", (TriggerStyle)0, 1, -1f, consumesTargetGunAmmo: false, 0f);
			ItemBuilder.Guns["frogun"].AddHoveringGunSynergyProcessor("Revenge", 149, usesMultipleGuns: false, null, (HoverPosition)1, (AimType)1, (FireType)0, 0.2f, 0f, onlyOnEmptyReload: false, "", "", "", (TriggerStyle)0, 1, -1f, consumesTargetGunAmmo: false, 0f);
			MiscSynergyProcessor miscSynergyProcessor = ((Component)(object)CodeShortcuts.MicrotransactionGunObject).AddComponent<MiscSynergyProcessor>();
			miscSynergyProcessor.synergy = "Good Game Design";
			miscSynergyProcessor.toggleFundsToShoot = true;
			CodeShortcuts.MicrotransactionGunObject.ammo = CodeShortcuts.MicrotransactionGunObject.maxAmmo;
			((Component)(object)ItemBuilder.Guns["catapult"]).AddComponent<AdvancedDualWieldSynergyProcessor>();
			SynergyBuilder.SetupDualWieldSynergy("Killing 1 Bird With 2 Stones", ItemBuilder.Guns["catapult"], CodeShortcuts.SlingObject);
			List<StatModifier> list = new List<StatModifier>();
			if (DateTime.Now.DayOfWeek == DayOfWeek.Monday)
			{
				list.Add(StatModifier.Create((StatType)0, (ModifyMethod)0, -3f));
				list.Add(StatModifier.Create((StatType)5, (ModifyMethod)0, 0.5f));
			}
			else
			{
				list.Add(StatModifier.Create((StatType)0, (ModifyMethod)0, 1f));
			}
			SynergyBuilder.CreateSynergy("I Hate Mondays", new List<int> { ItemBuilder.ItemIds["calendar"] }, new List<int>
			{
				CodeShortcuts.ShotgunFullOfHateId,
				CodeShortcuts.TableTechRageId
			}, activeWhenGunsUnequipped: true, list);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)337, ItemBuilder.ItemIds["greencandle"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)299, ItemBuilder.ItemIds["greencandle"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)67, ItemBuilder.ItemIds["bombammolet"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)98, ItemBuilder.ItemIds["bombammolet"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)67, ItemBuilder.ItemIds["redammolet"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)98, ItemBuilder.ItemIds["redammolet"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)297, ItemBuilder.ItemIds["energydrink"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)322, ItemBuilder.ItemIds["energydrink"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)278, ItemBuilder.ItemIds["energydrink"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)293, ItemBuilder.ItemIds["energydrink"]);
			SynergyBuilder.AddItemToSynergy((CustomSynergyType)305, ItemBuilder.ItemIds["rustyammobox"]);
			SynergyBuilder.AddItemToSynergy("#GARBAGE", ItemBuilder.ItemIds["soundengine"]);
			((Component)(object)PickupObjectDatabase.GetById(476)).AddComponent<MicrotransactionDiscountSynergyController>().SynergyToCheck = "25% OFF ON ALL IN-GAME PURCHASES!";
			new Hook((MethodBase)typeof(Gun).GetMethod("DecrementAmmoCost", BindingFlags.Instance | BindingFlags.NonPublic), typeof(MicrotransactionDiscountSynergyController).GetMethod("MaybeReduceCost"));
		}
	}
	public class TCultistController : PlayerController
	{
		public bool canHold;

		public override void Update()
		{
			((PlayerController)this).Update();
			if ((Object)(object)((BraveBehaviour)this).specRigidbody != (Object)null && GameManager.HasInstance && (Object)(object)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this) != (Object)null && (Object)(object)((BraveBehaviour)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this)).specRigidbody != (Object)null && PhysicsEngine.HasInstance)
			{
				List<SpeculativeRigidbody> overlappingRigidbodies = PhysicsEngine.Instance.GetOverlappingRigidbodies(((BraveBehaviour)this).specRigidbody, (int?)null, false);
				if (overlappingRigidbodies != null && overlappingRigidbodies.Contains(((BraveBehaviour)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this)).specRigidbody))
				{
					((BraveBehaviour)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this)).specRigidbody.RegisterGhostCollisionException(((BraveBehaviour)this).specRigidbody);
					((BraveBehaviour)this).specRigidbody.RegisterGhostCollisionException(((BraveBehaviour)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this)).specRigidbody);
				}
			}
			if (canHold && BraveInput.HasInstanceForPlayer(0) && (Object)(object)BraveInput.GetInstanceForPlayer(0) != (Object)null && (Object)(object)BraveInput.GetInstanceForPlayer(0).SpecialInput() != (Object)null && BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions != null && ((OneAxisInputControl)BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions.HoldSecondPlayerAction).IsPressed)
			{
				base.IsStationary = true;
			}
			else if (canHold && BraveInput.HasInstanceForPlayer(0) && (Object)(object)BraveInput.GetInstanceForPlayer(0) != (Object)null && (Object)(object)BraveInput.GetInstanceForPlayer(0).SpecialInput() != (Object)null && BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions != null && ((OneAxisInputControl)BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions.HoldSecondPlayerAction).WasReleased)
			{
				base.IsStationary = false;
			}
		}

		public override Vector2 HandlePlayerInput()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			Vector2 result = ((PlayerController)this).HandlePlayerInput();
			if ((canHold && BraveInput.HasInstanceForPlayer(0) && (Object)(object)BraveInput.GetInstanceForPlayer(0) != (Object)null && (Object)(object)BraveInput.GetInstanceForPlayer(0).SpecialInput() != (Object)null && BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions != null && ((OneAxisInputControl)BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions.HoldSecondPlayerAction).IsPressed) || ((Object)(object)((BraveBehaviour)this).specRigidbody != (Object)null && GameManager.HasInstance && (Object)(object)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this) != (Object)null && (Object)(object)((BraveBehaviour)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this)).specRigidbody != (Object)null && ((BraveBehaviour)this).specRigidbody.GhostCollisionExceptions != null && ((BraveBehaviour)this).specRigidbody.GhostCollisionExceptions.Contains(((BraveBehaviour)GameManager.Instance.GetOtherPlayer((PlayerController)(object)this)).specRigidbody)))
			{
				return Vector2.zero;
			}
			return result;
		}
	}
	public class TCultistHandler
	{
		public static void Init()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			ETGModConsole.Commands.AddUnit("tcultist_test", (Action<string[]>)delegate(string[] args)
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Expected O, but got Unknown
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					PlayerController[] allPlayers = GameManager.Instance.AllPlayers;
					foreach (PlayerController val in allPlayers)
					{
						string text = "Gunslinger";
						if (args.Length != 0)
						{
							text = args[0];
						}
						GameObject val2 = Object.Instantiate<GameObject>((GameObject)BraveResources.Load("Player" + text, ".prefab"), ((BraveBehaviour)val).transform.position, ((BraveBehaviour)val).transform.rotation);
						Transform transform = val2.transform;
						transform.position += new Vector3(1f, 0f, 0f);
						PlayerController component = val2.GetComponent<PlayerController>();
						((BraveBehaviour)val).specRigidbody.AddCollisionLayerOverride(CollisionMask.LayerToMask((CollisionLayer)1));
						((BraveBehaviour)val).specRigidbody.AddCollisionLayerOverride(CollisionMask.LayerToMask((CollisionLayer)0));
						((BraveBehaviour)component).specRigidbody.AddCollisionLayerOverride(CollisionMask.LayerToMask((CollisionLayer)1));
						((BraveBehaviour)component).specRigidbody.AddCollisionLayerOverride(CollisionMask.LayerToMask((CollisionLayer)0));
						TCultistController tCultistController = ReplacePlayerControllerWithTCC(component);
						((PlayerController)tCultistController).PlayerIDX = 1;
						val2.SetActive(true);
						GameManager.Instance.RefreshAllPlayers();
						GameManager.Instance.SecondaryPlayer = (PlayerController)(object)tCultistController;
						GameManager.Instance.PrimaryPlayer = val;
						tCultistController.canHold = true;
						GameUIRoot.Instance.ConvertCoreUIToCoopMode();
						typeof(BraveInput).GetField("m_playerID", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(BraveInput.GetInstanceForPlayer(1), 0);
					}
				}
				catch (Exception ex)
				{
					ETGModConsole.Log((object)("error: " + ex), false);
				}
			});
			new Hook((MethodBase)typeof(GameManager).GetProperty("SecondaryPlayer").GetGetMethod(), typeof(TCultistHandler).GetMethod("SecondaryPlayerButGood"));
			new Hook((MethodBase)typeof(GameManager).GetMethod("GetOtherPlayer"), typeof(TCultistHandler).GetMethod("GetOtherPlayerButGood"));
			new Hook((MethodBase)typeof(GameUIRoot).GetMethod("UpdateGunData"), typeof(TCultistHandler).GetMethod("UpdateGunDataButGood"));
			new Hook((MethodBase)typeof(GameUIRoot).GetMethod("UpdateItemData"), typeof(TCultistHandler).GetMethod("UpdateItemDataButGood"));
			new Hook((MethodBase)typeof(PlayerController).GetMethod("ReuniteWithOtherPlayer"), typeof(TCultistHandler).GetMethod("GhostCollisionExceptionOnReunite"));
			new Hook((MethodBase)typeof(RoomHandler).GetMethod("OnEntered", BindingFlags.Instance | BindingFlags.NonPublic), typeof(TCultistHandler).GetMethod("ReuniteWithOtherPlayerOnEnterWithEnemies"));
			new Hook((MethodBase)typeof(PlayerStats).GetMethod("RecalculateStatsInternal", BindingFlags.Instance | BindingFlags.Public), typeof(TCultistHandler).GetMethod("RecalculateStatsRecursive"));
			new Hook((MethodBase)typeof(DodgeRollStats).GetMethod("GetModifiedTime", BindingFlags.Instance | BindingFlags.Public), typeof(TCultistHandler).GetMethod("BalanceModifiedTime"));
			new Hook((MethodBase)typeof(DodgeRollStats).GetMethod("GetModifiedDistance", BindingFlags.Instance | BindingFlags.Public), typeof(TCultistHandler).GetMethod("BalanceModifiedDistance"));
			new Hook((MethodBase)typeof(OneAxisInputControl).GetProperty("WasPressed", BindingFlags.Instance | BindingFlags.Public).GetGetMethod(), typeof(TCultistHandler).GetMethod("WasPressedOverride"));
			new Hook((MethodBase)typeof(OneAxisInputControl).GetProperty("IsPressed", BindingFlags.Instance | BindingFlags.Public).GetGetMethod(), typeof(TCultistHandler).GetMethod("IsPressedOverride"));
			new Hook((MethodBase)typeof(OneAxisInputControl).GetProperty("WasReleased", BindingFlags.Instance | BindingFlags.Public).GetGetMethod(), typeof(TCultistHandler).GetMethod("WasReleasedOverride"));
		}

		public static bool CheckOverridePressedValue(OneAxisInputControl self, out bool value)
		{
			bool flag = false;
			bool flag2 = false;
			if (self != null && BraveInput.HasInstanceForPlayer(1) && BraveInput.HasInstanceForPlayer(0) && (Object)(object)BraveInput.GetInstanceForPlayer(1) != (Object)null && BraveInput.GetInstanceForPlayer(1).ActiveActions != null && (Object)(object)BraveInput.GetInstanceForPlayer(0) != (Object)null && BraveInput.GetInstanceForPlayer(0).ActiveActions != null && GameManager.HasInstance && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) is TCultistController)
			{
				GungeonActions activeActions = BraveInput.GetInstanceForPlayer(0).ActiveActions;
				GungeonActions activeActions2 = BraveInput.GetInstanceForPlayer(1).ActiveActions;
				flag = self == activeActions.EquipmentMenuAction || self == activeActions.UseItemAction || self == activeActions.ItemUpAction || self == activeActions.ItemDownAction || self == activeActions.GunQuickEquipAction || self == activeActions.GunDownAction || self == activeActions.GunUpAction || self == activeActions.BlankAction;
				if (!flag)
				{
					if (self == activeActions2.PauseAction || self == activeActions2.CancelAction)
					{
						value = false;
						return true;
					}
					flag = self == activeActions2.EquipmentMenuAction || self == activeActions2.UseItemAction || self == activeActions2.ItemUpAction || self == activeActions2.ItemDownAction || self == activeActions2.GunQuickEquipAction || self == activeActions2.GunDownAction || self == activeActions2.GunUpAction || self == activeActions2.BlankAction;
					flag2 = flag;
				}
			}
			value = flag && (BraveInput.HasInstanceForPlayer(0) && (Object)(object)BraveInput.GetInstanceForPlayer(0) != (Object)null && (Object)(object)BraveInput.GetInstanceForPlayer(0).SpecialInput() != (Object)null && BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions != null && ((OneAxisInputControl)BraveInput.GetInstanceForPlayer(0).SpecialInput().ActiveActions.HoldSecondPlayerAction).IsPressed) == flag2;
			return flag;
		}

		public static bool WasReleasedOverride(Func<OneAxisInputControl, bool> orig, OneAxisInputControl self)
		{
			bool flag = orig(self);
			if (flag && CheckOverridePressedValue(self, out var value))
			{
				return value;
			}
			return flag;
		}

		public static bool IsPressedOverride(Func<OneAxisInputControl, bool> orig, OneAxisInputControl self)
		{
			bool flag = orig(self);
			if (flag && CheckOverridePressedValue(self, out var value))
			{
				return value;
			}
			return flag;
		}

		public static bool WasPressedOverride(Func<OneAxisInputControl, bool> orig, OneAxisInputControl self)
		{
			bool flag = orig(self);
			if (flag && CheckOverridePressedValue(self, out var value))
			{
				return value;
			}
			return flag;
		}

		public static float BalanceModifiedDistance(Func<DodgeRollStats, PlayerController, float> orig, DodgeRollStats self, PlayerController owner)
		{
			float num = orig(self, owner);
			if (GameManager.HasInstance && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) is TCultistController)
			{
				PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(owner);
				if ((Object)(object)otherPlayer != (Object)null && otherPlayer.rollStats != null)
				{
					float num2 = orig(otherPlayer.rollStats, otherPlayer);
					return Mathf.Lerp(num, num2, 0.5f);
				}
			}
			return num;
		}

		public static float BalanceModifiedTime(Func<DodgeRollStats, PlayerController, float> orig, DodgeRollStats self, PlayerController owner)
		{
			float num = orig(self, owner);
			if (GameManager.HasInstance && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) is TCultistController)
			{
				PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(owner);
				if ((Object)(object)otherPlayer != (Object)null && otherPlayer.rollStats != null)
				{
					float num2 = orig(otherPlayer.rollStats, otherPlayer);
					return Mathf.Lerp(num, num2, 0.5f);
				}
			}
			return num;
		}

		public static void RecalculateStatsRecursive(Action<PlayerStats, PlayerController> orig, PlayerStats self, PlayerController owner)
		{
			orig(self, owner);
			if (!GameManager.HasInstance || typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) == null || !(typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) is TCultistController))
			{
				return;
			}
			PlayerController otherPlayer = GameManager.Instance.GetOtherPlayer(owner);
			if ((Object)(object)otherPlayer != (Object)null && (Object)(object)otherPlayer.stats != (Object)null)
			{
				orig(otherPlayer.stats, otherPlayer);
				FieldInfo field = typeof(PlayerStats).GetField("StatValues", BindingFlags.Instance | BindingFlags.NonPublic);
				List<float> list = (List<float>)field.GetValue(self);
				List<float> list2 = (List<float>)field.GetValue(otherPlayer.stats);
				try
				{
					float num = list[0];
					float num2 = list2[0];
					float value = (list[0] = Mathf.Lerp(num, num2, 0.5f));
					list2[0] = value;
				}
				catch
				{
				}
			}
		}

		public static void GhostCollisionExceptionOnReunite(Action<PlayerController, PlayerController, bool> orig, PlayerController self, PlayerController other, bool useDefaultVFX)
		{
			orig(self, other, useDefaultVFX);
			if ((self is TCultistController || other is TCultistController) && (Object)(object)((BraveBehaviour)self).specRigidbody != (Object)null && (Object)(object)((BraveBehaviour)other).specRigidbody != (Object)null)
			{
				((BraveBehaviour)self).specRigidbody.RegisterGhostCollisionException(((BraveBehaviour)other).specRigidbody);
				((BraveBehaviour)other).specRigidbody.RegisterGhostCollisionException(((BraveBehaviour)self).specRigidbody);
			}
		}

		public static void ReuniteWithOtherPlayerOnEnterWithEnemies(Action<RoomHandler, PlayerController> orig, RoomHandler self, PlayerController play)
		{
			orig(self, play);
			if (((Object)(object)play != (Object)null && play is TCultistController) || (GameManager.HasInstance && (Object)(object)GameManager.Instance.GetOtherPlayer(play) != (Object)null && GameManager.Instance.GetOtherPlayer(play) is TCultistController))
			{
				List<AIActor> activeEnemies = self.GetActiveEnemies((ActiveEnemyType)1);
				if (activeEnemies != null && activeEnemies.Exists((AIActor a) => !((BraveBehaviour)a).healthHaver.IsDead))
				{
					GameManager.Instance.GetOtherPlayer(play).ReuniteWithOtherPlayer(play, false);
				}
			}
		}

		public static void UpdateItemDataButGood(Action<GameUIRoot, PlayerController, PlayerItem, List<PlayerItem>> orig, GameUIRoot root, PlayerController targetPlayer, PlayerItem item, List<PlayerItem> items)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			GameType? val = null;
			if (GameManager.HasInstance && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) is TCultistController)
			{
				val = GameManager.Instance.CurrentGameType;
				GameManager.Instance.CurrentGameType = (GameType)1;
			}
			orig(root, targetPlayer, item, items);
			if (val.HasValue)
			{
				GameManager.Instance.CurrentGameType = val.Value;
			}
		}

		public static void UpdateGunDataButGood(Action<GameUIRoot, GunInventory, int, PlayerController> orig, GameUIRoot root, GunInventory inventory, int inventoryShift, PlayerController sourcePlayer)
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			GameType? val = null;
			if (GameManager.HasInstance && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(GameManager.Instance) is TCultistController)
			{
				val = GameManager.Instance.CurrentGameType;
				GameManager.Instance.CurrentGameType = (GameType)1;
			}
			orig(root, inventory, inventoryShift, sourcePlayer);
			if (val.HasValue)
			{
				GameManager.Instance.CurrentGameType = val.Value;
			}
		}

		public static PlayerController GetOtherPlayerButGood(Func<GameManager, PlayerController, PlayerController> orig, GameManager man, PlayerController play)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			GameType? val = null;
			if (typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(man) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(man) is TCultistController)
			{
				val = man.CurrentGameType;
				man.CurrentGameType = (GameType)1;
			}
			PlayerController result = orig(man, play);
			if (val.HasValue)
			{
				man.CurrentGameType = val.Value;
			}
			return result;
		}

		public static PlayerController SecondaryPlayerButGood(Func<GameManager, PlayerController> orig, GameManager man)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			GameType? val = null;
			if (typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(man) != null && typeof(GameManager).GetField("m_secondaryPlayer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(man) is TCultistController)
			{
				val = man.CurrentGameType;
				man.CurrentGameType = (GameType)1;
			}
			PlayerController result = orig(man);
			if (val.HasValue)
			{
				man.CurrentGameType = val.Value;
			}
			return result;
		}

		public static TCultistController ReplacePlayerControllerWithTCC(PlayerController pc)
		{
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			((Component)pc).gameObject.SetActive(false);
			TCultistController tCultistController = null;
			try
			{
				tCultistController = ((Component)pc).gameObject.AddComponent<TCultistController>();
			}
			catch
			{
			}
			PropertyInfo[] properties = typeof(PlayerController).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (PropertyInfo propertyInfo in properties)
			{
				if (propertyInfo.CanRead && propertyInfo.CanWrite)
				{
					try
					{
						propertyInfo.SetValue(tCultistController, propertyInfo.GetValue(pc, new object[0]), new object[0]);
					}
					catch
					{
					}
				}
			}
			FieldInfo[] fields = typeof(PlayerController).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (FieldInfo fieldInfo in fields)
			{
				if (!fieldInfo.IsLiteral)
				{
					fieldInfo.SetValue(tCultistController, fieldInfo.GetValue(pc));
				}
			}
			((PlayerController)tCultistController).stats = ((GameObject)BraveResources.Load("PlayerGunslinger", ".prefab")).GetComponent<PlayerController>().stats;
			((GameActor)tCultistController).Awake();
			Object.DestroyImmediate((Object)(object)pc);
			((Component)tCultistController).gameObject.SetActive(true);
			return tCultistController;
		}
	}
	public static class AssetBundleManager
	{
		public class ObjectInfo
		{
			public Dictionary<string, Dictionary<string, Dictionary<string, KeyValuePair<string, string>>>> objectNames = new Dictionary<string, Dictionary<string, Dictionary<string, KeyValuePair<string, string>>>>();

			public List<string> FormatFile()
			{
				List<string> list = new List<string>();
				foreach (KeyValuePair<string, Dictionary<string, Dictionary<string, KeyValuePair<string, string>>>> objectName in objectNames)
				{
					list.Add(objectName.Key + ":" + string.Join("|", objectName.Value.ToList().ConvertAll((KeyValuePair<string, Dictionary<string, KeyValuePair<string, string>>> x) => x.Key + ":" + string.Join(",", x.Value.ToList().ConvertAll((KeyValuePair<string, KeyValuePair<string, string>> x2) => x2.Key + ":" + x2.Value.Key + "%" + x2.Value.Value).ToArray())).ToArray()));
				}
				return list;
			}

			public static ObjectInfo FromFile(List<string> file)
			{
				ObjectInfo objectInfo = new ObjectInfo
				{
					objectNames = new Dictionary<string, Dictionary<string, Dictionary<string, KeyValuePair<string, string>>>>()
				};
				int num;
				for (num = 1; num < file.Count; num++)
				{
					string text = file[num];
					if (text.Trim() == "}" || string.IsNullOrEmpty(text.Trim()))
					{
						break;
					}
					string text2 = text.Trim().Substring(text.Trim().IndexOf("\"") + 1);
					text2 = text2.Substring(0, text2.LastIndexOf("\""));
					Dictionary<string, Dictionary<string, KeyValuePair<string, string>>> dictionary = new Dictionary<string, Dictionary<string, KeyValuePair<string, string>>>();
					for (num += 2; num < file.Count; num++)
					{
						text = file[num];
						if (text.Trim() == "},")
						{
							break;
						}
						string text3 = text.Trim().Substring(text.Trim().IndexOf("\"") + 1);
						text3 = text3.Substring(0, text3.LastIndexOf("\""));
						Dictionary<string, KeyValuePair<string, string>> dictionary2 = new Dictionary<string, KeyValuePair<string, string>>();
						for (num += 2; num < file.Count; num++)
						{
							text = file[num];
							if (text.Trim() == "},")
							{
								break;
							}
							string text4 = text.Trim().Substring(text.Trim().IndexOf("\"") + 1);
							text4 = text4.Substring(0, text4.IndexOf(":"));
							text4 = text4.Substring(0, text4.LastIndexOf("\""));
							string text5 = text.Trim().Substring(text.Trim().IndexOf(":") + 1).Trim();
							text5 = text5.Substring(0, text5.LastIndexOf(","));
							string key = text5.Substring(0, text5.IndexOf("%"));
							string value = text5.Substring(text5.IndexOf("%") + 1);
							KeyValuePair<string, string> value2 = new KeyValuePair<string, string>(key, value);
							dictionary2.Add(text4, value2);
						}
						dictionary.Add(text3, dictionary2);
					}
					objectInfo.objectNames.Add(text2, dictionary);
				}
				return objectInfo;
			}

			public static Type GetTypeFromAssemblies(string name)
			{
				return (from x in (from x in AppDomain.CurrentDomain.GetAssemblies()
						select x.GetTypes()).SelectMany((Type[] x) => x)
					where x.FullName == name
					select x).FirstOrDefault();
			}

			public static object DeformatValue(KeyValuePair<string, string> value, GameObject serializedObject)
			{
				if (value.Value.StartsWith("ENUM^"))
				{
					try
					{
						return Enum.Parse(GetTypeFromAssemblies(value.Key), value.Value.Substring(value.Value.IndexOf("^") + 1));
					}
					catch
					{
						try
						{
							return ETGModCompatibility.ExtendEnum("spapi.etg.specialstuffpack", value.Value.Substring(value.Value.IndexOf("^") + 1), GetTypeFromAssemblies(value.Key));
						}
						catch
						{
							ETGModConsole.Log((object)("bad and evil enum encountered: " + value.Key + ", " + value.Value), false);
						}
					}
				}
				switch (value.Key)
				{
				case "System.Int32":
					return int.Parse(value.Value);
				case "System.Int64":
					return long.Parse(value.Value);
				case "System.Boolean":
					return bool.Parse(value.Value);
				case "System.Single":
					return float.Parse(value.Value);
				case "System.String":
					return value;
				case "System.Int16":
					return short.Parse(value.Value);
				case "System.Double":
					return double.Parse(value.Value);
				case "System.UInt16":
					return ushort.Parse(value.Value);
				case "System.UInt64":
					return ulong.Parse(value.Value);
				case "System.UInt32":
					return uint.Parse(value.Value);
				case "System.Byte":
					return byte.Parse(value.Value);
				default:
				{
					Type typeFromAssemblies = GetTypeFromAssemblies(value.Key);
					if (typeFromAssemblies.IsSubclassOf(typeof(Object)))
					{
						if (value.Value.StartsWith("?CHILD_"))
						{
							if (typeFromAssemblies.IsSubclassOf(typeof(Component)))
							{
								try
								{
									string text = value.Value.Substring(value.Value.IndexOf("_") + 1);
									text = text.Substring(value.Value.IndexOf("*"));
									return ((Component)serializedObject.GetComponentsInChildren<Transform>()[int.Parse(text)]).GetComponents(typeFromAssemblies)[int.Parse(value.Value.Substring(value.Value.IndexOf("*") + 1))];
								}
								catch
								{
									ETGModConsole.Log((object)("bad and evil child component encountered: " + value.Key + ", " + value.Value + ", " + typeFromAssemblies.FullName), false);
								}
							}
							else if ((object)typeFromAssemblies == typeof(GameObject))
							{
								try
								{
									return ((Component)serializedObject.GetComponentsInChildren<Transform>()[int.Parse(value.Value.Substring(value.Value.IndexOf("_") + 1))]).gameObject;
								}
								catch
								{
									ETGModConsole.Log((object)("bad and evil child object encountered: " + value.Key + ", " + value.Value), false);
								}
							}
						}
						return AssetBundleManager.Load<Object>(value.Value, (tk2dSpriteCollectionData)null, (string)null);
					}
					return JsonUtility.FromJson(value.Value, typeFromAssemblies);
				}
				}
			}

			public static string FormatValue(object value)
			{
				if (value is int || value is long || value is bool || value is float || value is string || value is short || value is double || value is ushort || value is ulong || value is uint)
				{
					return value.ToString().Replace(",", "\ud83d\udc38");
				}
				return JsonUtility.ToJson(value);
			}
		}

		public static AssetBundle specialeverything;

		public static ObjectInfo specialobjectinfo;

		public static Dictionary<string, Object> loaded = new Dictionary<string, Object>();

		public static void LoadBundle()
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SpecialStuffPack.specialeverything"))
			{
				byte[] array = new byte[stream.Length];
				stream.Read(array, 0, array.Length);
				specialeverything = AssetBundle.LoadFromMemory(array);
			}
			using Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("SpecialStuffPack.specialeverything.objinfo");
			byte[] array2 = new byte[stream2.Length];
			stream2.Read(array2, 0, array2.Length);
			specialobjectinfo = ObjectInfo.FromFile(Encoding.UTF8.GetString(array2).Split(new char[1] { '\n' }).ToList());
		}

		public static T Load<T>(string path, tk2dSpriteCollectionData spriteCollection = null, string shader = null) where T : Object
		{
			if (loaded.TryGetValue($"{path}||{typeof(T)}", out var value))
			{
				return (T)(object)value;
			}
			if (path.Contains("/"))
			{
				if (!path.StartsWith("assets/"))
				{
					path = "assets/" + path;
				}
				if ((object)typeof(T) == typeof(GameObject) && !path.EndsWith(".prefab"))
				{
					path += ".prefab";
				}
				else if ((object)typeof(T) == typeof(Texture2D) && !path.EndsWith(".png"))
				{
					path += ".png";
				}
				else if ((object)typeof(T) == typeof(Material) && !path.EndsWith(".mat"))
				{
					path += ".mat";
				}
				else if ((object)typeof(T) == typeof(Shader) && !path.EndsWith(".shader"))
				{
					path += ".shader";
				}
			}
			T val = specialeverything.LoadAsset<T>(path);
			if (!loaded.ContainsKey($"{path}||{typeof(T)}"))
			{
				loaded.Add($"{path}||{typeof(T)}", (Object)(object)val);
			}
			GameObject val2 = null;
			object obj = val;
			GameObject val3 = (GameObject)((obj is GameObject) ? obj : null);
			if (val3 != null)
			{
				val2 = val3;
			}
			else
			{
				object obj2 = val;
				Component val4 = (Component)((obj2 is Component) ? obj2 : null);
				if (val4 != null)
				{
					val2 = val4.gameObject;
				}
			}
			if ((Object)(object)val2 != (Object)null)
			{
				val2.ProcessPrefab(spriteCollection);
				if (specialobjectinfo.objectNames.ContainsKey(((Object)val).name))
				{
					foreach (KeyValuePair<string, Dictionary<string, KeyValuePair<string, string>>> comp in specialobjectinfo.objectNames[((Object)val).name])
					{
						Type type = (from x2 in typeof(AssetBundleManager).Assembly.GetTypes()
							where x2.Name == comp.Key && x2.IsSubclassOf(typeof(Component)) && !x2.IsAbstract
							select x2).FirstOrDefault();
						if ((object)type == null || !type.IsSubclassOf(typeof(Component)) || type.IsAbstract)
						{
							continue;
						}
						Component val5 = val2.AddComponent(type);
						if (!((Object)(object)val5 != (Object)null))
						{
							continue;
						}
						Type type2 = ((object)val5).GetType();
						foreach (KeyValuePair<string, KeyValuePair<string, string>> item in comp.Value)
						{
							try
							{
								type2.GetField(item.Key, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.SetValue(val5, ObjectInfo.DeformatValue(item.Value, val2));
							}
							catch
							{
							}
						}
					}
				}
			}
			return val;
		}

		public static GameObject ProcessPrefab(this GameObject self, tk2dSpriteCollectionData collection = null, string shader = null)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			SpriteRenderer[] componentsInChildren = self.GetComponentsInChildren<SpriteRenderer>();
			foreach (SpriteRenderer val in componentsInChildren)
			{
				if ((Object)(object)val != (Object)null)
				{
					Sprite sprite = val.sprite;
					GameObject gameObject = ((Component)val).gameObject;
					Object.DestroyImmediate((Object)(object)val);
					if (collection == null)
					{
						collection = self.SetupCollection();
					}
					int num = SpriteBuilder.AddSpriteToCollection(sprite.texture, collection, shader ?? PlayerController.DefaultShaderName);
					collection.spriteDefinitions[num].AddOffset(Vector2.Scale(sprite.pivot, new Vector2((float)((Texture)sprite.texture).width, (float)((Texture)sprite.texture).height)) / 16f);
					tk2dSprite.AddComponent(gameObject, collection, num);
				}
			}
			return self;
		}
	}
	public static class CodeShortcuts
	{
		public static readonly List<StatType> ReverseBadStats = new List<StatType>
		{
			(StatType)2,
			(StatType)10,
			(StatType)13,
			(StatType)23,
			(StatType)14
		};

		public static readonly List<StatType> PercentageStats = new List<StatType>
		{
			(StatType)1,
			(StatType)2,
			(StatType)5,
			(StatType)6,
			(StatType)9,
			(StatType)10,
			(StatType)12,
			(StatType)13,
			(StatType)15,
			(StatType)16,
			(StatType)20,
			(StatType)21,
			(StatType)22,
			(StatType)23,
			(StatType)25,
			(StatType)26,
			(StatType)27,
			(StatType)28,
			(StatType)29,
			(StatType)30
		};

		public static readonly List<StatType> WeirdPercentageStats = new List<StatType>
		{
			(StatType)19,
			(StatType)24
		};

		public static readonly Dictionary<StatType, string> StatNameDict = new Dictionary<StatType, string>
		{
			{
				(StatType)0,
				"Speed"
			},
			{
				(StatType)1,
				"Firerate"
			},
			{
				(StatType)2,
				"Spread"
			},
			{
				(StatType)3,
				"Health"
			},
			{
				(StatType)4,
				"Coolness"
			},
			{
				(StatType)5,
				"Damage"
			},
			{
				(StatType)6,
				"Bullet Speed"
			},
			{
				(StatType)7,
				"d"
			},
			{
				(StatType)8,
				"Item Slots"
			},
			{
				(StatType)9,
				"Ammo"
			},
			{
				(StatType)10,
				"Reload Time"
			},
			{
				(StatType)11,
				"Bullet Pierces"
			},
			{
				(StatType)12,
				"Knockback"
			},
			{
				(StatType)13,
				"Shop Price"
			},
			{
				(StatType)14,
				"Curse"
			},
			{
				(StatType)15,
				"Bullet Scale"
			},
			{
				(StatType)16,
				"Clip Size"
			},
			{
				(StatType)17,
				"Bullet Bounces"
			},
			{
				(StatType)18,
				"Blanks Per Floor"
			},
			{
				(StatType)19,
				"Shadow Bullet Chance"
			},
			{
				(StatType)20,
				"Thrown Gun Damage"
			},
			{
				(StatType)21,
				"Roll Damage"
			},
			{
				(StatType)22,
				"Damage To Bosses"
			},
			{
				(StatType)23,
				"Enemy Bullet Speed"
			},
			{
				(StatType)24,
				"Pop-Pop Chance"
			},
			{
				(StatType)25,
				"Charge Speed"
			},
			{
				(StatType)26,
				"Range"
			},
			{
				(StatType)27,
				"Roll Distance"
			},
			{
				(StatType)28,
				"Roll Speed"
			},
			{
				(StatType)29,
				"Temporary Clip Size"
			},
			{
				(StatType)30,
				"Money Drops"
			}
		};

		public static GameObject stealthyPoof;

		public static GameActorHealthEffect defaultPoison;

		public static GameActorFireEffect defaultFire;

		public static GameActorFreezeEffect defaultFreeze;

		public static GameActorCheeseEffect defaultCheese;

		public static GameActorCharmEffect defaultCharm;

		public static GameActorCharmEffect permanentCharm;

		public static GameActorFireEffect defaultGreenFire;

		public static ExplosionData bombExplosionData;

		public static readonly string Ak47BulletKinGuid = "db35531e66ce41cbb81d507a34366dfe";

		public static readonly string RubberKinGuid = "6b7ef9e5d05b4f96b04f05ef4a0d1b18";

		public static readonly string RedShotgunKinGuid = "128db2f0781141bcb505d8f00f9e4d47";

		public static readonly string GatlingGullGuid = "ec6b674e0acd4553b47ee94493d66422";

		public static readonly string VeteranBulletKinGuid = "70216cae6c1346309d86d4a0b4603045";

		public static readonly string PinheadGuid = "4d37ce3d666b4ddda8039929225b7ede";

		public static readonly string BlobulinGuid = "42be66373a3d4d89b91a35c9ff8adfec";

		public static readonly string BulletKinGuid = "01972dee89fc4404a5c408d50007dad5";

		public static readonly string BandanaBulletKinGuid = "88b6b6a93d4b4234a67844ef4728382c";

		public static readonly string ArrowkinGuid = "05891b158cd542b1a5f3df30fb67a7ff";

		public static readonly string BlobulonGuid = "0239c0680f9f467dbe5c4aab7dd1eca6";

		public static readonly string HollowpointGuid = "4db03291a12144d69fe940d5a01de376";

		public static readonly string SkusketGuid = "af84951206324e349e1f13f9b7b60c1a";

		public static readonly string BlobuloidGuid = "042edb1dfb614dc385d5ad1b010f2ee3";

		public static readonly string BeholsterGuid = "4b992de5b4274168a8878ef9bf7ea36b";

		public static readonly string BulletKinFakeryGuid = "b5503988e3684e8fa78274dd0dda0bf5";

		public static readonly string VeteranBulletKinFakeryGuid = "06a82532447247f9ada1940d079a31a7";

		public static readonly string UnusedMuzzleFlareGuid = "98e52539e1964749a8bbce0fe6a85d6b";

		public static readonly string TreadnaughtGuid = "fa76c8cfdf1c4a88b55173666b4bc7fb";

		public static readonly string TankerGuid = "df7fb62405dc4697b7721862c7b6b3cd";

		public static readonly string BeadieGuid = "7b0b1b6d9ce7405b86b75ce648025dd6";

		public static readonly string MuzzleWispGuid = "ffdc8680bdaa487f8f31995539f74265";

		public static readonly string BlueShotgunKinGuid = "b54d89f9e802455cbb2b8a96a31e8259";

		public static readonly string CubulonGuid = "864ea5a6a9324efc95a0dd2407f42810";

		public static readonly string FriendlyBulletKinGuid = "c1757107b9a44f0c823a707adeb4ae7e";

		public static readonly string GunjurerGuid = "c4fba8def15e47b297865b18e36cbef8";

		public static readonly string PortableTurretGuid = "998807b57e454f00a63d67883fcf90d6";

		public static readonly string TutorialTurretGuid = "e667fdd01f1e43349c03a18e5b79e579";

		public static readonly string SerManuelGuid = "fc809bd43a4d41738a62d7565456622c";

		public static readonly string TutorialBulletKinGuid = "b08ec82bef6940328c7ecd9ffc6bd16c";

		public static readonly string BunkerGuid = "8817ab9de885424d9ba83455ead5ffef";

		public static readonly string BulletKingGuid = "ffca09398635467da3b1f4a54bcfda80";

		public static readonly string BulletKingsToadieGuid = "b5e699a0abb94666bda567ab23bd91c4";

		public static readonly string VeteranShotgunKinGuid = "2752019b770f473193b08b4005dc781f";

		public static readonly string HighGunjurerGuid = "9b2cf2949a894599917d4d391a0b7394";

		public static readonly string SpentGuid = "249db525a9464e5282d02162c88e0357";

		public static readonly string BlizzbulonGuid = "022d7c822bc146b58fe3b0287568aaa2";

		public static readonly string MountainCubeGuid = "f155fd2759764f4a9217db29dd21b7eb";

		public static readonly string SkulletGuid = "336190e29e8a4f75ab7486595b700d4a";

		public static readonly string GummyGuid = "5288e86d20184fa69c91ceb642d31474";

		public static readonly string SkullmetGuid = "95ec774b5a75467a9ab05fa230c0c143";

		public static readonly string SmileyGuid = "ea40fcc863d34b0088f490f4e57f8913";

		public static readonly string ShadesGuid = "c00390483f394a849c36143eb878998f";

		public static readonly string OldKingGuid = "5729c8b5ffa7415bb3d01205663a33ef";

		public sta