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 BittysSigils; using DiskCardGame; using GBC; using HarmonyLib; using InscryptionAPI.Ascension; using InscryptionAPI.Boons; using InscryptionAPI.Card; using InscryptionAPI.Dialogue; using InscryptionAPI.Helpers; using InscryptionAPI.Helpers.Extensions; using InscryptionAPI.RuleBook; using InscryptionAPI.Saves; using InscryptionAPI.Slots; using InscryptionAPI.Sound; using InscryptionAPI.Triggers; using Microsoft.CodeAnalysis; using Pixelplacement; 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+1d7a058b5b6610b5e33756d887530c144cfc780e")] [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] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] internal sealed class ParamCollectionAttribute : Attribute { } [CompilerGenerated] [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 BittysChallenges { [HarmonyPatch] public class Abilities { public class GiveSlotSpawner : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { List playerSlots = ((BoardManager)Singleton.Instance).PlayerSlotsCopy; for (int i = 0; i < playerSlots.Count; i++) { if (i == 0) { yield return playerSlots[0].FadeToSlotMod(SlotMods.SlotMod_Growth.SlotType); } if (i == 1) { yield return playerSlots[1].FadeToSlotMod(SlotMods.SlotMod_Grave.SlotType); } if (i == 2) { yield return playerSlots[2].FadeToSlotMod(SlotMods.SlotMod_Flood.SlotType); } if (i == 3) { yield return playerSlots[3].FadeToSlotMod(SlotMods.SlotMod_Obelisk.SlotType); } } ((Card)((AbilityBehaviour)this).Card).Anim.PlayDeathAnimation(false); Object.Destroy((Object)(object)((Component)((AbilityBehaviour)this).Card).gameObject); } } public class GiveRaft : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { yield return SlotModificationExtensions.SetSlotModification(((AbilityBehaviour)this).Card.Slot, SlotMods.SlotMod_Raft.SlotType); ((Card)((AbilityBehaviour)this).Card).Anim.PlayDeathAnimation(false); Object.Destroy((Object)(object)((Component)((AbilityBehaviour)this).Card).gameObject); } } public class AddCloverReRollAbility : SpecialCardBehaviour, IOnOtherCardResolveInHand { public static readonly SpecialTriggeredAbility CloverReRollSpecialAbility = SpecialTriggeredAbilityManager.Add("bitty45.inscryption.challenges", "CloverReRollSpecialAbility", typeof(AddCloverReRollAbility)).Id; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { yield return MoveCardIntoDeck(Singleton.Instance.cardsInHand[0], toSideDeck: true); int cardsToDraw = 0; int cardsToShuffle = Singleton.Instance.cardsInHand.Count; for (int i = 0; i < cardsToShuffle; i++) { cardsToDraw++; yield return MoveCardIntoDeck(Singleton.Instance.cardsInHand[0]); } if (CardDrawPiles3D.Instance.SideDeck.CardsInDeck > 0) { yield return (object)new WaitForSeconds(0.4f); if ((int)Singleton.Instance.CurrentView != 1) { yield return (object)new WaitForSeconds(0.2f); Singleton.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.2f); } CardDrawPiles3D.Instance.SidePile.Draw(); yield return CardDrawPiles3D.Instance.DrawFromSidePile(); } for (int j = 0; j < cardsToDraw; j++) { if (((CardDrawPiles)CardDrawPiles3D.Instance).Deck.CardsInDeck > 0) { yield return (object)new WaitForSeconds(0.4f); if ((int)Singleton.Instance.CurrentView != 1) { yield return (object)new WaitForSeconds(0.2f); Singleton.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.2f); } CardDrawPiles3D.Instance.Pile.Draw(); yield return ((CardDrawPiles)CardDrawPiles3D.Instance).DrawCardFromDeck((CardInfo)null, (Action)null); } } ((Card)((SpecialCardBehaviour)this).PlayableCard).Anim.PlayDeathAnimation(false); Object.Destroy((Object)(object)((Component)((SpecialCardBehaviour)this).PlayableCard).gameObject); } public bool RespondsToOtherCardResolveInHand(PlayableCard resolvingCard) { return CardExtensions.IsPlayerCard(resolvingCard) && (Object)(object)resolvingCard != (Object)(object)((SpecialCardBehaviour)this).PlayableCard; } public IEnumerator OnOtherCardResolveInHand(PlayableCard resolvingCard) { Singleton.Instance.RemoveCardFromHand(((SpecialCardBehaviour)this).PlayableCard); Object.Destroy((Object)(object)((Component)((SpecialCardBehaviour)this).PlayableCard).gameObject); yield break; } public IEnumerator MoveCardIntoDeck(PlayableCard card, bool toSideDeck = false) { bool is3D = Singleton.Instance is BoardManager3D; if (Singleton.Instance.CardsInHand.Contains(card) && (int)Singleton.Instance.CurrentView > 0) { yield return (object)new WaitForSeconds(0.2f); Singleton.Instance.SwitchToView((View)0, false, false); yield return (object)new WaitForSeconds(0.2f); } if (Singleton.Instance.CardsInHand.Contains(card)) { Singleton.Instance.RemoveCardFromHand(card); } if (is3D && toSideDeck) { Singleton.Instance.sidePile.MoveCardToPile((Card)(object)card, true, 0f, 0.7f); Object.Destroy((Object)(object)((Component)card).gameObject, 1f); } else if (is3D) { Singleton.Instance.pile.MoveCardToPile((Card)(object)card, true, 0f, 0.7f); Object.Destroy((Object)(object)((Component)card).gameObject, 1f); } CreateCardInDeck(((Card)card).Info, toSideDeck); } public void CreateCardInDeck(CardInfo info, bool toSideDeck = false) { bool flag = Singleton.Instance is BoardManager3D; if (flag && toSideDeck) { Singleton.Instance.sidePile.CreateCards(1, 15f); Singleton.Instance.SideDeck.AddCard(info); return; } if (flag) { Singleton.Instance.pile.CreateCards(1, 15f); } Singleton.Instance.Deck.AddCard(info); } } public class AddTravelingOuroAbility : SpecialCardBehaviour { public static readonly SpecialTriggeredAbility TravelingOuroSpecialAbility = SpecialTriggeredAbilityManager.Add("bitty45.inscryption.challenges", "TravelingOuroSpecialAbility", typeof(AddTravelingOuroAbility)).Id; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return true; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { Challenges.MiscEncounters.IncreaseOuro(); string zoom = "OuroDies"; if ((int)Singleton.Instance.OpponentType == 20) { zoom = ((!((Object)(object)killer != (Object)null) || killer.OpponentCard) ? "RoyalOuroDies" : "RoyalOuroDiesPlayer"); } if (Plugin.modModeActive(Plugin.MOD_MODE.P03)) { zoom = "P03OuroDies"; } yield return Singleton.Instance.PlayDialogueEvent(zoom, (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } public class AddGoldenSheepAbility : SpecialCardBehaviour { public static readonly SpecialTriggeredAbility GoldenSheepSpecialAbility = SpecialTriggeredAbilityManager.Add("bitty45.inscryption.challenges", "GoldenSheep Special Ability", typeof(AddGoldenSheepAbility)).Id; private int turnCount; private int MAX_TURNS = 2; public static Ability ability; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return true; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { Challenges.MiscEncounters.GoldenSheepKill(); yield return GiveWool(fromBattle: true); yield return Singleton.Instance.PlayDialogueEvent("SheepDies", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } private IEnumerator GiveWool(bool fromBattle) { yield return (object)new WaitForSeconds(0.5f); if (fromBattle) { CardInfo pelt = CardLoader.GetCardByName("PeltGolden"); CardModificationInfo mod = new CardModificationInfo(); mod.abilities.Add(GiveFragile.ability); pelt.Mods.Add(mod); ((CardCollectionInfo)RunState.Run.playerDeck).AddCard(pelt); yield return (object)new WaitForSeconds(0.3f); Singleton.Instance.SwitchToView((View)0, false, false); yield return Singleton.Instance.SpawnCardToHand(pelt, (List)null, 0.25f, (Action)null); yield return (object)new WaitForSeconds(0.45f); } } public override bool RespondsToUpkeep(bool playerUpkeep) { return ((SpecialCardBehaviour)this).PlayableCard.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { turnCount++; if (turnCount > MAX_TURNS) { yield return Singleton.Instance.PlayDialogueEvent("SheepEscapes", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); ((Card)((SpecialCardBehaviour)this).PlayableCard).Anim.PlayDeathAnimation(false); Object.Destroy((Object)(object)((Component)((SpecialCardBehaviour)this).PlayableCard).gameObject); } } } public class GiveWarper : AbilityBehaviour { public static Ability ability; protected bool movingLeft; public override Ability Ability => ability; public override bool RespondsToTurnEnd(bool playerTurnEnd) { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { CardSlot toLeft = Singleton.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true); CardSlot toRight = Singleton.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false); Singleton.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.25f); yield return ((MonoBehaviour)this).StartCoroutine(DoStrafe(toLeft, toRight)); } protected virtual IEnumerator DoStrafe(CardSlot toLeft, CardSlot toRight) { if ((Object)(object)toLeft == (Object)null) { toLeft = Singleton.Instance.playerSlots.Last(); } if ((Object)(object)toRight == (Object)null) { toRight = Singleton.Instance.playerSlots.First(); } CardSlot toLefttwice = Singleton.Instance.GetAdjacent(toLeft, true); CardSlot toRighttwice = Singleton.Instance.GetAdjacent(toRight, false); if ((Object)(object)toLefttwice == (Object)null) { toLefttwice = Singleton.Instance.playerSlots.Last(); } if ((Object)(object)toRighttwice == (Object)null) { toRighttwice = Singleton.Instance.playerSlots.First(); } bool canmoveleft = (Object)(object)toLeft.Card == (Object)null || (Object)(object)toLefttwice.Card == (Object)null; bool canmoveright = (Object)(object)toRight.Card == (Object)null || (Object)(object)toRighttwice.Card == (Object)null; if (movingLeft && !canmoveleft) { movingLeft = false; } if (!movingLeft && !canmoveright) { movingLeft = true; } CardSlot destination = (movingLeft ? toLeft : toRight); if ((Object)(object)destination.Card != (Object)null) { destination = (movingLeft ? toLefttwice : toRighttwice); } yield return ((MonoBehaviour)this).StartCoroutine(MoveToSlot(destination)); } protected IEnumerator MoveToSlot(CardSlot destination) { ((Card)((AbilityBehaviour)this).Card).RenderInfo.SetAbilityFlipped(((AbilityBehaviour)this).Ability, movingLeft); ((Card)((AbilityBehaviour)this).Card).RenderInfo.flippedPortrait = movingLeft && ((Card)((AbilityBehaviour)this).Card).Info.flipPortraitForStrafe; ((Card)((AbilityBehaviour)this).Card).RenderCard(); if ((Object)(object)destination != (Object)null && (Object)(object)destination.Card == (Object)null) { CardSlot oldSlot = ((AbilityBehaviour)this).Card.Slot; yield return Singleton.Instance.AssignCardToSlot(((AbilityBehaviour)this).Card, destination, 0.1f, (Action)null, true); yield return PostSuccessfulMoveSequence(oldSlot); yield return (object)new WaitForSeconds(0.25f); } else { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.15f); } } protected virtual IEnumerator PostSuccessfulMoveSequence(CardSlot oldSlot) { yield break; } } public class GiveFragile : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return true; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { DeckInfo currentDeck = SaveManager.SaveFile.CurrentDeck; CardInfo card = ((CardCollectionInfo)currentDeck).Cards.Find((CardInfo x) => x.HasAbility(ability) && ((Object)x).name == ((Object)((Card)((AbilityBehaviour)this).Card).Info).name); ((CardCollectionInfo)currentDeck).RemoveCard(card); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); if (!wasSacrifice && (Object)(object)killer != (Object)null) { yield return Singleton.Instance.PlayDialogueEvent("FragileEnemy", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[2] { ((Card)((AbilityBehaviour)this).Card).Info.displayedName, ((Card)killer).Info.displayedName }, (Action)null); } else if (!wasSacrifice && (Object)(object)killer == (Object)null) { yield return Singleton.Instance.PlayDialogueEvent("FragileDies", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { ((Card)((AbilityBehaviour)this).Card).Info.displayedName }, (Action)null); } else { yield return Singleton.Instance.PlayDialogueEvent("FragileSacrifice", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { ((Card)((AbilityBehaviour)this).Card).Info.displayedName }, (Action)null); } } } public class GiveFalseUnkillable : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; } public class GiveParalysis : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { bool flag = Singleton.Instance.TurnNumber % 2 == 0; return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep && flag; } public override IEnumerator OnUpkeep(bool playerUpkeep) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); CardModificationInfo cardModificationInfo = new CardModificationInfo(); if (!((AbilityBehaviour)this).Card.HasAbility(GiveCantAttack.ability)) { cardModificationInfo.abilities.Add(GiveCantAttack.ability); cardModificationInfo.RemoveOnUpkeep = true; ((AbilityBehaviour)this).Card.AddTemporaryMod(cardModificationInfo); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); } yield return ((AbilityBehaviour)this).LearnAbility(0f); } } public class GiveStrafeKiller : Strafe { public static Ability ability; public override Ability Ability => ability; public override IEnumerator DoStrafe(CardSlot toLeft, CardSlot toRight) { bool toLeftValid = (Object)(object)toLeft != (Object)null; bool toRightValid = (Object)(object)toRight != (Object)null; if (base.movingLeft && !toLeftValid) { base.movingLeft = false; } if (!base.movingLeft && !toRightValid) { base.movingLeft = true; } CardSlot destination = (base.movingLeft ? toLeft : toRight); bool destinationValid = (base.movingLeft ? toLeftValid : toRightValid); if ((Object)(object)destination != (Object)null && (Object)(object)destination.Card != (Object)null) { yield return destination.Card.Die(false, ((AbilityBehaviour)this).Card, true); } yield return (object)new WaitForSeconds(0.2f); yield return ((Strafe)this).MoveToSlot(destination, destinationValid); yield return ((AbilityBehaviour)this).LearnAbility(0f); } public override IEnumerator PostSuccessfulMoveSequence(CardSlot oldSlot) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); } } public class GiveStrafeAvalanche : Strafe { public static Ability ability; public override Ability Ability => ability; public override IEnumerator DoStrafe(CardSlot toLeft, CardSlot toRight) { bool toLeftValid = (Object)(object)toLeft != (Object)null; bool toRightValid = (Object)(object)toRight != (Object)null; if (base.movingLeft && !toLeftValid) { base.movingLeft = false; } if (!base.movingLeft && !toRightValid) { base.movingLeft = true; } CardSlot destination = (base.movingLeft ? toLeft : toRight); bool destinationValid = (base.movingLeft ? toLeftValid : toRightValid); List slotsCopy = (((AbilityBehaviour)this).Card.OpponentCard ? Singleton.Instance.OpponentSlotsCopy : Singleton.Instance.PlayerSlotsCopy); if (slotsCopy != null && (Object)(object)slotsCopy[slotsCopy.Count - 1].Card == (Object)(object)((AbilityBehaviour)this).Card) { yield return ((AbilityBehaviour)this).Card.Die(false, (PlayableCard)null, true); yield return ((AbilityBehaviour)this).LearnAbility(0f); yield break; } int killLoops = 0; while ((Object)(object)destination != (Object)null && (Object)(object)destination.Card != (Object)null && killLoops < 5) { killLoops++; yield return destination.Card.Die(false, ((AbilityBehaviour)this).Card, true); } yield return (object)new WaitForSeconds(0.2f); yield return ((Strafe)this).MoveToSlot(destination, destinationValid); yield return ((AbilityBehaviour)this).LearnAbility(0f); } public override IEnumerator PostSuccessfulMoveSequence(CardSlot oldSlot) { if ((Object)(object)oldSlot.Card != (Object)null) { yield return oldSlot.Card.Die(false, ((AbilityBehaviour)this).Card, true); } } } public class GiveCannoneer : SpecialCardBehaviour { public static readonly SpecialTriggeredAbility MinicelloSpecialAbility = SpecialTriggeredAbilityManager.Add("bitty45.inscryption.challenges", "Minicello Special Ability", typeof(GiveCannoneer)).Id; private static List allInstancesOfThisClass = new List(); public bool triggeredThisTurn; private List cannonTargetSlots = new List(); private List targetIcons = new List(); private GameObject targetIconPrefab; public void ClearAllTargetIcons() { foreach (GiveCannoneer item in allInstancesOfThisClass) { if ((Object)(object)item != (Object)null) { item.CleanupTargetIcons(); } } } private void Start() { allInstancesOfThisClass.Add(this); } public override bool RespondsToTurnEnd(bool playerTurnEnd) { return playerTurnEnd != ((SpecialCardBehaviour)this).PlayableCard.OpponentCard; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if (cannonTargetSlots.Count > 0) { yield return FireCannonsSequence(); } if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard != (Object)null) { yield return ChooseCannonTargetsSequence(); } } public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return true; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { CleanupTargetIcons(); yield break; } public void CleanupTargetIcons() { targetIcons.ForEach(delegate(GameObject x) { if ((Object)(object)x != (Object)null) { CleanUpTargetIcon(x); } }); targetIcons.Clear(); } private void CleanUpTargetIcon(GameObject icon) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)icon != (Object)null) { Tween.LocalScale(icon.transform, Vector3.zero, 0.1f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)delegate { Object.Destroy((Object)(object)icon); }, true); } } private IEnumerator FireCannonsSequence() { for (int i = 0; i < cannonTargetSlots.Count; i++) { Singleton.Instance.SwitchToView((View)1, false, true); yield return (object)new WaitForSeconds(0.25f); CardSlot slot = cannonTargetSlots[i]; if ((Object)(object)slot.Card != (Object)null && !slot.Card.Dead) { AudioController.Instance.PlaySound2D("pirateskull_cannon_fire", (MixerGroup)4, 0.7f, 0f, new Pitch((Variation)0), (Repetition)null, (Randomization)null, (Distortion)null, false); yield return (object)new WaitForSeconds(0.3f); Singleton.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.2f); CleanUpTargetIcon(targetIcons[i]); GameObject cannonBall = Object.Instantiate(ResourceBank.Get("Prefabs/Cards/SpecificCardModels/CannonBallAnim")); cannonBall.transform.position = ((Component)slot).transform.position; Object.Destroy((Object)(object)cannonBall, 1f); yield return (object)new WaitForSeconds(0.1666f); Singleton.Instance.ThumpTable(0.4f); AudioController.Instance.PlaySound3D("metal_object_hit#1", (MixerGroup)4, cannonBall.transform.position, 1f, 0f, new Pitch((Variation)0), (Repetition)null, (Randomization)null, (Distortion)null, false); yield return slot.Card.TakeDamage(10, ((SpecialCardBehaviour)this).PlayableCard); } } CleanupTargetIcons(); } private IEnumerator ChooseCannonTargetsSequence() { Plugin.Log.LogInfo((object)"Cannoneer Activation"); yield return (object)new WaitForSeconds(0.3f); int num = ((TriggerReceiver)this).GetRandomSeed() + Singleton.Instance.TurnNumber; if ((Object)(object)targetIconPrefab == (Object)null) { targetIconPrefab = ResourceBank.Get("Prefabs/Cards/SpecificCardModels/CannonTargetIcon"); } if (((SpecialCardBehaviour)this).PlayableCard.OpponentCard) { List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; playerSlotsCopy.RemoveAll((CardSlot x) => cannonTargetSlots.Contains(x)); cannonTargetSlots.Clear(); cannonTargetSlots.Add(playerSlotsCopy[SeededRandom.Range(0, playerSlotsCopy.Count, num)]); } else { List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => cannonTargetSlots.Contains(x)); cannonTargetSlots.Clear(); cannonTargetSlots.Add(opponentSlotsCopy[SeededRandom.Range(0, opponentSlotsCopy.Count, num)]); } Singleton.Instance.SwitchToView((View)4, false, true); yield return (object)new WaitForSeconds(0.25f); foreach (CardSlot slot in cannonTargetSlots) { yield return (object)new WaitForSeconds(0.05f); GameObject gameObject = Object.Instantiate(targetIconPrefab, ((Component)slot).transform); gameObject.transform.localPosition = new Vector3(0f, 0.25f, 0f); gameObject.transform.localRotation = Quaternion.identity; targetIcons.Add(gameObject); } AudioController.Instance.PlaySound2D("dial_low", (MixerGroup)4, 0.7f, 0f, new Pitch((Variation)0), (Repetition)null, (Randomization)null, (Distortion)null, false); } } public class GiveRedChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; } public class GiveYellowChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; } public class GiveGreenChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return Singleton.Instance.ShowDamageSequence(1, 1, ((AbilityBehaviour)this).Card.OpponentCard, 0.125f, (GameObject)null, 0f, true); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } public class GiveOrangeChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToDealDamageDirectly(int amount) { return RunState.Run.currency >= 1 || !((AbilityBehaviour)this).Card.OpponentCard; } public override IEnumerator OnDealDamageDirectly(int amount) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (((AbilityBehaviour)this).Card.OpponentCard) { yield return Singleton.Instance.SpillOnTable(); yield return (object)new WaitForSeconds(0.4f); int moneyToTake = 1; if (RunState.Run.currency >= 2) { moneyToTake = 2; } List list = Singleton.Instance.TakeWeights(moneyToTake); foreach (Rigidbody rigidbody in list) { float num = (float)list.IndexOf(rigidbody) * 0.05f; Tween.Position(((Component)rigidbody).transform, ((Component)rigidbody).transform.position + Vector3.up * 0.5f, 0.075f, num, Tween.EaseIn, (LoopType)0, (Action)null, (Action)null, true); Tween.Position(((Component)rigidbody).transform, new Vector3(0f, 5.5f, 4f), 0.3f, 0.125f + num, Tween.EaseOut, (LoopType)0, (Action)null, (Action)null, true); Object.Destroy((Object)(object)((Component)rigidbody).gameObject, 0.5f); } RunState.Run.currency = RunState.Run.currency - moneyToTake; yield return (object)new WaitForSeconds(0.4f); yield return ((MonoBehaviour)this).StartCoroutine(Singleton.Instance.CleanUpFromTableAndExit()); } else { yield return Singleton.Instance.ShowGain(5, false, true); RunState run = RunState.Run; run.currency += 2; } yield return ((AbilityBehaviour)this).LearnAbility(0f); } } public class GiveCyanChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return !wasSacrifice; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); foreach (PlayableCard target in Singleton.Instance.CardsOnBoard) { ((Card)target).Anim.StrongNegationEffect(); yield return target.TakeDamage(1, (PlayableCard)null); } yield return ((AbilityBehaviour)this).LearnAbility(0f); } } public class GiveWhiteChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return !wasSacrifice && ((AbilityBehaviour)this).Card.OnBoard; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return (object)new WaitForSeconds(0.3f); yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("Boulder"), ((AbilityBehaviour)this).Card.Slot, 0.15f, true); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } public class GiveMagentaChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep == ((AbilityBehaviour)this).Card.OpponentCard; } public override IEnumerator OnUpkeep(bool playerUpkeep) { yield return (object)new WaitForSeconds(0.3f); int seed = ((TriggerReceiver)this).GetRandomSeed() + Singleton.Instance.TurnNumber; PlayableCard target; if (((AbilityBehaviour)this).Card.OpponentCard) { List playerCardsCopy = BoardManagerExtensions.GetPlayerCards(Singleton.Instance, (Predicate)null); target = ((playerCardsCopy.Count <= 0) ? null : playerCardsCopy[SeededRandom.Range(0, playerCardsCopy.Count - 1, seed)]); } else { List opponentCardsCopy = BoardManagerExtensions.GetOpponentCards(Singleton.Instance, (Predicate)null); target = ((opponentCardsCopy.Count <= 0) ? null : opponentCardsCopy[SeededRandom.Range(0, opponentCardsCopy.Count - 1, seed)]); } if (!((Object)(object)target == (Object)null)) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.3f); ((Card)target).Anim.StrongNegationEffect(); yield return target.TakeDamage(1, ((AbilityBehaviour)this).Card); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } } public class GivePurpleChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)otherCard != (Object)null && (Object)(object)otherCard.Slot != (Object)null && CardExtensions.IsPlayerCard(otherCard) == ((AbilityBehaviour)this).Card.OpponentCard && (Object)(object)otherCard.Slot != (Object)(object)((AbilityBehaviour)this).Card.Slot.opposingSlot; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { Singleton.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); CardSlot targetSlot = CardExtensions.OpposingSlot(((AbilityBehaviour)this).Card); if ((Object)(object)targetSlot.Card != (Object)null) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.3f); yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); Vector3 a = (((Component)otherCard.Slot).transform.position + ((Component)targetSlot).transform.position) / 2f; Tween.Position(((Component)otherCard).transform, a + Vector3.up * 0.5f, 0.1f, 0f, Tween.EaseIn, (LoopType)0, (Action)null, (Action)null, true); yield return Singleton.Instance.AssignCardToSlot(otherCard, targetSlot, 0.1f, (Action)null, true); yield return (object)new WaitForSeconds(0.3f); yield return ((AbilityBehaviour)this).LearnAbility(0.1f); } } public class GiveBlueChamp : AbilityBehaviour, IOnBellRung { private CardModificationInfo airborneMod = new CardModificationInfo { singletonId = "bitty_airborne_champ", abilities = new List { (Ability)19 } }; public static Ability ability; public override Ability Ability => ability; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return RespondsToTrigger(otherCard); } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return AddAirborne(otherCard); yield return ((AbilityBehaviour)this).LearnAbility(0f); } public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) { return RespondsToTrigger(otherCard); } public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return AddAirborne(otherCard); yield return ((AbilityBehaviour)this).LearnAbility(0f); } public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return true; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); foreach (PlayableCard target in Singleton.Instance.CardsOnBoard) { yield return RemoveAirborne(target); } yield return ((AbilityBehaviour)this).LearnAbility(0f); } private bool RespondsToTrigger(PlayableCard otherCard) { return !((AbilityBehaviour)this).Card.Dead && !otherCard.Dead && (Object)(object)otherCard != (Object)(object)((AbilityBehaviour)this).Card && otherCard.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard; } public IEnumerator AddAirborne(PlayableCard target) { CardModificationInfo cardModificationInfo = target.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == airborneMod.singletonId); if (cardModificationInfo == null && !((Card)target).Info.HasTrait((Trait)12) && !target.HasAbility((Ability)19)) { Plugin.Log.LogInfo((object)"Apply Airborne"); Singleton.Instance.SwitchToView((View)4, false, false); target.AddTemporaryMod(airborneMod); target.OnStatsChanged(); ((Card)target).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); } } public IEnumerator RemoveAirborne(PlayableCard target) { CardModificationInfo cardModificationInfo = target.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == airborneMod.singletonId); if (cardModificationInfo != null) { Plugin.Log.LogInfo((object)"Remove Airborne"); Singleton.Instance.SwitchToView((View)4, false, false); target.RemoveTemporaryMod(cardModificationInfo, true); target.OnStatsChanged(); ((Card)target).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); } } public bool RespondsToBellRung(bool playerCombatPhase) { return true; } public IEnumerator OnBellRung(bool playerCombatPhase) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); List cards = (CardExtensions.IsPlayerCard(((AbilityBehaviour)this).Card) ? BoardManagerExtensions.GetPlayerCards(Singleton.Instance, (Predicate)null) : BoardManagerExtensions.GetOpponentCards(Singleton.Instance, (Predicate)null)); foreach (PlayableCard curCard in cards) { if ((Object)(object)curCard != (Object)(object)((AbilityBehaviour)this).Card) { yield return AddAirborne(curCard); } } yield return ((AbilityBehaviour)this).LearnAbility(0f); } } public class GiveLightBlueChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToPreDeathAnimation(bool wasSacrifice) { return !wasSacrifice; } public override IEnumerator OnPreDeathAnimation(bool wasSacrifice) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return ExplodeFromSlot(((AbilityBehaviour)this).Card.slot); yield return ((AbilityBehaviour)this).LearnAbility(0f); } public IEnumerator ExplodeFromSlot(CardSlot slot) { List adjacentSlots = Singleton.Instance.GetAdjacentSlots(slot); if (adjacentSlots.Count > 0 && adjacentSlots[0].Index < slot.Index) { if ((Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead) { yield return BombCard(adjacentSlots[0].Card, slot.Card); } adjacentSlots.RemoveAt(0); } if ((Object)(object)slot.opposingSlot.Card != (Object)null && !slot.opposingSlot.Card.Dead) { yield return BombCard(slot.opposingSlot.Card, slot.Card); } if (adjacentSlots.Count > 0 && (Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead) { yield return BombCard(adjacentSlots[0].Card, slot.Card); } } private IEnumerator BombCard(PlayableCard target, PlayableCard attacker) { yield return (object)new WaitForSeconds(0.5f); ((Card)target).Anim.PlayHitAnimation(); yield return target.TakeDamage(3, attacker); } } public class GiveLightGreenChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((AbilityBehaviour)this).Card.Status.hiddenAbilities.Add((Ability)54); ((AbilityBehaviour)this).Card.AddTemporaryMod(new CardModificationInfo((Ability)54)); ((AbilityBehaviour)this).Card.ResetShield(); yield return ((AbilityBehaviour)this).LearnAbility(0f); } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { if ((Object)(object)attacker != (Object)null) { bool flag = attacker.HasAbility((Ability)19); return (Object)(object)slot.Card == (Object)(object)((AbilityBehaviour)this).Card && (!flag || ((AbilityBehaviour)this).Card.HasAbility((Ability)23)); } return false; } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((AbilityBehaviour)this).Card.AddTemporaryMod(new CardModificationInfo { negateAbilities = { ((AbilityBehaviour)this).Ability } }); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } public class GiveBrightRedChamp : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep == ((AbilityBehaviour)this).Card.OpponentCard; } public override IEnumerator OnUpkeep(bool playerUpkeep) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); foreach (PlayableCard target in Singleton.Instance.CardsOnBoard) { if (target.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard && !CardExtensions.HasTrait(target, (Trait)12) && target.Health < target.MaxHealth) { target.HealDamage(1); } } yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } public static void AddAbilities() { Plugin.Log.LogInfo((object)"Start of sigils"); Add_Ability_FalseUnkillable(); Add_Ability_Warper(); Add_Ability_Fragile(); Add_Ability_Paralysis(); Add_Ability_StrafeKiller(); Add_Ability_StrafeAvalanche(); Add_Ability_SlotSpawner(); Add_Ability_RedChamp(); Add_Ability_YellowChamp(); Add_Ability_GreenChamp(); Add_Ability_OrangeChamp(); Add_Ability_CyanChamp(); Add_Ability_WhiteChamp(); Add_Ability_MagentaChamp(); Add_Ability_PurpleChamp(); Add_Ability_BlueChamp(); Add_Ability_LightBlueChamp(); Add_Ability_LightGreenChamp(); Add_Ability_BrightRedChamp(); Plugin.Log.LogInfo((object)"End of sigils"); } public static void Add_Reliant_Abilities() { Plugin.Log.LogInfo((object)"Start of reliant sigils"); Add_Ability_Raft(); Plugin.Log.LogInfo((object)"End of reliant sigils"); } private static void Add_Ability_SlotSpawner() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Slot Spawner", "When played, spawns a slot. Used for testing.", typeof(GiveSlotSpawner), (Texture)(object)Tools.LoadTexture("ability_test.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 1; GiveSlotSpawner.ability = val.ability; } private static void Add_Ability_Raft() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = RuleBookRedirectExtensions.SetSlotRedirect(AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Seaworthy", "When played, converts the slot into a Raft.", typeof(GiveRaft), (Texture)(object)Tools.LoadTexture("ability_raft.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]), "Raft", SlotMods.SlotMod_Raft.SlotType, GameColors.Instance.orange); val.powerLevel = 1; GiveRaft.ability = val.ability; } private static void Add_Ability_Warper() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Warper", "At the end of the owner's turn, [creature] will move to the right, jumping over any creatures in its path. If it encounters the edge of the board, it will loop over to the other side.", typeof(GiveWarper), (Texture)(object)Tools.LoadTexture("ability_warper.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 0; GiveWarper.ability = val.ability; } private static void Add_Ability_Fragile() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Fragile", "If [creature] perishes, it is permanently removed from your deck.", typeof(GiveFragile), (Texture)(object)Tools.LoadTexture("ability_fragile.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = -3; GiveFragile.ability = val.ability; } private static void Add_Ability_FalseUnkillable() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Unkillable", "When [creature] perishes, a copy of it is created in the opponent's hand.", typeof(GiveFalseUnkillable), (Texture)(object)Tools.LoadTexture("ability_drawcopyondeath")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[2] { default(AbilityMetaCategory), (AbilityMetaCategory)2 }); val.powerLevel = 1; GiveFalseUnkillable.ability = val.ability; } private static void Add_Ability_Paralysis() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Paralysis", "[creature] may not attack every other turn.", typeof(GiveParalysis), (Texture)(object)Tools.LoadTexture("ability_paralysis.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = -1; GiveParalysis.ability = val.ability; } private static void Add_Ability_StrafeKiller() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Trampler", "At the end of the owner's turn, [creature] will move in the direction inscribed in the sigil. Creatures in the way will be killed.", typeof(GiveStrafeKiller), (Texture)(object)Tools.LoadTexture("ability_strafeskull.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 0; GiveStrafeKiller.ability = val.ability; } private static void Add_Ability_StrafeAvalanche() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Avalancher", "At the end of the owner's turn, [creature] will move in the direction inscribed in the sigil. Creatures in the way will be killed. If [creature] is at the right most side of the board, it dies.", typeof(GiveStrafeAvalanche), (Texture)(object)Tools.LoadTexture("ability_strafeskull.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 0; GiveStrafeAvalanche.ability = val.ability; } private static void Add_Ability_RedChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Red Champion", "This champion starts with 2 additional Health.", typeof(GiveRedChamp), (Texture)(object)Tools.LoadTexture("ability_redChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveRedChamp.ability = val.ability; } private static void Add_Ability_YellowChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Yellow Champion", "This champion starts with 1 additional Power.", typeof(GiveYellowChamp), (Texture)(object)Tools.LoadTexture("ability_yellowChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveYellowChamp.ability = val.ability; } private static void Add_Ability_GreenChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Green Champion", "This champion will deal 1 damage directly to you, after it destroys another creature.", typeof(GiveGreenChamp), (Texture)(object)Tools.LoadTexture("ability_greenChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveGreenChamp.ability = val.ability; } private static void Add_Ability_OrangeChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Orange Champion", "This champion will steal 2 golden teeth from you if it damages you directly.", typeof(GiveOrangeChamp), (Texture)(object)Tools.LoadTexture("ability_orangeChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveOrangeChamp.ability = val.ability; } private static void Add_Ability_CyanChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Cyan Champion", "When this champion perishes, it will deal 1 damage to every other creature on the board.", typeof(GiveCyanChamp), (Texture)(object)Tools.LoadTexture("ability_cyanChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveCyanChamp.ability = val.ability; } private static void Add_Ability_WhiteChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "White Champion", "When this champion perishes, it will create a Boulder in its space. [define:Boulder]", typeof(GiveWhiteChamp), (Texture)(object)Tools.LoadTexture("ability_whiteChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveWhiteChamp.ability = val.ability; } private static void Add_Ability_MagentaChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Magenta Champion", "At the start of each turn, this champion will attack for 1 damage in a random space on your side.", typeof(GiveMagentaChamp), (Texture)(object)Tools.LoadTexture("ability_magentaChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveMagentaChamp.ability = val.ability; } private static void Add_Ability_PurpleChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Purple Champion", "Each time you play a card, if the space opposing this champion is empty, that card will move to that space.", typeof(GivePurpleChamp), (Texture)(object)Tools.LoadTexture("ability_purpleChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GivePurpleChamp.ability = val.ability; } private static void Add_Ability_BlueChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Blue Champion", "This champion will cause all other non-Terrain cards on the same side to gain flight, as long as the champion is alive.", typeof(GiveBlueChamp), (Texture)(object)Tools.LoadTexture("ability_blueChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveBlueChamp.ability = val.ability; } private static void Add_Ability_LightBlueChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Light Blue Champion", "When this champion perishes, it will deal 3 damage to creatures to the left and right of it as well as the opposing creature.", typeof(GiveLightBlueChamp), (Texture)(object)Tools.LoadTexture("ability_lightBlueChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveLightBlueChamp.ability = val.ability; } private static void Add_Ability_LightGreenChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Light Green Champion", "This champion will prevent all damage from the first strike dealt to it. Damage from effects like sigils will not be prevented.", typeof(GiveLightGreenChamp), (Texture)(object)Tools.LoadTexture("ability_lightGreenChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveLightGreenChamp.ability = val.ability; } private static void Add_Ability_BrightRedChamp() { //IL_003d: 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) AbilityInfo val = AbilityExtensions.AddMetaCategories(AbilityManager.New("bitty45.inscryption.challenges", "Bright Red Champion", "At the start of each turn, this champion will heal all other non-terrain creatures on the opponent's side by 1.", typeof(GiveBrightRedChamp), (Texture)(object)Tools.LoadTexture("ability_brightRedChampion.png")), (AbilityMetaCategory[])(object)new AbilityMetaCategory[1]); val.powerLevel = 5; GiveBrightRedChamp.ability = val.ability; } [HarmonyPostfix] [HarmonyPatch(typeof(TurnManager), "CleanupPhase")] public static void CannoneerPatch() { try { GiveCannoneer giveCannoneer = new GiveCannoneer(); giveCannoneer.ClearAllTargetIcons(); } catch { Plugin.Log.LogInfo((object)"Did not find Cannoneer Instance"); } } } public class Boons { public abstract class ChallengeBoonBase : BoonBehaviour { private static int randomMod; protected abstract Type boonType { get; } public override bool RespondsToPostBoonActivation() { return true; } public override IEnumerator OnPostBoonActivation() { if (Plugin.modModeActive(Plugin.MOD_MODE.KCM) && Singleton.Instance.HasBoonOfType(boonType)) { Singleton.Instance.SwitchToView((View)1, false, false); yield return Singleton.Instance.PlayBoonAnimation(boonType); } string P03 = (Plugin.modModeActive(Plugin.MOD_MODE.P03) ? "P03" : ""); if (SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed(P03 + "EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); Singleton.Instance.ShowActivation(Challenges.Challenge_environment.challengeType); ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent(P03 + "EnvironmentsIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null)); } } public override bool RespondsToPostBattleCleanup() { return true; } public override IEnumerator OnPostBattleCleanup() { SetSceneEffectsShown(showEffects: false); yield break; } public List SelectRandomSlots(int amount, List slotsCopy) { List list = new List(); randomMod += amount; int num = SaveManager.SaveFile.GetCurrentRandomSeed() + randomMod; for (int i = 0; i < amount; i++) { if (i >= slotsCopy.Count) { return list; } int index = SeededRandom.Range(0, slotsCopy.Count, num * i); list.Add(slotsCopy[index]); slotsCopy.Remove(slotsCopy[index]); } return list; } public void SetSceneEffectsShown(bool showEffects, Color mainLightColor, Color cardLightColor, Color interactablesColor, Color slotDefaultColor, Color slotInteractableColor, Color slotHighlightColor, Color queueSlotDefaultColor, Color queueSlotInteractableColor, Color queueSlotHighlightColor) { //IL_001b: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0057: Unknown result type (might be due to invalid IL or missing references) Singleton.Instance.SetDustParticlesActive(!showEffects); if (showEffects) { Color darkRed = GameColors.Instance.darkRed; darkRed.a = 0.5f; Color glowRed = GameColors.Instance.glowRed; glowRed.a = 0.5f; Singleton.Instance.ChangeTableColors(mainLightColor, cardLightColor, interactablesColor, slotDefaultColor, slotInteractableColor, slotHighlightColor, queueSlotDefaultColor, queueSlotInteractableColor, queueSlotHighlightColor); } else { Singleton.Instance.ResetTableColors(); } } public void SetSceneEffectsShown(bool showEffects) { //IL_001e: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) Singleton.Instance.SetDustParticlesActive(!showEffects); if (showEffects) { Color gray = GameColors.Instance.gray; gray.a = 0.5f; Color blue = GameColors.Instance.blue; blue.a = 0.5f; Singleton.Instance.ChangeTableColors(GameColors.Instance.brightNearWhite, GameColors.Instance.brightBlue, GameColors.Instance.brightNearWhite, gray, GameColors.Instance.gray, GameColors.Instance.brightNearWhite, blue, GameColors.Instance.blue, GameColors.Instance.brightNearWhite); } else { Singleton.Instance.ResetTableColors(); } } } public class ChallengeBoonMud : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("MudBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("MudBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List boardCards = new List(); foreach (CardSlot slot in Singleton.Instance.PlayerSlotsCopy) { if ((Object)(object)slot.Card != (Object)null) { boardCards.Add(((Card)slot.Card).Info); } } List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; playerSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(Math.Max((playerSlotsCopy.Count + 1) / 2, 1), playerSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return slots[i].FadeToSlotMod(SlotMods.SlotMod_Muddy.SlotType); if (RunState.CurrentRegionTier >= 1) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("Daus"), slots[i].opposingSlot, 0.1f, true); } } } } public class ChallengeBoonHail : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.gray; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.blue; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.brightBlue, GameColors.Instance.brightBlue, GameColors.Instance.brightNearWhite, darkRed, GameColors.Instance.gray, GameColors.Instance.brightNearWhite, brownOrange, GameColors.Instance.blue, GameColors.Instance.brightNearWhite); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("HailBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("HailBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slotsO = SelectRandomSlots(3 - RunState.CurrentRegionTier, opponentSlotsCopy); for (int i = 0; i < slotsO.Count; i++) { yield return slotsO[i].FadeToSlotMod(SlotMods.SlotMod_Hail.SlotType); } List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; playerSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); int playerHail = 2; if (RunState.CurrentRegionTier >= 2) { playerHail = 3; } List slotsP = SelectRandomSlots(playerHail, playerSlotsCopy); for (int i2 = 0; i2 < slotsP.Count; i2++) { yield return slotsP[i2].FadeToSlotMod(SlotMods.SlotMod_Hail.SlotType); } } } public class ChallengeBoonCliffs : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("CliffsBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("CliffsBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; CardInfo cardInfo = CardLoader.GetCardByName("bitty_Cliff"); yield return Singleton.Instance.CreateCardInSlot(cardInfo, opponentSlotsCopy[0], 0.1f, true); yield return Singleton.Instance.CreateCardInSlot(cardInfo, opponentSlotsCopy[0].opposingSlot, 0.1f, true); yield return Singleton.Instance.QueueCard(cardInfo, opponentSlotsCopy[0], true, false, true); } } public class ChallengeBoonMushrooms : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("MushroomsBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.Remove(opponentSlotsCopy[0]); opponentSlotsCopy.Remove(opponentSlotsCopy[opponentSlotsCopy.Count - 1]); opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(1, opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_Mushrooms"), slots[i], 0.1f, true); } yield return AudioController.Instance.PlaySound2D("mushroom_large_appear", (MixerGroup)4, 1f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } } public class ChallengeBoonDynamite : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("DynamiteBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("DynamiteBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List allSlotsCopy = Singleton.Instance.AllSlotsCopy; allSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(4, allSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return slots[i].FadeToSlotMod(SlotMods.SlotMod_Dynamite.SlotType); } if (RunState.CurrentRegionTier >= 2) { List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; playerSlotsCopy.RemoveAll((CardSlot x) => (int)SlotModificationExtensions.GetSlotModification(x) == 0); for (int i2 = 0; i2 < playerSlotsCopy.Count; i2++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("GoldNugget"), playerSlotsCopy[i2].opposingSlot, 0.1f, true); } } } } public class ChallengeBoonBait : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("BaitBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("BaitBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List boardCards = new List(); foreach (CardSlot slot in Singleton.Instance.OpponentSlotsCopy) { if ((Object)(object)slot.Card != (Object)null) { boardCards.Add(((Card)slot.Card).Info); } } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(Math.Max((opponentSlotsCopy.Count + 1) / 2, 1), opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("BaitBucket"), slots[i], 0.1f, true); } if (RunState.CurrentRegionTier >= 2) { List opponentSlotsCopy2 = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy2.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); for (int i2 = 0; i2 < opponentSlotsCopy2.Count; i2++) { yield return opponentSlotsCopy2[i2].opposingSlot.FadeToSlotMod(SlotMods.SlotMod_Muddy.SlotType); } } } public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return ((Object)((Card)card).Info).name == "BaitBucket"; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("Shark"), deathSlot, 0.1f, true); } } public class ChallengeBoonTrap : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("TrapBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("TrapBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List boardCards = new List(); foreach (CardSlot slot in Singleton.Instance.OpponentSlotsCopy) { if ((Object)(object)slot.Card != (Object)null) { boardCards.Add(((Card)slot.Card).Info); } } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(Math.Max((opponentSlotsCopy.Count + 1) / 2, 1), opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("Trap"), slots[i], 0.1f, true); } if (RunState.CurrentRegionTier >= 2) { List opponentSlotsCopy2 = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy2.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); for (int i2 = 0; i2 < opponentSlotsCopy2.Count; i2++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_IceCube"), opponentSlotsCopy2[i2].opposingSlot, 0.1f, true); } } } } public class ChallengeBoonTotem : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("TotemBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("TotemBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List boardCards = new List(); foreach (CardSlot slot in Singleton.Instance.OpponentSlotsCopy) { if ((Object)(object)slot.Card != (Object)null) { boardCards.Add(((Card)slot.Card).Info); } } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(opponentSlotsCopy.Count / 5 + 1, opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_Totem"), slots[i], 0.1f, true); if (RunState.CurrentRegionTier >= 2) { slots[i].Card.AddTemporaryMod(new CardModificationInfo((Ability)54) { healthAdjustment = 1 }); } } } } public class ChallengeBoonBloodMoon : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.darkRed; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.glowRed; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.glowRed, GameColors.Instance.brightRed, GameColors.Instance.nearBlack, darkRed, GameColors.Instance.lightGray, GameColors.Instance.nearBlack, brownOrange, GameColors.Instance.lightGray, GameColors.Instance.nearBlack); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("BloodMoonBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } Singleton.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.1f); yield return Singleton.Instance.ClearBoard(); yield return Singleton.Instance.ClearQueue(); yield return (object)new WaitForSeconds(0.1f); LeshyAnimationController.Instance.SetEyesTexture(ResourceBank.Get("Art/Effects/red")); yield return CardGlitchSequence(CardLoader.GetCardByName("DireWolfCub")); } public static IEnumerator CardGlitchSequence(CardInfo grizzlyInfo) { ((ScreenEffect)Singleton.Instance.Effects.GetEffect()).SetIntensity(1f, 1.5f); Singleton.Instance.Shake(0.1f, 1f); AudioController.Instance.PlaySound2D("broken_hum", (MixerGroup)0, 0.5f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); foreach (CardSlot slot in Singleton.Instance.OpponentSlotsCopy) { if (!Singleton.Instance.Opponent.QueuedSlots.Contains(slot)) { yield return Singleton.Instance.Opponent.QueueCard(grizzlyInfo, slot, false, false, false); } if ((Object)(object)slot.Card == (Object)null) { yield return Singleton.Instance.CreateCardInSlot(grizzlyInfo, slot, 0f, true); } if ((Object)(object)slot.Card != (Object)null) { Tutorial4BattleSequencer.GiveCardReachAndRedColor(slot.Card); } } foreach (PlayableCard playableCard in Singleton.Instance.Opponent.Queue) { Tutorial4BattleSequencer.GiveCardReachAndRedColor(playableCard); } yield return (object)new WaitForSeconds(0.5f); } } public class ChallengeBoonCarrotPatch : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.darkRed; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.glowRed; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.glowRed, GameColors.Instance.brightRed, GameColors.Instance.nearBlack, darkRed, GameColors.Instance.lightGray, GameColors.Instance.nearBlack, brownOrange, GameColors.Instance.lightGray, GameColors.Instance.nearBlack); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("BloodMoonBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } Singleton.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.1f); yield return Singleton.Instance.ClearBoard(); yield return Singleton.Instance.ClearQueue(); yield return (object)new WaitForSeconds(0.1f); LeshyAnimationController.Instance.SetEyesTexture(ResourceBank.Get("Art/Effects/red")); yield return CardGlitchSequence(CardLoader.GetCardByName("Rabbit")); SetSceneEffectsShown(showEffects: false); LeshyAnimationController.Instance.ResetEyesTexture(); Singleton.Instance.SwitchToView((View)6, false, false); yield return Singleton.Instance.PlayDialogueEvent("CarrotBoonIntro", (MessageAdvanceMode)0, (EventIntersectMode)0, (string[])null, (Action)null); yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView((View)1, false, false); yield return Singleton.Instance.PlayDialogueEvent("CarrotBoonIntro2", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } public static IEnumerator CardGlitchSequence(CardInfo grizzlyInfo) { ((ScreenEffect)Singleton.Instance.Effects.GetEffect()).SetIntensity(1f, 1.5f); Singleton.Instance.Shake(0.1f, 1f); AudioController.Instance.PlaySound2D("broken_hum", (MixerGroup)0, 0.5f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); foreach (CardSlot slot in Singleton.Instance.OpponentSlotsCopy) { if (!Singleton.Instance.Opponent.QueuedSlots.Contains(slot)) { yield return Singleton.Instance.Opponent.QueueCard(grizzlyInfo, slot, false, false, false); } if ((Object)(object)slot.Card == (Object)null) { yield return Singleton.Instance.CreateCardInSlot(grizzlyInfo, slot, 0f, true); } if ((Object)(object)slot.Card != (Object)null) { Tutorial4BattleSequencer.GiveCardReachAndRedColor(slot.Card); } } foreach (PlayableCard playableCard in Singleton.Instance.Opponent.Queue) { Tutorial4BattleSequencer.GiveCardReachAndRedColor(playableCard); } yield return (object)new WaitForSeconds(0.5f); } } public class ChallengeBoonBlizzard : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.gray; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.blue; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.brightBlue, GameColors.Instance.brightBlue, GameColors.Instance.brightNearWhite, darkRed, GameColors.Instance.gray, GameColors.Instance.brightNearWhite, brownOrange, GameColors.Instance.blue, GameColors.Instance.brightNearWhite); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("BlizzardBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("BlizzardBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; CardInfo cardInfo = CardLoader.GetCardByName("bitty_Avalanche"); if ((Object)(object)playerSlotsCopy[0].Card != (Object)null) { yield return playerSlotsCopy[0].Card.TakeDamage(10, (PlayableCard)null); } if ((Object)(object)playerSlotsCopy[0].opposingSlot.Card != (Object)null) { yield return playerSlotsCopy[0].opposingSlot.Card.TakeDamage(10, (PlayableCard)null); } yield return Singleton.Instance.CreateCardInSlot(cardInfo, playerSlotsCopy[0], 0.1f, true); yield return Singleton.Instance.CreateCardInSlot(cardInfo, playerSlotsCopy[0].opposingSlot, 0.1f, true); } public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { Plugin.Log.LogInfo((object)"Avalanche Activation"); bool avalancheExists = false; foreach (CardSlot slot in Singleton.Instance.AllSlotsCopy) { if ((Object)(object)slot.Card != (Object)null && ((Object)((Card)slot.Card).Info).name == "bitty_Avalanche") { avalancheExists = true; } } if (!avalancheExists) { Singleton.Instance.SwitchToView((View)1, false, false); yield return Singleton.Instance.PlayBoonAnimation(boonType); yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView((View)4, false, true); yield return (object)new WaitForSeconds(0.5f); List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; CardInfo cardInfo = CardLoader.GetCardByName("bitty_Avalanche"); if ((Object)(object)playerSlotsCopy[0].Card != (Object)null) { yield return playerSlotsCopy[0].Card.TakeDamage(10, (PlayableCard)null); } if ((Object)(object)playerSlotsCopy[0].opposingSlot.Card != (Object)null) { yield return playerSlotsCopy[0].opposingSlot.Card.TakeDamage(10, (PlayableCard)null); } yield return Singleton.Instance.CreateCardInSlot(cardInfo, playerSlotsCopy[0], 0.1f, true); yield return Singleton.Instance.CreateCardInSlot(cardInfo, playerSlotsCopy[0].opposingSlot, 0.1f, true); } yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView((View)1, false, false); } } public class ChallengeBoonObelisk : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(1, opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_Obelisk"), slots[i], 0.1f, true); if ((Object)(object)slots[i].opposingSlot.Card != (Object)null) { yield return slots[i].opposingSlot.Card.Die(false, (PlayableCard)null, false); } yield return slots[i].opposingSlot.FadeToSlotMod(SlotMods.SlotMod_Obelisk.SlotType); } if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("ObeliskBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("ObeliskBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } } public class ChallengeBoonMinicello : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.Remove(opponentSlotsCopy[0]); opponentSlotsCopy.Remove(opponentSlotsCopy[opponentSlotsCopy.Count - 1]); opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(1, opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { CardInfo card = CardLoader.GetCardByName("bitty_Minicello"); card.mods.Add(new CardModificationInfo((Ability)33)); card.mods.Add(new CardModificationInfo(0, 3)); yield return Singleton.Instance.CreateCardInSlot(card, slots[i], 0.1f, true); } if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); Singleton.Instance.SwitchToView((View)4, false, false); if (!DialogueEventsData.EventIsPlayed("MinicelloBoonIntro")) { yield return Singleton.Instance.PlayDialogueEvent("MinicelloBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } yield return Singleton.Instance.PlayDialogueEvent("MinicelloBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); Singleton.Instance.SwitchToView((View)1, false, false); } } } public class ChallengeBoonDarkForest : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.gray; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.lightGray; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.gray, GameColors.Instance.gray, GameColors.Instance.brightNearWhite, darkRed, GameColors.Instance.gray, GameColors.Instance.lightGray, brownOrange, GameColors.Instance.gray, GameColors.Instance.lightGray); List boardCards = new List(); foreach (CardSlot slot in Singleton.Instance.OpponentSlotsCopy) { if ((Object)(object)slot.Card != (Object)null) { boardCards.Add(((Card)slot.Card).Info); PlayableCard otherCard = slot.Card; if (CardExtensions.HasTrait(otherCard, (Trait)12)) { object obj = ((Card)otherCard).Info.Clone(); CardInfo cardInfo = (CardInfo)((obj is CardInfo) ? obj : null); CardModificationInfo cardModificationInfo = new CardModificationInfo(); cardModificationInfo.attackAdjustment = 1; cardModificationInfo.nameReplacement = string.Format(Localization.Translate("Living {0}"), cardInfo.DisplayedNameLocalized); cardInfo.Mods.Add(cardModificationInfo); yield return otherCard.TransformIntoCard(cardInfo, (Action)null, (Action)null); } yield break; } } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); int terrainCards = 0; if (boardCards.Count <= 0) { terrainCards = 3; } else if (boardCards.Count <= 1) { terrainCards = 2; } else if (boardCards.Count == 2) { terrainCards = 1; } List slots = SelectRandomSlots(terrainCards, opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { CardInfo card = CardLoader.GetCardByName("Tree"); yield return Singleton.Instance.CreateCardInSlot(card, slots[i], 0.1f, true); } if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("DarkForestBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); Singleton.Instance.SwitchToView((View)4, false, false); yield return Singleton.Instance.PlayDialogueEvent("DarkForestBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return otherCard.OpponentCard; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { if (CardExtensions.HasTrait(otherCard, (Trait)12)) { object obj = ((Card)otherCard).Info.Clone(); CardInfo cardInfo = (CardInfo)((obj is CardInfo) ? obj : null); CardModificationInfo cardModificationInfo = new CardModificationInfo(); cardModificationInfo.attackAdjustment = 1; cardModificationInfo.nameReplacement = string.Format(Localization.Translate("Living {0}"), cardInfo.DisplayedNameLocalized); cardInfo.Mods.Add(cardModificationInfo); yield return otherCard.TransformIntoCard(cardInfo, (Action)null, (Action)null); } } } public class ChallengeBoonFlood : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.gray; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.blue; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.darkBlue, GameColors.Instance.brightBlue, GameColors.Instance.brightNearWhite, darkRed, GameColors.Instance.gray, GameColors.Instance.brightNearWhite, brownOrange, GameColors.Instance.blue, GameColors.Instance.brightNearWhite); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("FloodBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("FloodBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); yield return (object)new WaitForSeconds(0.7f); } for (int i = 0; i < 3 - RunState.CurrentRegionTier; i++) { yield return Singleton.Instance.SpawnCardToHand(CardLoader.GetCardByName("bitty_Raft"), 0.25f); yield return (object)new WaitForSeconds(0.2f); } List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List opponentSlots = SelectRandomSlots(2, opponentSlotsCopy); for (int i2 = 0; i2 < opponentSlots.Count; i2++) { yield return opponentSlots[i2].FadeToSlotMod(SlotMods.SlotMod_Flood.SlotType); } List playerSlots = Singleton.Instance.AllSlotsCopy; playerSlots.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); for (int i3 = 0; i3 < playerSlots.Count; i3++) { yield return playerSlots[i3].FadeToSlotMod(SlotMods.SlotMod_Flood.SlotType); } } } public class ChallengeBoonBreeze : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed("EnvironmentsIntro") && !DialogueEventsData.EventIsPlayed("BreezeBoonIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent("BreezeBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List allSlotsCopy = Singleton.Instance.AllSlotsCopy; allSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(6, allSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return slots[i].FadeToSlotMod(SlotMods.SlotMod_Breeze.SlotType); } } } public class ChallengeBoonGraveyard : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.gray; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.lightGray; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.lightGray, GameColors.Instance.lightGray, GameColors.Instance.gray, darkRed, GameColors.Instance.gray, GameColors.Instance.gray, brownOrange, GameColors.Instance.gray, GameColors.Instance.gray); string P03 = (Plugin.modModeActive(Plugin.MOD_MODE.P03) ? "P03" : ""); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed(P03 + "EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent(P03 + "GraveyardBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } if (Plugin.modModeActive(Plugin.MOD_MODE.KCM) && RunState.CurrentRegionTier >= 1) { List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(Math.Max((opponentSlotsCopy.Count + 1) / 2, 1), opponentSlotsCopy); for (int i = 0; i < slots.Count; i++) { string name = (SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + i) ? "bitty_SkeletonPirate" : "Amoeba"); yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName(name), slots[i], 0.1f, true); } } else if (Plugin.modModeActive(Plugin.MOD_MODE.P03)) { List opponentSlotsCopy2 = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy2.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots2 = SelectRandomSlots(Math.Max((opponentSlotsCopy2.Count + 1) / 2, 1), opponentSlotsCopy2); for (int i2 = 0; i2 < slots2.Count; i2++) { string name2 = (SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + i2) ? "BrokenBot" : "Amoebot"); yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName(name2), slots2[i2], 0.1f, true); } } List allSlotsCopy = Singleton.Instance.AllSlotsCopy; allSlotsCopy = SelectRandomSlots(6, allSlotsCopy); for (int i3 = 0; i3 < allSlotsCopy.Count; i3++) { yield return allSlotsCopy[i3].FadeToSlotMod(SlotMods.SlotMod_Grave.SlotType); } } } public class ChallengeBoonFlashGrowth : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { Color darkRed = GameColors.Instance.darkLimeGreen; darkRed.a = 0.5f; Color brownOrange = GameColors.Instance.brightLimeGreen; brownOrange.a = 0.5f; SetSceneEffectsShown(showEffects: true, GameColors.Instance.brightLimeGreen, GameColors.Instance.brightLimeGreen, GameColors.Instance.brightLimeGreen, darkRed, GameColors.Instance.darkLimeGreen, GameColors.Instance.brightLimeGreen, brownOrange, GameColors.Instance.limeGreen, GameColors.Instance.brightLimeGreen); string P03 = (Plugin.modModeActive(Plugin.MOD_MODE.P03) ? "P03" : ""); if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed(P03 + "EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent(P03 + "FlashGrowthBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } List slots = SelectRandomSlots(slotsCopy: Singleton.Instance.OpponentSlotsCopy, amount: RunState.CurrentRegionTier + 1); for (int i = 0; i < slots.Count; i++) { yield return slots[i].FadeToSlotMod(SlotMods.SlotMod_Growth.SlotType); } List playerSlotsCopy = Singleton.Instance.PlayerSlotsCopy; List slots2 = SelectRandomSlots(2, playerSlotsCopy); for (int j = 0; j < slots2.Count; j++) { yield return slots2[j].FadeToSlotMod(SlotMods.SlotMod_Growth.SlotType); } } } public class ChallengeBoonGemSanctuary : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { List emptySlots = Singleton.Instance.OpponentSlotsCopy; emptySlots.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); List slots = SelectRandomSlots(Math.Max((emptySlots.Count + 1) / 2, 1), emptySlots); CardSlot animatorSlot = null; for (int i = 0; i < slots.Count; i++) { string name = (SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + i + 1) ? "EmptyVessel_OrangeGem" : "EmptyVessel_GreenGem"); yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName(name), slots[i], 0.1f, true); if (i == 0) { slots[i].Card.AddTemporaryMod(new CardModificationInfo((Ability)40)); animatorSlot = slots[i]; } } emptySlots = Singleton.Instance.PlayerSlotsCopy; emptySlots.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null || (Object)(object)x == (Object)(object)animatorSlot); slots = SelectRandomSlots(1, emptySlots); for (int i2 = 0; i2 < slots.Count; i2++) { string name2 = "EmptyVessel_GreenGem"; yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName(name2), slots[i2], 0.1f, true); if (i2 == 0) { slots[i2].Card.AddTemporaryMod(new CardModificationInfo((Ability)40)); } } string P03 = "P03"; if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed(P03 + "EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent(P03 + "GemSanctuaryBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } } public class ChallengeBoonElectricStorm : ChallengeBoonBase { internal static Type boo; protected override Type boonType => boo; public override bool RespondsToPreBoonActivation() { return true; } public override IEnumerator OnPreBoonActivation() { string P03 = "P03"; if (SaveFile.IsAscension && DialogueEventsData.EventIsPlayed(P03 + "EnvironmentsIntro")) { yield return (object)new WaitForSeconds(0.7f); yield return Singleton.Instance.PlayDialogueEvent(P03 + "ElectricStormBoonIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)Dialogue.P03HappyCloseUp); } List allSlotsCopy = Singleton.Instance.AllSlotsCopy; List slots = SelectRandomSlots(6, allSlotsCopy); for (int i = 0; i < slots.Count; i++) { yield return slots[i].FadeToSlotMod(SlotMods.SlotMod_Overclock.SlotType); } } } public static void AddBoons() { Plugin.Log.LogInfo((object)"Start of boons"); Add_Boon_Mud(); Add_Boon_Hail(); Add_Boon_Cliff(); Add_Boon_Mushrooms(); Add_Boon_Dynamite(); Add_Boon_Bait(); Add_Boon_Trap(); Add_Boon_Totem(); Add_Boon_BloodMoon(); Add_Boon_CarrotPatch(); Add_Boon_Blizzard(); Add_Boon_Obelisk(); Add_Boon_Minicello(); Add_Boon_DarkForest(); Add_Boon_Flood(); Add_Boon_Breeze(); Add_Boon_Graveyard(); Add_Boon_FlashGrowth(); Add_Boon_GemSanctuary(); Add_Boon_ElectricalStorm(); EnviroHandler.Init_EnviroBoonList(); Plugin.Log.LogInfo((object)"End of boons"); } private static void Add_Boon_Mud() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_mud"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_swamp"); Type boo = BoonManager.New("bitty45.inscryption.challenges.mud", "Environment: Mud Swamp", typeof(ChallengeBoonMud), "You will start the battle with Mud on some of your spaces.", val, val2, false, false, true); ChallengeBoonMud.boo = boo; } private static void Add_Boon_Hail() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_hail"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_snowtrees"); Type boo = BoonManager.New("bitty45.inscryption.challenges.hail", "Environment: Hail Storm", typeof(ChallengeBoonHail), "At the start of each turn, all of the turn owner's non-terrain cards take 1 damage.", val, val2, false, false, true); ChallengeBoonHail.boo = boo; } private static void Add_Boon_Cliff() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_cliff"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_cliffs"); Type boo = BoonManager.New("bitty45.inscryption.challenges.cliff", "Environment: Cliffside", typeof(ChallengeBoonCliffs), "At the start of the battle, the leftmost lane will be blocked with Cliffs.", val, val2, false, false, true); ChallengeBoonCliffs.boo = boo; } private static void Add_Boon_Mushrooms() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_fungus"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_mushrooms"); Type boo = BoonManager.New("bitty45.inscryption.challenges.mushrooms", "Environment: Fungal Field", typeof(ChallengeBoonMushrooms), "The opponent will start the battle with Mushrooms.", val, val2, false, false, true); ChallengeBoonMushrooms.boo = boo; } private static void Add_Boon_Dynamite() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_dynamite"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_startingtrees"); Type boo = BoonManager.New("bitty45.inscryption.challenges.dynamite", "Environment: Prospector's Camp", typeof(ChallengeBoonDynamite), "You will start the battle with Dynamite on some of your spaces.", val, val2, false, false, true); ChallengeBoonDynamite.boo = boo; } private static void Add_Boon_Bait() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_bait"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_swamp"); Type boo = BoonManager.New("bitty45.inscryption.challenges.bait", "Environment: Angler's Pond", typeof(ChallengeBoonBait), "The opponent will start the battle with Bait Buckets.", val, val2, false, false, true); ChallengeBoonBait.boo = boo; } private static void Add_Boon_Trap() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_trap"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_snowtrees"); Type boo = BoonManager.New("bitty45.inscryption.challenges.trap", "Environment: Trapper's Hunting Grounds", typeof(ChallengeBoonTrap), "The opponent will start the battle with Steel Traps.", val, val2, false, false, true); ChallengeBoonTrap.boo = boo; } private static void Add_Boon_Totem() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_totem"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_startingtrees"); Type boo = BoonManager.New("bitty45.inscryption.challenges.totem", "Environment: Cursed Totem", typeof(ChallengeBoonTotem), "The opponent will start the battle with Cursed Totems.", val, val2, false, false, true); ChallengeBoonTotem.boo = boo; } private static void Add_Boon_BloodMoon() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_Blood_Moon"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_Blood_Moon"); Type boo = BoonManager.New("bitty45.inscryption.challenges.bloodmoon", "Environment: Blood Moon", typeof(ChallengeBoonBloodMoon), "The opponent will start the battle with Dire Wolf Pups.", val, val2, false, false, true); ChallengeBoonBloodMoon.boo = boo; } private static void Add_Boon_CarrotPatch() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_carrot"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_Blood_Moon"); Type boo = BoonManager.New("bitty45.inscryption.challenges.carrot", "Environment: Carrot Patch", typeof(ChallengeBoonCarrotPatch), "The opponent will start the battle with Rabbits.", val, val2, false, false, true); ChallengeBoonCarrotPatch.boo = boo; } private static void Add_Boon_Blizzard() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_blizzard"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_snowtrees"); Type boo = BoonManager.New("bitty45.inscryption.challenges.blizzard", "Environment: Blizzard", typeof(ChallengeBoonBlizzard), "At the start of each turn, if there is not an Avalanche present on the board, one will be created on the left-most side of the board.", val, val2, false, false, true); ChallengeBoonBlizzard.boo = boo; } private static void Add_Boon_Obelisk() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_obelisk"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_voidaura"); Type boo = BoonManager.New("bitty45.inscryption.challenges.obelisk", "Environment: Obelisk", typeof(ChallengeBoonObelisk), "The opponent will start the battle with an Obelisk.", val, val2, false, false, true); ChallengeBoonObelisk.boo = boo; } private static void Add_Boon_Minicello() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_pirate"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_pirate"); Type boo = BoonManager.New("bitty45.inscryption.challenges.minicello", "Environment: Pirate's Hollow", typeof(ChallengeBoonMinicello), "The opponent will start the battle with a Minicello.", val, val2, false, false, true); ChallengeBoonMinicello.boo = boo; } private static void Add_Boon_DarkForest() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_tree"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_startingtrees"); Type boo = BoonManager.New("bitty45.inscryption.challenges.darkForest", "Environment: Dark Forest", typeof(ChallengeBoonDarkForest), "The opponent will start the battle with Trees. All of the opponent's terrain have +1 power.", val, val2, false, false, true); ChallengeBoonDarkForest.boo = boo; } private static void Add_Boon_Flood() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_flood"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_flood"); Type boo = BoonManager.New("bitty45.inscryption.challenges.flood", "Environment: Flood", typeof(ChallengeBoonFlood), "Whenever a creature is played, it gains Waterborne. Terrain, and creatures with Airborne are ignored.", val, val2, false, false, true); ChallengeBoonFlood.boo = boo; } private static void Add_Boon_Breeze() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_breeze"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_breeze"); Type boo = BoonManager.New("bitty45.inscryption.challenges.breeze", "Environment: Breeze", typeof(ChallengeBoonBreeze), "At the start of every turn, all creatures gain or lose Airborne. Terrain, and creatures with Waterborne or Burrower are ignored.", val, val2, false, false, true); ChallengeBoonBreeze.boo = boo; } private static void Add_Boon_Graveyard() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_graveyard"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_graveyard"); Type boo = BoonManager.New("bitty45.inscryption.challenges", "Environment: Graveyard", typeof(ChallengeBoonGraveyard), "When a creature dies, it dies again.", val, val2, false, false, true); ChallengeBoonGraveyard.boo = boo; } private static void Add_Boon_FlashGrowth() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_flashgrowth"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_flashgrowth"); Type boo = BoonManager.New("bitty45.inscryption.challenges", "Environment: Flash Growth", typeof(ChallengeBoonFlashGrowth), "When a card is played, any sigils that activate at the start of the turn are activated.", val, val2, false, false, true); ChallengeBoonFlashGrowth.boo = boo; } private static void Add_Boon_GemSanctuary() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_breeze"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_blank"); Type boo = BoonManager.New("bitty45.inscryption.challenges", "Environment: Gem Sanctuary", typeof(ChallengeBoonGemSanctuary), "All gems have +1 power.", val, val2, false, false, false); ChallengeBoonGemSanctuary.boo = boo; } private static void Add_Boon_ElectricalStorm() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_003c: Unknown result type (might be due to invalid IL or missing references) Texture val = (Texture)(object)Tools.LoadTexture("boonicon_breeze"); Texture val2 = (Texture)(object)Tools.LoadTexture("boon_blank"); Type boo = BoonManager.New("bitty45.inscryption.challenges", "Environment: Electrical Storm", typeof(ChallengeBoonElectricStorm), "When a card is played, it takes 1 damage and gains 1 power.", val, val2, false, false, false); ChallengeBoonElectricStorm.boo = boo; } } public class CAppearances { public class CloverAppearanceBehaviour : CardAppearanceBehaviour { private Texture2D CardBG = Tools.LoadTexture("card_clover"); public override void ApplyAppearance() { ((Texture)CardBG).filterMode = (FilterMode)0; ((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)CardBG; CardExtensions.AddDecal(((CardAppearanceBehaviour)this).Card.Info, (Texture[])(object)new Texture[1] { (Texture)CardBG }); } public override void ResetAppearance() { ((CardAppearanceBehaviour)this).Card.Info.Decals.Clear(); } } public class RedChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.darkRed); } } public class YellowChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.yellow); } } public class OrangeChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.orange); } } public class CyanChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(Color.cyan); } } public class WhiteChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.brightNearWhite); } } public class MagentaChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(Color.magenta); } } public class PurpleChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.darkPurple); } } public class LightBlueChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.brightBlue); } } public class BrightRedChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.brightRed); } } public class LightGreenChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.brightLimeGreen); } } public class BlueChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.darkBlue); } } public class GreenChampAppearanceBehaviour : CardAppearanceBehaviour { public override void ApplyAppearance() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) ((CardAppearanceBehaviour)this).Card.renderInfo.forceEmissivePortrait = true; ((CardAppearanceBehaviour)this).Card.StatsLayer.SetEmissionColor(GameColors.Instance.darkLimeGreen); } } public static readonly Appearance CloverAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "CloverAppearance", typeof(CloverAppearanceBehaviour)).Id; public static readonly Appearance RedChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "RedChampAppearance", typeof(RedChampAppearanceBehaviour)).Id; public static readonly Appearance YellowChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "YellowChampAppearance", typeof(YellowChampAppearanceBehaviour)).Id; public static readonly Appearance OrangeChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "OrangeChampAppearance", typeof(OrangeChampAppearanceBehaviour)).Id; public static readonly Appearance CyanChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "CyanChampAppearance", typeof(CyanChampAppearanceBehaviour)).Id; public static readonly Appearance WhiteChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "WhiteChampAppearance", typeof(WhiteChampAppearanceBehaviour)).Id; public static readonly Appearance MagentaChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "MagentaChampAppearance", typeof(MagentaChampAppearanceBehaviour)).Id; public static readonly Appearance PurpleChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "PurpleChampAppearance", typeof(PurpleChampAppearanceBehaviour)).Id; public static readonly Appearance LightBlueChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "LightBlueChampAppearance", typeof(LightBlueChampAppearanceBehaviour)).Id; public static readonly Appearance BrightRedChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "BrightRedChampAppearance", typeof(BrightRedChampAppearanceBehaviour)).Id; public static readonly Appearance LightGreenChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "LightGreenChampAppearance", typeof(LightGreenChampAppearanceBehaviour)).Id; public static readonly Appearance BlueChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "BlueChampAppearance", typeof(BlueChampAppearanceBehaviour)).Id; public static readonly Appearance GreenChampAppearance = CardAppearanceBehaviourManager.Add("bitty45.inscryption.challenges", "GreenChampAppearance", typeof(GreenChampAppearanceBehaviour)).Id; } public class Cards { public static void AddCards() { Plugin.Log.LogInfo((object)"Start of cards"); Add_Card_TravelingOuroboros(); Add_Card_GoldenSheep(); Add_Card_WoodenBoard(); Add_Card_Cliff(); Add_Card_Mushrooms(); Add_Card_IceCube(); Add_Card_Totem(); Add_Card_Avalanche(); Add_Card_Obelisk(); Add_Card_Minicello(); Add_Card_DeckSkeletonPirate(); Add_Card_DeckSkeletonParrot(); Add_Card_Raft(); Add_Card_AscenderBane(); Add_Card_CloverReRoll(); Add_Card_Test(); Plugin.Log.LogInfo((object)"End of cards"); } private static void Add_Card_Test() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.AddAbilities(CardManager.New("bitty", "ChallengeTest", "Test", 0, 1, "Testing Card."), (Ability[])(object)new Ability[1] { (Ability)(int)Abilities.GiveSlotSpawner.ability }), Tools.LoadTexture("portrait_test.png"), Tools.LoadTexture("portrait_test.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Raft() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardManager.New("bitty", "Raft", "Raft", 0, 1, "A dry patch in the flood."), (Ability[])(object)new Ability[1] { (Ability)(int)Abilities.GiveRaft.ability })), Tools.LoadTexture("portrait_raft.png"), Tools.LoadTexture("portrait_raft.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_AscenderBane() { CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.SetBloodCost(CardManager.New("bitty", "Ascender's Bane", "Ascender's Bane", 0, 1, "A reminder of past challengers."), (int?)4)), Tools.LoadTexture("portrait_ascendersbane"), Tools.LoadTexture("portrait_ascendersbane"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_CloverReRoll() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected I4, but got Unknown CardInfo val = CardExtensions.SetExtendedProperty(CardExtensions.SetPortraitAndEmission(CardExtensions.AddSpecialAbilities(CardExtensions.AddAppearances(CardManager.New("bitty", "Clover", "", 0, 0, "A reminder of past challengers."), (Appearance[])(object)new Appearance[1] { (Appearance)(int)CAppearances.CloverAppearance }), (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)Abilities.AddCloverReRollAbility.CloverReRollSpecialAbility }), Tools.LoadTexture("portrait_blank"), Tools.LoadTexture("portrait_blank"), (FilterMode?)null), "bitty_spaceNotRequired", (object)true); CardManager.Add("bitty", val); } private static void Add_Card_TravelingOuroboros() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected I4, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected I4, but got Unknown CardInfo val = CardExtensions.SetIceCube(CardExtensions.AddTribes(CardExtensions.SetPortraitAndEmission(CardExtensions.AddAppearances(CardExtensions.AddSpecialAbilities(CardExtensions.AddAbilities(CardExtensions.SetCost(CardManager.New("bitty", "TravelingOuroboros", "Ouroboros", 1, 1, "My very own Ouroboros."), (int?)2, (int?)0, (int?)0, (List)null), (Ability[])(object)new Ability[1] { (Ability)(int)Abilities.GiveFalseUnkillable.ability }), (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)Abilities.AddTravelingOuroAbility.TravelingOuroSpecialAbility }), (Appearance[])(object)new Appearance[1] { (Appearance)7 }), Tools.LoadTexture("portrait_ouroboros.png"), Tools.LoadTexture("portrait_ouroboros_emission.png"), (FilterMode?)null), (Tribe[])(object)new Tribe[1] { (Tribe)5 }), CardLoader.GetCardByName("Adder"), (IEnumerable)null); val.defaultEvolutionName = "Jörmungandr"; CardManager.Add("bitty", val); } private static void Add_Card_GoldenSheep() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected I4, but got Unknown CardInfo val = CardExtensions.AddTribes(CardExtensions.SetPortraitAndEmission(CardExtensions.AddAppearances(CardExtensions.AddAppearances(CardExtensions.AddSpecialAbilities(CardExtensions.AddAbilities(CardExtensions.SetCost(CardManager.New("bitty", "GoldenSheep", "Chrysomallos", 0, 4, "A mystical, glittering being."), (int?)1, (int?)0, (int?)0, (List)null), (Ability[])(object)new Ability[1] { (Ability)102 }), (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)Abilities.AddGoldenSheepAbility.GoldenSheepSpecialAbility }), (Appearance[])(object)new Appearance[1] { (Appearance)7 }), (Appearance[])(object)new Appearance[1] { (Appearance)6 }), Tools.LoadTexture("portrait_goldram.png"), Tools.LoadTexture("portrait_goldram_emission.png"), (FilterMode?)null), (Tribe[])(object)new Tribe[1] { (Tribe)4 }); CardManager.Add("bitty", val); } private static void Add_Card_WoodenBoard() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected I4, but got Unknown CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardExtensions.AddAbilities(CardManager.New("bitty", "WoodenBoard", "Wooden Board", 0, 1, "A regular wooden board."), (Ability[])(object)new Ability[1] { (Ability)13 }), (Ability[])(object)new Ability[1] { (Ability)(int)GiveDeathBell.ability })), Tools.LoadTexture("portrait_woodenplank.png"), Tools.LoadTexture("portrait_woodenplank.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Cliff() { CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardExtensions.AddAbilities(CardManager.New("bitty", "Cliff", "Cliff", 0, 10, "A solid wall of rock."), (Ability[])(object)new Ability[1] { (Ability)105 }), (Ability[])(object)new Ability[1] { (Ability)23 })), Tools.LoadTexture("portrait_cliff.png"), Tools.LoadTexture("portrait_cliff.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Mushrooms() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.AddAppearances(CardExtensions.AddTraits(CardExtensions.AddAbilities(CardManager.New("bitty", "Mushrooms", "Mushrooms", 0, 2, "A collection of strange mushrooms. They attract anything nearby."), (Ability[])(object)new Ability[1] { (Ability)(int)GiveMushrooms.ability }), (Trait[])(object)new Trait[1] { (Trait)12 }), (Appearance[])(object)new Appearance[1] { (Appearance)2 }), Tools.LoadTexture("portrait_mushroom.png"), Tools.LoadTexture("portrait_fungus.png"), (FilterMode?)null); val.defaultEvolutionName = "Mega Mushrooms"; CardManager.Add("bitty", val); } private static void Add_Card_IceCube() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected I4, but got Unknown CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardManager.New("bitty", "IceCube", "Ice Cube", 0, 1, "A block of ice."), (Ability[])(object)new Ability[1] { (Ability)(int)GiveDeathBell.ability })), Tools.LoadTexture("portrait_icecube.png"), Tools.LoadTexture("portrait_icecube.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Totem() { CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardManager.New("bitty", "Totem", "Cursed Totem", 0, 2, "A totem surrounded in mysterious energy."), (Ability[])(object)new Ability[1] { (Ability)34 })), Tools.LoadTexture("portrait_totem.png"), Tools.LoadTexture("portrait_totem_emission.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Avalanche() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardExtensions.AddAbilities(CardManager.New("bitty", "Avalanche", "Avalanche", 0, 9, "A monsterous mound of snow."), (Ability[])(object)new Ability[1] { (Ability)(int)Abilities.GiveStrafeAvalanche.ability }), (Ability[])(object)new Ability[1] { (Ability)105 })), Tools.LoadTexture("portrait_avalanche.png"), Tools.LoadTexture("portrait_avalanche.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Obelisk() { CardInfo val = CardExtensions.SetPortraitAndEmission(CardExtensions.SetTerrain(CardExtensions.AddAbilities(CardManager.New("bitty", "Obelisk", "Obelisk", 0, 10, "A tall mysterious stone."), (Ability[])(object)new Ability[1] { (Ability)105 })), Tools.LoadTexture("portrait_obelisk.png"), Tools.LoadTexture("portrait_obelisk.png"), (FilterMode?)null); CardManager.Add("bitty", val); } private static void Add_Card_Minicello() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected I4, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) CardInfo val = CardExtensions.SetPixelPortrait(CardExtensions.SetPortraitAndEmission(CardExtensions.SetIceCube(CardExtensions.AddAppearances(CardExtensions.AddAbilities(CardExtensions.AddAbilities(CardExtensions.AddSpecialAbilities(CardExtensions.SetCost(CardManager.New("bitty", "Minicello", "Minicello", 1, 1, "A miniture version of a famous pirate's ship."), (int?)1, (int?)0, (int?)0, (List)null), (SpecialTriggeredAbility[])(object)new SpecialTriggeredAbility[1] { (SpecialTriggeredAbility)(int)Abilities.GiveCannoneer.MinicelloSpecialAbility }), (Ability[])(object)new Ability[1] { (Ability)13 }), (Ability[])(object)new Ability[1] { (Ability)36 }), (Appearance[])(object)new Appearance[1] { (Appearance)7 }), CardLoader.GetCardByName("SkeletonPirate"), (IEnumerable)null), Tools.LoadTexture("portrait_minicello.png"), Tools.LoadTexture("portrait_minicello_emission.png"), (FilterMode?)null), Tools.LoadTexture("pixelportrait_ghostshiprepaired.png"), (FilterMode?)null); val.defaultEvolutionName = "Mediumcello"; val.temple = (CardTemple)1; CardManager.Add("bitty", val); } private static void Add_Card_DeckSkeletonPirate() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected I4, but got Unknown CardInfo obj = CardManager.New("bitty", "SkeletonPirate", "Skeleton Crew", 2, 1, "A loyal member of Royal's crew."); int? num = 2; CardInfo val = CardExtensions.AddAppearances(CardExtensions.SetPixelPortrait(CardExtensions.SetPortraitAndEmission(CardExtensions.AddAbilities(CardExtensions.SetCost(obj, (int?)0, num, (int?)0, (List)null), (Ability[])(object)new Ability[1] { (Ability)35 }), Tools.LoadTexture("portrait_skeletonpirate.png"), Tools.LoadTexture("portrait_skeletonpirate_emission.png"), (FilterMode?)null), Tools.LoadTexture("pixelportrait_skeletoncrew.png"), (FilterMode?)null), (Appearance[])(object)new Appearance[1] { (Appearance)(int)Plugin.UndeadAppearance }); val.defaultEvolutionName = "Sans"; CardManager.Add("bitty", val); } private static void Add_Card_DeckSkeletonParrot() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected I4, but got Unknown CardInfo val = CardExtensions.AddAppearances(CardExtensions.SetPixelPortrait(CardExtensions.SetPortraitAndEmission(CardExtensions.AddAbilities(CardExtensions.AddAbilities(CardExtensions.SetCost(CardExtensions.SetTribes(CardManager.New("bitty", "SkeletonParrot", "Undead Parrot", 2, 3, "A loyal member of Royal's crew."), (Tribe[])(object)new Tribe[1] { (Tribe)2 }), (int?)1, (int?)0, (int?)0, (List)null), (Ability[])(object)new Ability[1] { (Ability)35 }), (Ability[])(object)new Ability[1] { (Ability)19 }), Tools.LoadTexture("portrait_skeletonparrot.png"), Tools.LoadTexture("portrait_skeletonparrot_emission.png"), (FilterMode?)null), Tools.LoadTexture("pixelportrait_undeadparrot.png"), (FilterMode?)null), (Appearance[])(object)new Appearance[1] { (Appearance)(int)Plugin.UndeadAppearance }); val.defaultEvolutionName = "Polly"; CardManager.Add("bitty", val); } } public class Challenges { [HarmonyPatch] public class 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(Challenge_harderFinalBoss.challengeType) && (int)Singleton.Instance.OpponentType != 0 && (int)Singleton.Instance.OpponentType != 2) { Singleton.Instance.ShowActivation(Challenge_harderFinalBoss.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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Invalid comparison between Unknown and I4 if (!SaveFile.IsAscension || !AscensionSaveData.Data.ChallengeIsActive(Challenge_harderFinalBoss.challengeType) || (int)__result.OpponentType == 0 || (int)__result.OpponentType == 2) { return; } List> turnPlan = __result.TurnPlan; int count = Singleton.Instance.PlayerSlotsCopy.Count; if (turnPlan.Count <= 0) { return; } CardInfo cardByName = CardLoader.GetCardByName("SkeletonPirate"); int num = ((turnPlan[0].Count >= 2) ? 1 : 0); if (turnPlan[num].Count < count) { Plugin.Log.LogInfo((object)"Adding Skeleton to turn plan..."); turnPlan[num].Add(cardByName); } num++; if (turnPlan[num].Count < count) { Plugin.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")); Plugin.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(Challenge_harderFinalBoss.challengeType)) { return false; } return true; } [HarmonyPostfix] [HarmonyPatch(typeof(GiantShip), "MutinySequence")] public static IEnumerator MutinyChangePost(IEnumerator values) { if (AscensionSaveData.Data.ChallengeIsActive(Challenge_harderFinalBoss.challengeType)) { int numSkeles = (Singleton.Instance.nextHealthThreshold - ((SpecialCardBehaviour)Singleton.Instance).PlayableCard.Health) / 5 + 1; for (int i = 0; i < Math.Min(numSkeles, 3); i++) { List validSlots = Singleton.Instance.PlayerSlotsCopy; validSlots.RemoveAll((CardSlot x) => (Object)(object)x.Card != (Object)null); if (validSlots.Count > 0) { Singleton.Instance.SwitchToView((View)6, false, true); yield return (object)new WaitForSeconds(0.5f); ? val = Singleton.Instance; RenderStatsLayer statsLayer = ((SpecialCardBehaviour)Singleton.Instance).Card.StatsLayer; ((Component)((CardRenderCamera)val).GetLiveRenderCamera((statsLayer is RenderLiveStatsLayer) ? statsLayer : null)).GetComponentInChildren().NextSkeletonJumpOverboard(); yield return (object)new WaitForSeconds(1f); Singleton.Instance.SwitchToView((View)4, false, false); CardSlot slot = validSlots[Random.Range(0, validSlots.Count)]; yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_WoodenBoard"), slot, 0.1f, true); yield return (object)new WaitForSeconds(0.2f); GiantShip instance = Singleton.Instance; instance.skelesSpawned++; } } if (Singleton.Instance.mutineesSinceDialogue > 1) { yield return (object)new WaitForSeconds(0.3f); yield return Singleton.Instance.PlayDialogueEvent("PirateSkullShipMutinee", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); Singleton.Instance.mutineesSinceDialogue = 0; } GiantShip instance2 = Singleton.Instance; instance2.mutineesSinceDialogue++; } else { yield return values; } } [HarmonyPostfix] [HarmonyPatch(typeof(PirateSkullBossOpponent), "StartPhase2")] public static IEnumerator RoyalPhase2(IEnumerator values) { yield return values; if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_harderFinalBoss.challengeType)) { yield break; } Singleton.Instance.ShowActivation(Challenge_harderFinalBoss.challengeType); _ = Singleton.Instance.OpponentSlotsCopy; if (AscensionSaveData.Data.ChallengeIsActive(Challenge_travelingOuro.challengeType)) { Plugin.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++) { 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 opponentSlotsCopy1 = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy1.RemoveAll((CardSlot x) => Object.op_Implicit((Object)(object)Singleton.Instance.queuedCards.Find((PlayableCard y) => (Object)(object)y.QueuedSlot == (Object)(object)x))); if (opponentSlotsCopy1.Count >= 1) { yield return Singleton.Instance.QueueCard(ouro, opponentSlotsCopy1[0], true, true, true); yield return Singleton.Instance.PlayDialogueEvent("RoyalOuro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); Plugin.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.abilities.Add((Ability)54); mod2.nameReplacement = "Mole Firstmate"; CardExtensions.AddAppearances(mole, (Appearance[])(object)new Appearance[1] { (Appearance)6 }); mole.mods.Add(mod2); List opponentSlotsCopy2 = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy2.RemoveAll((CardSlot x) => Object.op_Implicit((Object)(object)Singleton.Instance.queuedCards.Find((PlayableCard y) => (Object)(object)y.QueuedSlot == (Object)(object)x))); if (opponentSlotsCopy2.Count >= 1) { yield return Singleton.Instance.QueueCard(mole, opponentSlotsCopy2[0], true, true, true); Plugin.Log.LogInfo((object)"Playing animation"); View oldView = Singleton.Instance.CurrentView; Singleton.Instance.SwitchToView((View)6, false, false); yield return Singleton.Instance.PlayDialogueEvent("RoyalFirstMate", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView(oldView, false, false); } } Plugin.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(Challenge_harderFinalBoss.challengeType) && (Object)(object)Singleton.Instance.totem != (Object)null && (int)((Opponent)Singleton.Instance).OpponentType == 20) { ((Card)card).StatsLayer.SetEmissionColor(Singleton.Instance.InteractablesGlowColor); if (!card.TemporaryMods.Exists((CardModificationInfo x) => x.fromTotem) && !((Card)card).Info.HasTrait((Trait)16)) { card.AddTemporaryMod(new CardModificationInfo { abilities = { ((Totem)Singleton.Instance.totem).TotemItemData.bottom.effectParams.ability }, fromTotem = true }); } } } } [HarmonyPatch(typeof(RunIntroSequencer))] public class StarterChallengesPatch { [HarmonyPostfix] [HarmonyPatch("TryModifyStarterCards")] public static void StartersPatch() { //IL_000b: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0318: 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_008a: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown //IL_02c8: Unknown result type (might be due to invalid IL or missing references) if (AscensionSaveData.Data.ChallengeIsActive(Challenge_infiniteLives.challengeType)) { InfiniteLives.LifeRepeatsReset(); } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_waterborneStarter.challengeType)) { foreach (CardInfo card in ((CardCollectionInfo)RunState.Run.playerDeck).Cards) { if (!card.HasTrait((Trait)13)) { Plugin.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(Challenge_shockedStarter.challengeType)) { foreach (CardInfo card2 in ((CardCollectionInfo)RunState.Run.playerDeck).Cards) { if (!card2.HasTrait((Trait)13)) { Plugin.Log.LogInfo((object)"Paralysis Check"); CardModificationInfo val2 = new CardModificationInfo(Abilities.GiveParalysis.ability); if (!card2.HasAbility(Abilities.GiveParalysis.ability)) { RunState.Run.playerDeck.ModifyCard(card2, val2); } } } } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_weakStarters.challengeType)) { foreach (CardInfo card3 in ((CardCollectionInfo)RunState.Run.playerDeck).Cards) { if (!card3.HasTrait((Trait)13)) { Plugin.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(Challenge_weakSoulStarter.challengeType)) { foreach (CardInfo card4 in ((CardCollectionInfo)RunState.Run.playerDeck).Cards) { if (!card4.HasTrait((Trait)13)) { Plugin.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(Challenge_ascenderBane.challengeType)) { Plugin.Log.LogInfo((object)"Ascender's Bane Check"); ((CardCollectionInfo)RunState.Run.playerDeck).AddCard(CardLoader.GetCardByName("bitty_Ascender's Bane")); } } [HarmonyPostfix] [HarmonyPatch("RunIntroSequence")] public static IEnumerator StartersAnnouncer(IEnumerator values) { yield return values; bool dialoguePlayed = false; if (AscensionSaveData.Data.ChallengeIsActive(Challenge_waterborneStarter.challengeType)) { yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.ShowActivation(Challenge_waterborneStarter.challengeType); if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("WaterborneStart")) { dialoguePlayed = true; yield return (object)new WaitForSeconds(0.5f); yield return Singleton.Instance.PlayDialogueEvent("WaterborneStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_shockedStarter.challengeType)) { yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.ShowActivation(Challenge_shockedStarter.challengeType); if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("ShockedStart")) { dialoguePlayed = true; yield return (object)new WaitForSeconds(0.5f); yield return Singleton.Instance.PlayDialogueEvent("ShockedStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_weakStarters.challengeType)) { yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.ShowActivation(Challenge_weakStarters.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 && Plugin.modModeActive(Plugin.MOD_MODE.KCM) && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("WeakStart") && weakenedCards) { dialoguePlayed = true; yield return (object)new WaitForSeconds(0.5f); yield return Singleton.Instance.PlayDialogueEvent("WeakStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } else if (!dialoguePlayed && Plugin.modModeActive(Plugin.MOD_MODE.P03) && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("P03WeakStart") && weakenedCards) { dialoguePlayed = true; yield return (object)new WaitForSeconds(0.5f); yield return Singleton.Instance.PlayDialogueEvent("P03WeakStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_weakSoulStarter.challengeType)) { yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.ShowActivation(Challenge_weakSoulStarter.challengeType); if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("WeakSoulStart")) { dialoguePlayed = true; yield return (object)new WaitForSeconds(0.5f); yield return Singleton.Instance.PlayDialogueEvent("WeakSoulStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_ascenderBane.challengeType)) { yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.ShowActivation(Challenge_ascenderBane.challengeType); if (!dialoguePlayed && SaveFile.IsAscension && !DialogueEventsData.EventIsPlayed("AscenderBaneStart")) { yield return (object)new WaitForSeconds(0.5f); yield return Singleton.Instance.PlayDialogueEvent("AscenderBaneStart", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } } } [HarmonyPatch(typeof(EncounterBuilder))] public class EncounterAddPatches { [HarmonyPostfix] [HarmonyPatch("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_0255: 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_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) List> opponentTurnPlan = __result.opponentTurnPlan; if (AscensionSaveData.Data.ChallengeIsActive(Challenge_travelingOuro.challengeType)) { Plugin.Log.LogInfo((object)"Checking to see if we should add Ouroboros..."); if (MiscEncounters.RollForOuro(nodeData)) { Plugin.Log.LogInfo((object)"Creating an Ouroboros..."); CardInfo cardByName = CardLoader.GetCardByName("bitty_TravelingOuroboros"); CardModificationInfo val = new CardModificationInfo(); if (Plugin.modModeActive(Plugin.MOD_MODE.P03)) { cardByName.portraitTex = Tools.LoadSprite("portrait_ourobot.png"); val.nameReplacement = "Ourobot"; } val.abilities.Add((Ability)18); if (Plugin.modModeActive(Plugin.MOD_MODE.P03)) { val.fromCardMerge = true; for (int i = 1; i <= AscensionStatsData.GetStatValue((Type)2, false); i++) { Plugin.Log.LogInfo((object)i); val.abilities.Add(MiscEncounters.ValidAbilities(i).ability); } } val.attackAdjustment = MiscEncounters.TravelingOuroborosBuffs(); val.healthAdjustment = MiscEncounters.TravelingOuroborosBuffs(); if (Plugin.modModeActive(Plugin.MOD_MODE.KCM) && 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); Plugin.Log.LogInfo((object)"Finding Ouro placement..."); int num = ((Plugin.modModeActive(Plugin.MOD_MODE.P03) && opponentTurnPlan[3].Count <= 1) ? 3 : (Plugin.modModeActive(Plugin.MOD_MODE.P03) ? 4 : ((opponentTurnPlan[0].Count > 1) ? 1 : 0))); if (opponentTurnPlan[num].Count < Singleton.Instance.PlayerSlotsCopy.Count) { Plugin.Log.LogInfo((object)"Adding Ouro to turn plan..."); opponentTurnPlan[num].Add(cardByName); Plugin.Log.LogInfo((object)$"Added Ouroboros in turn {num}"); } } else { Plugin.Log.LogInfo((object)"Failed Ouro Roll..."); } } if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_goldenSheep.challengeType)) { return; } Plugin.Log.LogInfo((object)"Golden Ram Challenge on..."); Plugin.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; Plugin.Log.LogInfo((object)("Sheep Roll: " + flag)); if (flag && MiscEncounters.TimesGoldenSheepKilled() < AscensionStatsData.GetStatValue((Type)2, false)) { Plugin.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); Plugin.Log.LogInfo((object)"Finding Golden Ram placement..."); int index = ((opponentTurnPlan[0].Count > 1) ? 1 : 0); if (opponentTurnPlan[index].Count < Singleton.Instance.PlayerSlotsCopy.Count) { Plugin.Log.LogInfo((object)"Adding Gold Ram to turn plan..."); opponentTurnPlan[index].Add(cardByName2); Plugin.Log.LogInfo((object)("added gold ram to " + index)); } } else { Plugin.Log.LogInfo((object)"Failed Roll..."); } } } [HarmonyPatch(typeof(DuplicateMergeSequencer))] public class BotchedPatch { [HarmonyPostfix] [HarmonyPatch("MergeCards")] 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(Challenge_mycoBotch.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 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.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("MycoFailSigils", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null)); } else if (num < 0.66f && card1.Attack > 0) { int num2 = card1.Attack / 2; val.attackAdjustment = -num2; flag = true; ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("MycoFailAttack", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null)); } else if (card1.Health > 1) { int num3 = card1.Health / 2; val.healthAdjustment = -num3; flag = true; ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("MycoFailHealth", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null)); } RunState.Run.playerDeck.ModifyCard(card1, val); if (flag) { Singleton.Instance.ShowActivation(Challenge_mycoBotch.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 list = ScriptableObjectLoader.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 == Abilities.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)]; Plugin.Log.LogInfo((object)val.ability); return val; } } [HarmonyPatch(typeof(CardDrawPiles3D))] public class SideDeckPatch { [HarmonyPostfix] [HarmonyPatch("InitializePiles")] 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) if (AscensionSaveData.Data.ChallengeIsActive(Challenge_famine.challengeType) || AscensionSaveData.Data.ChallengeIsActive(Challenge_abundance.challengeType)) { int num = 0; int num2 = 0; for (int i = 0; i < AscensionSaveData.Data.GetNumChallengesOfTypeActive(Challenge_famine.challengeType); i++) { num++; } for (int j = 0; j < AscensionSaveData.Data.GetNumChallengesOfTypeActive(Challenge_abundance.challengeType); j++) { num2++; } Plugin.Log.LogInfo((object)("Famine Severity: " + num * Plugin.famineRemoval.Value)); Plugin.Log.LogInfo((object)("Abundance Quality: " + num2 * Plugin.abundanceQuality.Value)); ChallengeActivationUI.TryShowActivation(Challenge_abundance.challengeType); CardInfo val = ((Singleton.Instance.SideDeck.cards.Count > 0) ? Singleton.Instance.SideDeck.cards[0] : CardLoader.GetCardByName("Bee")); for (int k = 0; k < num2 * Plugin.abundanceQuality.Value; k++) { Singleton.Instance.sidePile.CreateCards(1, 15f); Singleton.Instance.SideDeck.AddCard(val); } ChallengeActivationUI.TryShowActivation(Challenge_famine.challengeType); for (int l = 0; l < Math.Min(10, num * Plugin.famineRemoval.Value); l++) { CardDrawPiles3D.Instance.SidePile.Draw(); CardDrawPiles3D.Instance.SideDeck.Draw(); } Plugin.Log.LogInfo((object)("Total cards in side deck: " + CardDrawPiles3D.Instance.SideDeck.CardsInDeck)); if (AscensionSaveData.Data.ChallengeIsActive(Challenge_famine.challengeType) && !DialogueEventsData.EventIsPlayed("P03FamineIntro") && Plugin.modModeActive(Plugin.MOD_MODE.P03)) { ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("P03FamineIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { val.displayedName }, (Action)Dialogue.P03HappyCloseUp)); } else if (AscensionSaveData.Data.ChallengeIsActive(Challenge_famine.challengeType) && !DialogueEventsData.EventIsPlayed("FamineIntro")) { ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("FamineIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { val.displayedName }, (Action)null)); } else if (AscensionSaveData.Data.ChallengeIsActive(Challenge_abundance.challengeType) && !DialogueEventsData.EventIsPlayed("P03AbundanceIntro") && Plugin.modModeActive(Plugin.MOD_MODE.P03)) { ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("P03AbundanceIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { (num2 * Plugin.abundanceQuality.Value).ToString() }, (Action)Dialogue.P03HappyCloseUp)); } else if (AscensionSaveData.Data.ChallengeIsActive(Challenge_abundance.challengeType) && !DialogueEventsData.EventIsPlayed("AbundanceIntro")) { ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("AbundanceIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { val.displayedName }, (Action)null)); } } } } public class FleetingSquirrels : ChallengeBehaviour { public string sideDeckName; public override bool RespondsToUpkeep(bool playerUpkeep) { return Singleton.Instance.SideDeck.CardsInDeck > 0; } public override IEnumerator OnUpkeep(bool playerUpkeep) { sideDeckName = ((Object)Singleton.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; } } [HarmonyPatch(typeof(PlayerHand))] public class SprinterDraw { [HarmonyPostfix] [HarmonyPatch("AddCardToHand")] 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_0054: 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(Challenge_sprinter.challengeType)) { Singleton.Instance.ShowActivation(Challenge_sprinter.challengeType); CardModificationInfo val = new CardModificationInfo(); if (Plugin.modModeActive(Plugin.MOD_MODE.KCM)) { val.fromCardMerge = true; } val.abilities.Add(GetRandomStrafe().ability); if (Plugin.modModeActive(Plugin.MOD_MODE.KCM) || CardExtensions.AllAbilities(card).Count() <= 4) { card.AddTemporaryMod(val); } if (Plugin.modModeActive(Plugin.MOD_MODE.KCM) && !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 list = ScriptableObjectLoader.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 == Abilities.GiveWarper.ability || x.ability == GiveStrafePull.ability || x.ability == GiveStrafeSuper.ability); return list[Random.Range(0, list.Count)]; } } [HarmonyPatch] public class 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(Challenge_harderBosses.challengeType) && (int)Singleton.Instance.OpponentType != 0 && (int)Singleton.Instance.OpponentType != 2) { Singleton.Instance.ShowActivation(Challenge_harderBosses.challengeType); } } [HarmonyPostfix] [HarmonyPatch(typeof(TradeCardsForPelts), "TradePhase")] public static IEnumerator PostTradePlayQueueCards(IEnumerator values) { yield return values; if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(Challenge_harderBosses.challengeType)) { Singleton.Instance.ShowActivation(Challenge_harderBosses.challengeType); yield return Singleton.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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Invalid comparison between Unknown and I4 //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Invalid comparison between Unknown and I4 //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Invalid comparison between Unknown and I4 //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Invalid comparison between Unknown and I4 //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Expected O, but got Unknown //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Expected O, but got Unknown //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Expected O, but got Unknown //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Expected O, but got Unknown //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Expected O, but got Unknown Type opponentType = ((Opponent)Singleton.Instance).OpponentType; if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_harderBosses.challengeType) || (int)opponentType == 0 || (int)opponentType == 2) { return; } if ((int)opponentType == 3) { if (((Object)((Card)card).Info).name == "Mule") { CardModificationInfo val = new CardModificationInfo(); val.abilities.Add((Ability)62); ApplyMods(val, card); } if (((Object)((Card)card).Info).name == "Bloodhound" || ((Object)((Card)card).Info).name == "Coyote" || ((Object)((Card)card).Info).name == "Wolverine") { CardModificationInfo val2 = new CardModificationInfo(); val2.abilities.Add((Ability)4); ApplyMods(val2, card); } } else if ((int)opponentType == 4) { if (((Object)((Card)card).Info).name == "Kingfisher") { CardModificationInfo val3 = new CardModificationInfo(); val3.abilities.Add((Ability)34); ApplyMods(val3, card); } if (((Object)((Card)card).Info).name == "BaitBucket") { CardModificationInfo val4 = new CardModificationInfo(); val4.abilities.Add((Ability)23); ApplyMods(val4, card); } } else if ((int)opponentType == 6) { if (((Object)((Card)card).Info).name == "Bullfrog") { CardModificationInfo val5 = new CardModificationInfo(); val5.abilities.Add((Ability)30); ApplyMods(val5, card); } if (((Object)((Card)card).Info).name == "Rabbit") { CardModificationInfo val6 = new CardModificationInfo(); val6.abilities.Add((Ability)8); ApplyMods(val6, card); } if (((Object)((Card)card).Info).name == "TrapFrog") { CardModificationInfo val7 = new CardModificationInfo(); val7.abilities.Add((Ability)18); ApplyMods(val7, card); } } else if ((int)opponentType == 7) { if (((Object)((Card)card).Info).name == "Amalgam") { CardModificationInfo val8 = new CardModificationInfo(); val8.abilities.Add((Ability)15); ApplyMods(val8, card); } if (((Object)((Card)card).Info).name == "MantisGod") { CardModificationInfo val9 = new CardModificationInfo(); val9.abilities.Add((Ability)24); ApplyMods(val9, card); } if (((Object)((Card)card).Info).name == "Mantis") { CardModificationInfo val10 = new CardModificationInfo(); val10.abilities.Add((Ability)100); ApplyMods(val10, card); } } else if ((int)opponentType == 20) { if (((Object)((Card)card).Info).name == "MoleSeaman") { CardModificationInfo val11 = new CardModificationInfo(); val11.abilities.Add((Ability)47); ApplyMods(val11, card); } if (((Object)((Card)card).Info).name == "SkeletonPirate") { CardModificationInfo val12 = new CardModificationInfo(); val12.abilities.Add((Ability)4); ApplyMods(val12, card); } if (((Object)((Card)card).Info).name == "SkeletonParrot") { CardModificationInfo val13 = new CardModificationInfo(); val13.abilities.Add((Ability)26); CardExtensions.SetIceCube(((Card)card).Info, CardLoader.GetCardByName("Maggots"), (IEnumerable)null); ApplyMods(val13, card); } if (((Object)((Card)card).Info).name == "Maggots") { CardModificationInfo val14 = new CardModificationInfo(); val14.abilities.Add((Ability)35); ApplyMods(val14, card); } } } public static void ApplyMods(CardModificationInfo mod, PlayableCard card) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) 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(); } } [HarmonyPatch] public class Environments { public static List allEnvironmentBoons = new List { Boons.ChallengeBoonCliffs.boo, Boons.ChallengeBoonFlashGrowth.boo, Boons.ChallengeBoonTotem.boo, Boons.ChallengeBoonMud.boo, Boons.ChallengeBoonHail.boo, Boons.ChallengeBoonBreeze.boo, Boons.ChallengeBoonGraveyard.boo, Boons.ChallengeBoonDynamite.boo, Boons.ChallengeBoonBait.boo, Boons.ChallengeBoonTrap.boo, Boons.ChallengeBoonObelisk.boo, Boons.ChallengeBoonMushrooms.boo, Boons.ChallengeBoonBloodMoon.boo, Boons.ChallengeBoonMinicello.boo, Boons.ChallengeBoonCarrotPatch.boo, Boons.ChallengeBoonDarkForest.boo, Boons.ChallengeBoonFlood.boo, Boons.ChallengeBoonBlizzard.boo, Boons.ChallengeBoonGemSanctuary.boo, Boons.ChallengeBoonElectricStorm.boo }; public static int EnvironmentNumber() { return ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber"); } public static void ResetEnviroNumber(int value = 0) { Plugin.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; Plugin.Log.LogInfo((object)$"Increasing Environment Number by {by} to {num}"); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.EnvironmentNumber", (object)num.ToString()); } public static int PrevEnvironment() { return ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.PreviousEnvironment"); } public static void ResetPrevEnviro(int value = 0) { Plugin.Log.LogInfo((object)$"Resetting Prev Environment Number to {value}"); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.PreviousEnvironment", (object)value); } public static void IncreasePrevEnviro(int by = 1) { int num = ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.PreviousEnvironment") + by; Plugin.Log.LogInfo((object)$"Increasing Prev Environment Number by {by} to {num}"); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.PreviousEnvironment", (object)num.ToString()); } [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] 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(Challenge_environment.challengeType)) { __result = true; } } [HarmonyPrefix] [HarmonyPatch(typeof(TurnManager), "SetupPhase")] 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_0165: Unknown result type (might be due to invalid IL or missing references) Type opponentType = Singleton.Instance.OpponentType; if (AscensionSaveData.Data.ChallengeIsActive(Challenge_environment.challengeType) && ((int)opponentType == 0 || (int)opponentType == 2)) { ClearEnvironmentBoons(); bool flag = SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + PrevEnvironment()); if (PrevEnvironment() < 2 && !flag) { IncreasePrevEnviro(); return true; } ResetPrevEnviro(); IncreaseEnviroNumber(); List list = new List(); foreach (EnviroHandler.EnviroBoon enviroBoon in EnviroHandler.EnviroBoonList) { if (enviroBoon.regionTier <= RunState.CurrentRegionTier && enviroBoon.RegionMatch(((Object)RunState.CurrentMapRegion).name) && enviroBoon.condition.IsActive() && enviroBoon.modes.Contains(Plugin.getModMode())) { list.Add(enviroBoon); Plugin.Log.LogInfo((object)("Add: " + enviroBoon.boonName)); } } int index = EnvironmentNumber() % list.Count; CustomList.Randomize((IEnumerable)list); if (list != null) { RunState.Run.playerDeck.AddBoon(list[index].boonType); Plugin.Log.LogInfo((object)("Using boon: " + list[index].boonName)); } } return true; } [HarmonyPostfix] [HarmonyPatch(typeof(TurnManager), "CleanupPhase")] public static void EnvironmentBoonCleanup() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_environment.challengeType)) { return; } foreach (CardSlot item in Singleton.Instance.AllSlotsCopy) { SlotModificationExtensions.ResetSlotTexture(item); } Singleton.Instance.ResetTableColors(); ClearEnvironmentBoons(); } 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); } } Plugin.Log.LogInfo((object)"Resetting Environment Boons..."); } } [HarmonyPatch] public class UnfairHandPatch { [HarmonyPostfix] [HarmonyPatch(typeof(CardDrawPiles3D), "InitializePiles")] public static void UnfairHandShowActivation() { //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) if (AscensionSaveData.Data.ChallengeIsActive(Challenge_unfairHand.challengeType)) { ChallengeActivationUI.TryShowActivation(Challenge_unfairHand.challengeType); if (!DialogueEventsData.EventIsPlayed("UnfairHandIntro")) { ((MonoBehaviour)Singleton.Instance).StartCoroutine(Singleton.Instance.PlayDialogueEvent("UnfairHandIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null)); } } } [HarmonyPrefix] [HarmonyPatch(typeof(Deck), "GetFairHand")] private static bool GetFairHand_nomore(Deck __instance, ref List __result, int numCards = 4, List existingHand = null) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_unfairHand.challengeType)) { return true; } Plugin.Log.LogInfo((object)"UNFAIR HAND GO!"); List list = new List(); List list2 = new List(__instance.Cards); int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed(); if (existingHand != null) { list2.RemoveAll((CardInfo x) => existingHand.Contains(x)); list.AddRange(existingHand); } int num = list2.Count; if (num > numCards) { for (int num2 = 0; num2 < numCards - 1; num2++) { int num3 = currentRandomSeed + num2; CardInfo item = list2[SeededRandom.Range(0, num, num3)]; list.Add(item); list2.Remove(item); num--; } } else { list = list2; } __result = list; return false; } } [HarmonyPatch] public class Champions { [HarmonyPatch(typeof(TurnManager), "CleanupPhase")] private static class ChampionCleanupPatch { [HarmonyPostfix] public static void ChampionCleanup() { summonedChampion = false; summonCount = 0; } } [HarmonyPatch(typeof(Part1BossOpponent), "PostResetScalesSequence")] private static class MoreChampionsOnPhaseTransition { [HarmonyPostfix] public static void ChampionCleanup() { summonedChampion = false; } } [HarmonyPatch(typeof(Part1Opponent), "ModifyQueuedCard")] private class ChampionPatch { public static CardModificationInfo championIDMod = new CardModificationInfo { singletonId = "bitty_champion" }; [HarmonyPrefix] public static void ChangeToChamp(ref PlayableCard card) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Invalid comparison between Unknown and I4 //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Expected O, but got Unknown //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Expected O, but got Unknown //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Expected O, but got Unknown //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Expected O, but got Unknown //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Expected O, but got Unknown //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Expected O, but got Unknown //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Expected O, but got Unknown summonCount++; Type opponentType = ((Opponent)Singleton.Instance).OpponentType; if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_champion.challengeType)) { return; } PlayableCard obj = card; Trait[] array = new Trait[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); if (CardExtensions.HasAnyOfTraits(obj, (Trait[])(object)array) || (int)opponentType == 6) { return; } int num = SeededRandom.Range(75, 200, SaveManager.SaveFile.GetCurrentRandomSeed() + Singleton.Instance.TurnNumber + summonCount); num += ((Opponent)Singleton.Instance).Difficulty; if (num >= 100 && !summonedChampion) { ChallengeActivationUI.TryShowActivation(Challenge_champion.challengeType); summonedChampion = true; if (num <= 113) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.RedChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(0, 2) { abilities = new List { Abilities.GiveRedChamp.ability }, fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 125) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.YellowChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(1, 0) { abilities = new List { Abilities.GiveYellowChamp.ability }, fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 135) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.GreenChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveGreenChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 145) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.OrangeChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveOrangeChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 155) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.CyanChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveCyanChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 165) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.WhiteChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveWhiteChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 173) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.MagentaChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveMagentaChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 180) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.PurpleChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GivePurpleChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 185) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.BlueChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveBlueChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 190) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.LightBlueChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveLightBlueChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 195) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.LightGreenChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveLightGreenChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } else if (num <= 200) { ((Card)card).ApplyAppearanceBehaviours(new List { CAppearances.BrightRedChampAppearance }); card.AddTemporaryMod(new CardModificationInfo(Abilities.GiveBrightRedChamp.ability) { fromCardMerge = true }); card.AddTemporaryMod(championIDMod); } ((Card)card).RenderCard(); } } } public static bool summonedChampion; public static int summonCount; } [HarmonyPatch(typeof(Opponent))] public class MiscEncounters { public class IntWrapper { public int Value { get; set; } } private static ConditionalWeakTable ouroAnimationPlayTable = new ConditionalWeakTable(); public static int TravelingOuroborosBuffs() { return ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.TravelingOuroborosBuffs"); } public static void ResetOuro(int value = 0) { Plugin.Log.LogInfo((object)$"Resetting Traveling Ouroboros to {value}"); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.TravelingOuroborosBuffs", (object)value); } public static void IncreaseOuro(int by = 1) { int num = ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.TravelingOuroborosBuffs") + by; Plugin.Log.LogInfo((object)$"Increasing Traveling Ouroboros by {by} to {num}"); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.TravelingOuroborosBuffs", (object)num.ToString()); } public static int TimesGoldenSheepKilled() { return ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.GoldenSheepKilled"); } public static void GoldenSheepKill(int by = 1) { int num = ModdedSaveManager.RunState.GetValueAsInt("bitty45.inscryption.challenges", "BittysChallenges.GoldenSheepKilled") + by; Plugin.Log.LogInfo((object)$"Increasing Golden Sheep Killed by {by} to {num}"); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.GoldenSheepKilled", (object)num.ToString()); } public static bool RollForOuro(CardBattleNodeData nodeData) { if (Plugin.modModeActive(Plugin.MOD_MODE.P03)) { return SeededRandom.Bool(SaveManager.SaveFile.GetCurrentRandomSeed() + 6); } return true; } public static double TurnAverage(IEnumerable turn) { int num = 0; double num2 = 0.0; foreach (CardInfo item in turn) { num2 += (double)item.PowerLevel; num++; } return (num == 0) ? (-100.0) : (num2 / (double)num); } public static AbilityInfo ValidAbilities(int plus) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) List list = ScriptableObjectLoader.AllData.FindAll((AbilityInfo x) => x.metaCategories.Contains((AbilityMetaCategory)4) || (int)x.ability == 102 || (int)x.ability == 16 || x.ability == GiveStrafePull.ability || x.ability == GiveStrafeSticky.ability || x.ability == GiveSwapStats.ability || (int)x.ability == 104 || (int)x.ability == 99 || (int)x.ability == 52 || (int)x.ability == 5 || (int)x.ability == 26 || (int)x.ability == 35); list.RemoveAll((AbilityInfo x) => (int)x.ability == 62 || (int)x.ability == 54 || (int)x.ability == 19 || (int)x.ability == 8 || (int)x.ability == 24 || (int)x.ability == 72 || (int)x.ability == 18); int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed(); AbilityInfo val = list[SeededRandom.Range(0, list.Count, currentRandomSeed + plus)]; Plugin.Log.LogInfo((object)val.ability); return val; } public static void SetOuroCardSlot(CardInfo card, int slot) { if (!ouroAnimationPlayTable.TryGetValue(card, out var value)) { ouroAnimationPlayTable.Add(card, new IntWrapper { Value = slot }); } else { value.Value = slot; } } private static int GetOuroCardSlot(CardInfo card) { if (ouroAnimationPlayTable.TryGetValue(card, out var value)) { return value.Value; } return -1; } private static Vector3 GetSlotOffset(Transform transform) { //IL_0002: 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_001b: 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) return new Vector3(transform.position.x, -1f, 1.5f); } [HarmonyPostfix] [HarmonyPatch("QueueCard")] public static IEnumerator PlayEncounterIntro(IEnumerator sequenceEvent, CardInfo cardInfo, CardSlot slot) { sequenceEvent.MoveNext(); yield return sequenceEvent.Current; sequenceEvent.MoveNext(); if (AscensionSaveData.Data.ChallengeIsActive(Challenge_travelingOuro.challengeType)) { if (((Object)cardInfo).name == "bitty_TravelingOuroboros") { SetOuroCardSlot(cardInfo, slot.Index); } int customSlot = GetOuroCardSlot(cardInfo); if (customSlot >= 0) { Plugin.Log.LogInfo((object)"Playing animation"); View oldView = Singleton.Instance.CurrentView; ViewInfo targetPos = ViewManager.GetViewInfo((View)6); try { Vector3 translationOffset = targetPos.camPosition + GetSlotOffset(((Component)((BoardManager)Singleton.Instance).OpponentQueueSlots[slot.Index]).transform) - ViewManager.GetViewInfo(Singleton.Instance.CurrentView).camPosition; Vector3 rotationOffset = targetPos.camRotation - ViewManager.GetViewInfo(Singleton.Instance.CurrentView).camRotation; Singleton.Instance.OffsetPosition(translationOffset, 0.75f); Singleton.Instance.OffsetRotation(rotationOffset, 0.75f); } catch { Singleton.Instance.SwitchToView((View)6, false, false); } Singleton.Instance.ShowActivation(Challenge_travelingOuro.challengeType); if ((int)Singleton.Instance.OpponentType != 20) { if (Plugin.modModeActive(Plugin.MOD_MODE.KCM)) { yield return Singleton.Instance.PlayDialogueEvent("OuroIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } else if (Plugin.modModeActive(Plugin.MOD_MODE.P03)) { yield return Singleton.Instance.PlayDialogueEvent("P03OuroIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)Dialogue.P03HappyCloseUp); } } yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView(oldView, false, false); } } if (AscensionSaveData.Data.ChallengeIsActive(Challenge_goldenSheep.challengeType)) { int customSlot2 = -1; if (((Object)cardInfo).name == "bitty_GoldenSheep") { customSlot2 = slot.Index; } if (customSlot2 >= 0) { Plugin.Log.LogInfo((object)"Playing animation"); View oldView2 = Singleton.Instance.CurrentView; ViewInfo targetPos2 = ViewManager.GetViewInfo((View)6); try { Vector3 translationOffset2 = targetPos2.camPosition + GetSlotOffset(((Component)((BoardManager)Singleton.Instance).OpponentQueueSlots[slot.Index]).transform) - ViewManager.GetViewInfo(Singleton.Instance.CurrentView).camPosition; Vector3 rotationOffset2 = targetPos2.camRotation - ViewManager.GetViewInfo(Singleton.Instance.CurrentView).camRotation; Singleton.Instance.OffsetPosition(translationOffset2, 0.75f); Singleton.Instance.OffsetRotation(rotationOffset2, 0.75f); } catch { Singleton.Instance.SwitchToView((View)6, false, false); } Singleton.Instance.ShowActivation(Challenge_goldenSheep.challengeType); yield return Singleton.Instance.PlayDialogueEvent("GoldenSheepIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView(oldView2, false, false); } } if (!AscensionSaveData.Data.ChallengeIsActive(Challenge_harderFinalBoss.challengeType)) { yield break; } int customSlot3 = -1; if (((Object)cardInfo).name == "SkeletonPirate") { customSlot3 = slot.Index; } if (customSlot3 >= 0 && !DialogueEventsData.EventIsPlayed("PirateIntro")) { Singleton.Instance.ShowActivation(Challenge_harderFinalBoss.challengeType); Plugin.Log.LogInfo((object)"Playing animation"); View oldView3 = Singleton.Instance.CurrentView; ViewInfo targetPos3 = ViewManager.GetViewInfo((View)6); try { Vector3 translationOffset3 = targetPos3.camPosition + GetSlotOffset(((Component)((BoardManager)Singleton.Instance).OpponentQueueSlots[slot.Index]).transform) - ViewManager.GetViewInfo(Singleton.Instance.CurrentView).camPosition; Vector3 rotationOffset3 = targetPos3.camRotation - ViewManager.GetViewInfo(Singleton.Instance.CurrentView).camRotation; Singleton.Instance.OffsetPosition(translationOffset3, 0.75f); Singleton.Instance.OffsetRotation(rotationOffset3, 0.75f); } catch { Singleton.Instance.SwitchToView((View)6, false, false); } yield return Singleton.Instance.PlayDialogueEvent("PirateIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); yield return (object)new WaitForSeconds(0.5f); Singleton.Instance.SwitchToView(oldView3, false, false); } } } [HarmonyPatch(typeof(DrawCopy))] public class NoFecundityNerf { [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static void Postfix(ref List __result) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(Challenge_oldFecund.challengeType)) { __result = null; } } [HarmonyPostfix] [HarmonyPatch("OnResolveOnBoard")] public static IEnumerator UnNerfDialogue(IEnumerator values) { yield return values; if (SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(Challenge_oldFecund.challengeType) && (!DialogueEventsData.EventIsPlayed("P03FecundityUnNerfIntro") || !DialogueEventsData.EventIsPlayed("FecundityUnNerfIntro"))) { Singleton.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 (Plugin.modModeActive(Plugin.MOD_MODE.P03) && !DialogueEventsData.EventIsPlayed("P03FecundityUnNerfIntro")) { yield return Singleton.Instance.PlayDialogueEvent("P03FecundityUnNerfIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)Dialogue.P03HappyCloseUp); } else if (Plugin.modModeActive(Plugin.MOD_MODE.KCM) && !DialogueEventsData.EventIsPlayed("FecundityUnNerfIntro")) { yield return Singleton.Instance.PlayDialogueEvent("FecundityUnNerfIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } } } [HarmonyPatch(typeof(LifeManager))] public class InfiniteLives { [HarmonyPostfix] [HarmonyPatch("ShowDamageSequence")] public static IEnumerator GiveLife(IEnumerator values) { yield return values; if (!SaveFile.IsAscension || !AscensionSaveData.Data.ChallengeIsActive(Challenge_infiniteLives.challengeType) || Singleton.Instance.Balance > -5) { yield break; } Singleton.Instance.ShowActivation(Challenge_infiniteLives.challengeType); LifeRepeatsIncrease(); yield return Singleton.Instance.ShowResetSequence(); if (LifeRepeats() < Math.Max(0, Plugin.allowedResets.Value)) { if ((int)Singleton.Instance.OpponentType == 20) { yield return Singleton.Instance.PlayDialogueEvent("InfiniteLivesRoyal", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } else { yield return Singleton.Instance.PlayDialogueEvent("InfiniteLivesIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } else if (LifeRepeats() == Math.Max(0, Plugin.allowedResets.Value)) { yield return Singleton.Instance.PlayDialogueEvent("InfiniteLivesLoop", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } else { yield return Singleton.Instance.PlayDialogueEvent("InfiniteLivesLoopBreak", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); Singleton.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; Plugin.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) { Plugin.Log.LogInfo((object)string.Format("Setting LifeResets to ", num)); ModdedSaveManager.RunState.SetValue("bitty45.inscryption.challenges", "BittysChallenges.LifeRepeats", (object)num.ToString()); } } [HarmonyPatch(typeof(TurnManager))] public class ReverseScales { [HarmonyPostfix] [HarmonyPatch("SetupPhase")] public static IEnumerator TipScale(IEnumerator values) { yield return values; if (AscensionSaveData.Data.ChallengeIsActive(Challenge_reverseScales.challengeType)) { Singleton.Instance.ShowActivation(Challenge_reverseScales.challengeType); yield return Singleton.Instance.ShowDamageSequence(1, 1, false, 0.125f, (GameObject)null, 0f, false); } } } [HarmonyPatch(typeof(TurnManager))] public class RedrawHand { [HarmonyPostfix] [HarmonyPatch("SetupPhase")] public static IEnumerator CloverGiver(IEnumerator __result) { yield return __result; if (AscensionSaveData.Data.ChallengeIsActive(Challenge_redrawHand.challengeType)) { ChallengeActivationUI.TryShowActivation(Challenge_redrawHand.challengeType); yield return Singleton.Instance.SpawnCardToHand(CardLoader.GetCardByName("bitty_Clover"), (List)null, 0.25f, (Action)null); if (!DialogueEventsData.EventIsPlayed("RedrawHandIntro")) { yield return Singleton.Instance.PlayDialogueEvent("RedrawHandIntro", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } } } } 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.PlaySound3D("bitty45.inscryption.challenges_sfx_vineBoom.ogg", (MixerGroup)0, ((Component)deathSlot).transform.position, 1f, 0f, new Pitch((Variation)0), (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 static AscensionChallengeInfo Challenge_waterborneStarter; public static AscensionChallengeInfo Challenge_shockedStarter; public static AscensionChallengeInfo Challenge_travelingOuro; public static AscensionChallengeInfo Challenge_mycoBotch; public static AscensionChallengeInfo Challenge_famine; public static AscensionChallengeInfo Challenge_abundance; public static AscensionChallengeInfo Challenge_weakStarters; public static AscensionChallengeInfo Challenge_sprinter; public static AscensionChallengeInfo Challenge_oldFecund; public static AscensionChallengeInfo Challenge_goldenSheep; public static AscensionChallengeInfo Challenge_harderFinalBoss; public static AscensionChallengeInfo Challenge_weakSoulStarter; public static AscensionChallengeInfo Challenge_harderBosses; public static AscensionChallengeInfo Challenge_infiniteLives; public static AscensionChallengeInfo Challenge_reverseScales; public static AscensionChallengeInfo Challenge_environment; public static AscensionChallengeInfo Challenge_vineBoom; public static AscensionChallengeInfo Challenge_fleetingSquirrels; public static AscensionChallengeInfo Challenge_unfairHand; public static AscensionChallengeInfo Challenge_ascenderBane; public static AscensionChallengeInfo Challenge_redrawHand; public static AscensionChallengeInfo Challenge_champion; public static void AddChallenges() { Plugin.Log.LogInfo((object)"Start of challenges"); AddMycoChallenge(); AddWeakStartersChallenge(); AddWaterborneStarterChallenge(); AddShockedStarterChallenge(); AddWeakSoulStarterChallenge(); AddSprinterChallenge(); AddFamineChallenge(); AddAbundanceChallenge(); AddHarderBossesChallenge(); AddEnvironmentChallenge(); AddTravelingOuroChallenge(); AddHarderFinalBossChallenge(); AddOldFecundChallenge(); AddReverseScalesChallenge(); AddGoldenSheepChallenge(); AddInfiniteLivesChallenge(); AddVineBoomChallenge(); AddFleetingSquirrelsChallenge(); AddUnfairHandChallenge(); AddAscenderBaneChallenge(); AddRedrawHandChallenge(); AddChampionsChallenge(); Plugin.Log.LogInfo((object)"End of challenges"); } private static void AddWaterborneStarterChallenge() { Challenge_waterborneStarter = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Aquatic Starters", "Cards in starting deck have the Waterborne sigil.", 10, Tools.LoadTexture("ascensionicon_waterbornestarterdeck"), Tools.LoadTexture("ascensionicon_activated_waterbornestarterdeck"), 2, 1)); } private static void AddShockedStarterChallenge() { Challenge_shockedStarter = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Shocked Starters", "Cards in starting deck attack every other turn.", 20, Tools.LoadTexture("ascensionicon_paralysisstarterdeck"), Tools.LoadTexture("ascensionicon_activated_paralysisstarterdeck"), 3, 1)); } private static void AddTravelingOuroChallenge() { Challenge_travelingOuro = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Traveling Ouroboros", "A traveling Ouroboros appears throughout the run.", 40, Tools.LoadTexture("ascensionicon_travelingouro"), Tools.LoadTexture("ascensionicon_activated_travelingouro"), 12, 1).SetFlags(new object[1] { "p03" })); } private static void AddMycoChallenge() { Challenge_mycoBotch = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Botched Experiments", "The Mycologists have a chance to make mistakes while fusing cards.", 5, Tools.LoadTexture("ascensionicon_myco"), Tools.LoadTexture("ascensionicon_activated_myco"), 1, 1)); } private static void AddFamineChallenge() { Challenge_famine = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Famine", $"The side deck has {Math.Max(0, Math.Min(10, Plugin.famineRemoval.Value))} less cards.", 15, Tools.LoadTexture("ascensionicon_famine"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 5, 2).SetFlags(new object[1] { "p03" })); } private static void AddAbundanceChallenge() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected I4, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected I4, but got Unknown Challenge_abundance = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Abundance", $"The side deck has {Math.Max(0, Plugin.abundanceQuality.Value)} more cards.", -15, Tools.LoadTexture("ascensionicon_abundance"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 5, 2).SetFlags(new object[1] { "p03" }).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)(int)Challenge_famine.challengeType })); ChallengeManager.GetFullChallenge(Challenge_famine).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)(int)Challenge_abundance.challengeType }); } private static void AddWeakStartersChallenge() { Challenge_weakStarters = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Weak Starters", "Cards in the starting deck have 1 less health.", 5, Tools.LoadTexture("ascensionicon_weakstarters"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 2, 1)); } private static void AddSprinterChallenge() { Challenge_sprinter = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Sprintmaggedon", "All cards get a random Sprinter sigil when drawn.", 20, Tools.LoadTexture("ascensionicon_sprintmageddon"), ChallengeManager.HAPPY_ACTIVATED_SPRITE, 6, 1).SetFlags(new object[1] { "p03" })); } private static void AddOldFecundChallenge() { Challenge_oldFecund = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Old Fecundity", "Reverts the Fecundity Nerf.", -20, Tools.LoadTexture("ascensionicon_oldfecund"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 6, 1).SetFlags(new object[1] { "p03" })); } private static void AddGoldenSheepChallenge() { Challenge_goldenSheep = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "The Golden Fleece", "A Golden Ram appears randomly throughout the run.", -20, Tools.LoadTexture("ascensionicon_goldensheep"), Tools.LoadTexture("ascensionicon_activated_goldensheep"), 7, 1)); } private static void AddHarderFinalBossChallenge() { Challenge_harderFinalBoss = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "True Pirate", "Pirates invade Bosses. The Final Boss Challenge is harder.", 35, Tools.LoadTexture("ascensionicon_harderfinalboss"), Tools.LoadTexture("ascensionicon_activated_harderfinalboss"), 13, 1)); } private static void AddWeakSoulStarterChallenge() { Challenge_weakSoulStarter = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Unspirited Starters", "Cards in the starting deck may not have their sigils transferred.", 25, Tools.LoadTexture("ascensionicon_weaksoul"), Tools.LoadTexture("ascensionicon_activated_weaksoul"), 3, 1)); } private static void AddHarderBossesChallenge() { Challenge_harderBosses = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Harder Bosses", "Bosses' main cards are more powerful, and bosses are more agressive.", 25, Tools.LoadTexture("ascensionicon_hardersignatures"), Tools.LoadTexture("ascensionicon_activated_hardersignatures"), 8, 1)); } private static void AddInfiniteLivesChallenge() { Challenge_infiniteLives = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Extra Lives", $"The scales will reset once they hit 0, up to {Plugin.allowedResets.Value} times for each candle.", -Plugin.allowedResets.Value * 75, Tools.LoadTexture("ascensionicon_infinitelives"), Tools.LoadTexture("ascensionicon_activated_infinitelives"), 12, 1)); } private static void AddReverseScalesChallenge() { Challenge_reverseScales = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Reverse Scales", "Start all battles with 1 damage on the opponent's side of the scale.", -30, Tools.LoadTexture("ascensionicon_reversescales"), ChallengeManager.HAPPY_ACTIVATED_SPRITE, 8, 1).SetFlags(new object[1] { "p03" }).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)10 })); } private static void AddEnvironmentChallenge() { Challenge_environment = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Environmental Effects", "At the start of each battle, a random environmental effect may activate.", 25, Tools.LoadTexture("ascensionicon_environment"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 9, 1).SetFlags(new object[1] { "p03" })); } private static void AddVineBoomChallenge() { Challenge_vineBoom = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Explosive Noise", "When a card dies, a loud boom will play. All cards explode on death.", 0, Tools.LoadTexture("ascensionicon_nuclear"), Tools.LoadTexture("activated_nuclear"), 0, (List)null, (Func>)null, (Func>)null, 1).SetFlags(new object[1] { "p03" })); } private static void AddFleetingSquirrelsChallenge() { Challenge_fleetingSquirrels = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Runaway Side Deck", "Your Side Deck cards have the Fleeting sigil.", 10, Tools.LoadTexture("ascensionicon_fleetingsquirrels"), Tools.LoadTexture("activated_fleetingsquirrels"), 1, (List)null, (Func>)null, (Func>)null, 1).SetFlags(new object[1] { "p03" })); } private static void AddUnfairHandChallenge() { Challenge_unfairHand = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Unfair Hand", "Your starting hand is randomly drawn.", 50, Tools.LoadTexture("ascensionicon_unfairhand"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 4, 1).SetFlags(new object[1] { "p03" })); } private static void AddAscenderBaneChallenge() { Challenge_ascenderBane = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Ascender's Bane", "You start with a useless card in the deck.", 20, Tools.LoadTexture("ascensionicon_ascenderbane"), Tools.LoadTexture("ascensionicon_activated_ascenderbane"), 4, 1)); } private static void AddRedrawHandChallenge() { Challenge_redrawHand = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Mulligan", "You may redraw your hand at the start of each battle.", -20, Tools.LoadTexture("ascensionicon_redrawhand"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 0, 1).SetFlags(new object[1] { "p03" })); } private static void AddChampionsChallenge() { Challenge_champion = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("bitty45.inscryption.challenges", "Champions", "Opponent cards have a chance to become a champion.", 20, Tools.LoadTexture("ascensionicon_champion"), ChallengeManager.DEFAULT_ACTIVATED_SPRITE, 6, 1)); } } public class Decks { public static void AddDecks() { Plugin.Log.LogInfo((object)"Start of starting decks"); Add_Deck_Pirate(); Plugin.Log.LogInfo((object)"End of starting decks"); } private static void Add_Deck_Pirate() { StarterDeckManager.New("bitty45.inscryption.challenges", "PirateDeck", Tools.LoadTexture("starterdeck_icon_pirate.png"), new string[3] { "bitty_Minicello", "bitty_SkeletonPirate", "bitty_SkeletonParrot" }, 0); } } [HarmonyPatch] public class Dialogue { public static Dictionary P03_EmoteFaces = new Dictionary { { (Emotion)6, (Face)17 }, { (Emotion)2, (Face)3 }, { (Emotion)1, (Face)4 }, { (Emotion)5, (Face)1 }, { (Emotion)0, (Face)0 }, { (Emotion)3, (Face)5 }, { (Emotion)4, (Face)0 } }; 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.Instance.SwitchToView((View)33, true, false); } else { Singleton.Instance.SwitchToView((View)1, true, false); } } private static CustomLine GenerateEmotionLine(string text, bool wavy = false, Emotion emotion = (Emotion)0, Speaker speaker = (Speaker)1, bool P03 = false, Face faceOverride = (Face)17) { //IL_0002: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0074: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) LetterAnimation letterAnimation = (LetterAnimation)0; if (wavy) { letterAnimation = (LetterAnimation)1; } Face p03Face = (Face)17; if (P03) { p03Face = (((int)faceOverride == 17) ? P03_EmoteFaces[emotion] : faceOverride); } CustomLine result = default(CustomLine); ((CustomLine)(ref result))..ctor(); result.p03Face = p03Face; result.emotion = emotion; result.letterAnimation = letterAnimation; result.text = text; result.speaker = speaker; return result; } private static CustomLine GenerateP03EmotionLine(string text, bool wavy = false, Emotion emotion = (Emotion)2, Speaker speaker = (Speaker)1, Face faceOverride = (Face)17) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_0010: Unknown result type (might be due to invalid IL or missing references) return GenerateEmotionLine(text, wavy, emotion, speaker, P03: true, faceOverride); } public static void Add_Dialogue() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_054d: 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) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0748: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_078e: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07bc: Unknown result type (might be due to invalid IL or missing references) //IL_07d3: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_092a: Unknown result type (might be due to invalid IL or missing references) //IL_0958: Unknown result type (might be due to invalid IL or missing references) //IL_0961: Unknown result type (might be due to invalid IL or missing references) //IL_0972: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Unknown result type (might be due to invalid IL or missing references) //IL_09a8: Unknown result type (might be due to invalid IL or missing references) //IL_09b9: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_0a0a: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a2c: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: Unknown result type (might be due to invalid IL or missing references) //IL_0a7d: Unknown result type (might be due to invalid IL or missing references) //IL_0a8e: Unknown result type (might be due to invalid IL or missing references) //IL_0a9f: Unknown result type (might be due to invalid IL or missing references) //IL_0ab0: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Unknown result type (might be due to invalid IL or missing references) //IL_0b01: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b41: Unknown result type (might be due to invalid IL or missing references) //IL_0b52: Unknown result type (might be due to invalid IL or missing references) //IL_0b63: Unknown result type (might be due to invalid IL or missing references) //IL_0b74: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: Unknown result type (might be due to invalid IL or missing references) //IL_0bee: Unknown result type (might be due to invalid IL or missing references) //IL_0bff: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Unknown result type (might be due to invalid IL or missing references) //IL_0c3f: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c7f: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Unknown result type (might be due to invalid IL or missing references) //IL_0ca1: Unknown result type (might be due to invalid IL or missing references) //IL_0cca: Unknown result type (might be due to invalid IL or missing references) //IL_0cdb: Unknown result type (might be due to invalid IL or missing references) //IL_0cec: Unknown result type (might be due to invalid IL or missing references) //IL_0d15: Unknown result type (might be due to invalid IL or missing references) //IL_0d26: Unknown result type (might be due to invalid IL or missing references) //IL_0d37: Unknown result type (might be due to invalid IL or missing references) //IL_0d48: Unknown result type (might be due to invalid IL or missing references) //IL_0d71: Unknown result type (might be due to invalid IL or missing references) //IL_0d82: Unknown result type (might be due to invalid IL or missing references) //IL_0d93: Unknown result type (might be due to invalid IL or missing references) //IL_0dbc: Unknown result type (might be due to invalid IL or missing references) //IL_0dcd: Unknown result type (might be due to invalid IL or missing references) //IL_0dde: Unknown result type (might be due to invalid IL or missing references) //IL_0e07: Unknown result type (might be due to invalid IL or missing references) //IL_0e18: Unknown result type (might be due to invalid IL or missing references) //IL_0e29: Unknown result type (might be due to invalid IL or missing references) //IL_0e3a: Unknown result type (might be due to invalid IL or missing references) //IL_0e63: Unknown result type (might be due to invalid IL or missing references) //IL_0e74: Unknown result type (might be due to invalid IL or missing references) //IL_0e85: Unknown result type (might be due to invalid IL or missing references) //IL_0eae: Unknown result type (might be due to invalid IL or missing references) //IL_0ebf: Unknown result type (might be due to invalid IL or missing references) //IL_0ed0: Unknown result type (might be due to invalid IL or missing references) //IL_0ef9: Unknown result type (might be due to invalid IL or missing references) //IL_0f0a: Unknown result type (might be due to invalid IL or missing references) //IL_0f1b: Unknown result type (might be due to invalid IL or missing references) //IL_0f44: Unknown result type (might be due to invalid IL or missing references) //IL_0f55: Unknown result type (might be due to invalid IL or missing references) //IL_0f7e: Unknown result type (might be due to invalid IL or missing references) //IL_0f8f: Unknown result type (might be due to invalid IL or missing references) //IL_0fa0: Unknown result type (might be due to invalid IL or missing references) //IL_0fb1: Unknown result type (might be due to invalid IL or missing references) //IL_0fda: Unknown result type (might be due to invalid IL or missing references) //IL_1003: Unknown result type (might be due to invalid IL or missing references) //IL_1014: Unknown result type (might be due to invalid IL or missing references) //IL_1025: Unknown result type (might be due to invalid IL or missing references) //IL_1036: Unknown result type (might be due to invalid IL or missing references) //IL_1047: Unknown result type (might be due to invalid IL or missing references) //IL_1070: Unknown result type (might be due to invalid IL or missing references) //IL_1081: Unknown result type (might be due to invalid IL or missing references) //IL_1092: Unknown result type (might be due to invalid IL or missing references) //IL_10bb: Unknown result type (might be due to invalid IL or missing references) //IL_10cc: Unknown result type (might be due to invalid IL or missing references) //IL_10f5: Unknown result type (might be due to invalid IL or missing references) //IL_1106: Unknown result type (might be due to invalid IL or missing references) //IL_112f: Unknown result type (might be due to invalid IL or missing references) //IL_1140: Unknown result type (might be due to invalid IL or missing references) //IL_1169: Unknown result type (might be due to invalid IL or missing references) //IL_117a: Unknown result type (might be due to invalid IL or missing references) //IL_11a3: Unknown result type (might be due to invalid IL or missing references) //IL_11b4: Unknown result type (might be due to invalid IL or missing references) //IL_11d0: Unknown result type (might be due to invalid IL or missing references) //IL_11e1: Unknown result type (might be due to invalid IL or missing references) //IL_11fe: Unknown result type (might be due to invalid IL or missing references) //IL_121b: Unknown result type (might be due to invalid IL or missing references) //IL_1238: Unknown result type (might be due to invalid IL or missing references) //IL_1255: Unknown result type (might be due to invalid IL or missing references) //IL_1289: Unknown result type (might be due to invalid IL or missing references) //IL_12a0: Unknown result type (might be due to invalid IL or missing references) //IL_12c3: Unknown result type (might be due to invalid IL or missing references) //IL_12db: Unknown result type (might be due to invalid IL or missing references) //IL_12f3: Unknown result type (might be due to invalid IL or missing references) //IL_1321: Unknown result type (might be due to invalid IL or missing references) //IL_1332: Unknown result type (might be due to invalid IL or missing references) //IL_1343: Unknown result type (might be due to invalid IL or missing references) //IL_1354: Unknown result type (might be due to invalid IL or missing references) //IL_137d: Unknown result type (might be due to invalid IL or missing references) //IL_138e: Unknown result type (might be due to invalid IL or missing references) //IL_139f: Unknown result type (might be due to invalid IL or missing references) //IL_13b0: Unknown result type (might be due to invalid IL or missing references) //IL_13d9: Unknown result type (might be due to invalid IL or missing references) //IL_13ea: Unknown result type (might be due to invalid IL or missing references) //IL_13fb: Unknown result type (might be due to invalid IL or missing references) //IL_140c: Unknown result type (might be due to invalid IL or missing references) //IL_1435: Unknown result type (might be due to invalid IL or missing references) //IL_145e: Unknown result type (might be due to invalid IL or missing references) //IL_146f: Unknown result type (might be due to invalid IL or missing references) //IL_1480: Unknown result type (might be due to invalid IL or missing references) //IL_1491: Unknown result type (might be due to invalid IL or missing references) //IL_14ad: Unknown result type (might be due to invalid IL or missing references) //IL_14db: Unknown result type (might be due to invalid IL or missing references) //IL_14ec: Unknown result type (might be due to invalid IL or missing references) //IL_14fd: Unknown result type (might be due to invalid IL or missing references) //IL_150e: Unknown result type (might be due to invalid IL or missing references) //IL_151f: Unknown result type (might be due to invalid IL or missing references) //IL_153b: Unknown result type (might be due to invalid IL or missing references) //IL_154c: Unknown result type (might be due to invalid IL or missing references) //IL_157f: Unknown result type (might be due to invalid IL or missing references) //IL_1595: Unknown result type (might be due to invalid IL or missing references) //IL_15ab: Unknown result type (might be due to invalid IL or missing references) //IL_15c1: Unknown result type (might be due to invalid IL or missing references) //IL_15ef: Unknown result type (might be due to invalid IL or missing references) //IL_1605: Unknown result type (might be due to invalid IL or missing references) //IL_161b: Unknown result type (might be due to invalid IL or missing references) //IL_1631: Unknown result type (might be due to invalid IL or missing references) //IL_165f: Unknown result type (might be due to invalid IL or missing references) //IL_1675: Unknown result type (might be due to invalid IL or missing references) //IL_168b: Unknown result type (might be due to invalid IL or missing references) //IL_16b9: Unknown result type (might be due to invalid IL or missing references) //IL_16cf: Unknown result type (might be due to invalid IL or missing references) //IL_16e5: Unknown result type (might be due to invalid IL or missing references) //IL_16fb: Unknown result type (might be due to invalid IL or missing references) //IL_1729: Unknown result type (might be due to invalid IL or missing references) //IL_174a: Unknown result type (might be due to invalid IL or missing references) //IL_176c: Unknown result type (might be due to invalid IL or missing references) //IL_1782: Unknown result type (might be due to invalid IL or missing references) //IL_17a4: Unknown result type (might be due to invalid IL or missing references) //IL_17ba: Unknown result type (might be due to invalid IL or missing references) //IL_17ed: Unknown result type (might be due to invalid IL or missing references) //IL_1803: Unknown result type (might be due to invalid IL or missing references) //IL_1819: Unknown result type (might be due to invalid IL or missing references) //IL_1847: Unknown result type (might be due to invalid IL or missing references) //IL_185d: Unknown result type (might be due to invalid IL or missing references) //IL_1873: Unknown result type (might be due to invalid IL or missing references) //IL_18a1: Unknown result type (might be due to invalid IL or missing references) //IL_18b7: Unknown result type (might be due to invalid IL or missing references) //IL_18cd: Unknown result type (might be due to invalid IL or missing references) //IL_18e3: Unknown result type (might be due to invalid IL or missing references) //IL_18f9: Unknown result type (might be due to invalid IL or missing references) //IL_191a: Unknown result type (might be due to invalid IL or missing references) //IL_1930: Unknown result type (might be due to invalid IL or missing references) //IL_1963: Unknown result type (might be due to invalid IL or missing references) //IL_1979: Unknown result type (might be due to invalid IL or missing references) //IL_198f: Unknown result type (might be due to invalid IL or missing references) //IL_19a5: Unknown result type (might be due to invalid IL or missing references) //IL_19bb: Unknown result type (might be due to invalid IL or missing references) //IL_19dc: Unknown result type (might be due to invalid IL or missing references) //IL_19f2: Unknown result type (might be due to invalid IL or missing references) //IL_1a25: Unknown result type (might be due to invalid IL or missing references) //IL_1a3b: Unknown result type (might be due to invalid IL or missing references) //IL_1a51: Unknown result type (might be due to invalid IL or missing references) //IL_1a67: Unknown result type (might be due to invalid IL or missing references) //IL_1a88: Unknown result type (might be due to invalid IL or missing references) //IL_1a9e: Unknown result type (might be due to invalid IL or missing references) //IL_1ad1: Unknown result type (might be due to invalid IL or missing references) //IL_1ae7: Unknown result type (might be due to invalid IL or missing references) //IL_1afd: Unknown result type (might be due to invalid IL or missing references) //IL_1b13: Unknown result type (might be due to invalid IL or missing references) //IL_1b29: Unknown result type (might be due to invalid IL or missing references) //IL_1b3f: Unknown result type (might be due to invalid IL or missing references) //IL_1b60: Unknown result type (might be due to invalid IL or missing references) //IL_1b76: Unknown result type (might be due to invalid IL or missing references) //IL_1b98: Unknown result type (might be due to invalid IL or missing references) //IL_1bae: Unknown result type (might be due to invalid IL or missing references) Plugin.Log.LogInfo((object)"Start of dialogue"); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "RedrawHandIntro", new List { CustomLine.op_Implicit("Is that a clover?"), CustomLine.op_Implicit("I see.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "UnfairHandIntro", new List { CustomLine.op_Implicit("Oh?"), CustomLine.op_Implicit("Did you not like having a stacked deck?"), CustomLine.op_Implicit("That's fine with me."), CustomLine.op_Implicit("It will be more fair this way anyways.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "OuroIntro", new List { CustomLine.op_Implicit("Oh?"), CustomLine.op_Implicit("My very own Ouroboros."), CustomLine.op_Implicit("I will be sure to put it to good use.") }, new List> { new List { CustomLine.op_Implicit("The ouroboros has followed you."), CustomLine.op_Implicit("It's fangs are beared, and it's ready for another fight.") }, new List { CustomLine.op_Implicit("the unyielding ouroboros has returned,"), CustomLine.op_Implicit("growing stronger every death.") }, new List { CustomLine.op_Implicit("as inevitable as death,"), CustomLine.op_Implicit("the ouroboros has returned.") }, new List { CustomLine.op_Implicit("a serpent slithers out from the undergrowth."), CustomLine.op_Implicit("perhaps you have seen it before?") } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "OuroDies", new List { CustomLine.op_Implicit("the ouroboros has died."), CustomLine.op_Implicit("and yet, it will return.") }, new List> { new List { CustomLine.op_Implicit("the ouroboros has died."), CustomLine.op_Implicit("and yet, it will return.") }, new List { CustomLine.op_Implicit("the serpent's wrath has been delayed."), CustomLine.op_Implicit("for now.") }, new List { CustomLine.op_Implicit("the ouroboros only grows stronger from death."), CustomLine.op_Implicit("it will be back.") } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "MycoFailSigils", new List { CustomLine.op_Implicit("a-ah, the sigils...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)5); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "MycoFailAttack", new List { CustomLine.op_Implicit("o-oh, the power...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)5); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "MycoFailHealth", new List { CustomLine.op_Implicit("a-ah, the health...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)5); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "GoldenSheepIntro", new List { CustomLine.op_Implicit("ah..."), CustomLine.op_Implicit("Chrysomallos, the golden ram."), CustomLine.op_Implicit("what a glorious pelt....") }, new List> { new List { CustomLine.op_Implicit("The golden ram."), CustomLine.op_Implicit("catch it before it escapes.") }, new List { CustomLine.op_Implicit("a rare sight."), CustomLine.op_Implicit("it will not stay for long.") }, new List { CustomLine.op_Implicit("what glittering wool,"), CustomLine.op_Implicit("attached to such a rare creature.") }, new List { CustomLine.op_Implicit("oh?"), CustomLine.op_Implicit("a rare chance to get a rare pelt."), CustomLine.op_Implicit("best make the most of it.") } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "SheepDies", new List { CustomLine.op_Implicit("You slay the glimmering creature, stealing its pelt.") }, new List> { new List { CustomLine.op_Implicit("You slay the glimmering creature, stealing its pelt.") }, new List { CustomLine.op_Implicit("The end of such a glorious creature."), CustomLine.op_Implicit("And what a glorious pelt you have obtained.") }, new List { CustomLine.op_Implicit("Chrysomallos..."), CustomLine.op_Implicit("How tragic your tale is..."), CustomLine.op_Implicit("To be killed for your pelt...") } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "SheepEscapes", new List { CustomLine.op_Implicit("The Golden Ram lives another day.") }, new List> { new List { CustomLine.op_Implicit("The Golden Ram lives another day.") }, new List { CustomLine.op_Implicit("Time's up."), CustomLine.op_Implicit("The Golden Ram has found an escape route.") }, new List { CustomLine.op_Implicit("The glimmer of the Golden Ram's fur blinds you,"), CustomLine.op_Implicit("giving it the opportunity to escape.") } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FragileEnemy", new List { CustomLine.op_Implicit("Ah..."), CustomLine.op_Implicit("Your [v:0] has taken a devastating blow from the [v:1]."), CustomLine.op_Implicit("You will not be able to take it with your caravan.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FragileDies", new List { CustomLine.op_Implicit("Ah..."), CustomLine.op_Implicit("You won't be seeing your [v:0] again,"), CustomLine.op_Implicit("It has taken too much damage.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FragileSacrifice", new List { CustomLine.op_Implicit("Ah..."), CustomLine.op_Implicit("Did you permanently kill your [v:0] on purpose?"), CustomLine.op_Implicit("A shame...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "RoyalFirstMate", new List { CustomLine.op_Implicit("Ha! There be my first mate!") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)22); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "RoyalOuro", new List { CustomLine.op_Implicit("Argh! There be snakes on me ship as well!") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)22); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "RoyalOuroDiesPlayer", new List { CustomLine.op_Implicit("Ha!"), CustomLine.op_Implicit("I should hire ye to get rid of the rest of them!") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)22); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "RoyalOuroDies", new List { CustomLine.op_Implicit("Ha! It's dead!") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)22); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "PirateIntro", new List { CustomLine.op_Implicit("what?"), CustomLine.op_Implicit("Pirates?"), CustomLine.op_Implicit("..."), CustomLine.op_Implicit("I'll allow it.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "InfiniteLivesIntro", new List { GenerateEmotionLine("what?", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17), GenerateEmotionLine("cheating?", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17), GenerateEmotionLine("how dissapointing...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17), GenerateEmotionLine("...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17), GenerateEmotionLine("the game will be soured from a pitifully easy ascent.", wavy: false, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List> { new List { GenerateEmotionLine("cheater...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List { GenerateEmotionLine("Have you no shame?", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List { GenerateEmotionLine("To cheat so blatantly...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List { GenerateEmotionLine("you should be dead.", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List { GenerateEmotionLine("and yet...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List { GenerateEmotionLine("how dissapointing...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, new List { GenerateEmotionLine("...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "InfiniteLivesLoop", new List { GenerateEmotionLine("I won't tolerate this for much longer...", wavy: true, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "InfiniteLivesLoopBreak", new List { GenerateEmotionLine("Enough of this.", wavy: false, (Emotion)2, (Speaker)1, P03: false, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); List list = new List(); CustomLine item = default(CustomLine); ((CustomLine)(ref item))..ctor(); item.emotion = (Emotion)5; item.speaker = (Speaker)22; item.text = "Yer not dead?"; list.Add(item); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "InfiniteLivesRoyal", list, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FecundityUnNerfIntro", new List { CustomLine.op_Implicit("ah..."), CustomLine.op_Implicit("back to normal then?"), CustomLine.op_Implicit("I'll admit, I had gotten used to the changes...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "WeakStart", new List { GenerateEmotionLine("Weak Cards?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("This is hard to explain..."), CustomLine.op_Implicit("Perhaps they are sick?"), CustomLine.op_Implicit("Yes..."), CustomLine.op_Implicit("A crippling disease afflicted your meager troupe of creatures.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "WaterborneStart", new List { GenerateEmotionLine("Waterborne Cards?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("This is hard to explain..."), CustomLine.op_Implicit("Perhaps a mutation?"), CustomLine.op_Implicit("Yes..."), CustomLine.op_Implicit("Your caravan of creatures had a startling mutation,"), CustomLine.op_Implicit("They could only survive in the water.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "ShockedStart", new List { GenerateEmotionLine("Paralyzed Cards?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("Hmm..."), CustomLine.op_Implicit("Your group of creatures were fatigued from the long journey,"), CustomLine.op_Implicit("but there would be a long way to go yet.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "WeakSoulStart", new List { GenerateEmotionLine("Weak Souled Cards?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("Hmm..."), CustomLine.op_Implicit("You will not be able to extract their souls into new creatures,"), CustomLine.op_Implicit("For better or worse...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "AscenderBaneStart", new List { CustomLine.op_Implicit("The lives of past challengers weighed down on you...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FamineIntro", new List { GenerateEmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("How to explain this..."), CustomLine.op_Implicit("You were running low on supplies that day..."), CustomLine.op_Implicit("You'll have fewer [c:G][v:0]s[c:] to work with.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "AbundanceIntro", new List { GenerateEmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("An abundance of [c:G][v:0]s[c:]..."), CustomLine.op_Implicit("Must be mating season...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "EnvironmentsIntro", new List { GenerateEmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), CustomLine.op_Implicit("Environmental effects?"), CustomLine.op_Implicit("how interesting...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "MudBoonIntro", new List { CustomLine.op_Implicit("In order to proceed,"), CustomLine.op_Implicit("you had to slog through the wetter parts of the swamp."), CustomLine.op_Implicit("The thick [c:G]mud[c:] stuck to your boots, and hindered your movements...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "HailBoonIntro", new List { CustomLine.op_Implicit("The frigid air was not the only obstacle in your way,"), CustomLine.op_Implicit("the harsh ice and unforgiving snow also stood in your path."), CustomLine.op_Implicit("before long you found yourself in..."), CustomLine.op_Implicit("a [c:B]hailstorm.[c:]") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "CliffsBoonIntro", new List { CustomLine.op_Implicit("You found yourself cornered against a sheer rock wall,"), CustomLine.op_Implicit("the [c:G]cliffside.[c:]"), CustomLine.op_Implicit("Against the cold stone, there would be less space to fight.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "MushroomsBoonIntro", new List { CustomLine.op_Implicit("The mycologists had left one of their experiments behind,"), CustomLine.op_Implicit("unbeknownst to them, it began to fester and grow."), CustomLine.op_Implicit("even the creatures fighting you would not be safe from the [c:G]fungal mass.[c:]") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "DynamiteBoonIntro", new List { CustomLine.op_Implicit("You stumbled across one of the Prospector's Camps."), CustomLine.op_Implicit("The camp was filled with prospecting tools."), CustomLine.op_Implicit("pickaxes, headlamps..."), CustomLine.op_Implicit("and [c:bR]dynamite.[c:]") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "BaitBoonIntro", new List { CustomLine.op_Implicit("You came across one of the Angler's Ponds."), CustomLine.op_Implicit("the area stank of rotting fish,"), CustomLine.op_Implicit("emanating from the nearby abandoned buckets of [c:dB]bait.[c:]") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "TrapBoonIntro", new List { CustomLine.op_Implicit("You came across one of the Trapper's Hunting Grounds."), CustomLine.op_Implicit("the stench of blood hung in the air..."), CustomLine.op_Implicit("you noticed the numerous [c:G]traps[c:] lying in wait.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "TotemBoonIntro", new List { CustomLine.op_Implicit("You came upon a strange [c:bR]totem.[c:]"), CustomLine.op_Implicit("a mysterious energy swirled around it,"), CustomLine.op_Implicit("the creatures nearby seem more agressive than usual...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "BloodMoonBoonIntro", new List { CustomLine.op_Implicit("Ah..."), CustomLine.op_Implicit("a [c:bR]Blood Moon.[c:]") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "CarrotBoonIntro", new List { CustomLine.op_Implicit("Er..."), CustomLine.op_Implicit("You..."), CustomLine.op_Implicit("..."), CustomLine.op_Implicit("...What?") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "CarrotBoonIntro2", new List { CustomLine.op_Implicit("I am at a loss for words.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "BlizzardBoonIntro", new List { CustomLine.op_Implicit("The wind was howling around you."), CustomLine.op_Implicit("Stuck in the middle of a blizzard,"), CustomLine.op_Implicit("You heard rumbling from the mountains above."), CustomLine.op_Implicit("Here it comes..."), CustomLine.op_Implicit("an [c:B]avalanche.[c:]") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "ObeliskBoonIntro", new List { CustomLine.op_Implicit("You stumble across a strange black stone."), CustomLine.op_Implicit("A stone tablet sits in front of it, clearly made for sacrifices."), CustomLine.op_Implicit("Perhaps a certain creature may cause a reaction?") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "WorthySacrifice", new List { CustomLine.op_Implicit("The obelisk trembles in delight."), CustomLine.op_Implicit("This is truly a worthy sacrifice.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "PeltSacrifice", new List { CustomLine.op_Implicit("The obelisk rumbles with anger."), CustomLine.op_Implicit("A pelt is a truly pitiful sacrifice.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "TerrainSacrifice", new List { CustomLine.op_Implicit("The obelisk rumbles with anger."), CustomLine.op_Implicit("Such a thing... does not bleed.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "NormalSacrifice", new List { CustomLine.op_Implicit("The obelisk does not react."), CustomLine.op_Implicit("Perhaps, something greater.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "SquirrelSacrifice", new List { CustomLine.op_Implicit("The obelisk does not react."), CustomLine.op_Implicit("Perhaps, something greater.") }, new List> { new List { CustomLine.op_Implicit("..."), CustomLine.op_Implicit("...That is not a proper sacrifice.") }, new List { CustomLine.op_Implicit("Stop this.") }, new List { CustomLine.op_Implicit("You...") }, new List { CustomLine.op_Implicit("This is bloodshed without meaning.") }, new List { CustomLine.op_Implicit("[v:0] squirrels...") } }, (MaxRepeatsBehaviour)1, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "MinicelloBoonIntro", new List { GenerateEmotionLine("Hmm?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17), GenerateEmotionLine("What is this?", wavy: false, (Emotion)5, (Speaker)1, P03: false, (Face)17) }, new List> { new List { GenerateEmotionLine("Heh heh heh...", wavy: true, (Emotion)1, (Speaker)22, P03: false, (Face)17), GenerateEmotionLine("Ye walked into th' pirate's cove!", wavy: true, (Emotion)1, (Speaker)22, P03: false, (Face)17), GenerateEmotionLine("Me crew will get rid of ye quick!", wavy: false, (Emotion)1, (Speaker)22, P03: false, (Face)17) } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "DarkForestBoonIntro", new List { CustomLine.op_Implicit("You carve through the thick underbrush and foilage."), CustomLine.op_Implicit("The trees blotting out the sun..."), CustomLine.op_Implicit("As you travel, you hear the woods start to creak around you."), CustomLine.op_Implicit("You should know better than to walk in the darkness...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FloodBoonIntro", new List { CustomLine.op_Implicit("As your caravan of creatures travels, you hear a rushing sound."), CustomLine.op_Implicit("You climb to a higher place as water flows around you."), CustomLine.op_Implicit("You are caught in a [c:B]flood.[c:]"), CustomLine.op_Implicit("Only the terrain and flying creatures will be able to avoid the waters.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "BreezeBoonIntro", new List { CustomLine.op_Implicit("As your caravan of creatures moves across a clearing, the winds blow stronger."), CustomLine.op_Implicit("A strong breeze greets your face, and you grasp onto the surroundings for dear life."), CustomLine.op_Implicit("Your creatures are blown [c:G]airborne.[c:]"), CustomLine.op_Implicit("Only burrowing and submerged creatures will be able to avoid the gusts.") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "BreezeActivation", new List { CustomLine.op_Implicit("The Breeze blows...") }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "GraveyardBoonIntro", new List { CustomLine.op_Implicit("You come across a pile of corpses."), CustomLine.op_Implicit("A strange energy swirls around them as you approach."), CustomLine.op_Implicit("Then..."), CustomLine.op_Implicit("[c:R]The dead walk.[c:]") }, new List> { new List { CustomLine.op_Implicit("[c:R]The dead walk.[c:]") } }, (MaxRepeatsBehaviour)1, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "FlashGrowthBoonIntro", new List { CustomLine.op_Implicit("You came across an overgrown glade."), CustomLine.op_Implicit("The trees seemed taller, and stronger than usual."), CustomLine.op_Implicit("Your creatures grew faster as well."), CustomLine.op_Implicit("The glade glowed with unnatural light."), CustomLine.op_Implicit("Flash Growth.") }, new List> { new List { CustomLine.op_Implicit("The glade glowed with unnatural light."), CustomLine.op_Implicit("Flash Growth.") } }, (MaxRepeatsBehaviour)1, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03FamineIntro", new List { GenerateP03EmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("You're decreasing the number of vessels you have?", wavy: false, (Emotion)0, (Speaker)1, (Face)17), GenerateP03EmotionLine("Surely a player as bad as you would need the extra chump blockers?", wavy: true, (Emotion)1, (Speaker)1, (Face)17), GenerateP03EmotionLine("I guess we'll see.", wavy: false, (Emotion)0, (Speaker)1, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03AbundanceIntro", new List { GenerateP03EmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("You're increasing the number of vessels you have?", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Makes sense.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("After all, a player as bad as you needs the extra chump blockers.", wavy: true, (Emotion)1, (Speaker)1, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03FecundityUnNerfIntro", new List { GenerateP03EmotionLine("Oh?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("You couldn't even stick to the changes?", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Pathetic.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03OuroIntro", new List { GenerateP03EmotionLine("Oh?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("My own Ourobot?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("You must be masochistic if you thought this was a good idea.", wavy: true, (Emotion)1, (Speaker)1, (Face)17), GenerateP03EmotionLine("Your funeral.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03OuroDies", new List { GenerateP03EmotionLine("There it goes.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, new List> { new List { GenerateP03EmotionLine("There it goes.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, new List { GenerateP03EmotionLine("You just made it stronger.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Of course, you knew that already.", wavy: true, (Emotion)1, (Speaker)1, (Face)17) }, new List { GenerateP03EmotionLine("I'm not worried.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("It'll come back to crush you later.", wavy: true, (Emotion)1, (Speaker)1, (Face)17) } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03WeakStart", new List { GenerateP03EmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("Weaker starting cards?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("As if one health will make a difference.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03EnvironmentsIntro", new List { GenerateP03EmotionLine("Hm?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("Were my environments not good enough for you?", wavy: false, (Emotion)5, (Speaker)1, (Face)17), GenerateP03EmotionLine("Fine.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03GraveyardBoonIntro", new List { GenerateP03EmotionLine("Hm...", wavy: false, (Emotion)3, (Speaker)1, (Face)17), GenerateP03EmotionLine("You have found a...", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Robot scrapyard.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("There's broken down robots everywhere.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Every robot in this area dies twice.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, new List> { new List { GenerateP03EmotionLine("It's the scrapyard again.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("You know the drill.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03FlashGrowthBoonIntro", new List { GenerateP03EmotionLine("Eugh.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("This is one of [c:O]HIS.[c:]", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Your... transformer bots will be more effective here.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("They'll transform when played.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("You'll see.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, new List> { new List { GenerateP03EmotionLine("Your transformer bots will be more effective here.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("They'll transform when played.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03GemSanctuaryBoonIntro", new List { GenerateP03EmotionLine("Ah...", wavy: false, (Emotion)3, (Speaker)1, (Face)17), GenerateP03EmotionLine("Your G[c:O]E[c:][c:B]M[c:]s will be more useful.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("More useful than [c:R]he[c:] ever was able to make them...", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("...As long as you keep that one alive.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, new List> { new List { GenerateP03EmotionLine("Your G[c:O]E[c:][c:B]M[c:]s will be more useful.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("...As long as you keep that one alive.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) } }, (MaxRepeatsBehaviour)0, (Speaker)0); DialogueManager.GenerateEvent("bitty45.inscryption.challenges", "P03ElectricStormBoonIntro", new List { GenerateP03EmotionLine("Heh.", wavy: false, (Emotion)1, (Speaker)1, (Face)17), GenerateP03EmotionLine("This one will be quite...", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("Shocking.", wavy: false, (Emotion)1, (Speaker)1, (Face)17), GenerateP03EmotionLine("You find yourself in an electrical storm.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("The cards you play will be shocked.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("If they survive, they'll be stronger for a bit.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) }, new List> { new List { GenerateP03EmotionLine("Shocking, heh.", wavy: false, (Emotion)1, (Speaker)1, (Face)17), GenerateP03EmotionLine("Still funny.", wavy: false, (Emotion)1, (Speaker)1, (Face)17) }, new List { GenerateP03EmotionLine("The cards you play will be shocked.", wavy: false, (Emotion)2, (Speaker)1, (Face)17), GenerateP03EmotionLine("If they survive, they'll be stronger for a bit.", wavy: false, (Emotion)2, (Speaker)1, (Face)17) } }, (MaxRepeatsBehaviour)1, (Speaker)0); Plugin.Log.LogInfo((object)"End of dialogue"); } } public class EnviroHandler { public class EnviroBoon { public string boonName; public Type boonType; private string regionName; public int regionTier; public EnviroCondition condition; public List modes; public EnviroBoon(string boonName, Type boonType, string regionName, int regionTier, [ParamCollection] List modes) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.boonName = boonName; this.boonType = boonType; this.regionName = regionName; this.regionTier = regionTier; this.modes = modes; condition = new ECond_Default(); } public EnviroBoon(string boonName, Type boonType, string regionName, int regionTier, EnviroCondition condition, [ParamCollection] List modes) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) this.boonName = boonName; this.boonType = boonType; this.regionName = regionName; this.regionTier = regionTier; this.modes = modes; this.condition = condition; } public bool RegionMatch(string regionName) { if (this.regionName == REGION_ANY || this.regionName == regionName) { return true; } return false; } } public abstract class EnviroCondition { public abstract bool IsActive(); } public class ECond_Default : EnviroCondition { public override bool IsActive() { return true; } } public class ECond_Challenge_Inclusive : EnviroCondition { private List challenges; public ECond_Challenge_Inclusive([ParamCollection] List challenges) { this.challenges = challenges; } public override bool IsActive() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) foreach (AscensionChallenge challenge in challenges) { if (AscensionSaveData.Data.ChallengeIsActive(challenge)) { return true; } } return false; } } public class ECond_Challenge_Exclusive : EnviroCondition { private List challenges; public ECond_Challenge_Exclusive([ParamCollection] List challenges) { this.challenges = challenges; } public override bool IsActive() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) foreach (AscensionChallenge challenge in challenges) { if (!AscensionSaveData.Data.ChallengeIsActive(challenge)) { return false; } } return true; } } public class ECond_CarrotPatch : EnviroCondition { public override bool IsActive() { return !DialogueEventsData.EventIsPlayed("CarrotBoonIntro") && AscensionSaveData.Data.ChallengeIsActive((AscensionChallenge)13); } } public static List EnviroBoonList; public static readonly string REGION_ANY = "Any"; public static readonly string REGION_FOREST = "Forest"; public static readonly string REGION_WETLANDS = "Wetlands"; public static readonly string REGION_ALPINE = "Alpine"; public static readonly string REGION_MAGMA = "Magma_bitty"; public static void Init_EnviroBoonList() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_0211: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) Plugin.Log.LogInfo((object)"Init EnviroBoons"); EnviroBoonList = new List(); EnviroBoonList.Add(new EnviroBoon("Cliffs", Boons.ChallengeBoonCliffs.boo, REGION_ANY, 0, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Breeze", Boons.ChallengeBoonBreeze.boo, REGION_ANY, 1, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Growth", Boons.ChallengeBoonFlashGrowth.boo, REGION_ANY, 1, new List(2) { Plugin.MOD_MODE.KCM, Plugin.MOD_MODE.P03 })); EnviroBoonList.Add(new EnviroBoon("Grave", Boons.ChallengeBoonGraveyard.boo, REGION_ANY, 1, new List(2) { Plugin.MOD_MODE.KCM, Plugin.MOD_MODE.P03 })); EnviroBoonList.Add(new EnviroBoon("Obelisk", Boons.ChallengeBoonObelisk.boo, REGION_ANY, 2, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Mushrooms", Boons.ChallengeBoonMushrooms.boo, REGION_ANY, 2, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("BloodMoon", Boons.ChallengeBoonBloodMoon.boo, REGION_ANY, 2, new ECond_Challenge_Inclusive(new List(1) { (AscensionChallenge)13 }), new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("BloodMoon(?)", Boons.ChallengeBoonCarrotPatch.boo, REGION_ANY, 2, new ECond_CarrotPatch(), new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Minicello", Boons.ChallengeBoonMinicello.boo, REGION_ANY, 2, new ECond_Challenge_Inclusive(new List(2) { Challenges.Challenge_harderFinalBoss.challengeType, (AscensionChallenge)15 }), new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Totem", Boons.ChallengeBoonTotem.boo, REGION_FOREST, 0, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Dynamite", Boons.ChallengeBoonDynamite.boo, REGION_FOREST, 1, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("DForest", Boons.ChallengeBoonDarkForest.boo, REGION_FOREST, 2, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Hail", Boons.ChallengeBoonHail.boo, REGION_ALPINE, 0, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Trap", Boons.ChallengeBoonTrap.boo, REGION_ALPINE, 1, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Bliz", Boons.ChallengeBoonBlizzard.boo, REGION_ALPINE, 2, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Mud", Boons.ChallengeBoonMud.boo, REGION_WETLANDS, 0, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Bait", Boons.ChallengeBoonBait.boo, REGION_WETLANDS, 1, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Flood", Boons.ChallengeBoonFlood.boo, REGION_WETLANDS, 2, new List(1) { Plugin.MOD_MODE.KCM })); EnviroBoonList.Add(new EnviroBoon("Gem", Boons.ChallengeBoonGemSanctuary.boo, REGION_ANY, 0, new List(1) { Plugin.MOD_MODE.P03 })); EnviroBoonList.Add(new EnviroBoon("Overclock", Boons.ChallengeBoonElectricStorm.boo, REGION_ANY, 0, new List(1) { Plugin.MOD_MODE.P03 })); } } [BepInPlugin("bitty45.inscryption.challenges", "Bitty's Challenges", "6.1.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public enum MOD_MODE { KCM, P03 } [HarmonyPatch(typeof(AudioController))] public class AudioPatches { [HarmonyPrefix] [HarmonyPatch("GetAudioClip")] public static void AddAudiosClips(AudioController __instance, string soundId) { __instance.SFX.AddRange(addedSfx.Where((AudioClip x) => !__instance.SFX.Contains(x))); } [HarmonyPrefix] [HarmonyPatch("GetLoopClip")] public static void AddLoopClips(AudioController __instance, string loopId) { __instance.Loops.AddRange(addedSfx.Where((AudioClip x) => !__instance.Loops.Contains(x))); } [HarmonyPrefix] [HarmonyPatch("GetLoop")] public static void AddLoops(AudioController __instance, string loopName) { __instance.Loops.AddRange(addedSfx.Where((AudioClip x) => !__instance.Loops.Contains(x))); } } internal const string PluginGuid = "bitty45.inscryption.challenges"; internal const string PluginName = "Bitty's Challenges"; internal const string PluginVersion = "6.1.1"; internal const string CardPrefix = "bitty"; public static string AssemblyLoc; public static List addedSfx = new List(); internal static ConfigEntry famineRemoval; internal static ConfigEntry abundanceQuality; internal static ConfigEntry allowedResets; internal static ManualLogSource Log; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("bitty45.inscryption.challenges"); famineRemoval = ((BaseUnityPlugin)this).Config.Bind("General", "Famine Challenge Severity", 3, "The number of cards removed from your side deck."); abundanceQuality = ((BaseUnityPlugin)this).Config.Bind("General", "Abundance Challenge Quality", 5, "The number of cards added to your side deck."); allowedResets = ((BaseUnityPlugin)this).Config.Bind("General", "Extra Lives Allowed Resets", 3, "The max number of times that extra lives will reset the scales during a run."); AssemblyLoc = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); addedSfx.Add(SoundManager.LoadAudioClip("bitty45.inscryption.challenges", AssemblyLoc + "/Resources/sfx_vineBoom.ogg")); Challenges.AddChallenges(); Boons.AddBoons(); SlotMods.Add_SlotMods(); Abilities.AddAbilities(); SlotMods.Add_Reliant_SlotMods(); Abilities.Add_Reliant_Abilities(); Cards.AddCards(); Dialogue.Add_Dialogue(); Decks.AddDecks(); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Bitty's Challenges is loaded!"); } public static MOD_MODE getModMode() { if (Chainloader.PluginInfos.ContainsKey("zorro.inscryption.infiniscryption.p03kayceerun") && AscensionSaveData.Data != null && AscensionSaveData.Data.currentRun != null && AscensionSaveData.Data.currentRun.playerLives > 0 && ModdedSaveManager.SaveData.GetValueAsBoolean("zorro.inscryption.infiniscryption.p03kayceerun", "IsP03Run")) { return MOD_MODE.P03; } return MOD_MODE.KCM; } public static bool modModeActive(MOD_MODE modMode) { return getModMode() == modMode; } } [HarmonyPatch(typeof(RuleBookInfo))] public class RulebookExpansion { [HarmonyPostfix] [HarmonyPatch("AbilityShouldBeAdded")] 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 == Abilities.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 == Abilities.GiveWarper.ability) { __result = true; } } } public static class SlotModExtensions { public static IEnumerator FadeToSlotMod(this CardSlot cardSlot, ModificationType slotType) { //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) ((HighlightedInteractable)cardSlot).SetShown(false, false); yield return (object)new WaitForSeconds(0.45f); yield return SlotModificationExtensions.SetSlotModification(cardSlot, slotType); ((HighlightedInteractable)cardSlot).SetShown(true, false); } } public class SlotMods { public class SlotMod_Obelisk : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo(1, 0) { singletonId = "bitty_obeliskAnger", abilities = new List { (Ability)34 }, nonCopyable = true }; private bool properSacrifice = false; public int squirrelSacrifices; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { if (((Card)otherCard).Info.HasTrait((Trait)20) || otherCard.HasAbility((Ability)22)) { AudioController.Instance.PlaySound2D("creepy_rattle_lofi", (MixerGroup)0, 1f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); yield return DialogueManager.PlayDialogueEventSafe("WorthySacrifice", (MessageAdvanceMode)1, (EventIntersectMode)0, (DialogueSpeaker)null, (Style)4, (ScreenPosition)2, (string[])null, (Action)null, true); yield return (object)new WaitForSeconds(0.25f); Singleton.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.25f); yield return Singleton.Instance.AddBones(8, (CardSlot)null); yield return (object)new WaitForSeconds(0.25f); properSacrifice = true; } else if (CardExtensions.HasTrait(otherCard, (Trait)13) || CardExtensions.HasTrait(otherCard, (Trait)12)) { yield return (object)new WaitForSeconds(0.7f); if (CardExtensions.HasTrait(otherCard, (Trait)13)) { yield return Singleton.Instance.PlayDialogueEvent("PeltSacrifice", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } else { yield return Singleton.Instance.PlayDialogueEvent("TerrainSacrifice", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); } yield return (object)new WaitForSeconds(0.25f); List opponentSlotsCopy = Singleton.Instance.OpponentSlotsCopy; opponentSlotsCopy.RemoveAll((CardSlot x) => (Object)(object)x.Card == (Object)null || ((Object)((Card)x.Card).Info).name != "bitty_Obelisk"); if (opponentSlotsCopy.Count > 0) { AudioController.Instance.PlaySound3D("dueldisk_card_played", (MixerGroup)4, ((Component)opponentSlotsCopy[0].Card).transform.position, 2f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); for (int i = 0; i < opponentSlotsCopy.Count; i++) { opponentSlotsCopy[i].Card.AddTemporaryMod(mod); ((Card)opponentSlotsCopy[i].Card).Anim.PlayTransformAnimation(); } } } else if (((Object)otherCard).name.Contains("Squirrel")) { yield return (object)new WaitForSeconds(0.7f); squirrelSacrifices++; yield return Singleton.Instance.PlayDialogueEvent("SquirrelSacrifice", (MessageAdvanceMode)1, (EventIntersectMode)0, new string[1] { squirrelSacrifices.ToString() }, (Action)null); yield return (object)new WaitForSeconds(0.25f); } else { yield return Singleton.Instance.PlayDialogueEvent("NormalSacrifice", (MessageAdvanceMode)1, (EventIntersectMode)0, (string[])null, (Action)null); yield return (object)new WaitForSeconds(0.25f); } BoardManager instance = Singleton.Instance; instance.SacrificesMadeThisTurn += 1; yield return otherCard.Die(false, (PlayableCard)null, true); if (properSacrifice) { yield return SlotModificationExtensions.ClearSlotModification(((SlotModificationBehaviour)this).Slot); } } } public class SlotMod_Dynamite : SlotModificationBehaviour { public static ModificationType SlotType; private GameObject bombPrefab; private void Awake() { bombPrefab = ResourceBank.Get("Prefabs/Cards/SpecificCardModels/DetonatorHoloBomb"); } public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { yield return ExplodeFromSlot(((SlotModificationBehaviour)this).Slot); yield return otherCard.TakeDamage(10, (PlayableCard)null); yield return SlotModificationExtensions.ClearSlotModification(((SlotModificationBehaviour)this).Slot); } protected IEnumerator ExplodeFromSlot(CardSlot slot) { List adjacentSlots = Singleton.Instance.GetAdjacentSlots(slot); if (adjacentSlots.Count > 0 && adjacentSlots[0].Index < slot.Index) { if ((Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead) { yield return BombCard(adjacentSlots[0].Card); } adjacentSlots.RemoveAt(0); } if ((Object)(object)slot.opposingSlot.Card != (Object)null && !slot.opposingSlot.Card.Dead) { yield return BombCard(slot.opposingSlot.Card); } if (adjacentSlots.Count > 0 && (Object)(object)adjacentSlots[0].Card != (Object)null && !adjacentSlots[0].Card.Dead) { yield return BombCard(adjacentSlots[0].Card); } } private IEnumerator BombCard(PlayableCard target) { GameObject bomb = Object.Instantiate(bombPrefab); bomb.transform.position = ((Component)((SlotModificationBehaviour)this).Slot).transform.position + Vector3.up * 0.1f; Tween.Position(bomb.transform, ((Component)target).transform.position + Vector3.up * 0.1f, 0.5f, 0f, Tween.EaseLinear, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.5f); ((Card)target).Anim.PlayHitAnimation(); Object.Destroy((Object)(object)bomb); yield return target.TakeDamage(10, (PlayableCard)null); } } public class SlotMod_Overclock : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo(1, 0) { singletonId = "bitty_overclock", fromOverclock = true }; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { AudioController.Instance.PlaySound2D("teslacoil_overload", (MixerGroup)4, 1f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); yield return otherCard.TakeDamage(1, (PlayableCard)null); if (!otherCard.Dead) { yield return (object)new WaitForSeconds(0.3f); ((Card)otherCard).Anim.PlayTransformAnimation(); otherCard.AddTemporaryMod(mod); } } } public class SlotMod_Growth : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo { singletonId = "bitty_evolve", nonCopyable = true, abilities = new List { (Ability)5 } }; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { if (otherCard.HasAbility((Ability)61)) { yield return otherCard.TriggerHandler.OnTrigger((Trigger)0, new object[1] { true }); } else if (otherCard.HasAbility((Ability)5)) { yield return otherCard.TriggerHandler.OnTrigger((Trigger)0, new object[1] { CardExtensions.IsPlayerCard(otherCard) }); } else { otherCard.AddTemporaryMod(mod); otherCard.OnStatsChanged(); ((Card)otherCard).Anim.StrongNegationEffect(); } } } public class SlotMod_Grave : SlotModificationBehaviour { public static ModificationType SlotType; private int REVIVES; private CardModificationInfo mod = new CardModificationInfo { singletonId = "bitty_grave", nonCopyable = true }; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { CardModificationInfo val = card.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "bitty_grave"); return (Object)(object)card != (Object)null && (Object)(object)deathSlot == (Object)(object)((SlotModificationBehaviour)this).Slot && val == null; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { REVIVES++; if (REVIVES <= 5) { yield return Singleton.Instance.CreateCardInSlot(((Card)card).Info, deathSlot, 0.1f, true); yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)deathSlot.Card != (Object)null) { deathSlot.Card.AddTemporaryMod(mod); yield return deathSlot.Card.Die(false, (PlayableCard)null, true); } } } public override bool RespondsToTurnEnd(bool playerTurnEnd) { return true; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { REVIVES = 0; yield break; } } public class SlotMod_Breeze : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo { abilities = new List { (Ability)19 }, singletonId = "bitty_airborne", nonCopyable = true }; public override bool RespondsToUpkeep(bool playerUpkeep) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && !((Card)((SlotModificationBehaviour)this).Slot.Card).Info.HasTrait((Trait)12) && CardExtensions.IsPlayerCard(((SlotModificationBehaviour)this).Slot.Card) == playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { CardModificationInfo cardModificationInfo = ((SlotModificationBehaviour)this).Slot.Card.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "bitty_airborne"); if (cardModificationInfo != null) { Singleton.Instance.SwitchToView((View)4, false, true); ((SlotModificationBehaviour)this).Slot.Card.RemoveTemporaryMod(cardModificationInfo, true); ((SlotModificationBehaviour)this).Slot.Card.OnStatsChanged(); ((Card)((SlotModificationBehaviour)this).Slot.Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); } else if (!((SlotModificationBehaviour)this).Slot.Card.HasAbility((Ability)19)) { Singleton.Instance.SwitchToView((View)4, false, true); ((SlotModificationBehaviour)this).Slot.Card.AddTemporaryMod(mod); ((SlotModificationBehaviour)this).Slot.Card.OnStatsChanged(); ((Card)((SlotModificationBehaviour)this).Slot.Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); } } } public class SlotMod_Flood : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo { abilities = new List { (Ability)13 }, singletonId = "bitty_flood", nonCopyable = true }; public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) { return (Object)(object)otherCard == (Object)(object)((SlotModificationBehaviour)this).Slot.Card && !((Card)((SlotModificationBehaviour)this).Slot.Card).Info.HasTrait((Trait)12) && !((SlotModificationBehaviour)this).Slot.Card.HasAbility((Ability)19) && !((SlotModificationBehaviour)this).Slot.Card.HasAbility((Ability)13); } public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { CardModificationInfo cardModificationInfo = otherCard.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "bitty_raft"); if (cardModificationInfo != null) { otherCard.RemoveTemporaryMod(cardModificationInfo, true); } otherCard.AddTemporaryMod(mod); otherCard.OnStatsChanged(); ((Card)otherCard).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.1f); } } public class SlotMod_Hail : SlotModificationBehaviour { public static ModificationType SlotType; public override bool RespondsToUpkeep(bool playerUpkeep) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && !((Card)((SlotModificationBehaviour)this).Slot.Card).Info.HasTrait((Trait)12) && CardExtensions.IsPlayerCard(((SlotModificationBehaviour)this).Slot.Card) == playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { if (RunState.CurrentRegionTier >= 1 || ((SlotModificationBehaviour)this).Slot.Card.Health >= 1) { Singleton.Instance.SwitchToView((View)4, false, true); yield return (object)new WaitForSeconds(0.5f); yield return ((SlotModificationBehaviour)this).Slot.Card.TakeDamage(1, (PlayableCard)null); } if ((Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)null && RunState.CurrentRegionTier >= 2) { yield return Singleton.Instance.CreateCardInSlot(CardLoader.GetCardByName("bitty_IceCube"), ((SlotModificationBehaviour)this).Slot, 0.5f, false); } yield return (object)new WaitForSeconds(0.3f); } } public class SlotMod_Muddy : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo { abilities = new List { GiveCantAttack.ability }, RemoveOnUpkeep = true }; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { otherCard.AddTemporaryMod(mod); ((Card)otherCard).Anim.StrongNegationEffect(); yield break; } } public class SlotMod_Raft : SlotModificationBehaviour { public static ModificationType SlotType; private CardModificationInfo mod = new CardModificationInfo { negateAbilities = new List { (Ability)13, (Ability)89 }, singletonId = "bitty_raft", nonCopyable = true }; public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) { return (Object)(object)((SlotModificationBehaviour)this).Slot.Card != (Object)null && (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard; } public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { CardModificationInfo cardModificationInfo = otherCard.TemporaryMods.Find((CardModificationInfo x) => x.singletonId == "bitty_flood"); if (cardModificationInfo != null) { otherCard.RemoveTemporaryMod(cardModificationInfo, true); } otherCard.AddTemporaryMod(mod); if (((Card)otherCard).Anim.FaceDown) { ((Card)otherCard).Anim.SetFaceDown(false, false); } otherCard.OnStatsChanged(); ((Card)otherCard).Anim.StrongNegationEffect(); yield break; } } public static void Add_SlotMods() { Plugin.Log.LogInfo((object)"Start of slot mods"); Add_Slot_Raft(); Add_Slot_Hail(); Add_Slot_Flood(); Add_Slot_Breeze(); Add_Slot_Grave(); Add_Slot_Growth(); Add_Slot_Overclock(); Add_Slot_Dynamite(); Add_Slot_Obelisk(); Plugin.Log.LogInfo((object)"End of slot mods"); } public static void Add_Reliant_SlotMods() { Plugin.Log.LogInfo((object)"Start of reliant slot mods"); Add_Slot_Muddy(); Plugin.Log.LogInfo((object)"End of reliant slot mods"); } public static void Add_Slot_Raft() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_005d: Unknown result type (might be due to invalid IL or missing references) ModificationType val = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotRaft", typeof(SlotMod_Raft), Tools.LoadTexture("card_slot_raft.png")), "Raft Slot", "Prevents creatures on this slot from submerging into the water.", Tools.LoadTexture("rulebookitemicon_raft.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); RuleBookRedirectExtensions.SetAbilityRedirect(val, "submerging", (Ability)13, GameColors.Instance.blue); SlotMod_Raft.SlotType = val; } public static void Add_Slot_Muddy() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0057: 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_005d: 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) ModificationType slotType = RuleBookRedirectExtensions.SetAbilityRedirect(SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotMuddy", typeof(SlotMod_Muddy), Tools.LoadTexture("card_slot_mud.png")), "Muddy Slot", "When a creature is played on this slot, it cannot attack for one turn.", Tools.LoadTexture("rulebookitemicon_mud.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]), "cannot attack", GiveCantAttack.ability, GameColors.Instance.orange); SlotMod_Muddy.SlotType = slotType; } public static void Add_Slot_Hail() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ModificationType slotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotHail", typeof(SlotMod_Hail), Tools.LoadTexture("card_slot_hail.png")), "Hail Slot", "At the start of the owner's turn, a creature in this slot takes 1 damage.", Tools.LoadTexture("rulebookitemicon_hail.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); SlotMod_Hail.SlotType = slotType; } public static void Add_Slot_Flood() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) ModificationType slotType = RuleBookRedirectExtensions.SetAbilityRedirect(RuleBookRedirectExtensions.SetAbilityRedirect(SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotFlood", typeof(SlotMod_Flood), Tools.LoadTexture("card_slot_flood.png")), "Flooded Slot", "When a creature is played in this slot, it gets submerged in the water unless it is flying.", Tools.LoadTexture("rulebookitemicon_flood.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]), "flying", (Ability)19, GameColors.Instance.orange), "submerged", (Ability)13, GameColors.Instance.blue); SlotMod_Flood.SlotType = slotType; } public static void Add_Slot_Breeze() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0080: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) ModificationType slotType = RuleBookRedirectExtensions.SetAbilityRedirect(RuleBookRedirectExtensions.SetAbilityRedirect(RuleBookRedirectExtensions.SetAbilityRedirect(RuleBookRedirectExtensions.SetAbilityRedirect(SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotBreeze", typeof(SlotMod_Breeze), Tools.LoadTexture("card_slot_breeze.png")), "Windy Slot", "At the start of the owner's turn, a creature in this slot will alternate between flying and not flying. This effect is ignored if the creature naturally flies, submerges, or burrows.", Tools.LoadTexture("rulebookitemicon_breeze.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]), "flying", (Ability)19, GameColors.Instance.orange), "flies", (Ability)19, GameColors.Instance.orange), "submerges", (Ability)13, GameColors.Instance.blue), "burrows", (Ability)8, GameColors.Instance.gold); SlotMod_Breeze.SlotType = slotType; } public static void Add_Slot_Grave() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ModificationType slotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotGrave", typeof(SlotMod_Grave), Tools.LoadTexture("card_slot_grave.png")), "Grim Slot", "When a creature dies in this slot, it dies again.", Tools.LoadTexture("rulebookitemicon_grave.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); SlotMod_Grave.SlotType = slotType; } public static void Add_Slot_Growth() { //IL_001f: 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_0052: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) ModificationType slotType = RuleBookRedirectExtensions.SetAbilityRedirect(SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotGrowth", typeof(SlotMod_Growth), Tools.LoadTexture("card_slot_overgrowth.png")), "Growth Slot", "When a creature is played in this slot, instantly evolve it if it has an evolve related sigil. If it does not have Fledgling, it instead gains Fledgling.", Tools.LoadTexture("rulebookitemicon_overgrowth.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[2] { default(ModificationMetaCategory), (ModificationMetaCategory)2 }), "Fledgling", (Ability)5, GameColors.Instance.orange); SlotMod_Growth.SlotType = slotType; } public static void Add_Slot_Overclock() { //IL_001f: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) ModificationType slotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotOverclock", typeof(SlotMod_Overclock), Tools.LoadTexture("card_slot_overclock.png")), "Overclocking Slot", "When a creature is played in this slot, it takes 1 damage and gains 1 attack.", Tools.LoadTexture("rulebookitemicon_overclock.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[2] { (ModificationMetaCategory)2, default(ModificationMetaCategory) }); SlotMod_Overclock.SlotType = slotType; } public static void Add_Slot_Dynamite() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ModificationType slotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotDynamite", typeof(SlotMod_Dynamite), Tools.LoadTexture("card_slot_dynamite.png")), "Dynamite Slot", "When a creature is played in this slot, it takes 10 damage and explodes. The dynamite is removed.", Tools.LoadTexture("rulebookitemicon_dynamite.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); SlotMod_Dynamite.SlotType = slotType; } public static void Add_Slot_Obelisk() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_0053: 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_0059: 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) ModificationType slotType = RuleBookRedirectExtensions.SetStatIconRedirect(SlotModificationExtensions.SetRulebook(SlotModificationManager.New("bitty45.inscryption.challenges", "SlotObelisk", typeof(SlotMod_Obelisk), Tools.LoadTexture("card_slot_obelisk.png")), "Obelisk Tablet", "When a creature is played in this slot, it is sacrificed.", Tools.LoadTexture("rulebookitemicon_obelisk.png"), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]), "sacrificed", (SpecialStatIcon)7, GameColors.Instance.red); SlotMod_Obelisk.SlotType = slotType; } } public static class Tools { private static Assembly _assembly; public static Assembly CurrentAssembly => _assembly ?? (_assembly = Assembly.GetExecutingAssembly()); public static Texture2D LoadTexture(string name) { return TextureHelper.GetImageAsTexture(name + (name.EndsWith(".png") ? "" : ".png"), CurrentAssembly, (FilterMode)0); } public static Sprite LoadSprite(string name) { return TextureHelper.ConvertTexture(TextureHelper.GetImageAsTexture(name + (name.EndsWith(".png") ? "" : ".png"), CurrentAssembly, (FilterMode)0), (Vector2?)null); } } }