Decompiled source of BittysChallenges v5.3.0

BittysChallenges.dll

Decompiled 10 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BittysChallenges;
using BittysChallenges.Encounters;
using BittysSigils;
using Dialogue;
using DiskCardGame;
using Division.Helpers;
using HarmonyLib;
using InscryptionAPI.Ascension;
using InscryptionAPI.Boons;
using InscryptionAPI.Card;
using InscryptionAPI.Helpers;
using InscryptionAPI.Helpers.Extensions;
using InscryptionAPI.Saves;
using InscryptionAPI.Triggers;
using InscryptionMod.Abilities;
using Microsoft.CodeAnalysis;
using Pixelplacement;
using RulebookExpander;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("BittysChallenges")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+1c93348715ede063eacd4736ffcdcb527ae1fbe9")]
[assembly: AssemblyProduct("BittysChallenges")]
[assembly: AssemblyTitle("BittysChallenges")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Dialogue
{
	public class Dialogue
	{
		public static void Register(Harmony harmony)
		{
			harmony.PatchAll(typeof(Dialogue));
		}

		public static LineSet SetAbilityInfoDialogue(string dialogue)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			return new LineSet(new List<Line>
			{
				new Line
				{
					text = dialogue
				}
			});
		}

		public static void P03HappyCloseUp(Line line)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)line.p03Face == 4)
			{
				Singleton<ViewManager>.Instance.SwitchToView((View)33, true, false);
			}
			else
			{
				Singleton<ViewManager>.Instance.SwitchToView((View)1, true, false);
			}
		}

		[HarmonyPatch(typeof(DialogueDataUtil), "ReadDialogueData")]
		[HarmonyPostfix]
		public static void ModDialogue()
		{
			DialogueHelper.AddOrModifySimpleDialogEvent("RedrawHandIntro", new string[2] { "Is that a clover?", "I see." });
			DialogueHelper.AddOrModifySimpleDialogEvent("UnfairHandIntro", new string[4] { "Oh?", "Did you not like having a stacked deck?", "That's fine with me.", "It will be more fair this way anyways." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroIntro", new string[3] { "oh?", "my very own ouroboros.", "i will be sure to put it to good use." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroZoom1", new string[2] { "the ouroboros has followed you.", "it's fangs are beared, and it's ready for another fight." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroZoom3", new string[2] { "the unyielding ouroboros has returned,", "growing stronger every death." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroZoom4", new string[2] { "as inevitable as death,", "the ouroboros has returned." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroZoom2", new string[2] { "a serpent slithers out from the undergrowth.", "perhaps you have seen it before?" });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroDies1", new string[2] { "the ouroboros has died.", "and yet, it will return." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroDies2", new string[2] { "the serpent's wrath has been delayed.", "for now." });
			DialogueHelper.AddOrModifySimpleDialogEvent("OuroDies3", new string[2] { "the ouroboros only grows stronger from death.", "it will be back." });
			DialogueHelper.AddOrModifySimpleDialogEvent("MycoFailSigils", new string[1] { "a-ah, the sigils..." }, null, null, null, "DoctorIntro");
			DialogueHelper.AddOrModifySimpleDialogEvent("MycoFailAttack", new string[1] { "o-oh, the power..." }, null, null, null, "DoctorIntro");
			DialogueHelper.AddOrModifySimpleDialogEvent("MycoFailHealth", new string[1] { "a-ah, the health..." }, null, null, null, "DoctorIntro");
			DialogueHelper.AddOrModifySimpleDialogEvent("GoldenSheepIntro", new string[3] { "ah...", "Chrysomallos, the golden ram.", "what a glorious pelt...." });
			DialogueHelper.AddOrModifySimpleDialogEvent("GoldenSheepZoom1", new string[2] { "The golden ram.", "catch it before it escapes." });
			DialogueHelper.AddOrModifySimpleDialogEvent("GoldenSheepZoom3", new string[2] { "a rare sight.", "it will not stay for long." });
			DialogueHelper.AddOrModifySimpleDialogEvent("GoldenSheepZoom4", new string[2] { "what glittering wool,", "attached to such a rare creature." });
			DialogueHelper.AddOrModifySimpleDialogEvent("GoldenSheepZoom2", new string[3] { "oh?", "a rare chance to get a rare pelt.", "best make the most of it." });
			DialogueHelper.AddOrModifySimpleDialogEvent("SheepDies1", new string[1] { "You slay the glimmering creature, stealing its pelt." });
			DialogueHelper.AddOrModifySimpleDialogEvent("SheepDies2", new string[2] { "The end of such a glorious creature.", "And what a glorious pelt you have obtained." });
			DialogueHelper.AddOrModifySimpleDialogEvent("SheepDies3", new string[3] { "Chrysomallos...", "How tragic your tale is...", "To be killed for your pelt..." });
			DialogueHelper.AddOrModifySimpleDialogEvent("SheepEscapes1", new string[1] { "The Golden Ram lives another day." });
			DialogueHelper.AddOrModifySimpleDialogEvent("SheepEscapes2", new string[2] { "Time's up.", "The Golden Ram has found an escape route." });
			DialogueHelper.AddOrModifySimpleDialogEvent("SheepEscapes3", new string[2] { "The glimmer of the Golden Ram's fur blinds you,", "giving it the opportunity to escape." });
			DialogueHelper.AddOrModifySimpleDialogEvent("FragileEnemy", new string[3] { "Ah...", "Your [v:0] has taken a devastating blow from the [v:1].", "You will not be able to take it with your caravan." });
			DialogueHelper.AddOrModifySimpleDialogEvent("FragileDies", new string[3] { "Ah...", "You won't be seeing your [v:0] again,", "It has taken too much damage." });
			DialogueHelper.AddOrModifySimpleDialogEvent("FragileSacrifice", new string[3] { "Ah...", "Did you permanently kill your [v:0] on purpose?", "A shame..." });
			DialogueHelper.AddOrModifySimpleDialogEvent("RoyalFirstMate", new string[1] { "Ha! There be my first mate!" }, null, null, (Emotion)1, "PirateSkullPreCharge");
			DialogueHelper.AddOrModifySimpleDialogEvent("RoyalOuro", new string[1] { "Argh! There be snakes on me ship as well!" }, null, null, (Emotion)2, "PirateSkullPreCharge");
			DialogueHelper.AddOrModifySimpleDialogEvent("RoyalOuroDiesPlayer", new string[2] { "Ha!", "I should hire ye to get rid of the rest of them!" }, null, null, (Emotion)0, "PirateSkullPreCharge");
			DialogueHelper.AddOrModifySimpleDialogEvent("RoyalOuroDies", new string[1] { "Ha! It's dead!" }, null, null, (Emotion)1, "PirateSkullPreCharge");
			DialogueHelper.AddOrModifySimpleDialogEvent("PirateIntro", new string[4] { "what?", "Pirates?", "...", "I'll allow it." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("InfiniteLivesIntro", new string[5] { "what?", "cheating?", "how dissapointing...", "...", "the game will be soured from a pitifully easy ascent." }, null, null, (Emotion)2);
			DialogueHelper.AddOrModifySimpleDialogEvent("InfiniteLivesRepeat", new string[1] { "cheater..." }, new string[6][]
			{
				new string[1] { "Have you no shame?" },
				new string[1] { "To cheat so blatantly..." },
				new string[1] { "you should be dead." },
				new string[1] { "and yet..." },
				new string[1] { "how dissapointing..." },
				new string[1] { "..." }
			}, null, (Emotion)2);
			DialogueHelper.AddOrModifySimpleDialogEvent("InfiniteLivesLoop", new string[1] { "I won't tolerate this for much longer..." }, null, null, (Emotion)2);
			DialogueHelper.AddOrModifySimpleDialogEvent("InfiniteLivesLoopBreak", new string[1] { "Enough of this." }, null, null, (Emotion)2);
			DialogueHelper.AddOrModifySimpleDialogEvent("InfiniteLivesRoyal", new string[1] { "Yer not dead?" }, null, null, (Emotion)5, "PirateSkullPreCharge");
			DialogueHelper.AddOrModifySimpleDialogEvent("FecundityUnNerfIntro", new string[3] { "ah...", "back to normal then?", "I'll admit, I had gotten used to the changes..." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("WeakStart", new string[4] { "Weak Cards?", "This is hard to explain...", "Perhaps they are sick? Yes.", "A crippling disease afflicted your meager troupe of creatures." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("WaterborneStart", new string[5] { "Waterborne Cards?", "This is hard to explain...", "Perhaps a mutation? Yes.", "Your caravan of creatures had a startling mutation,", "They could only survive in the water." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("ShockedStart", new string[4] { "Paralyzed Cards?", "Hmm...", "Your group of creatures were fatigued from the long journey,", "but there would be a long way to go yet." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("WeakSoulStart", new string[4] { "Weak Souled Cards?", "Hmm...", "You will not be able to extract their souls into new creatures,", "For better or worse..." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("AscenderBaneStart", new string[1] { "The lives of past challengers weighed down on you..." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("FamineIntro", new string[4] { "Hm?", "How to explain this...", "You were running low on supplies that day...", "You'll have fewer [c:G][v:0]s[c:] to work with." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("AbundanceIntro", new string[3] { "Hm?", "An abundance of [c:G][v:0]s[c:]...", "Must be mating season..." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("EnvironmentsIntro", new string[3] { "Hm?", "Environmental effects?", "how interesting..." }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("MudBoonIntro", new string[3] { "In order to proceed,", "you had to slog through the wetter parts of the swamp.", "The thick [c:G]mud[c:] stuck to your boots, and hindered your movements..." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("HailBoonIntro", new string[4] { "The frigid air was not the only obstacle in your way,", "the harsh ice and unforgiving snow also stood in your path.", "before long you found yourself in...", "a [c:B]hailstorm.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("CliffsBoonIntro", new string[3] { "You found yourself cornered against a sheer rock wall,", "the [c:G]cliffside.[c:]", "Against the cold stone, there would be less space to fight." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("MushroomsBoonIntro", new string[3] { "The mycologists had left one of their experiments behind,", "unbeknownst to them, it began to fester and grow.", "even the creatures fighting you would not be safe from the [c:G]fungal mass.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("DynamiteBoonIntro", new string[4] { "You stumbled across one of the Prospector's Camps.", "The camp was filled with prospecting tools.", "pickaxes, headlamps...", "and [c:bR]dynamite.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("BaitBoonIntro", new string[3] { "You came across one of the Angler's Ponds.", "the area stank of rotting fish,", "emanating from the nearby abandoned buckets of [c:dB]bait.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("TrapBoonIntro", new string[3] { "You came across one of the Trapper's Hunting Grounds.", "the stench of blood hung in the air...", "you noticed the numerous [c:G]traps[c:] lying in wait." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("TotemBoonIntro", new string[3] { "You came upon a strange [c:bR]totem.[c:]", "a mysterious energy swirled around it,", "the creatures nearby seem more agressive than usual..." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("BloodMoonBoonIntro", new string[2] { "Ah...", "a [c:bR]Blood Moon.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("CarrotBoonIntro", new string[4] { "Er...", "You...", "...", "...What?" }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("CarrotBoonIntro2", new string[1] { "I am at a loss for words." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("BlizzardBoonIntro", new string[5] { "The wind was howling around you.", "Stuck in the middle of a blizzard,", "You heard rumbling from the mountains above.", "Here it comes...", "an [c:B]avalanche.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("ObeliskBoonIntro", new string[3] { "You stumble across a strange black stone.", "A stone tablet sits in front of it, clearly made for sacrifices.", "Perhaps a certain creature may cause a reaction?" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("GoatSacrifice", new string[3] { "The obelisk trembles in delight.", "A goat is truly a worthy sacrifice.", "You won't be seeing it again." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("PeltSacrifice", new string[2] { "The obelisk rumbles with anger.", "A pelt is a truly pitiful sacrifice." }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("SquirrelSacrifice", new string[2] { "...", "...That is not a proper sacrifice." }, new string[4][]
			{
				new string[1] { "Stop this." },
				new string[1] { "You..." },
				new string[1] { "This is bloodshed without meaning." },
				new string[1] { "[v:0]..." }
			}, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("MinicelloBoonIntro", new string[2] { "Hmm?", "What is this?" }, null, null, (Emotion)4);
			DialogueHelper.AddOrModifySimpleDialogEvent("MinicelloBoonIntro2", new string[3] { "Heh heh heh...", "Ye walked into th' pirate's cove!", "Me crew will get rid of ye quick!" }, null, null, (Emotion)1, "PirateSkullPreCharge");
			DialogueHelper.AddOrModifySimpleDialogEvent("DarkForestBoonIntro", new string[4] { "You carve through the thick underbrush and foilage.", "The trees blotting out the sun...", "As you travel, you hear the woods start to creak around you.", "You should know better than to walk in the darkness..." });
			DialogueHelper.AddOrModifySimpleDialogEvent("FloodBoonIntro", new string[4] { "As your caravan of creatures travels, you hear a rushing sound.", "You climb to a higher place as water flows around you.", "You are caught in a [c:B]flood.[c:]", "Only the terrain and flying creatures will be able to avoid the waters." });
			DialogueHelper.AddOrModifySimpleDialogEvent("BreezeBoonIntro", new string[4] { "As your caravan of creatures moves across a clearing, the winds blow stronger.", "A strong breeze greets your face, and you grasp onto the surroundings for dear life.", "Your creatures are blown [c:G]airborne.[c:]", "Only burrowing and submerged creatures will be able to avoid the gusts." });
			DialogueHelper.AddOrModifySimpleDialogEvent("BreezeActivation", new string[1] { "The Breeze blows..." });
			DialogueHelper.AddOrModifySimpleDialogEvent("GraveyardBoonIntro", new string[4] { "You come across a pile of corpses.", "A strange energy swirls around them as you approach.", "Then...", "[c:R]The dead walk.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("GraveyardBoonIntro2", new string[1] { "[c:R]The dead walk.[c:]" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("FlashGrowthBoonIntro", new string[4] { "You came across an overgrown glade.", "The trees seemed taller, and stronger than usual.", "Your creatures grew faster as well.", "<color=#25C102>Flash Growth.</color>" }, null, null, (Emotion)0);
			DialogueHelper.AddOrModifySimpleDialogEvent("FlashGrowthBoonIntro2", new string[1] { "<color=#25C102>Flash Growth.</color>" }, null, null, (Emotion)0);
			DialogueHelper.AddDialogue("P03FamineIntro", new List<string> { "Hm?", "You're decreasing the number of vessels you have?", "Surely a player as bad as you needs the extra chump blockers?", "You'll see." }, new List<string> { "Default", "", "Happy", "Default" }, new List<string> { "", "", "y", "" });
			DialogueHelper.AddDialogue("P03AbundanceIntro", new List<string> { "Hm?", "You're increasing the number of vessels you have?", "Makes sense.", "After all, a player as bad as you needs the extra chump blockers.", "[v:0] vessels..." }, new List<string> { "Default", "", "", "Happy", "Default" }, new List<string> { "", "", "", "y", "" });
			DialogueHelper.AddDialogue("P03FecundityUnNerfIntro", new List<string> { "Oh?", "You couldn't even stick to the changes?", "Pathetic." }, new List<string> { "Default", "Happy", "Default" }, new List<string> { "", "", "" });
			DialogueHelper.AddDialogue("P03OuroIntro", new List<string> { "Oh?", "My own Ourobot?", "You must be masochistic if you thought this was a good idea.", "Your funeral." }, new List<string> { "Thinking", "Default", "Happy", "Default" }, new List<string> { "", "", "", "" });
			DialogueHelper.AddDialogue("P03OuroDies1", new List<string> { "There it goes." }, new List<string> { "Default" }, new List<string> { "" });
			DialogueHelper.AddDialogue("P03OuroDies2", new List<string> { "You just made it stronger.", "Of course, you knew that already." }, new List<string> { "Default", "Happy" }, new List<string> { "", "" });
			DialogueHelper.AddDialogue("P03OuroDies3", new List<string> { "I'm not worried.", "It'll come back to crush you later." }, new List<string> { "Default", "Happy" }, new List<string> { "", "" });
			DialogueHelper.AddDialogue("P03WeakStart", new List<string> { "Hm?", "Weaker starting cards?", "As if one health will make a difference." }, new List<string> { "Default", "", "" }, new List<string> { "", "", "" });
			DialogueHelper.AddDialogue("P03EnvironmentsIntro", new List<string> { "Hm?", "Were my environments not good enough for you?", "Fine." }, new List<string> { "Default", "", "" }, new List<string> { "", "", "" });
			DialogueHelper.AddDialogue("P03GraveyardBoonIntro", new List<string> { "Hm...", "You have found a...", "Robot scrapyard.", "There's broken down robots everywhere.", "Every robot in this area dies twice." }, new List<string> { "Thinking", "Default", "", "", "" }, new List<string> { "", "", "", "", "" });
			DialogueHelper.AddDialogue("P03GraveyardBoonIntro2", new List<string> { "It's the scrapyard again.", "You know the drill." }, new List<string> { "Default", "" }, new List<string> { "", "" });
			DialogueHelper.AddDialogue("P03FlashGrowthBoonIntro", new List<string> { "Eugh.", "This is one of [c:O]HIS.[c:]", "Your... transformer bots will be more effective here.", "They'll transform when played.", "You'll see." }, new List<string> { "Angry", "", "Default", "", "" }, new List<string> { "", "", "", "", "" });
			DialogueHelper.AddDialogue("P03FlashGrowthBoonIntro2", new List<string> { "Your transformer bots will be more effective here.", "They'll tranform when played." }, new List<string> { "Default", "" }, new List<string> { "", "" });
			DialogueHelper.AddDialogue("P03ConveyorBoonIntro", new List<string> { "Ah...", "A favorite of mine.", "At the start of each of your turns all cards will be moved clockwise.", "I'm sure you've seen it before." }, new List<string> { "Happy", "", "", "Default" }, new List<string> { "", "", "", "" });
			DialogueHelper.AddDialogue("P03ConveyorBoonIntro2", new List<string> { "At the start of each of your turns all cards will be moved clockwise.", "You've seen it before." }, new List<string> { "Default", "" }, new List<string> { "", "" });
			DialogueHelper.AddDialogue("P03GemSanctuaryBoonIntro", new List<string> { "Ah...", "Your <color=#25C102>G</color>[c:O]E[c:][c:B]M[c:]s will be more useful.", "More useful than [c:R]he[c:] ever was able to make them...", "...As long as you keep that one alive." }, new List<string> { "Thinking", "Default", "Angry", "Default" }, new List<string> { "", "", "", "" });
			DialogueHelper.AddDialogue("P03GemSanctuaryBoonIntro2", new List<string> { "Your <color=#25C102>G</color>[c:O]E[c:][c:B]M[c:]s will be more useful.", "...As long as you keep that one alive." }, new List<string> { "Default", "Default" }, new List<string> { "", "" });
			DialogueHelper.AddDialogue("P03ElectricStormBoonIntro", new List<string> { "Heh.", "This one will be quite...", "Shocking.", "You find yourself in an electrical storm.", "When a card is played, it will take 1 damage.", "If it survives, it'll be stronger for a bit." }, new List<string> { "Happy", "", "Happy", "", "", "Default" }, new List<string> { "", "", "", "", "", "" });
			DialogueHelper.AddDialogue("P03ElectricStormBoonIntro2", new List<string> { "I think you'll find this one quite...", "Shocking." }, new List<string> { "Default", "Happy" }, new List<string> { "", "" });
		}
	}
}
namespace Division.Helpers
{
	public static class DialogueHelper
	{
		public static LineSet CreateLineSet(string[] lineString, Emotion emotion = 0, LetterAnimation animation = 2, Face p03Face = 0, int speakerIndex = 0)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			return new LineSet
			{
				lines = ((IEnumerable<string>)lineString).Select((Func<string, Line>)((string s) => new Line
				{
					text = s,
					emotion = emotion,
					letterAnimation = animation,
					p03Face = p03Face,
					speakerIndex = speakerIndex
				})).ToList()
			};
		}

		public static void AddDialogue(string id, List<string> lines, List<string> faces, List<string> dialogueWavies)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Invalid comparison between Unknown and I4
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Invalid comparison between Unknown and I4
			//IL_00ac: 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_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Expected O, but got Unknown
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Expected O, but got Unknown
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			Speaker val = (Speaker)6;
			if (faces.Exists((string s) => s.ToLowerInvariant().Contains("leshy")))
			{
				val = (Speaker)1;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("telegrapher")))
			{
				val = (Speaker)11;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("archivist")))
			{
				val = (Speaker)9;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("photographer")))
			{
				val = (Speaker)10;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("canvas")))
			{
				val = (Speaker)12;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("goo")))
			{
				val = (Speaker)7;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("side")))
			{
				val = (Speaker)20;
			}
			else if (faces.Exists((string s) => s.ToLowerInvariant().Contains("mycolo")))
			{
				val = (Speaker)19;
			}
			bool leshy = (int)val == 1 || (int)val == 7;
			Emotion leshyEmotion = (Emotion)(faces.Exists((string s) => s.ToLowerInvariant().Contains("goocurious")) ? 5 : 0);
			if (string.IsNullOrEmpty(id))
			{
				return;
			}
			List<DialogueEvent> events = DialogueDataUtil.Data.events;
			DialogueEvent val2 = new DialogueEvent();
			val2.id = id;
			val2.speakers = new List<Speaker>
			{
				(Speaker)0,
				val
			};
			val2.mainLines = new LineSet(((IEnumerable<string>)faces).Zip((IEnumerable<string>)lines, (Func<string, string, Line>)((string face, string line) => new Line
			{
				text = line,
				specialInstruction = "",
				p03Face = (Face)(leshy ? 17 : ((int)face.ParseFace())),
				speakerIndex = 1,
				emotion = (leshy ? leshyEmotion : face.ParseFace().FaceEmotion())
			})).Zip(dialogueWavies, delegate(Line line, string wavy)
			{
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				if (!string.IsNullOrEmpty(wavy) && wavy.ToLowerInvariant() == "y")
				{
					line.letterAnimation = (LetterAnimation)1;
				}
				return line;
			}).ToList());
			events.Add(val2);
		}

		private static Face ParseFace(this string face)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(face))
			{
				return (Face)17;
			}
			return (Face)Enum.Parse(typeof(Face), face);
		}

		private static Emotion FaceEmotion(this Face face)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Invalid comparison between Unknown and I4
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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)
			if ((int)face == 3)
			{
				return (Emotion)2;
			}
			if ((int)face == 1)
			{
				return (Emotion)5;
			}
			if ((int)face == 49)
			{
				return (Emotion)2;
			}
			if ((int)face == 46)
			{
				return (Emotion)1;
			}
			return (Emotion)0;
		}

		public static void AddOrModifySimpleDialogEvent(string eventId, string line, LetterAnimation? animation = null, Emotion? emotion = null)
		{
			string[] lines = new string[1] { line };
			AddOrModifySimpleDialogEvent(eventId, lines, null, animation, emotion);
		}

		private static void SyncLineCollection(List<Line> curLines, string[] newLines, LetterAnimation? animation, Emotion? emotion)
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			while (curLines.Count > newLines.Length)
			{
				curLines.RemoveAt(curLines.Count - 1);
			}
			for (int i = 0; i < curLines.Count; i++)
			{
				curLines[i].text = newLines[i];
			}
			for (int j = curLines.Count; j < newLines.Length; j++)
			{
				Line val = CloneLine(curLines[0]);
				val.text = newLines[j];
				if (animation.HasValue)
				{
					val.letterAnimation = animation.Value;
				}
				if (emotion.HasValue)
				{
					val.emotion = emotion.Value;
				}
				curLines.Add(val);
			}
		}

		public static void AddOrModifySimpleDialogEvent(string eventId, string[] lines, string[][] repeatLines = null, LetterAnimation? animation = null, Emotion? emotion = null, string template = "NewRunDealtDeckDefault")
		{
			bool flag = false;
			DialogueEvent val = DialogueDataUtil.Data.GetEvent(eventId);
			if (val == null)
			{
				flag = true;
				val = CloneDialogueEvent(DialogueDataUtil.Data.GetEvent(template), eventId);
				while (val.mainLines.lines.Count > lines.Length)
				{
					val.mainLines.lines.RemoveAt(lines.Length);
				}
			}
			SyncLineCollection(val.mainLines.lines, lines, animation, emotion);
			if (repeatLines == null)
			{
				val.repeatLines.Clear();
			}
			else
			{
				while (val.repeatLines.Count > repeatLines.Length)
				{
					val.repeatLines.RemoveAt(val.repeatLines.Count - 1);
				}
				for (int i = 0; i < val.repeatLines.Count; i++)
				{
					SyncLineCollection(val.repeatLines[i].lines, repeatLines[i], animation, emotion);
				}
			}
			if (flag)
			{
				DialogueDataUtil.Data.events.Add(val);
			}
		}

		public static Line CloneLine(Line line)
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			return new Line
			{
				p03Face = line.p03Face,
				emotion = line.emotion,
				letterAnimation = line.letterAnimation,
				speakerIndex = line.speakerIndex,
				text = line.text,
				specialInstruction = line.specialInstruction,
				storyCondition = line.storyCondition,
				storyConditionMustBeMet = line.storyConditionMustBeMet
			};
		}

		public static DialogueEvent CloneDialogueEvent(DialogueEvent dialogueEvent, string newId, bool includeRepeat = false)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			DialogueEvent val = new DialogueEvent
			{
				id = newId,
				groupId = dialogueEvent.groupId,
				mainLines = new LineSet(),
				speakers = new List<Speaker>(),
				repeatLines = new List<LineSet>()
			};
			foreach (Line line in dialogueEvent.mainLines.lines)
			{
				val.mainLines.lines.Add(CloneLine(line));
			}
			if (includeRepeat)
			{
				foreach (LineSet repeatLine in dialogueEvent.repeatLines)
				{
					LineSet val2 = new LineSet();
					foreach (Line line2 in repeatLine.lines)
					{
						val2.lines.Add(CloneLine(line2));
					}
					val.repeatLines.Add(val2);
				}
			}
			foreach (Speaker speaker in dialogueEvent.speakers)
			{
				val.speakers.Add(speaker);
			}
			return val;
		}
	}
}
namespace RulebookExpander
{
	public class RulebookExpansion
	{
		public static void Register(Harmony harmony)
		{
			harmony.PatchAll(typeof(RulebookExpansion));
		}

		[HarmonyPatch(typeof(RuleBookInfo), "AbilityShouldBeAdded")]
		[HarmonyPostfix]
		private static void Postfix(ref bool __result, ref int abilityIndex)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Invalid comparison between Unknown and I4
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Invalid comparison between Unknown and I4
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: 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)
			AbilityInfo info = AbilitiesUtil.GetInfo((Ability)abilityIndex);
			if ((int)info.ability == 88 || (int)info.ability == 52 || (int)info.ability == 36 || (int)info.ability == 62 || info.ability == GiveNoTransfer.ability || info.ability == Plugin.GiveParalysis.ability || (int)info.ability == 47 || info.ability == GiveFleeting.ability || info.ability == GiveCantAttack.ability || info.ability == GiveStrafePull.ability || info.ability == GiveStrafeSticky.ability || info.ability == GiveStrafeSuper.ability || info.ability == Plugin.GiveWarper.ability)
			{
				__result = true;
			}
		}
	}
}
namespace BittysChallenges
{
	[BepInPlugin("bitty45.inscryption.challenges", "Bitty's Challenges", "5.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public class RandomPiratesPatch
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(RandomPiratesPatch));
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(TurnManager), "SetupPhase")]
			public static void ChallengeActivations()
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: 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)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Invalid comparison between Unknown and I4
				if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType) && (int)Singleton<Opponent>.Instance.OpponentType != 0 && (int)Singleton<Opponent>.Instance.OpponentType != 2)
				{
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(harderFinalBossChallenge.challengeType);
				}
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(Opponent), "SpawnOpponent")]
			public static void AddToEncounter(ref Opponent __result)
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Invalid comparison between Unknown and I4
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Invalid comparison between Unknown and I4
				//IL_0131: Unknown result type (might be due to invalid IL or missing references)
				//IL_0138: Invalid comparison between Unknown and I4
				if (!SaveFile.IsAscension || !AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType) || (int)__result.OpponentType == 0 || (int)__result.OpponentType == 2)
				{
					return;
				}
				List<List<CardInfo>> turnPlan = __result.TurnPlan;
				int count = Singleton<BoardManager>.Instance.PlayerSlotsCopy.Count;
				if (turnPlan.Count <= 0)
				{
					return;
				}
				CardInfo cardByName = CardLoader.GetCardByName("SkeletonPirate");
				int num = ((turnPlan[0].Count >= 2) ? 1 : 0);
				Log.LogInfo((object)num);
				if (turnPlan[num].Count < count)
				{
					Log.LogInfo((object)"Adding Skeleton to turn plan...");
					turnPlan[num].Add(cardByName);
				}
				num++;
				if (turnPlan[num].Count < count)
				{
					Log.LogInfo((object)"Adding Undead Parrot to turn plan...");
					turnPlan[num].Add(CardLoader.GetCardByName("SkeletonParrot"));
				}
				if ((int)__result.OpponentType == 4 || (int)__result.OpponentType == 20)
				{
					num = ((turnPlan[0].Count >= count) ? 1 : 0);
					if (turnPlan[num].Count < count)
					{
						turnPlan[num].Add(CardLoader.GetCardByName("MoleSeaman"));
						Log.LogInfo((object)"Adding Mole Seaman to turn plan...");
					}
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(GiantShip), "MutinySequence")]
			public static bool MutinyChangePre()
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				if (AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType))
				{
					return false;
				}
				return true;
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(GiantShip), "MutinySequence")]
			public static IEnumerator MutinyChangePost(IEnumerator values)
			{
				if (!AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType))
				{
					yield break;
				}
				int numSkeles = (Singleton<GiantShip>.Instance.nextHealthThreshold - ((SpecialCardBehaviour)Singleton<GiantShip>.Instance).PlayableCard.Health) / 5 + 1;
				for (int i = 0; i < Math.Min(numSkeles, 3); i++)
				{
					List<CardSlot> validSlots = Singleton<BoardManager>.Instance.PlayerSlotsCopy;
					validSlots.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null);
					if (validSlots.Count > 0)
					{
						Singleton<ViewManager>.Instance.SwitchToView((View)6, false, true);
						yield return (object)new WaitForSeconds(0.5f);
						? val = Singleton<CardRenderCamera>.Instance;
						RenderStatsLayer statsLayer = ((SpecialCardBehaviour)Singleton<GiantShip>.Instance).Card.StatsLayer;
						((Component)((CardRenderCamera)val).GetLiveRenderCamera((statsLayer is RenderLiveStatsLayer) ? statsLayer : null)).GetComponentInChildren<PirateShipAnimatedPortrait>().NextSkeletonJumpOverboard();
						yield return (object)new WaitForSeconds(1f);
						Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false);
						CardSlot slot = validSlots[Random.Range(0, validSlots.Count)];
						yield return Singleton<BoardManager>.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_WoodenBoard"), slot, 0.1f, true);
						yield return (object)new WaitForSeconds(0.2f);
						GiantShip instance = Singleton<GiantShip>.Instance;
						instance.skelesSpawned++;
					}
				}
				if (Singleton<GiantShip>.Instance.mutineesSinceDialogue > 1)
				{
					yield return (object)new WaitForSeconds(0.3f);
					yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("PirateSkullShipMutinee", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					Singleton<GiantShip>.Instance.mutineesSinceDialogue = 0;
				}
				GiantShip instance2 = Singleton<GiantShip>.Instance;
				instance2.mutineesSinceDialogue++;
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(PirateSkullBossOpponent), "StartPhase2")]
			public static IEnumerator RoyalPhase2(IEnumerator values)
			{
				yield return values;
				if (!AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType))
				{
					yield break;
				}
				Singleton<ChallengeActivationUI>.Instance.ShowActivation(harderFinalBossChallenge.challengeType);
				_ = Singleton<BoardManager>.Instance.OpponentSlotsCopy;
				if (AscensionSaveData.Data.ChallengeIsActive(travelingOuroChallenge.challengeType))
				{
					Log.LogInfo((object)"Creating an Ouroboros...");
					CardInfo ouro = CardLoader.GetCardByName("bitty_TravelingOuroboros");
					CardModificationInfo mod = new CardModificationInfo();
					mod.fromCardMerge = true;
					mod.abilities.Add((Ability)8);
					for (int i = 1; i <= AscensionStatsData.GetStatValue((Type)2, false); i++)
					{
						Log.LogInfo((object)i);
						mod.abilities.Add(MiscEncounters.ValidAbilities(i).ability);
					}
					mod.attackAdjustment = MiscEncounters.TravelingOuroborosBuffs();
					mod.healthAdjustment = MiscEncounters.TravelingOuroborosBuffs();
					if (MiscEncounters.TravelingOuroborosBuffs() < AscensionStatsData.GetStatValue((Type)2, false))
					{
						mod.attackAdjustment = AscensionStatsData.GetStatValue((Type)2, false);
						mod.healthAdjustment = AscensionStatsData.GetStatValue((Type)2, false);
					}
					ouro.mods.Add(mod);
					List<CardSlot> opponentSlotsCopy2 = Singleton<BoardManager>.Instance.OpponentSlotsCopy;
					opponentSlotsCopy2.RemoveAll((CardSlot x) => Object.op_Implicit((Object)(object)Singleton<Opponent>.Instance.queuedCards.Find((PlayableCard y) => (Object)(object)y.QueuedSlot == (Object)(object)x)));
					if (opponentSlotsCopy2.Count >= 1)
					{
						yield return Singleton<Opponent>.Instance.QueueCard(ouro, opponentSlotsCopy2[0], true, true, true);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("RoyalOuro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
						Log.LogInfo((object)"Ouro Sequence Finished");
					}
				}
				else
				{
					yield return (object)new WaitForSeconds(0.4f);
					CardInfo mole = CardLoader.GetCardByName("MoleSeaman");
					CardModificationInfo mod2 = new CardModificationInfo();
					mod2.attackAdjustment = 1;
					mod2.healthAdjustment = 4;
					mod2.abilities.Add((Ability)34);
					mod2.nameReplacement = "Mole Firstmate";
					CardExtensions.AddAppearances(mole, (Appearance[])(object)new Appearance[1] { (Appearance)6 });
					mole.mods.Add(mod2);
					List<CardSlot> opponentSlotsCopy = Singleton<BoardManager>.Instance.OpponentSlotsCopy;
					opponentSlotsCopy.RemoveAll((CardSlot x) => Object.op_Implicit((Object)(object)Singleton<Opponent>.Instance.queuedCards.Find((PlayableCard y) => (Object)(object)y.QueuedSlot == (Object)(object)x)));
					if (opponentSlotsCopy.Count >= 1)
					{
						yield return Singleton<Opponent>.Instance.QueueCard(mole, opponentSlotsCopy[0], true, true, true);
						Log.LogInfo((object)"Playing animation");
						View oldView = Singleton<ViewManager>.Instance.CurrentView;
						Singleton<ViewManager>.Instance.SwitchToView((View)6, false, false);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("RoyalFirstMate", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
						yield return (object)new WaitForSeconds(0.5f);
						Singleton<ViewManager>.Instance.SwitchToView(oldView, false, false);
					}
				}
				Log.LogInfo((object)"Phase 2 additions complete");
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(Part1Opponent), "TryModifyCardWithTotem")]
			public static void RoyalTotem(PlayableCard card)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Invalid comparison between Unknown and I4
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Expected O, but got Unknown
				if (AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType) && (Object)(object)Singleton<Part1Opponent>.Instance.totem != (Object)null && (int)((Opponent)Singleton<Part1Opponent>.Instance).OpponentType == 20)
				{
					((Card)card).StatsLayer.SetEmissionColor(Singleton<Part1Opponent>.Instance.InteractablesGlowColor);
					if (!card.TemporaryMods.Exists((CardModificationInfo x) => x.fromTotem) && !((Card)card).Info.HasTrait((Trait)16))
					{
						card.AddTemporaryMod(new CardModificationInfo
						{
							abilities = { ((Totem)Singleton<Part1Opponent>.Instance.totem).TotemItemData.bottom.effectParams.ability },
							fromTotem = true
						});
					}
				}
			}
		}

		public class StarterChallengesPatch
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(StarterChallengesPatch));
			}

			[HarmonyPatch(typeof(RunIntroSequencer), "TryModifyStarterCards")]
			[HarmonyPostfix]
			public static void StartersPatch()
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_016c: Unknown result type (might be due to invalid IL or missing references)
				//IL_023d: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Expected O, but got Unknown
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0113: Unknown result type (might be due to invalid IL or missing references)
				//IL_011a: Expected O, but got Unknown
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Expected O, but got Unknown
				//IL_0297: Unknown result type (might be due to invalid IL or missing references)
				//IL_029c: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a3: Expected O, but got Unknown
				//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
				if (AscensionSaveData.Data.ChallengeIsActive(waterborneStarterChallenge.challengeType))
				{
					foreach (CardInfo card in ((CardCollectionInfo)RunState.Run.playerDeck).Cards)
					{
						if (!card.HasTrait((Trait)13))
						{
							Log.LogInfo((object)"Waterborne Check");
							CardModificationInfo val = new CardModificationInfo((Ability)13);
							if (!card.HasAbility((Ability)13))
							{
								RunState.Run.playerDeck.ModifyCard(card, val);
							}
						}
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(shockedStarterChallenge.challengeType))
				{
					foreach (CardInfo card2 in ((CardCollectionInfo)RunState.Run.playerDeck).Cards)
					{
						if (!card2.HasTrait((Trait)13))
						{
							Log.LogInfo((object)"Paralysis Check");
							CardModificationInfo val2 = new CardModificationInfo(GiveParalysis.ability);
							if (!card2.HasAbility(GiveParalysis.ability))
							{
								RunState.Run.playerDeck.ModifyCard(card2, val2);
							}
						}
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(weakStartersChallenge.challengeType))
				{
					foreach (CardInfo card3 in ((CardCollectionInfo)RunState.Run.playerDeck).Cards)
					{
						if (!card3.HasTrait((Trait)13))
						{
							Log.LogInfo((object)"Weak Check");
							CardModificationInfo val3 = new CardModificationInfo();
							val3.healthAdjustment = -1;
							if (card3.Health > 1)
							{
								val3.nameReplacement = "Weak " + card3.displayedName;
								RunState.Run.playerDeck.ModifyCard(card3, val3);
							}
						}
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(weakSoulStarterChallenge.challengeType))
				{
					foreach (CardInfo card4 in ((CardCollectionInfo)RunState.Run.playerDeck).Cards)
					{
						if (!card4.HasTrait((Trait)13))
						{
							Log.LogInfo((object)"Weak Soul Check");
							CardModificationInfo val4 = new CardModificationInfo(GiveNoTransfer.ability);
							if (!card4.HasAbility(GiveNoTransfer.ability))
							{
								RunState.Run.playerDeck.ModifyCard(card4, val4);
							}
						}
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(ascenderBaneChallenge.challengeType))
				{
					Log.LogInfo((object)"Ascender's Bane Check");
					((CardCollectionInfo)RunState.Run.playerDeck).AddCard(CardLoader.GetCardByName("bitty_Ascender's Bane"));
				}
			}

			[HarmonyPatch(typeof(RunIntroSequencer), "RunIntroSequence")]
			[HarmonyPostfix]
			public static IEnumerator StartersAnnouncer(IEnumerator values)
			{
				yield return values;
				bool dialoguePlayed = false;
				if (AscensionSaveData.Data.ChallengeIsActive(waterborneStarterChallenge.challengeType))
				{
					yield return (object)new WaitForSeconds(0.5f);
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(waterborneStarterChallenge.challengeType);
					if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("WaterborneStart"))
					{
						dialoguePlayed = true;
						yield return (object)new WaitForSeconds(0.5f);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("WaterborneStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(shockedStarterChallenge.challengeType))
				{
					yield return (object)new WaitForSeconds(0.5f);
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(shockedStarterChallenge.challengeType);
					if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("ShockedStart"))
					{
						dialoguePlayed = true;
						yield return (object)new WaitForSeconds(0.5f);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("ShockedStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(weakStartersChallenge.challengeType))
				{
					yield return (object)new WaitForSeconds(0.5f);
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(weakStartersChallenge.challengeType);
					bool weakenedCards = false;
					foreach (CardInfo cardInfo in ((CardCollectionInfo)RunState.Run.playerDeck).Cards)
					{
						if (!cardInfo.HasTrait((Trait)13) && cardInfo.Health != cardInfo.baseHealth)
						{
							weakenedCards = true;
						}
					}
					if (!dialoguePlayed && !IsP03Run && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("WeakStart") && weakenedCards)
					{
						dialoguePlayed = true;
						yield return (object)new WaitForSeconds(0.5f);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("WeakStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
					else if (!dialoguePlayed && IsP03Run && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("P03WeakStart") && weakenedCards)
					{
						dialoguePlayed = true;
						yield return (object)new WaitForSeconds(0.5f);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("P03WeakStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(weakSoulStarterChallenge.challengeType))
				{
					yield return (object)new WaitForSeconds(0.5f);
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(weakSoulStarterChallenge.challengeType);
					if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("WeakSoulStart"))
					{
						dialoguePlayed = true;
						yield return (object)new WaitForSeconds(0.5f);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("WeakSoulStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
				if (AscensionSaveData.Data.ChallengeIsActive(ascenderBaneChallenge.challengeType))
				{
					yield return (object)new WaitForSeconds(0.5f);
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(ascenderBaneChallenge.challengeType);
					if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("AscenderBaneStart"))
					{
						yield return (object)new WaitForSeconds(0.5f);
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("AscenderBaneStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
			}
		}

		public class EncounterAddPatches
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(EncounterAddPatches));
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(EncounterBuilder), "Build")]
			public static void AddToEncounter(ref EncounterData __result, CardBattleNodeData nodeData)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0253: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Expected O, but got Unknown
				//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0302: Expected O, but got Unknown
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				List<List<CardInfo>> opponentTurnPlan = __result.opponentTurnPlan;
				if (AscensionSaveData.Data.ChallengeIsActive(travelingOuroChallenge.challengeType))
				{
					Log.LogInfo((object)"Checking to see if we should add Ouroboros...");
					if (MiscEncounters.RollForOuro(nodeData))
					{
						Log.LogInfo((object)"Creating an Ouroboros...");
						CardInfo cardByName = CardLoader.GetCardByName("bitty_TravelingOuroboros");
						CardModificationInfo val = new CardModificationInfo();
						if (IsP03Run)
						{
							cardByName.portraitTex = Tools.LoadSprite("portrait_ourobot.png");
							val.nameReplacement = "Ourobot";
						}
						val.abilities.Add((Ability)18);
						if (!IsP03Run)
						{
							val.fromCardMerge = true;
							for (int i = 1; i <= AscensionStatsData.GetStatValue((Type)2, false); i++)
							{
								Log.LogInfo((object)i);
								val.abilities.Add(MiscEncounters.ValidAbilities(i).ability);
							}
						}
						val.attackAdjustment = MiscEncounters.TravelingOuroborosBuffs();
						val.healthAdjustment = MiscEncounters.TravelingOuroborosBuffs();
						if (!IsP03Run && MiscEncounters.TravelingOuroborosBuffs() < AscensionStatsData.GetStatValue((Type)2, false))
						{
							val.attackAdjustment = AscensionStatsData.GetStatValue((Type)2, false);
							val.healthAdjustment = AscensionStatsData.GetStatValue((Type)2, false);
						}
						cardByName.mods.Add(val);
						Log.LogInfo((object)"Finding Ouro placement...");
						int num = ((IsP03Run && opponentTurnPlan[3].Count <= 1) ? 3 : (IsP03Run ? 4 : ((opponentTurnPlan[0].Count > 1) ? 1 : 0)));
						if (opponentTurnPlan[num].Count < Singleton<BoardManager>.Instance.PlayerSlotsCopy.Count)
						{
							Log.LogInfo((object)"Adding Ouro to turn plan...");
							opponentTurnPlan[num].Add(cardByName);
							Log.LogInfo((object)$"Added Ouroboros in turn {num}");
						}
					}
					else
					{
						Log.LogInfo((object)"Failed Ouro Roll...");
					}
				}
				if (!AscensionSaveData.Data.ChallengeIsActive(goldenSheepChallenge.challengeType))
				{
					return;
				}
				Log.LogInfo((object)"Golden Ram Challenge on...");
				Log.LogInfo((object)"Checking to see if we should add Golden Ram...");
				int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed();
				bool flag = SeededRandom.Range(0, 3, currentRandomSeed) == 0;
				flag = true;
				Log.LogInfo((object)("Sheep Roll: " + flag));
				if (flag && MiscEncounters.TimesGoldenSheepKilled() < AscensionStatsData.GetStatValue((Type)2, false))
				{
					Log.LogInfo((object)"Creating a Golden Ram...");
					CardInfo cardByName2 = CardLoader.GetCardByName("bitty_GoldenSheep");
					CardModificationInfo val2 = new CardModificationInfo();
					val2.healthAdjustment += AscensionStatsData.GetStatValue((Type)2, false);
					cardByName2.mods.Add(val2);
					Log.LogInfo((object)"Finding Golden Ram placement...");
					int index = ((opponentTurnPlan[0].Count > 1) ? 1 : 0);
					if (opponentTurnPlan[index].Count < Singleton<BoardManager>.Instance.PlayerSlotsCopy.Count)
					{
						Log.LogInfo((object)"Adding Gold Ram to turn plan...");
						opponentTurnPlan[index].Add(cardByName2);
						Log.LogInfo((object)("added gold ram to " + index));
					}
				}
				else
				{
					Log.LogInfo((object)"Failed Roll...");
				}
			}
		}

		public class BotchedPatch
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(BotchedPatch));
			}

			[HarmonyPatch(typeof(DuplicateMergeSequencer), "MergeCards")]
			[HarmonyPostfix]
			public static CardInfo MycoPatch(CardInfo card1)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Expected O, but got Unknown
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
				if (AscensionSaveData.Data.ChallengeIsActive(mycoChallenge.challengeType))
				{
					bool flag = false;
					CardModificationInfo val = new CardModificationInfo();
					int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed();
					float num = SeededRandom.Value(currentRandomSeed++);
					if (num < 0.33f && card1.Mods.Exists((CardModificationInfo x) => x.abilities.Count > 0))
					{
						List<CardModificationInfo> list = card1.Mods.FindAll((CardModificationInfo x) => x.abilities.Count > 0);
						list[SeededRandom.Range(0, list.Count, currentRandomSeed++)].abilities[0] = ValidMycoAbilities(1).ability;
						flag = true;
						((MonoBehaviour)Singleton<TextDisplayer>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("MycoFailSigils", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null));
					}
					else if (num < 0.66f && card1.Attack > 0)
					{
						int num2 = card1.Attack / 2;
						val.attackAdjustment = -num2;
						flag = true;
						((MonoBehaviour)Singleton<TextDisplayer>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("MycoFailAttack", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null));
					}
					else if (card1.Health > 1)
					{
						int num3 = card1.Health / 2;
						val.healthAdjustment = -num3;
						flag = true;
						((MonoBehaviour)Singleton<TextDisplayer>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("MycoFailHealth", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null));
					}
					RunState.Run.playerDeck.ModifyCard(card1, val);
					if (flag)
					{
						Singleton<ChallengeActivationUI>.Instance.ShowActivation(mycoChallenge.challengeType);
						flag = false;
					}
				}
				return card1;
			}

			public static AbilityInfo ValidMycoAbilities(int plus)
			{
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				List<AbilityInfo> list = ScriptableObjectLoader<AbilityInfo>.AllData.FindAll((AbilityInfo x) => (int)x.ability == 102 || (int)x.ability == 16 || x.ability == GiveStrafePull.ability || x.ability == GiveStrafeSticky.ability || (int)x.ability == 104 || (int)x.ability == 8 || (int)x.ability == 12 || (int)x.ability == 13 || (int)x.ability == 18 || (int)x.ability == 23 || (int)x.ability == 19 || (int)x.ability == 31 || x.ability == GiveFragile.ability || (int)x.ability == 105 || (int)x.ability == 76 || (int)x.ability == 101 || (int)x.ability == 28 || (int)x.ability == 35);
				int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed();
				AbilityInfo val = list[SeededRandom.Range(0, list.Count, currentRandomSeed + plus)];
				Log.LogInfo((object)val.ability);
				return val;
			}
		}

		public class SideDeckPatch
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(SideDeckPatch));
			}

			[HarmonyPatch(typeof(CardDrawPiles3D), "InitializePiles")]
			[HarmonyPostfix]
			public static void AbundanceFaminePatch()
			{
				//IL_000b: 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)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_0221: Unknown result type (might be due to invalid IL or missing references)
				//IL_028f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_0368: Unknown result type (might be due to invalid IL or missing references)
				if (AscensionSaveData.Data.ChallengeIsActive(famineChallenge.challengeType) || AscensionSaveData.Data.ChallengeIsActive(abundanceChallenge.challengeType))
				{
					int num = 0;
					int num2 = 0;
					for (int i = 0; i < AscensionSaveData.Data.GetNumChallengesOfTypeActive(famineChallenge.challengeType); i++)
					{
						num++;
					}
					for (int j = 0; j < AscensionSaveData.Data.GetNumChallengesOfTypeActive(abundanceChallenge.challengeType); j++)
					{
						num2++;
					}
					Log.LogInfo((object)("Famine Severity: " + num * famineRemoval.Value));
					Log.LogInfo((object)("Abundance Quality: " + num2 * abundanceQuality.Value));
					ChallengeActivationUI.TryShowActivation(abundanceChallenge.challengeType);
					CardInfo val = ((Singleton<CardDrawPiles3D>.Instance.SideDeck.cards.Count > 0) ? Singleton<CardDrawPiles3D>.Instance.SideDeck.cards[0] : CardLoader.GetCardByName("Bee"));
					Log.LogInfo((object)val.displayedName);
					for (int k = 0; k < num2 * abundanceQuality.Value; k++)
					{
						Singleton<CardDrawPiles3D>.Instance.sidePile.CreateCards(1, 15f);
						Singleton<CardDrawPiles3D>.Instance.SideDeck.AddCard(val);
					}
					ChallengeActivationUI.TryShowActivation(famineChallenge.challengeType);
					for (int l = 0; l < Math.Min(10, num * famineRemoval.Value); l++)
					{
						CardDrawPiles3D.Instance.SidePile.Draw();
						CardDrawPiles3D.Instance.SideDeck.Draw();
					}
					Log.LogInfo((object)("Total cards in side deck: " + CardDrawPiles3D.Instance.SideDeck.CardsInDeck));
					if (AscensionSaveData.Data.ChallengeIsActive(famineChallenge.challengeType) && !DialogueEventsData.EventIsPlayed("P03FamineIntro") && IsP03Run)
					{
						((MonoBehaviour)Singleton<CardDrawPiles3D>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("P03FamineIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { val.displayedName }, (Action<Line>)global::Dialogue.Dialogue.P03HappyCloseUp));
					}
					else if (AscensionSaveData.Data.ChallengeIsActive(famineChallenge.challengeType) && !DialogueEventsData.EventIsPlayed("FamineIntro"))
					{
						((MonoBehaviour)Singleton<CardDrawPiles3D>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("FamineIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { val.displayedName }, (Action<Line>)null));
					}
					else if (AscensionSaveData.Data.ChallengeIsActive(abundanceChallenge.challengeType) && !DialogueEventsData.EventIsPlayed("P03AbundanceIntro") && IsP03Run)
					{
						((MonoBehaviour)Singleton<CardDrawPiles3D>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("P03AbundanceIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { (num2 * abundanceQuality.Value).ToString() }, (Action<Line>)global::Dialogue.Dialogue.P03HappyCloseUp));
					}
					else if (AscensionSaveData.Data.ChallengeIsActive(abundanceChallenge.challengeType) && !DialogueEventsData.EventIsPlayed("AbundanceIntro"))
					{
						((MonoBehaviour)Singleton<CardDrawPiles3D>.Instance).StartCoroutine(Singleton<TextDisplayer>.Instance.PlayDialogueEvent("AbundanceIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { val.displayedName }, (Action<Line>)null));
					}
				}
			}
		}

		public class SprinterDraw
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(SprinterDraw));
			}

			[HarmonyPatch(typeof(PlayerHand), "AddCardToHand")]
			[HarmonyPostfix]
			public static void SprinterHandPatch(ref PlayableCard card)
			{
				//IL_000b: 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)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Expected O, but got Unknown
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				if (AscensionSaveData.Data.ChallengeIsActive(sprinterChallenge.challengeType))
				{
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(sprinterChallenge.challengeType);
					CardModificationInfo val = new CardModificationInfo();
					if (!IsP03Run)
					{
						val.fromCardMerge = true;
					}
					val.abilities.Add(GetRandomStrafe().ability);
					if (!IsP03Run || CardExtensions.AllAbilities(card).Count() <= 4)
					{
						card.AddTemporaryMod(val);
					}
					if (!IsP03Run && !CardDisplayer3D.EmissionEnabledForCard(((Card)card).renderInfo, card))
					{
						((Card)card).RenderInfo.forceEmissivePortrait = true;
						((Card)card).StatsLayer.SetEmissionColor(GameColors.Instance.lightPurple);
					}
					((Card)card).RenderCard();
				}
			}

			public static AbilityInfo GetRandomStrafe()
			{
				List<AbilityInfo> list = ScriptableObjectLoader<AbilityInfo>.AllData.FindAll((AbilityInfo x) => (int)x.ability == 102 || (int)x.ability == 16 || (int)x.ability == 3 || (int)x.ability == 88 || x.ability == GiveStrafeSticky.ability || x.ability == GiveWarper.ability || x.ability == GiveStrafePull.ability || x.ability == GiveStrafeSuper.ability);
				return list[Random.Range(0, list.Count)];
			}
		}

		public class NoFecundityNerf
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(NoFecundityNerf));
			}

			[HarmonyPatch(typeof(DrawCopy))]
			[HarmonyPatch(/*Could not decode attribute arguments.*/)]
			[HarmonyPostfix]
			private static void Postfix(ref List<CardModificationInfo> __result)
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(oldFecundChallenge.challengeType))
				{
					__result = null;
				}
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(DrawCopy), "OnResolveOnBoard")]
			public static IEnumerator UnNerfDialogue(IEnumerator values)
			{
				yield return values;
				if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(oldFecundChallenge.challengeType) && (!DialogueEventsData.EventIsPlayed("P03FecundityUnNerfIntro") || !DialogueEventsData.EventIsPlayed("FecundityUnNerfIntro")))
				{
					Singleton<ChallengeActivationUI>.Instance.ShowTextLines(new string[3]
					{
						Localization.Translate("DEPLOY SIGIL UNNERF: FECUNDITY"),
						Localization.Translate("AddSigilToCopy()"),
						Localization.Translate("// It was asked for.")
					});
					yield return (object)new WaitForSeconds(0.5f);
					if (IsP03Run && !DialogueEventsData.EventIsPlayed("P03FecundityUnNerfIntro"))
					{
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("P03FecundityUnNerfIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)global::Dialogue.Dialogue.P03HappyCloseUp);
					}
					else if (!IsP03Run && !DialogueEventsData.EventIsPlayed("FecundityUnNerfIntro"))
					{
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("FecundityUnNerfIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
			}
		}

		public class HarderBosses
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(HarderBosses));
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(TurnManager), "SetupPhase")]
			public static void ChallengeActivations()
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: 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)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Invalid comparison between Unknown and I4
				if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(harderBossesChallenge.challengeType) && (int)Singleton<Opponent>.Instance.OpponentType != 0 && (int)Singleton<Opponent>.Instance.OpponentType != 2)
				{
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(harderBossesChallenge.challengeType);
				}
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(TradeCardsForPelts), "TradePhase")]
			public static IEnumerator PostTradePlayQueueCards(IEnumerator values)
			{
				yield return values;
				if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(harderBossesChallenge.challengeType))
				{
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(harderBossesChallenge.challengeType);
					yield return Singleton<TurnManager>.Instance.opponent.PlayCardsInQueue(0.1f);
				}
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(Part1Opponent), "TryModifyCardWithTotem")]
			public static void AddToSignatures(PlayableCard card)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: 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_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Invalid comparison between Unknown and I4
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Invalid comparison between Unknown and I4
				//IL_0129: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Invalid comparison between Unknown and I4
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Invalid comparison between Unknown and I4
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Expected O, but got Unknown
				//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ce: Invalid comparison between Unknown and I4
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				//IL_016a: Expected O, but got Unknown
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Expected O, but got Unknown
				//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c7: Invalid comparison between Unknown and I4
				//IL_020f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0216: Expected O, but got Unknown
				//IL_01af: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b6: Expected O, but got Unknown
				//IL_0104: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Expected O, but got Unknown
				//IL_0306: Unknown result type (might be due to invalid IL or missing references)
				//IL_030d: Expected O, but got Unknown
				//IL_025b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Expected O, but got Unknown
				//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0406: Expected O, but got Unknown
				//IL_0352: Unknown result type (might be due to invalid IL or missing references)
				//IL_0359: Expected O, but got Unknown
				//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ad: Expected O, but got Unknown
				//IL_044b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0452: Expected O, but got Unknown
				//IL_039e: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a5: Expected O, but got Unknown
				//IL_0496: Unknown result type (might be due to invalid IL or missing references)
				//IL_049d: Expected O, but got Unknown
				//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0500: Expected O, but got Unknown
				Type opponentType = ((Opponent)Singleton<Part1Opponent>.Instance).OpponentType;
				if (!AscensionSaveData.Data.ChallengeIsActive(harderBossesChallenge.challengeType) || (int)opponentType == 0 || (int)opponentType == 2)
				{
					return;
				}
				if ((int)opponentType == 3)
				{
					if (((Object)((Card)card).Info).name == "Mule")
					{
						Log.LogInfo((object)"Mule Check");
						CardModificationInfo val = new CardModificationInfo();
						val.abilities.Add((Ability)62);
						ApplyMods(val, card);
					}
					if (((Object)((Card)card).Info).name == "Bloodhound")
					{
						Log.LogInfo((object)"Bloodhound Check");
						CardModificationInfo val2 = new CardModificationInfo();
						val2.abilities.Add((Ability)4);
						ApplyMods(val2, card);
					}
					if (((Object)((Card)card).Info).name == "Coyote")
					{
						Log.LogInfo((object)"Coyote Check");
						CardModificationInfo val3 = new CardModificationInfo();
						val3.abilities.Add((Ability)4);
						ApplyMods(val3, card);
					}
				}
				else if ((int)opponentType == 4)
				{
					if (((Object)((Card)card).Info).name == "Kingfisher")
					{
						Log.LogInfo((object)"Kingfisher Check");
						CardModificationInfo val4 = new CardModificationInfo();
						val4.abilities.Add((Ability)34);
						ApplyMods(val4, card);
					}
					if (((Object)((Card)card).Info).name == "BaitBucket")
					{
						Log.LogInfo((object)"BaitBucket Check");
						CardModificationInfo val5 = new CardModificationInfo();
						val5.abilities.Add((Ability)23);
						ApplyMods(val5, card);
					}
				}
				else if ((int)opponentType == 6)
				{
					if (((Object)((Card)card).Info).name == "Bullfrog")
					{
						Log.LogInfo((object)"Bullfrog Check");
						CardModificationInfo val6 = new CardModificationInfo();
						val6.abilities.Add((Ability)30);
						ApplyMods(val6, card);
					}
					if (((Object)((Card)card).Info).name == "Rabbit")
					{
						Log.LogInfo((object)"Rabbit Check");
						CardModificationInfo val7 = new CardModificationInfo();
						val7.abilities.Add((Ability)8);
						ApplyMods(val7, card);
					}
					if (((Object)((Card)card).Info).name == "TrapFrog")
					{
						Log.LogInfo((object)"TrapFrog Check");
						CardModificationInfo val8 = new CardModificationInfo();
						val8.abilities.Add((Ability)18);
						ApplyMods(val8, card);
					}
				}
				else if ((int)opponentType == 7)
				{
					if (((Object)((Card)card).Info).name == "Amalgam")
					{
						Log.LogInfo((object)"Amalgam Check");
						CardModificationInfo val9 = new CardModificationInfo();
						val9.abilities.Add((Ability)15);
						ApplyMods(val9, card);
					}
					if (((Object)((Card)card).Info).name == "MantisGod")
					{
						Log.LogInfo((object)"MantisGod Check");
						CardModificationInfo val10 = new CardModificationInfo();
						val10.abilities.Add((Ability)24);
						ApplyMods(val10, card);
					}
					if (((Object)((Card)card).Info).name == "Mantis")
					{
						Log.LogInfo((object)"Mantis Check");
						CardModificationInfo val11 = new CardModificationInfo();
						val11.abilities.Add((Ability)100);
						ApplyMods(val11, card);
					}
				}
				else if ((int)opponentType == 20)
				{
					if (((Object)((Card)card).Info).name == "MoleSeaman")
					{
						Log.LogInfo((object)"MoleSeaman Check");
						CardModificationInfo val12 = new CardModificationInfo();
						val12.abilities.Add((Ability)47);
						ApplyMods(val12, card);
					}
					if (((Object)((Card)card).Info).name == "SkeletonPirate")
					{
						Log.LogInfo((object)"SkeletonPirate Check");
						CardModificationInfo val13 = new CardModificationInfo();
						val13.abilities.Add((Ability)4);
						ApplyMods(val13, card);
					}
					if (((Object)((Card)card).Info).name == "SkeletonParrot")
					{
						Log.LogInfo((object)"SkeletonParrot Check");
						CardModificationInfo val14 = new CardModificationInfo();
						val14.abilities.Add((Ability)26);
						CardExtensions.SetIceCube(((Card)card).Info, CardLoader.GetCardByName("Maggots"), (IEnumerable<CardModificationInfo>)null);
						ApplyMods(val14, card);
					}
					if (((Object)((Card)card).Info).name == "Maggots")
					{
						Log.LogInfo((object)"Maggots Check");
						CardModificationInfo val15 = new CardModificationInfo();
						val15.abilities.Add((Ability)35);
						ApplyMods(val15, card);
					}
				}
			}

			public static void ApplyMods(CardModificationInfo mod, PlayableCard card)
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				Log.LogInfo((object)"Adding Mods...");
				mod.fromCardMerge = true;
				card.AddTemporaryMod(mod);
				if (!CardDisplayer3D.EmissionEnabledForCard(((Card)card).renderInfo, card))
				{
					((Card)card).RenderInfo.forceEmissivePortrait = true;
					((Card)card).StatsLayer.SetEmissionColor(GameColors.Instance.nearWhite);
				}
				((Card)card).RenderCard();
			}
		}

		public class InfiniteLives
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(InfiniteLives));
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(LifeManager), "ShowDamageSequence")]
			public static IEnumerator GiveLife(IEnumerator values)
			{
				yield return values;
				if (!SaveFile.IsAscension || !AscensionSaveData.Data.ChallengeIsActive(infiniteLivesChallenge.challengeType) || Singleton<LifeManager>.Instance.Balance > -5)
				{
					yield break;
				}
				Singleton<ChallengeActivationUI>.Instance.ShowActivation(infiniteLivesChallenge.challengeType);
				LifeRepeatsIncrease();
				yield return Singleton<LifeManager>.Instance.ShowResetSequence();
				if (LifeRepeats() < Math.Max(0, allowedResets.Value))
				{
					if (!DialogueEventsData.EventIsPlayed("InfiniteLivesIntro"))
					{
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("InfiniteLivesIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
					else if ((int)Singleton<Opponent>.Instance.OpponentType == 20)
					{
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("InfiniteLivesRoyal", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
					else
					{
						yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("InfiniteLivesRepeat", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					}
				}
				else if (LifeRepeats() == Math.Max(0, allowedResets.Value))
				{
					yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("InfiniteLivesLoop", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
				}
				else
				{
					yield return Singleton<TextDisplayer>.Instance.PlayDialogueEvent("InfiniteLivesLoopBreak", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action<Line>)null);
					Singleton<LifeManager>.Instance.SetNumWeightsImmediate(5, 0);
					LifeRepeatsReset();
				}
			}

			public static int LifeRepeats()
			{
				return ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.LifeRepeats");
			}

			public static void LifeRepeatsIncrease(int by = 1)
			{
				int num = ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.LifeRepeats") + by;
				Log.LogInfo((object)$"Increasing LifeResets by {by} to {num}");
				ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.LifeRepeats", (object)num.ToString());
			}

			public static void LifeRepeatsReset(int num = 0)
			{
				Log.LogInfo((object)string.Format("Setting LifeResets to ", num));
				ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.LifeRepeats", (object)num.ToString());
			}
		}

		public class ReverseScales
		{
			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(ReverseScales));
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(TurnManager), "SetupPhase")]
			public static IEnumerator TipScale(IEnumerator values)
			{
				yield return values;
				if (AscensionSaveData.Data.ChallengeIsActive(reverseScalesChallenge.challengeType))
				{
					Singleton<ChallengeActivationUI>.Instance.ShowActivation(reverseScalesChallenge.challengeType);
					yield return Singleton<LifeManager>.Instance.ShowDamageSequence(1, 1, false, 0.125f, (GameObject)null, 0f, false);
				}
			}
		}

		public class Environment
		{
			public static List<Type> allEnvironmentBoons = new List<Type>
			{
				ChallengeBoonCliffs.boo,
				ChallengeBoonFlashGrowth.boo,
				ChallengeBoonTotem.boo,
				ChallengeBoonMud.boo,
				ChallengeBoonHail.boo,
				ChallengeBoonBreeze.boo,
				ChallengeBoonGraveyard.boo,
				ChallengeBoonDynamite.boo,
				ChallengeBoonBait.boo,
				ChallengeBoonTrap.boo,
				ChallengeBoonObelisk.boo,
				ChallengeBoonMushrooms.boo,
				ChallengeBoonBloodMoon.boo,
				ChallengeBoonMinicello.boo,
				ChallengeBoonCarrotPatch.boo,
				ChallengeBoonDarkForest.boo,
				ChallengeBoonFlood.boo,
				ChallengeBoonBlizzard.boo,
				ChallengeBoonConveyor.boo,
				ChallengeBoonGemSanctuary.boo,
				ChallengeBoonElectricStorm.boo
			};

			public static void Register(Harmony harmony)
			{
				harmony.PatchAll(typeof(Environment));
			}

			public static int EnvironmentNumber()
			{
				Log.LogInfo((object)ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber"));
				return ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber");
			}

			public static void ResetEnviroNumber(int value = 0)
			{
				Log.LogInfo((object)$"Resetting Environment Number to {value}");
				ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber", (object)value);
			}

			public static void IncreaseEnviroNumber(int by = 1)
			{
				int num = ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber") + by;
				Log.LogInfo((object)$"Increasing Environment Number by {by} to {num}");
				ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber", (object)num.ToString());
				Log.LogInfo((object)EnvironmentNumber());
			}

			[HarmonyPatch(/*Could not decode attribute arguments.*/)]
			[HarmonyPostfix]
			public static void OverrideBoonsEnabled(BoonsHandler __instance, ref bool __result)
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				if (AscensionSaveData.Data.ChallengeIsActive(environmentChallenge.challengeType))
				{
					__result = true;
				}
			}

			[HarmonyPatch(typeof(TurnManager), "SetupPhase")]
			[HarmonyPrefix]
			public static bool EnvironmentBoonGiver(ref IEnumerator __result)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: 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_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Invalid comparison between Unknown and I4
				//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0618: Unknown result type (might be due to invalid IL or missing references)
				//IL_0649: Unknown result type (might be due to invalid IL or missing references)
				//IL_067a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_0248: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_0367: Unknown result type (might be due to invalid IL or missing references)
				//IL_0398: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0168: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0700: Unknown result type (might be due to invalid IL or missing references)
				//IL_0705: Unknown result type (might be due to invalid IL or missing references)
				//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_019b: Unknown result type (might be due to invalid IL or missing references)
				//IL_031e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0481: Unknown result type (might be due to invalid IL or missing references)
				//IL_0446: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0515: Unknown result type (might be due to invalid IL or missing references)
				//IL_0548: Unknown result type (might be due to invalid IL or missing references)
				//IL_057b: Unknown result type (might be due to invalid IL or missing references)
				Type opponentType = Singleton<Opponent>.Instance.OpponentType;
				if (AscensionSaveData.Data.ChallengeIsActive(environmentChallenge.challengeType) && ((int)opponentType == 0 || (int)opponentType == 2))
				{
					ClearEnvironmentBoons();
					IncreaseEnviroNumber();
					List<Type> list = new List<Type>();
					if (!IsP03Run)
					{
						Log.LogInfo((object)("Region Tier: " + RunState.CurrentRegionTier));
						if (RunState.CurrentRegionTier >= 0)
						{
							list.Add(ChallengeBoonCliffs.boo);
							Log.LogInfo((object)("Added Cliffs to boons pool: " + ((object)(Type)(ref ChallengeBoonCliffs.boo)).ToString()));
							Log.LogInfo((object)("Region: " + ((Object)RunState.CurrentMapRegion).name));
							switch (((Object)RunState.CurrentMapRegion).name)
							{
							case "Forest":
								list.Add(ChallengeBoonTotem.boo);
								Log.LogInfo((object)("Added Totem to boons pool: " + ((object)(Type)(ref ChallengeBoonTotem.boo)).ToString()));
								break;
							case "Wetlands":
								list.Add(ChallengeBoonMud.boo);
								Log.LogInfo((object)("Added Mud to boons pool: " + ((object)(Type)(ref ChallengeBoonMud.boo)).ToString()));
								break;
							case "Alpine":
								list.Add(ChallengeBoonHail.boo);
								Log.LogInfo((object)("Added Hail to boons pool: " + ((object)(Type)(ref ChallengeBoonHail.boo)).ToString()));
								break;
							}
						}
						if (RunState.CurrentRegionTier >= 1)
						{
							list.Add(ChallengeBoonBreeze.boo);
							Log.LogInfo((object)("Added Breeze to boons pool: " + ((object)(Type)(ref ChallengeBoonBreeze.boo)).ToString()));
							list.Add(ChallengeBoonFlashGrowth.boo);
							Log.LogInfo((object)("Added Flash Growth to boons pool: " + ((object)(Type)(ref ChallengeBoonFlashGrowth.boo)).ToString()));
							list.Add(ChallengeBoonGraveyard.boo);
							Log.LogInfo((object)("Added Graveyard to boons pool: " + ((object)(Type)(ref ChallengeBoonGraveyard.boo)).ToString()));
							switch (((Object)RunState.CurrentMapRegion).name)
							{
							case "Forest":
								list.Add(ChallengeBoonDynamite.boo);
								Log.LogInfo((object)("Added Prospector's Camp to boons pool: " + ((object)(Type)(ref ChallengeBoonDynamite.boo)).ToString()));
								break;
							case "Wetlands":
								list.Add(ChallengeBoonBait.boo);
								Log.LogInfo((object)("Added Angler's Pool to boons pool: " + ((object)(Type)(ref ChallengeBoonBait.boo)).ToString()));
								break;
							case "Alpine":
								list.Add(ChallengeBoonTrap.boo);
								Log.LogInfo((object)("Added Trapper's Hunting Grounds to boons pool: " + ((object)(Type)(ref ChallengeBoonTrap.boo)).ToString()));
								break;
							}
						}
						if (RunState.CurrentRegionTier >= 2)
						{
							list.Add(ChallengeBoonObelisk.boo);
							Log.LogInfo((object)("Added Obelisk to boons pool: " + ((object)(Type)(ref ChallengeBoonObelisk.boo)).ToString()));
							list.Add(ChallengeBoonMushrooms.boo);
							Log.LogInfo((object)("Added Mushrooms to boons pool: " + ((object)(Type)(ref ChallengeBoonMushrooms.boo)).ToString()));
							if (AscensionSaveData.Data.ChallengeIsActive((AscensionChallenge)13))
							{
								list.Add(ChallengeBoonBloodMoon.boo);
								Log.LogInfo((object)("Added Blood Moon to boons pool: " + ((object)(Type)(ref ChallengeBoonBloodMoon.boo)).ToString()));
							}
							if (AscensionSaveData.Data.ChallengeIsActive((AscensionChallenge)13) && SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + 1) && !DialogueEventsData.EventIsPlayed("CarrotBoonIntro"))
							{
								list.Add(ChallengeBoonCarrotPatch.boo);
								Log.LogInfo((object)("Added Blood Moon(?) to boons pool: " + ((object)(Type)(ref ChallengeBoonCarrotPatch.boo)).ToString()));
							}
							if (AscensionSaveData.Data.ChallengeIsActive(harderFinalBossChallenge.challengeType) || AscensionSaveData.Data.ChallengeIsActive((AscensionChallenge)15))
							{
								list.Add(ChallengeBoonMinicello.boo);
								Log.LogInfo((object)("Added Minicello to boons pool: " + ((object)(Type)(ref ChallengeBoonMinicello.boo)).ToString()));
							}
							switch (((Object)RunState.CurrentMapRegion).name)
							{
							case "Forest":
								list.Add(ChallengeBoonDarkForest.boo);
								Log.LogInfo((object)("Added Dark Forest to boons pool: " + ((object)(Type)(ref ChallengeBoonDarkForest.boo)).ToString()));
								break;
							case "Wetlands":
								list.Add(ChallengeBoonFlood.boo);
								Log.LogInfo((object)("Added Flood to boons pool: " + ((object)(Type)(ref ChallengeBoonFlood.boo)).ToString()));
								break;
							case "Alpine":
								list.Add(ChallengeBoonBlizzard.boo);
								Log.LogInfo((object)("Added Blizzard to boons pool: " + ((object)(Type)(ref ChallengeBoonBlizzard.boo)).ToString()));
								break;
							}
						}
					}
					else
					{
						list.Add(ChallengeBoonGraveyard.boo);
						Log.LogInfo((object)("Added Graveyard to boons pool: " + ((object)(Type)(ref ChallengeBoonGraveyard.boo)).ToString()));
						list.Add(ChallengeBoonFlashGrowth.boo);
						Log.LogInfo((object)("Added Flash Growth to boons pool: " + ((object)(Type)(ref ChallengeBoonFlashGrowth.boo)).ToString()));
						list.Add(ChallengeBoonConveyor.boo);
						Log.LogInfo((object)("Added Conveyor to boons pool: " + ((object)(Type)(ref ChallengeBoonConveyor.boo)).ToString()));
						list.Add(ChallengeBoonGemSanctuary.boo);
						Log.LogInfo((object)("Added Gem Sanctuary to boons pool: " + ((object)(Type)(ref ChallengeBoonGemSanctuary.boo)).ToString()));
						list.Add(ChallengeBoonElectricStorm.boo);
						Log.LogInfo((object)("Added Electrical Storm to boons pool: " + ((object)(Type)(ref ChallengeBoonElectricStorm.boo)).ToString()));
					}
					int index = EnvironmentNumber() % list.Count;
					if (SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + 2) && list != null)
					{
						RunState.Run.playerDeck.AddBoon(list[index]);
						ManualLogSource log = Log;
						Type val = list[index];
						log.LogInfo((object)("Using boon: " + ((object)(Type)(ref val)).ToString()));
					}
				}
				return true;
			}

			[HarmonyPatch(typeof(TurnManager), "CleanupPhase")]
			[HarmonyPostfix]
			public static void EnvironmentBoonCleanup()
			{
				foreach (CardSlot item in Singleton<BoardManager>.Instance.AllSlotsCopy)
				{
					if (SaveManager.SaveFile.IsPart1)
					{
						item.SetTexture(ResourceBank.Get<Texture>("Art/Cards/card_slot"));
					}
					if (SaveManager.SaveFile.IsPart3)
					{
						item.SetTexture(ResourceBank.Get<Texture>("Art/Cards/card_slot_tech"));
					}
					if (SaveManager.SaveFile.IsGrimora)
					{
						item.SetTexture(ResourceBank.Get<Texture>("Art/Cards/card_slot_undead"));
					}
					if (SaveManager.SaveFile.IsMagnificus)
					{
						item.SetTexture(ResourceBank.Get<Texture>("Art/Cards/card_slot_wizard"));
					}
				}
				Singleton<TableVisualEffectsManager>.Instance.ResetTableColors();
				ClearEnvironmentBoons();
			}

			[HarmonyPatch(typeof(BoardManager), "SacrificesCreateRoomForCard")]
			[HarmonyPostfix]
			public static void MergeSigilPatch(ref bool __result)
			{
				foreach (CardSlot item in Singleton<BoardManager>.Instance.PlayerSlotsCopy)
				{
					if ((Object)(object)item.Card != (Object)null)
					{
						CardModificationInfo val = item.Card.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "bitty_mergeSigil");
						if (val != null)
						{
							__result = true;
						}
					}
				}
			}

			public static void ClearEnvironmentBoons()
			{
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				if (RunState.Run.playerDeck.Boons.Count <= 0)
				{
					return;
				}
				foreach (BoonData boon in RunState.Run.playerDeck.Boons)
				{
					if (allEnvironmentBoons.Contains(boon.type))
					{
						DeckInfoExtensions.RemoveAllBoonsOfType(RunState.Run.playerDeck, boon.type);
					}
				}
				Log.LogInfo((object)"Resetting Environment Boons...");
			}
		}

		public class VineBoomDeath : ChallengeBehaviour
		{
			public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
			{
				return true;
			}

			public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer)
			{
				AudioController.Instance.PlaySound2D("vine-boom", (MixerGroup)0, 4f, CustomRandom.RandomBetween(0f, 0.2f), new Pitch((Variation)2), (Repetition)null, (Randomization)null, (Distortion)null, false);
				yield break;
			}

			public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard)
			{
				return true;
			}

			public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard)
			{
				otherCard.Status.hiddenAbilities.Add((Ability)52);
				otherCard.AddTemporaryMod(new CardModificationInfo((Ability)52));
				yield break;
			}
		}

		public class FleetingSquirrels : ChallengeBehaviour
		{
			public string sideDeckName;

			public override bool RespondsToUpkeep(bool playerUpkeep)
			{
				return Singleton<CardDrawPiles3D>.Instance.SideDeck.CardsInDeck > 0;
			}

			public override IEnumerator OnUpkeep(bool playerUpkeep)
			{
				sideDeckName = ((Object)Singleton<CardDrawPiles3D>.Instance.SideDeck.Cards[0]).name;
				yield break;
			}

			public override bool RespondsToOtherCardDrawn(PlayableCard card)
			{
				return ((Object)((Card)card).Info).name == sideDeckName || ((Object)((Card)card).Info).name.ToLower().Contains("emptyvessel");
			}

			public override IEnumerator OnOtherCardDrawn(PlayableCard card)
			{
				card.AddTemporaryMod(new CardModificationInfo(GiveFleeting.ability));
				yield break;
			}
		}

		public class RedrawHand
		{
			[HarmonyPatch(typeof(TurnManager), "SetupPhase")]
			private class CloverGiverPatch
			{
				[HarmonyPostfix]
				public static IEnumerator CloverGiver(IEnumerator __result)
				{
					yield return __result;
					if (AscensionSaveData.Data.ChallengeIsActive(redrawHandChallenge.challengeType))
					{
						ChallengeActivationUI.TryShowActivation(redrawHandChallenge.challengeType);
						yield return Singleton<CardSpawner>.Instance.SpawnCardToHand(CardLoader.GetCardByName("bitty_Clover"), (List<CardModificationInfo>)null, 0.25f, (Action<PlayableCard>)null);
						if (!DialogueEventsData.EventIsPlayed("RedrawHandIntro"))
						{
							yield return Singleton<TextDisplayer>.Instance.P