using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; 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 DiskCardGame; using GBC; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.CardCosts; using InscryptionAPI.Dialogue; using InscryptionAPI.Helpers; using InscryptionAPI.Helpers.Extensions; using InscryptionAPI.PixelCard; using InscryptionCommunityPatch.Card; using Microsoft.CodeAnalysis; using StressCost.Cost; using StressCost.Patches; using StressCost.Sigils; using StressCost.Sigils.VariableStats; 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("StressCost")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+fa36551e6e8408c01d1ea3700e86ee20204797d3")] [assembly: AssemblyProduct("StressCost")] [assembly: AssemblyTitle("StressCost")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace StressCost { [BepInPlugin("aga.costmania", "CostMania", "0.0.6.7")] public class CostmaniaPlugin : BaseUnityPlugin { public const string GUID = "aga.costmania"; public const string NAME = "CostMania"; private const string VERSION = "0.0.6.7"; public static string Directory; internal static ManualLogSource Log; private Harmony harmony = new Harmony("aga.costmania"); public static readonly string[] NEW_TEMPLES = new string[4] { "Alchemy", "Stress", "Space", "Valor" }; internal static ConfigEntry config3DAlchemy; internal static ConfigEntry config3DStress; internal static ConfigEntry config3DStardust; internal static ConfigEntry config3DValor; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Directory = ((BaseUnityPlugin)this).Info.Location.Replace("CostmaniaActivatedAbility.dll", ""); harmony.PatchAll(); AddCosts(); AddSigils(); harmony.PatchAll(typeof(CostmaniaPlugin)); harmony.PatchAll(typeof(AbilityPatches)); harmony.PatchAll(typeof(CollectionUIPatches)); harmony.PatchAll(typeof(CostGraphicPatches)); harmony.PatchAll(typeof(CostPatches)); harmony.PatchAll(typeof(PackPatches)); harmony.PatchAll(typeof(DialoguePatches)); harmony.PatchAll(typeof(SporePatches)); harmony.PatchAll(typeof(EncounterPatches)); PackPatches.SetupStarterDecks(); AbilityPatches.SetStackableAbilities(); CollectionUIPatches.InitRareRecals(); DialoguePatches.GenerateRebechaRant(); config3DAlchemy = ((BaseUnityPlugin)this).Config.Bind("Alchemy in 3D", "Active", false, "Would allow Alchemy in 3D Acts, very buggy"); config3DStress = ((BaseUnityPlugin)this).Config.Bind("Stress in 3D", "Active", false, "Would allow Stress in 3D Acts, very buggy"); config3DStardust = ((BaseUnityPlugin)this).Config.Bind("Stardust in 3D", "Active", false, "Would allow Stardust in 3D Acts, very buggy"); config3DValor = ((BaseUnityPlugin)this).Config.Bind("Valor in 3D", "Active", false, "Would allow Valor in 3D Acts, very buggy"); } private void Update() { CostPatches.Update(); CostGraphicPatches.Update(); PackPatches.Update(); } public static void AddCosts() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) FullCardCost val = CardCostManager.Register("aga.costmania", "StressCost", typeof(StressCost.Cost.StressCost), (Func)StressCost.Cost.StressCost.Texture_3D, (Func)StressCost.Cost.StressCost.Texture_Pixel); CardCostManager.SetCostTier(val, (Func)CostTier.CostTierS); val.ResourceType = (ResourceType)42; CardCostManager.SetCanBePlayedByTurn2WithHand(val, (Func, bool>)FairHandStress.CanBePlayed); FullCardCost val2 = CardCostManager.Register("aga.costmania", "ValorCost", typeof(ValorCost), (Func)ValorCost.Texture_3D, (Func)ValorCost.Texture_Pixel); CardCostManager.SetCostTier(val2, (Func)CostTier.CostTierV); val2.ResourceType = (ResourceType)42; CardCostManager.SetCanBePlayedByTurn2WithHand(val2, (Func, bool>)FairHandValor.CanBePlayed); FullCardCost val3 = CardCostManager.Register("aga.costmania", "FleshCost", typeof(FleshCost), (Func)FleshCost.Texture_3D, (Func)FleshCost.Texture_Pixel); CardCostManager.SetCostTier(val3, (Func)CostTier.CostTierA); val3.ResourceType = (ResourceType)42; CardCostManager.SetCanBePlayedByTurn2WithHand(val3, (Func, bool>)FairHandFlesh.CanBePlayed); FullCardCost val4 = CardCostManager.Register("aga.costmania", "MetalCost", typeof(MetalCost), (Func)MetalCost.Texture_3D, (Func)MetalCost.Texture_Pixel); CardCostManager.SetCostTier(val4, (Func)CostTier.CostTierA); val4.ResourceType = (ResourceType)42; CardCostManager.SetCanBePlayedByTurn2WithHand(val4, (Func, bool>)FairHandMetal.CanBePlayed); FullCardCost val5 = CardCostManager.Register("aga.costmania", "ElixirCost", typeof(ElixirCost), (Func)ElixirCost.Texture_3D, (Func)ElixirCost.Texture_Pixel); CardCostManager.SetCostTier(val5, (Func)CostTier.CostTierA); val5.ResourceType = (ResourceType)42; CardCostManager.SetCanBePlayedByTurn2WithHand(val5, (Func, bool>)FairHandElixir.CanBePlayed); FullCardCost val6 = CardCostManager.Register("aga.costmania", "StardustCost", typeof(StardustCost), (Func)StardustCost.Texture_3D, (Func)StardustCost.Texture_Pixel); CardCostManager.SetCostTier(val6, (Func)CostTier.CostTierF); val6.ResourceType = (ResourceType)42; CardCostManager.SetCanBePlayedByTurn2WithHand(val6, (Func, bool>)FairHandStardust.CanBePlayed); Appearance id = CardAppearanceBehaviourManager.Add("aga.costmania", "PixelSporeBg", typeof(SporeBackground)).Id; } public static void AddSigils() { AbilRelaxant.AddRelaxant(); AbilAffection.AddAffection(); AbilEnrage.AddEnrage(); AbilLiftoff.AddLiftoff(); AbilGemAbsorber.AddGemAbsorber(); AbilFrontliner.AddFrontliner(); AbilBloodGuzzler.AddBloodGuzzler(); AbilIronclad.AddIronclad(); AbilFearmonger.AddFearmonger(); AbilFirstStrike.AddFirstStrike(); AbilWatchman.AddWatchman(); AbilEldritchPower.AddEldritchPower(); AbilSigilEater.AddSigilEater(); AbilStarbringer.AddStrbringer(); AbilHealingAura.AddHealingAura(); AbilWarper.AddWarper(); AbilShatteringStardust.AddShatteringStardust(); AbilArmyBuilder.AddArmyBuilder(); AbilAfterimage.AddAfterimage(); AbilRentrance.AddRentrance(); AbilEndOfTheTunnel.AddEndOfTheTunnel(); AbilDriveby.AddDriveby(); AbilDataBanks.AddDataBanks(); AbilPigify.AddPigify(); AbilTransmutation.AddTransmutation(); AbilGloryKill.AddGloryKill(); AbilImpart.AddImpart(); AbilProductionLine.AddProductionLine(); AbilGestationTank.AddGestationTank(); VariablestatMightierPen.AddMightierPen(); VariablestatDeathToll.AddDeathToll(); } } } namespace StressCost.Sigils { public class AbilAffection : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerTurnEnd; public AbilAffection <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " preformed a seducive dance!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; if (StressCost.Cost.StressCost.stressCounter > 0) { StressCost.Cost.StressCost.stressCounter--; AudioController.Instance.PlaySound2D("plainBlip6", (MixerGroup)0, 0.6f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToTurnEnd(bool playerTurnEnd) { return playerTurnEnd == !((AbilityBehaviour)this).Card.OpponentCard; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnTurnEnd(bool playerTurnEnd) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, playerTurnEnd = playerTurnEnd }; } public static void AddAffection() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Affection", "At the end of every turn, [creature] lowers the Stress Counter by 1.", typeof(AbilAffection), "3d_affection.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_affection.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 1); ability = val.ability; } } public class AbilAfterimage : AbilityBehaviour { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CardSlot destination; public bool isLeft; public AbilAfterimage <>4__this; private CardSlot 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).RenderInfo.flippedPortrait = isLeft && ((Card)((AbilityBehaviour)<>4__this).Card).Info.flipPortraitForStrafe; ((Card)((AbilityBehaviour)<>4__this).Card).RenderCard(); 5__1 = ((AbilityBehaviour)<>4__this).Card.Slot; <>2__current = Singleton.Instance.AssignCardToSlot(((AbilityBehaviour)<>4__this).Card, destination, 0.1f, (Action)null, true); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CardSlot slot; public PlayableCard attacker; public AbilAfterimage <>4__this; private CardSlot 5__1; private CardSlot 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.doDodge = false; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " responds with a vicious counter attack!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.PlayAttackAnimation(attacker.OpponentCard, attacker.Slot); <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = attacker.TakeDamage(1, ((AbilityBehaviour)<>4__this).Card); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 5; return true; case 5: <>1__state = -1; 5__1 = Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, false); 5__2 = Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, true); if ((Object)(object)5__1 != (Object)null && (Object)(object)5__1.Card == (Object)null) { <>2__current = <>4__this.DoMovement(5__1, isLeft: false); <>1__state = 6; return true; } if ((Object)(object)5__2 != (Object)null && (Object)(object)5__2.Card == (Object)null) { <>2__current = <>4__this.DoMovement(5__2, isLeft: true); <>1__state = 7; return true; } goto IL_026a; case 6: <>1__state = -1; goto IL_026a; case 7: <>1__state = -1; goto IL_026a; case 8: { <>1__state = -1; return false; } IL_026a: <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.1f); <>1__state = 8; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerUpkeep; public AbilAfterimage <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (<>4__this.doDodge = true); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = <>4__this.<>n__0(playerUpkeep); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private bool doDodge = true; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep == !((AbilityBehaviour)this).Card.OpponentCard; } public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { return ((object)slot).Equals((object?)((AbilityBehaviour)this).Card.Slot) && doDodge && ((Object)(object)Singleton.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true).Card == (Object)null || (Object)(object)Singleton.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false).Card == (Object)null); } [IteratorStateMachine(typeof(d__6))] public override IEnumerator OnUpkeep(bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this, playerUpkeep = playerUpkeep }; } [IteratorStateMachine(typeof(d__7))] public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, slot = slot, attacker = attacker }; } [IteratorStateMachine(typeof(d__8))] private IEnumerator DoMovement(CardSlot destination, bool isLeft) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this, destination = destination, isLeft = isLeft }; } public static void AddAfterimage() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Afterimage", "Once per round, [creature] may dodge an incoming attack, dealing 1 damage to the attacker.", typeof(AbilAfterimage), "3d_afterimage.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_afterimage.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } [CompilerGenerated] [DebuggerHidden] private IEnumerator <>n__0(bool playerUpkeep) { return ((TriggerReceiver)this).OnUpkeep(playerUpkeep); } } public class AbilArmyBuilder : AbilityBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass4_0 { public string modPrefix; internal bool b__1(string newTemple) { return modPrefix.Contains(newTemple); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilArmyBuilder <>4__this; private CardSlot[] 5__1; private <>c__DisplayClass4_0 <>8__2; private string 5__3; private CardTemple <>s__4; private CardSlot[] <>s__5; private int <>s__6; private CardSlot 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>8__2 = null; 5__3 = null; <>s__5 = null; 5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Expected I4, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = (CardSlot[])(object)new CardSlot[2] { Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, true), Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, false) }; if (5__1.Where((CardSlot slot) => (Object)(object)slot.Card == (Object)null).Count() > 0) { <>8__2 = new <>c__DisplayClass4_0(); <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " called upon the strength of it's soliders!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; } ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); goto IL_0423; case 2: <>1__state = -1; 5__3 = "Squirrel"; <>8__2.modPrefix = CardExtensions.GetModPrefix(((Card)((AbilityBehaviour)<>4__this).Card).Info); if (CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)<>4__this).Card).Info, "TroopName") != null) { 5__3 = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)<>4__this).Card).Info, "TroopName"); } else if (<>8__2.modPrefix == null || !CostmaniaPlugin.NEW_TEMPLES.Any((string newTemple) => <>8__2.modPrefix.Contains(newTemple))) { CardTemple temple = ((Card)((AbilityBehaviour)<>4__this).Card).Info.temple; <>s__4 = temple; CardTemple val = <>s__4; switch ((int)val) { case 0: 5__3 = "Bee"; break; case 1: 5__3 = "Zombie"; break; case 2: 5__3 = "Automaton"; break; case 3: 5__3 = "FlyingMage"; break; } } else if (<>8__2.modPrefix.Contains("Alchemy")) { 5__3 = "Alchemy_Homonculus"; } else if (<>8__2.modPrefix.Contains("Stress")) { 5__3 = "Stress_Micro"; } else if (<>8__2.modPrefix.Contains("Space")) { 5__3 = "Space_ShootingStar"; } else if (<>8__2.modPrefix.Contains("Valor")) { 5__3 = "Valor_InfantryKnight"; } <>s__5 = 5__1; <>s__6 = 0; goto IL_03e2; case 3: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 4; return true; case 4: <>1__state = -1; goto IL_03cc; case 5: { <>1__state = -1; return false; } IL_03cc: 5__7 = null; <>s__6++; goto IL_03e2; IL_0423: <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 5; return true; IL_03e2: if (<>s__6 < <>s__5.Length) { 5__7 = <>s__5[<>s__6]; if ((Object)(object)5__7.Card == (Object)null) { ((Card)((AbilityBehaviour)<>4__this).Card).Anim.PlayAttackAnimation(false, 5__7); <>2__current = CardSlotExtensions.CreateCardInSlot(5__7, CardLoader.GetCardByName(5__3), 0.1f, true); <>1__state = 3; return true; } goto IL_03cc; } <>s__5 = null; <>8__2 = null; 5__3 = null; goto IL_0423; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnResolveOnBoard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } public static void AddArmyBuilder() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Army Builder", "When [creature] is played, it's troops are placed to it's left and right.", typeof(AbilArmyBuilder), "3d_armybuilder.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_armybuilder.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 5); ability = val.ability; } } public class AbilBloodGuzzler : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int amount; public PlayableCard target; public AbilBloodGuzzler <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " slakes on the blood of " + ((Card)target).Info.DisplayedNameEnglish, (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 3; return true; case 3: <>1__state = -1; ((AbilityBehaviour)<>4__this).Card.AddTemporaryMod(new CardModificationInfo(0, amount)); ((AbilityBehaviour)<>4__this).Card.OnStatsChanged(); ((Card)((AbilityBehaviour)<>4__this).Card).RenderCard(); <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.25f); <>1__state = 5; return true; case 5: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToDealDamage(int amount, PlayableCard target) { return CardExtensions.NotDead(((AbilityBehaviour)this).Card) && amount > 0; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnDealDamage(int amount, PlayableCard target) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, amount = amount, target = target }; } public static void AddBloodGuzzler() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Blood Guzzler", "When [creature] deals damage, it gains 1 Health for each damage dealt.", typeof(AbilBloodGuzzler), "3d_bloodguzzler.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_bloodguzzler.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } [HarmonyPatch] public abstract class CostmaniaActivatedAbility : ActivatedAbilityBehaviour { [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CostmaniaActivatedAbility <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = true; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public virtual int StressCost => 0; public virtual int ValorCost => 0; public virtual int ValorRankCost => 0; public virtual int StardustCost => 0; public virtual int FleshCost => 0; public virtual int MetalCost => 0; public virtual int ElixirCost => 0; public override bool CanActivate() { return ((ActivatedAbilityBehaviour)this).CanActivate() && global::StressCost.Cost.ValorCost.MaxRank >= ValorCost && ((AbilityBehaviour)this).Card.ValorRank() >= ValorRankCost && global::StressCost.Cost.StardustCost.stardustCounter >= StardustCost && AlchemyCounter.fleshCount >= FleshCost && AlchemyCounter.metalCount >= MetalCost && AlchemyCounter.elixirCount >= ElixirCost; } [IteratorStateMachine(typeof(d__15))] public override IEnumerator Activate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this }; } } public class AbilDataBanks : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public static void AddDataBanks() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Data Banks", "While [creature] is on the board, it's owner loses 2 Stardust instead of all of them at the start of their turn.", typeof(AbilDataBanks), "3d_databanks.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_databanks.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } public class AbilDriveby : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public static void AddDriveby() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Driveby", "[creature] deals 1 damage to the creature opposing it when moving.", typeof(AbilDriveby), "3d_driveby.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_driveby.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 1); ability = val.ability; } } public class AbilEldritchPower : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerUpkeep; public AbilEldritchPower <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + "'s eldritch presence beckons towards you.", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; try { AlchemyCounter.AddDies(); } catch { } <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 5; return true; case 5: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep == !((AbilityBehaviour)this).Card.OpponentCard; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnUpkeep(bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, playerUpkeep = playerUpkeep }; } public static void AddEldritchPower() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Eldritch Power", "At the beginning of each turn, [creature] provides it's owner with 1 Alchemy Die.", typeof(AbilEldritchPower), "3d_eldritchpower.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_eldritchpower.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilEndOfTheTunnel : AbilityBehaviour { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerUpkeep; public AbilEndOfTheTunnel <>4__this; private IEnumerator <>s__1; private CardSlot 5__2; private CardSlot 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if ((uint)(num - -4) <= 1u || (uint)(num - 4) <= 1u) { try { if (num == -4 || (uint)(num - 4) <= 1u) { try { } finally { <>m__Finally2(); } } } finally { <>m__Finally1(); } } <>s__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput("The merciless forces of gravity push further", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 3; return true; case 3: <>1__state = -1; <>1__state = -3; <>s__1 = (from slot in Singleton.Instance.allSlots where (Object)(object)slot.Card != (Object)null && slot.Card.OpponentCard != ((AbilityBehaviour)<>4__this).Card.OpponentCard orderby Math.Abs(slot.Index - ((AbilityBehaviour)<>4__this).Card.Slot.Index) select slot).GetEnumerator(); <>1__state = -4; goto IL_0267; case 4: <>1__state = -4; goto IL_0258; case 5: <>1__state = -4; goto IL_0258; case 6: { <>1__state = -1; return false; } IL_0258: 5__3 = null; 5__2 = null; goto IL_0267; IL_0267: if (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; Console.WriteLine((Object)(object)5__2 == (Object)null); if (5__2.Index > ((AbilityBehaviour)<>4__this).Card.Slot.Index) { 5__3 = Singleton.Instance.GetAdjacent(5__2, true); } else { 5__3 = Singleton.Instance.GetAdjacent(5__2, false); } if ((Object)(object)5__3 != (Object)null) { <>2__current = Singleton.Instance.AssignCardToSlot(5__2.Card, 5__3, 0.1f, (Action)null, true); <>1__state = 4; return true; } <>2__current = 5__2.Card.Die(false, ((AbilityBehaviour)<>4__this).Card, true); <>1__state = 5; return true; } <>m__Finally2(); <>s__1 = null; <>m__Finally1(); <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 6; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; } private void <>m__Finally2() { <>1__state = -3; if (<>s__1 != null) { <>s__1.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public static bool dramaqueenTextPlayed; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep == !((AbilityBehaviour)this).Card.OpponentCard; } [IteratorStateMachine(typeof(d__5))] public override IEnumerator OnUpkeep(bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this, playerUpkeep = playerUpkeep }; } public static void AddEndOfTheTunnel() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "End Of The Tunnel", "After ringing the bell, all opposing creatures move one space towerds [creature], perishing should they be within their grasp.", typeof(AbilEndOfTheTunnel), "3d_endoftheline.png"); AbilityExtensions.SetPowerlevel(val, 5); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_endoftheline.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); ability = val.ability; } } public class AbilEnrage : CostmaniaActivatedAbility { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilEnrage <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + "'s rage crept further", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; case 1: <>1__state = -1; ((AbilityBehaviour)<>4__this).Card.temporaryMods.Add(new CardModificationInfo(1, 1)); ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0f); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override int StressCost => 2; [IteratorStateMachine(typeof(d__5))] public override IEnumerator Activate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this }; } public static void AddEnrage() { //IL_0060: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Enrage", "Pay 2 stress for [creature] to gain 1 Power and Health.", typeof(AbilEnrage), "3d_enrage.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_enrage.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetActivated(val, true); AbilityExtensions.SetPowerlevel(val, 3); ability = val.ability; } } public class AbilFearmonger : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public static void AddFearmonger() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Fearmonger", "[creature] strikes the opposing card every time the Stress Counter goes up.", typeof(AbilFearmonger), "3d_fearmonger.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_fearmonger.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilFirstStrike : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilFirstStrike <>4__this; private CardSlot 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_00d5: 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_0256: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; if (!((AbilityBehaviour)<>4__this).Card.Dead) { <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " took a free shot!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; } goto IL_026e; case 2: <>1__state = -1; 5__1 = ((AbilityBehaviour)<>4__this).Card.Slot.opposingSlot; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.PlayAttackAnimation(false, 5__1); <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 3; return true; case 3: <>1__state = -1; if ((Object)(object)5__1.Card != (Object)null && !((Card)5__1.Card).FaceDown) { <>2__current = 5__1.Card.TakeDamage(((AbilityBehaviour)<>4__this).Card.Attack, ((AbilityBehaviour)<>4__this).Card); <>1__state = 4; return true; } <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 5; return true; case 4: <>1__state = -1; goto IL_0246; case 5: <>1__state = -1; <>2__current = Singleton.Instance.ShowDamageSequence(((AbilityBehaviour)<>4__this).Card.Attack, ((AbilityBehaviour)<>4__this).Card.Attack, ((AbilityBehaviour)<>4__this).Card.OpponentCard, 0.3f, (GameObject)null, 0.15f, true); <>1__state = 6; return true; case 6: <>1__state = -1; goto IL_0246; case 7: <>1__state = -1; 5__1 = null; goto IL_026e; case 8: { <>1__state = -1; return false; } IL_0246: <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 7; return true; IL_026e: <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 8; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnResolveOnBoard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } public static void AddFirstStrike() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "First Strike", "[creature] attacks the moment it is placed.", typeof(AbilFirstStrike), "3d_firststrike.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_firststrike.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } public class AbilFrontliner : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerTurnEnd; public AbilFrontliner <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_00ab: 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_00f8: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + "'s bravery amplified it's morale", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; ((AbilityBehaviour)<>4__this).Card.AddValorRank(); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToTurnEnd(bool playerTurnEnd) { return playerTurnEnd; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnTurnEnd(bool playerTurnEnd) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, playerTurnEnd = playerTurnEnd }; } public static void AddFrontliner() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Frontliner", "At the end of every turn, [creature]'s Valor Rank increases by 1.", typeof(AbilFrontliner), "3d_frontliner.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_frontliner.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } public class AbilGemAbsorber : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilGemAbsorber <>4__this; private List 5__1; private List.Enumerator <>s__2; private CardSlot 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 3) <= 3u) { try { } finally { <>m__Finally1(); } } 5__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Expected O, but got Unknown //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Expected O, but got Unknown //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = new List(); if (((AbilityBehaviour)<>4__this).Card.OpponentCard) { 5__1 = Singleton.Instance.opponentSlots; } else { 5__1 = Singleton.Instance.playerSlots; } 5__1 = 5__1.FindAll((CardSlot slot) => (Object)(object)slot.Card != (Object)null && ((Card)slot.Card).Info.HasTrait((Trait)17)); Console.WriteLine(5__1.Count); if (5__1.Count > 0) { <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; } ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = false; <>1__state = 9; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " absorbs the mana of the crystals!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>s__2 = 5__1.GetEnumerator(); <>1__state = -3; goto IL_02f2; case 3: <>1__state = -3; 5__3.Card.AddTemporaryMod(new CardModificationInfo(0, -999)); <>2__current = 5__3.Card.Die(false, ((AbilityBehaviour)<>4__this).Card, true); <>1__state = 4; return true; case 4: <>1__state = -3; <>2__current = (object)new WaitForSeconds(0.015f); <>1__state = 5; return true; case 5: <>1__state = -3; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); ((AbilityBehaviour)<>4__this).Card.AddTemporaryMod(new CardModificationInfo(1, 1)); <>2__current = (object)new WaitForSeconds(0.165f); <>1__state = 6; return true; case 6: <>1__state = -3; 5__3 = null; goto IL_02f2; case 7: <>1__state = -1; <>2__current = true; <>1__state = 8; return true; case 8: <>1__state = -1; break; case 9: { <>1__state = -1; break; } IL_02f2: if (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.PlayAttackAnimation(5__3.Card.OpponentCard, 5__3); <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 3; return true; } <>m__Finally1(); <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 7; return true; } return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnResolveOnBoard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } public static void AddGemAbsorber() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Gem Absorber", "When [creature] is placed on the board. All Mox cards you control perish, each granting it +1 Power and Health.", typeof(AbilGemAbsorber), "3d_gemabsorber.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_gemabsorber.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilGestationTank : AbilityBehaviour { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool wasSacrifice; public PlayableCard killer; public AbilGestationTank <>4__this; private string 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " releases the monster inside!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; case 1: <>1__state = -1; if (<>4__this.curIceCube != null) { <>2__current = CardSlotExtensions.CreateCardInSlot(((AbilityBehaviour)<>4__this).Card.Slot, CardLoader.GetCardByName(<>4__this.curIceCube), 0.1f, true); <>1__state = 2; return true; } 5__1 = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)<>4__this).Card).Info, "GestationTankName1"); if (5__1 != null) { <>2__current = CardSlotExtensions.CreateCardInSlot(((AbilityBehaviour)<>4__this).Card.Slot, CardLoader.GetCardByName(5__1), 0.1f, true); <>1__state = 3; return true; } <>2__current = CardSlotExtensions.CreateCardInSlot(((AbilityBehaviour)<>4__this).Card.Slot, CardLoader.GetCardByName("Alchemy_Spite"), 0.1f, true); <>1__state = 4; return true; case 2: <>1__state = -1; break; case 3: <>1__state = -1; goto IL_01ab; case 4: { <>1__state = -1; goto IL_01ab; } IL_01ab: 5__1 = null; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private int turnsPassed = 1; private string curIceCube = null; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep; } public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return !wasSacrifice; } public override IEnumerator OnUpkeep(bool playerUpkeep) { turnsPassed++; string extendedProperty = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, $"GestationTankName{turnsPassed}"); if (extendedProperty != null) { curIceCube = extendedProperty; } ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); return ((TriggerReceiver)this).OnUpkeep(playerUpkeep); } [IteratorStateMachine(typeof(d__8))] public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this, wasSacrifice = wasSacrifice, killer = killer }; } public static void AddGestationTank() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Gestation Tank", "When [creature] perishes, it's ever growing spawn is released in it's place.", typeof(AbilGestationTank), "3d_gestationtank.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_gestationtank.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } public class AbilGloryKill : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayableCard card; public CardSlot deathSlot; public bool fromCombat; public PlayableCard killer; public AbilGloryKill <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0096: 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_00d1: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + "'s vigor rises with gusto!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; ((AbilityBehaviour)<>4__this).Card.AddValorRank(); ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } 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; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, card = card, deathSlot = deathSlot, fromCombat = fromCombat, killer = killer }; } public static void AddGloryKill() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Glory Kill", "When [creature] strikes an opposing creature and it perishes, this card's Valor Rank goes up by 1.", typeof(AbilGloryKill), "3d_glorykill.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_glorykill.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilHealingAura : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerTurnEnd; public AbilHealingAura <>4__this; private List 5__1; private PlayableCard 5__2; private PlayableCard 5__3; private List.Enumerator <>s__4; private PlayableCard 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_01ee: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); 5__1 = new List(); 5__2 = null; 5__3 = null; try { 5__2 = Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, true).Card; } catch { Console.WriteLine("Left failed"); } try { 5__3 = Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, false).Card; } catch { Console.WriteLine("Right failed"); } if ((Object)(object)5__2 != (Object)null) { 5__1.Add(5__2); } if ((Object)(object)5__3 != (Object)null) { 5__1.Add(5__3); } <>s__4 = 5__1.GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; if (5__5.Health < 5__5.MaxHealth + 1) { 5__5.HealDamage(1); } 5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " tended to the wounds of it's allies.", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToTurnEnd(bool playerTurnEnd) { return playerTurnEnd == !((AbilityBehaviour)this).Card.OpponentCard; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnTurnEnd(bool playerTurnEnd) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, playerTurnEnd = playerTurnEnd }; } public static void AddHealingAura() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Healing Aura", "At the end of it's owner's turn, [creature] heals it's 2 adjascent allies by 1 Health. [creature] can only heal up to 1 plus a creature's Maximum Health.", typeof(AbilHealingAura), "3d_healingaura.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_healingaura.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilImpart : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayableCard card; public CardSlot deathSlot; public bool fromCombat; public PlayableCard killer; public AbilImpart <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0096: 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_00d1: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " shares his wishom.", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; try { Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, true).Card.AddValorRank(((AbilityBehaviour)<>4__this).Card.ValorRank()); } catch { } try { Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, false).Card.AddValorRank(((AbilityBehaviour)<>4__this).Card.ValorRank()); } catch { } <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, card = card, deathSlot = deathSlot, fromCombat = fromCombat, killer = killer }; } public static void AddImpart() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Impart", "When [creature] perishes, it adds it's Valor Rank to it's adjacent allies.", typeof(AbilImpart), "3d_impart.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_impart.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 3); ability = val.ability; } } public class AbilIronclad : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public static void AddIronclad() { //IL_0061: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Ironclad", "Any damage [creature] takes is reduced by 1.", typeof(AbilIronclad), "3d_ironclad.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_ironclad.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); AbilityExtensions.SetCanStack(val, true, false); ability = val.ability; } } public class AbilLiftoff : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilLiftoff <>4__this; private List 5__1; private PlayableCard 5__2; private PlayableCard 5__3; private List.Enumerator <>s__4; private PlayableCard 5__5; private CardModificationInfo 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; 5__5 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_0239: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.PlayJumpAnimation(); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; 5__1 = new List(); 5__2 = null; 5__3 = null; try { 5__2 = Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, true).Card; } catch { Console.WriteLine("Left failed"); } try { 5__3 = Singleton.Instance.GetAdjacent(((AbilityBehaviour)<>4__this).Card.Slot, false).Card; } catch { Console.WriteLine("Right failed"); } if ((Object)(object)5__2 != (Object)null) { 5__1.Add(5__2); } if ((Object)(object)5__3 != (Object)null) { 5__1.Add(5__3); } <>s__4 = 5__1.GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; 5__6 = new CardModificationInfo((Ability)19); 5__6.singletonId = "Liftoff_buff"; 5__5.Status.hiddenAbilities.Add((Ability)19); 5__5.AddTemporaryMod(5__6); 5__6 = null; 5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " granted their friends the power of flight!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnResolveOnBoard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } public static void AddLiftoff() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Liftoff", "[creature] lifts adjascent allies to the air making them go Airborne.", typeof(AbilLiftoff), "3d_liftoff.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_liftoff.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 1); ability = val.ability; } } public class AbilPigify : CostmaniaActivatedAbility { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilPigify <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Expected O, but got Unknown //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Expected O, but got Unknown //IL_02c1: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; Singleton.Instance.Controller.SwitchToControlMode(Singleton.Instance.ChoosingSlotViewMode, false); Singleton.Instance.Controller.LockState = (ViewLockState)1; <>4__this.available = Singleton.Instance.AllSlots.Where((CardSlot slot) => (Object)(object)slot.Card != (Object)null && !((Card)slot.Card).Info.HasTrait((Trait)12) && !((object)slot).Equals((object?)((AbilityBehaviour)<>4__this).Card.Slot)).ToList(); <>2__current = Singleton.Instance.ChooseTarget(Singleton.Instance.AllSlots, <>4__this.available, (Action)<>4__this.ChosenTarget, (Action)<>4__this.ChooseFail, (Action)<>4__this.CursorEnteredSlot, (Func)(() => (Object)(object)<>4__this.selected == (Object)(object)((AbilityBehaviour)<>4__this).Card.slot), (CursorType)16); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)<>4__this.selected.Card).Info.displayedName + " underwent Pigification!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 3; return true; case 3: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).Anim.PlayAttackAnimation(false, <>4__this.selected); if ((Object)(object)<>4__this.selected != (Object)null) { <>2__current = <>4__this.selected.Card.Die(false, (PlayableCard)null, true); <>1__state = 4; return true; } goto IL_02a1; case 4: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = CardSlotExtensions.CreateCardInSlot(<>4__this.selected, CardLoader.GetCardByName("Valor_Pig"), 0.1f, true); <>1__state = 6; return true; case 6: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.375f); <>1__state = 7; return true; case 7: <>1__state = -1; goto IL_02a1; case 8: { <>1__state = -1; return false; } IL_02a1: Singleton.Instance.Controller.LockState = (ViewLockState)0; Singleton.Instance.Controller.SwitchToControlMode(Singleton.Instance.DefaultViewMode, false); <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0f); <>1__state = 8; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private List available = new List(); private CardSlot selected; public override Ability Ability => ability; public override int ValorRankCost => 2; public override bool CanActivate() { Debug.Log((object)Singleton.Instance.AllSlots.Where((CardSlot slot) => (Object)(object)slot.Card != (Object)null && !((Card)slot.Card).Info.HasTrait((Trait)12) && !((object)slot).Equals((object?)((AbilityBehaviour)this).Card.Slot)).ToList().Count); return Singleton.Instance.AllSlots.Any((CardSlot slot) => (Object)(object)slot.Card != (Object)null && !((Card)slot.Card).Info.HasTrait((Trait)12) && !((object)slot).Equals((object?)((AbilityBehaviour)this).Card.Slot)) && base.CanActivate(); } [IteratorStateMachine(typeof(d__8))] public override IEnumerator Activate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } private void ChosenTarget(CardSlot slot) { if (!((object)slot).Equals((object?)((AbilityBehaviour)this).Card.slot)) { selected = slot; } } private void ChooseFail(CardSlot slot) { AudioController.Instance.PlaySound2D("toneless_negate", (MixerGroup)0, 0.65f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } private void CursorEnteredSlot(CardSlot slot) { if ((Object)(object)slot.Card != (Object)null) { ((Card)slot.Card).Anim.StrongNegationEffect(); } } public static void AddPigify() { //IL_0060: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Pigify", "Expend 2 Valor Rank from [creature] to turn a chosen sacrificable creature into a Pig. A Pig is defined as: 0, 2, Sprinter", typeof(AbilPigify), "3d_pigify.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_pigify.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetActivated(val, true); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } public class AbilProductionLine : Strafe { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CardSlot destination; public bool isLeft; public AbilProductionLine <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ((Card)((AbilityBehaviour)<>4__this).Card).RenderInfo.flippedPortrait = isLeft; ((Card)((AbilityBehaviour)<>4__this).Card).RenderCard(); <>2__current = Singleton.Instance.AssignCardToSlot(((AbilityBehaviour)<>4__this).Card, destination, 0.1f, (Action)null, true); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CardSlot oldSlot; public AbilProductionLine <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + "'s pipeline triggers", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = CardSlotExtensions.CreateCardInSlot(oldSlot, CardLoader.GetCardByName(<>4__this.cards[Random.Range(0, <>4__this.cards.Length)]), 0.1f, true); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private string[] cards = new string[10] { "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_GreaterHomonculus" }; public override Ability Ability => ability; [IteratorStateMachine(typeof(d__4))] public override IEnumerator PostSuccessfulMoveSequence(CardSlot oldSlot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, oldSlot = oldSlot }; } [IteratorStateMachine(typeof(d__5))] private IEnumerator DoMovement(CardSlot destination, bool isLeft) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this, destination = destination, isLeft = isLeft }; } public static void AddProductionLine() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Production Line", "At the end of the turn, [creature] will move in the direction inscrybed in the sigil, and will drop a Homonculus in it's place.", typeof(AbilProductionLine), "3d_productionline.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_productionline.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 5); ability = val.ability; } } public class AbilRelaxant : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilRelaxant <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; Singleton.Instance.SwitchToView((View)1, false, false); ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); if (StressCost.Cost.StressCost.stressCounter > 0) { StressCost.Cost.StressCost.stressCounter--; AudioController.Instance.PlaySound2D("plainBlip6", (MixerGroup)0, 0.6f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnResolveOnBoard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } public static void AddRelaxant() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Relaxant", "[creature] lowers the Stress Counter by 1 when placed.", typeof(AbilRelaxant), "3d_relaxant.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_relaxant.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 1); ability = val.ability; } } public class AbilRentrance : ActivatedAbilityBehaviour { [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilRentrance <>4__this; private BoardManager 5__1; private List 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 3) { try { } finally { <>m__Finally1(); } } 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; Singleton.Instance.Controller.LockState = (ViewLockState)1; 5__1 = Singleton.Instance; 5__2 = 5__1.AllSlots.FindAll((CardSlot slot) => !((object)slot).Equals((object?)((AbilityBehaviour)<>4__this).Card.Slot) && (Object)(object)slot.Card != (Object)null); <>2__current = 5__1.ChooseTarget(5__2, 5__2, (Action)<>4__this.EntranceSuccess, (Action)<>4__this.EntranceFailed, (Action)<>4__this.CursorEnteredSlot, (Func)(() => false), (CursorType)16); <>1__state = 2; return true; case 2: <>1__state = -1; <>1__state = -3; <>2__current = <>4__this.TimeTravel(<>4__this.selected); <>1__state = 3; return true; case 3: <>1__state = -3; <>m__Finally1(); Singleton.Instance.Controller.LockState = (ViewLockState)0; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CardSlot slot; public AbilRentrance <>4__this; private string 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = ((Object)((Card)slot.Card).Info).name; <>2__current = slot.Card.Die(false, (PlayableCard)null, true); <>1__state = 1; return true; case 1: <>1__state = -1; Singleton.Instance.ShowUntilInput(((Card)slot.Card).Info.displayedName + " underwent Time Travel!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>2__current = CardSlotExtensions.CreateCardInSlot(slot, CardLoader.GetCardByName(5__1), 0.1f, true); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = true; <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private CardSlot selected; public override Ability Ability => ability; public override int EnergyCost => 4; [IteratorStateMachine(typeof(d__6))] public override IEnumerator Activate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this }; } private void EntranceSuccess(CardSlot slot) { selected = slot; } private void EntranceFailed(CardSlot slot) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); AudioController.Instance.PlaySound2D("toneless_negate", (MixerGroup)0, 0.65f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } private void CursorEnteredSlot(CardSlot slot) { } [IteratorStateMachine(typeof(d__10))] private IEnumerator TimeTravel(CardSlot slot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this, slot = slot }; } public static void AddRentrance() { //IL_0060: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Rentrance", "Pay 4 Energy then choose a creature on the board. It will perish and be replayed.", typeof(AbilRentrance), "3d_rentrance.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_rentrance.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetActivated(val, true); AbilityExtensions.SetPowerlevel(val, 4); ability = val.ability; } } public class AbilShatteringStardust : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilShatteringStardust <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; StardustCost.stardustCounter -= 2; if (StardustCost.stardustCounter < 0) { StardustCost.stardustCounter = 0; } <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToResolveOnBoard() { return true; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnResolveOnBoard() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } public static void AddShatteringStardust() { //IL_0059: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Shattering Stardust", "The owner of [creature] loses 2 Stardust when playing it instead of gaining 1.", typeof(AbilShatteringStardust), "3d_shatteringstardust.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_shatteringstardust.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, -2); ability = val.ability; } } public class AbilSigilEater : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayableCard card; public CardSlot deathSlot; public bool fromCombat; public PlayableCard killer; public AbilSigilEater <>4__this; private CardModificationInfo 5__1; private List 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " absorbs the powers of " + ((Card)deathSlot.Card).Info.displayedName + ".", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; 5__1 = new CardModificationInfo(); 5__2 = ((Card)deathSlot.Card).Info.Abilities; 5__2.AddRange(CardExtensions.GetAbilitiesFromAllMods(deathSlot.Card)); 5__1.abilities.AddRange(5__2); if (5__1.abilities.Count > 0 && 5__1.abilities.Contains(ability)) { 5__1.abilities.Remove(ability); } 5__1.singletonId = "SigilEater_absorbed"; ((AbilityBehaviour)<>4__this).Card.AddTemporaryMod(5__1); ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } 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; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, card = card, deathSlot = deathSlot, fromCombat = fromCombat, killer = killer }; } public static void AddSigilEater() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Sigil Eater", "When [creature] strikes an opposing creature and it perishes, replace all sigils except this one with those of the slain.", typeof(AbilSigilEater), "3d_sigileater.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_sigileater.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilStarbringer : AbilityBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerUpkeep; public AbilStarbringer <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; StardustCost.stardustCounter += 2; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = true; <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; public override Ability Ability => ability; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep; } [IteratorStateMachine(typeof(d__4))] public override IEnumerator OnUpkeep(bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, playerUpkeep = playerUpkeep }; } public static void AddStrbringer() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Starbringer", "While [creature] is on the board, it's owner starts every turn with 2 extra Stardust.", typeof(AbilStarbringer), "3d_starbringer.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_starbringer.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } } public class AbilTransmutation : ActivatedAbilityBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilTransmutation <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = AlchemyCounter.WaitUntilClick(<>4__this.Reroll()); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 3; return true; case 3: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerUpkeep; public AbilTransmutation <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (<>4__this.writeText = true); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = <>4__this.<>n__0(playerUpkeep); <>1__state = 2; return true; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilTransmutation <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (<>4__this.writeText) { <>2__current = Singleton.Instance.ShowUntilInput("TRANSMUTATION!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, true, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; } goto IL_0083; case 1: <>1__state = -1; goto IL_0083; case 2: { <>1__state = -1; return false; } IL_0083: ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); AlchemyCounter.RollDies(AlchemyCounter.lastClicked); <>2__current = (<>4__this.writeText = false); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private bool writeText = true; public override Ability Ability => ability; public override int EnergyCost => 2; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep; } [IteratorStateMachine(typeof(d__7))] public override IEnumerator Activate() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__8))] public IEnumerator Reroll() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__9))] public override IEnumerator OnUpkeep(bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this, playerUpkeep = playerUpkeep }; } public static void AddTransmutation() { //IL_0060: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Transmutation", "Pay 2 Energy to reroll a chosen Alchemy Die, provided it is not locked.", typeof(AbilTransmutation), "3d_transmutation.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_transmutation.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetActivated(val, true); AbilityExtensions.SetPowerlevel(val, 2); ability = val.ability; } [CompilerGenerated] [DebuggerHidden] private IEnumerator <>n__0(bool playerUpkeep) { return ((TriggerReceiver)this).OnUpkeep(playerUpkeep); } } public class AbilWarper : AbilityBehaviour { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CardSlot slot; public AbilWarper <>4__this; private PlayableCard 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)slot.Card != (Object)null) { 5__1 = slot.Card; if (!((object)slot).Equals((object?)((AbilityBehaviour)<>4__this).Card.Slot)) { <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " switched places with " + ((Card)5__1).Info.displayedName + ".", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; } goto IL_00fb; } goto IL_0140; case 1: <>1__state = -1; goto IL_00fb; case 2: <>1__state = -1; 5__1 = null; goto IL_0140; case 3: { <>1__state = -1; return false; } IL_0140: <>2__current = Singleton.Instance.AssignCardToSlot(((AbilityBehaviour)<>4__this).Card, slot, 0.1f, (Action)null, true); <>1__state = 3; return true; IL_00fb: <>2__current = Singleton.Instance.AssignCardToSlot(5__1, ((AbilityBehaviour)<>4__this).Card.Slot, 0.1f, (Action)null, true); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool playerTurnEnd; public AbilWarper <>4__this; private BoardManager 5__1; private List 5__2; private List 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = Singleton.Instance; 5__2 = 5__1.playerSlots; if (((AbilityBehaviour)<>4__this).Card.OpponentCard) { if (5__1.playerSlots.Where((CardSlot slot) => (Object)(object)slot.Card == (Object)null).Count() == 0) { <>4__this.selected = 5__1.opponentSlots[Random.Range(0, 5__1.opponentSlots.Count)]; } else { 5__3 = 5__1.playerSlots.Where((CardSlot slot) => (Object)(object)slot.Card == (Object)null).ToList(); <>4__this.selected = 5__3[Random.Range(0, 5__3.Count)].opposingSlot; 5__3 = null; } goto IL_01fb; } <>2__current = 5__1.ChooseTarget(5__2, 5__2, (Action)<>4__this.MovementSuccess, (Action)<>4__this.MovementFailed, (Action)<>4__this.CursorEnteredSlot, (Func)(() => false), (CursorType)16); <>1__state = 2; return true; case 2: <>1__state = -1; goto IL_01fb; case 3: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.2f); <>1__state = 4; return true; case 4: { <>1__state = -1; return false; } IL_01fb: <>2__current = <>4__this.DoMovement(<>4__this.selected); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private CardSlot selected; public override Ability Ability => ability; public override bool RespondsToTurnEnd(bool playerTurnEnd) { return playerTurnEnd == !((AbilityBehaviour)this).Card.OpponentCard; } [IteratorStateMachine(typeof(d__5))] public override IEnumerator OnTurnEnd(bool playerTurnEnd) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this, playerTurnEnd = playerTurnEnd }; } private void MovementSuccess(CardSlot slot) { selected = slot; } [IteratorStateMachine(typeof(d__7))] private IEnumerator DoMovement(CardSlot slot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { <>4__this = this, slot = slot }; } private void MovementFailed(CardSlot slot) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); ((HighlightedInteractable)slot).PlaySound(); } private void CursorEnteredSlot(CardSlot slot) { } public static void AddWarper() { //IL_0061: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Warper", "At the end of it's owner's turn, [creature] moves to a slot chosen by it's owner. Should a creature reside in that slot, the two will switch places.", typeof(AbilWarper), "3d_warper.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_warper.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 3); AbilityExtensions.SetCanStack(val, true, false); ability = val.ability; } } public class AbilWatchman : AbilityBehaviour { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayableCard otherCard; public AbilWatchman <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = ((AbilityBehaviour)<>4__this).PreSuccessfulTriggerSequence(); <>1__state = 1; return true; case 1: <>1__state = -1; if (!<>4__this.textDisplayed) { <>4__this.textDisplayed = true; <>2__current = Singleton.Instance.ShowUntilInput(((Card)((AbilityBehaviour)<>4__this).Card).Info.displayedName + " spied on incoming " + ((Card)otherCard).Info.displayedName + "!", (Style)((Card)((AbilityBehaviour)<>4__this).Card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; } goto IL_00f0; case 2: <>1__state = -1; goto IL_00f0; case 3: { <>1__state = -1; return false; } IL_00f0: ((Card)((AbilityBehaviour)<>4__this).Card).Anim.StrongNegationEffect(); if (((AbilityBehaviour)<>4__this).Card.OpponentCard) { spiedCountEnemy++; } else { spiedCountPlayer++; } <>2__current = ((AbilityBehaviour)<>4__this).LearnAbility(0.1f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Ability ability; private bool textDisplayed = false; public static int spiedCountPlayer; public static int spiedCountEnemy; public override Ability Ability => ability; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return otherCard.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard; } public override bool RespondsToUpkeep(bool playerUpkeep) { return true; } [IteratorStateMachine(typeof(d__8))] public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this, otherCard = otherCard }; } public override IEnumerator OnUpkeep(bool playerUpkeep) { textDisplayed = false; return ((TriggerReceiver)this).OnUpkeep(playerUpkeep); } public static void AddWatchman() { //IL_0058: 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) AbilityInfo val = AbilityManager.New("StressSigils", "Watchman", "While [creature] is on the board, it's owner draws a card every time an opponent enters play.", typeof(AbilWatchman), "3d_watchman.png"); AbilityExtensions.SetPixelAbilityIcon(val, TextureHelper.GetImageAsTexture("pixel_watchman.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPowerlevel(val, 3); ability = val.ability; } } } namespace StressCost.Sigils.VariableStats { public class VariablestatDeathToll : VariableStatBehaviour { private static SpecialStatIcon iconType; public static int killCount; public static int secondPlayer; public override SpecialStatIcon IconType => iconType; public override int[] GetStatValues() { Card card = ((SpecialCardBehaviour)this).Card; if (!((PlayableCard)((card is PlayableCard) ? card : null)).OpponentCard) { return new int[2] { killCount, 0 }; } return new int[2] { secondPlayer, 0 }; } public static void SwitchPlayer() { int num = killCount; killCount = secondPlayer; secondPlayer = num; } public static void ResetKillCounts() { secondPlayer = 0; killCount = 0; } public static void AddDeathToll() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = StatIconManager.New("StressSigils", "Death Toll", "The value represented in this sigil is equal to the amount of opposing cards that have perished.", typeof(VariablestatDeathToll)); AbilityExtensions.SetIcon(val, TextureHelper.GetImageAsTexture("3d_deathtoll.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPixelIcon(val, TextureHelper.GetImageAsTexture("pixel_deathtoll.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); val.appliesToAttack = true; val.appliesToHealth = false; val.gbcDescription = "[creature]'s power is equal to the amount of opposing cards that have perished."; iconType = val.iconType; } } public class VariablestatMightierPen : VariableStatBehaviour { private static SpecialStatIcon iconType; public override SpecialStatIcon IconType => iconType; public override int[] GetStatValues() { int num = 0; try { num += Singleton.Instance.GetAdjacent(((SpecialCardBehaviour)this).PlayableCard.Slot, true).Card.ValorRank(); } catch { Console.WriteLine("Left failed"); } try { num += Singleton.Instance.GetAdjacent(((SpecialCardBehaviour)this).PlayableCard.Slot, false).Card.ValorRank(); } catch { Console.WriteLine("Right failed"); } return new int[2] { num, 0 }; } public static void AddMightierPen() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = StatIconManager.New("StressSigils", "Mightier Pen", "The value represented in this sigil is equal to the sum of the Valor Rank of the bearer's adjascent allies", typeof(VariablestatMightierPen)); AbilityExtensions.SetIcon(val, TextureHelper.GetImageAsTexture("3d_mightierpen.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); AbilityExtensions.SetPixelIcon(val, TextureHelper.GetImageAsTexture("pixel_mightierpen.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), (FilterMode?)null); val.appliesToAttack = true; val.appliesToHealth = false; val.gbcDescription = "[creature]'s power is equal to the sum of the Valor Rank of it's adjascent allies"; iconType = val.iconType; } } } namespace StressCost.Patches { internal class AbilityPatches { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public ActivatedAbilityBehaviour __instance; private CostmaniaActivatedAbility 5__1; private List.Enumerator <>s__2; private CardSlot 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; if (__instance is CostmaniaActivatedAbility) { 5__1 = (CostmaniaActivatedAbility)(object)__instance; if (((ActivatedAbilityBehaviour)5__1).CanActivate()) { StressCost.Cost.StressCost.stressCounter += 5__1.StressCost; if (5__1.StressCost > 0 && enumerator != null) { <>s__2 = Singleton.Instance.AllSlots.FindAll((CardSlot slot) => (Object)(object)slot.Card != (Object)null).GetEnumerator(); try { while (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; OnStressCounterChange(5__3.Card, enumerator); 5__3 = null; } } finally { ((IDisposable)<>s__2).Dispose(); } } ((AbilityBehaviour)__instance).Card.AddValorRank(-5__1.ValorRankCost); AlchemyCounter.PayIfPossible(AlchemyValue.Flesh, 5__1.FleshCost); AlchemyCounter.PayIfPossible(AlchemyValue.Metal, 5__1.MetalCost); AlchemyCounter.PayIfPossible(AlchemyValue.Elixir, 5__1.ElixirCost); } 5__1 = null; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public BoardManager __instance; public PlayableCard card; public CardSlot slot; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 2) { try { } finally { <>m__Finally1(); } } <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; <>1__state = -3; <>2__current = EndOfTunnelSuckOne(card, slot); <>1__state = 2; return true; case 2: <>1__state = -3; <>m__Finally1(); return false; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public BoardManager __instance; public PlayableCard card; public CardSlot slot; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } <>1__state = -2; } private bool MoveNext() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>1__state = -3; if (card.HasAbility(AbilDriveby.ability) && (Object)(object)slot.opposingSlot.Card != (Object)null && card.TurnPlayed != Singleton.Instance.TurnNumber) { <>2__current = Singleton.Instance.ShowUntilInput(((Card)card).Info.displayedName + " got a parting shot.", (Style)((Card)card).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; } goto IL_0146; case 1: <>1__state = -3; ((Card)card).Anim.PlayAttackAnimation(false, slot.opposingSlot); <>2__current = slot.opposingSlot.Card.TakeDamage(1, card); <>1__state = 2; return true; case 2: <>1__state = -3; goto IL_0146; case 3: { <>1__state = -1; return false; } IL_0146: <>m__Finally1(); <>2__current = enumerator; <>1__state = 3; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayableCard victim; public CardSlot victimSlot; private PlayableCard 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = victimSlot.opposingSlot.Card; if (!((Object)(object)5__1 != (Object)null) || !5__1.HasAbility(AbilEndOfTheTunnel.ability)) { break; } if (!AbilEndOfTheTunnel.dramaqueenTextPlayed) { AbilEndOfTheTunnel.dramaqueenTextPlayed = true; <>2__current = Singleton.Instance.ShowUntilInput("At the end of the tunnel.", (Style)((Card)5__1).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, false, (Prompt)null, true, (Emotion)0); <>1__state = 1; return true; } goto IL_0112; case 1: <>1__state = -1; <>2__current = Singleton.Instance.ShowUntilInput("THERE I STOOD", (Style)((Card)5__1).Info.temple, (DialogueSpeaker)null, (ScreenPosition)2, 0f, true, true, (Prompt)null, true, (Emotion)0); <>1__state = 2; return true; case 2: <>1__state = -1; goto IL_0112; case 3: { <>1__state = -1; break; } IL_0112: <>2__current = victim.TakeDamage(999, 5__1); <>1__state = 3; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayableCard card; public IEnumerator enumerator; private CardSlot 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Console.WriteLine((Object)(object)card == (Object)null); if ((Object)(object)card != (Object)null) { if (CardExtensions.LacksAllAbilities(card, Array.Empty())) { <>2__current = enumerator; <>1__state = 1; return true; } goto IL_00a8; } goto IL_01ee; case 1: <>1__state = -1; goto IL_00a8; case 2: <>1__state = -1; if ((Object)(object)5__1.Card != (Object)null && !((Card)5__1.Card).FaceDown) { <>2__current = 5__1.Card.TakeDamage(card.Attack, card); <>1__state = 3; return true; } <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 4; return true; case 3: <>1__state = -1; goto IL_01e5; case 4: <>1__state = -1; <>2__current = Singleton.Instance.ShowDamageSequence(card.Attack, card.Attack, card.OpponentCard, 0.3f, (GameObject)null, 0.15f, true); <>1__state = 5; return true; case 5: <>1__state = -1; goto IL_01e5; case 6: { <>1__state = -1; return false; } IL_01e5: 5__1 = null; goto IL_01ee; IL_01ee: Console.WriteLine(enumerator == null); <>2__current = enumerator; <>1__state = 6; return true; IL_00a8: if (card.HasAbility(AbilFearmonger.ability)) { 5__1 = card.Slot.opposingSlot; ((Card)card).Anim.PlayAttackAnimation(false, 5__1); <>2__current = (object)new WaitForSeconds(0.175f); <>1__state = 2; return true; } goto IL_01ee; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public PlayableCard __instance; public bool wasSacrifice; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (__instance.OpponentCard) { VariablestatDeathToll.killCount++; } else { VariablestatDeathToll.secondPlayer++; } <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerUpkeep; private List 5__1; private List 5__2; private int 5__3; private CardInfo 5__4; private PlayableCard 5__5; private int 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__4 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (AbilWatchman.spiedCountEnemy > 0) { 5__1 = Singleton.Instance.opponentSlots.Where((CardSlot slot) => (Object)(object)Singleton.Instance.GetCardQueuedForSlot(slot) == (Object)null).ToList(); 5__2 = BoardManagerExtensions.GetOpponentCards(Singleton.Instance, (Predicate)null); 5__3 = 0; while (5__3 < AbilWatchman.spiedCountEnemy / 2) { 5__4 = CardLoader.GetCardByName(((Object)((Card)5__2[Random.Range(0, 5__2.Count)]).Info).name); if (5__1.Count > 0 && AbilWatchman.spiedCountEnemy > 1) { 5__5 = CardSpawner.SpawnPlayableCard(5__4); 5__5.SetIsOpponentCard(true); Singleton.Instance.Opponent.ModifyQueuedCard(5__5); Singleton.Instance.QueueCardForSlot(5__5, 5__1[Random.Range(0, 5__1.Count)], 0.1f, true, true); Singleton.Instance.Opponent.Queue.Add(5__5); AbilWatchman.spiedCountEnemy /= 2; 5__5 = null; } 5__4 = null; 5__3++; } 5__1 = null; 5__2 = null; } if (AbilWatchman.spiedCountPlayer > 0) { 5__6 = 0; goto IL_020a; } goto IL_0224; case 1: <>1__state = -1; 5__6++; goto IL_020a; case 2: { <>1__state = -1; return false; } IL_0224: <>2__current = enumerator; <>1__state = 2; return true; IL_020a: if (5__6 < AbilWatchman.spiedCountPlayer) { <>2__current = Singleton.Instance.DrawCardFromDeck((CardInfo)null, (Action)null); <>1__state = 1; return true; } AbilWatchman.spiedCountPlayer = 0; goto IL_0224; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static void SetStackableAbilities() { AbilityExtensions.SetCanStack(AbilityExtensions.AbilityByID((IEnumerable)AbilityManager.BaseGameAbilities, (Ability)31), true, false); AbilityExtensions.SetCanStack(AbilityExtensions.AbilityByID((IEnumerable)AbilityManager.BaseGameAbilities, (Ability)7), true, false); AbilityExtensions.SetCanStack(AbilityExtensions.AbilityByID((IEnumerable)AbilityManager.BaseGameAbilities, (Ability)15), true, false); } [IteratorStateMachine(typeof(d__1))] [HarmonyPatch(typeof(ActivatedAbilityBehaviour), "OnActivatedAbility")] [HarmonyPostfix] public static IEnumerator ActivatedAddCosts(IEnumerator enumerator, ActivatedAbilityBehaviour __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { enumerator = enumerator, __instance = __instance }; } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] [HarmonyPrefix] public static void SetupDefenceAbilities(out int __state, PlayableCard __instance, ref int damage, PlayableCard attacker) { //IL_0011: 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) __state = damage; if (Object.op_Implicit((Object)(object)__instance) && __instance.HasAbility(AbilIronclad.ability) && damage > 0) { for (int i = 0; i < CardExtensions.GetAbilityStacks(__instance, AbilIronclad.ability); i++) { __state--; damage--; } ((Card)__instance).Anim.StrongNegationEffect(); } } [IteratorStateMachine(typeof(d__3))] public static IEnumerator OnStressCounterChange(PlayableCard card, IEnumerator enumerator) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { card = card, enumerator = enumerator }; } [IteratorStateMachine(typeof(d__4))] [HarmonyPatch(typeof(PlayableCard), "Die")] [HarmonyPostfix] public static IEnumerator ThanatoKillCount(IEnumerator enumerator, PlayableCard __instance, bool wasSacrifice) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { enumerator = enumerator, __instance = __instance, wasSacrifice = wasSacrifice }; } [IteratorStateMachine(typeof(d__5))] [HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")] [HarmonyPostfix] public static IEnumerator WatchmanPlaceCards(IEnumerator enumerator, TurnManager __instance, bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { enumerator = enumerator, __instance = __instance, playerUpkeep = playerUpkeep }; } [IteratorStateMachine(typeof(d__6))] [HarmonyPatch(typeof(BoardManager), "AssignCardToSlot")] [HarmonyPostfix] public static IEnumerator BlackholeWhenMoving(IEnumerator enumerator, BoardManager __instance, PlayableCard card, CardSlot slot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { enumerator = enumerator, __instance = __instance, card = card, slot = slot }; } [HarmonyPatch(typeof(TurnManager), "CleanupPhase")] [HarmonyPrefix] public static void ResetAbilityVars() { AbilWatchman.spiedCountPlayer = 0; AbilWatchman.spiedCountEnemy = 0; AbilEndOfTheTunnel.dramaqueenTextPlayed = false; } [IteratorStateMachine(typeof(d__8))] private static IEnumerator EndOfTunnelSuckOne(PlayableCard victim, CardSlot victimSlot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { victim = victim, victimSlot = victimSlot }; } [IteratorStateMachine(typeof(d__9))] [HarmonyPatch(typeof(BoardManager), "AssignCardToSlot")] [HarmonyPostfix] public static IEnumerator DrivebyDamage(IEnumerator enumerator, BoardManager __instance, PlayableCard card, CardSlot slot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { enumerator = enumerator, __instance = __instance, card = card, slot = slot }; } [HarmonyPatch(typeof(RandomAbility), "ChooseAbility")] [HarmonyPostfix] public static void AmorphousMoreAbilities(ref RandomAbility __instance, ref Ability __result) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected I4, but got Unknown Ability ability = AbilityManager.AllAbilityInfos[Random.Range(0, AbilityManager.AllAbilityInfos.Count)].ability; __result = (Ability)(int)ability; } } internal class CollectionUIPatches { [HarmonyPatch(typeof(CollectionUI), "Start")] public class AddCostsTab { public static void Prefix(ref CollectionUI __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) AddTab(__instance, "Alchemy", new Vector3(-0.718f, 0.175f, 0f)); AddTab(__instance, "Stress", new Vector3(-0.242f, 0.175f, 0f)); AddTab(__instance, "Space", new Vector3(0.234f, 0.175f, 0f)); AddTab(__instance, "Valor", new Vector3(0.72f, 0.175f, 0f)); } public static void AddTab(CollectionUI instance, string name, Vector3 position) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(((Component)((Component)instance).gameObject.transform.Find("MainPanel").Find("Tabs").Find("Tab_4")).gameObject); ((Object)val).name = "Tab_" + name; val.transform.parent = ((Component)instance).gameObject.transform.Find("MainPanel").Find("Tabs"); val.transform.localPosition = position; ((TabbedUIPanel)instance).tabButtons.Add(val.GetComponent()); val.GetComponent().inputKey = (KeyCode)53; val.GetComponent().OnButtonDown = ((Component)((Component)instance).gameObject.transform.Find("MainPanel").Find("Tabs").Find("Tab_4")).gameObject.GetComponent().OnButtonDown; val.GetComponent().size = new Vector2(0.55f, 0.38f); Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("temple_" + name.ToLower() + ".png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); ((Component)val.gameObject.transform.Find("Icon")).gameObject.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); } } public static Sprite rareDecalStress; public static Sprite rareDecalValor; public static Sprite rareDecalAlchemy; public static Sprite rareDecalSpace; public static void InitRareRecals() { //IL_0035: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("pixel_rare_frame_stress.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); rareDecalStress = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("pixel_rare_frame_valor.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); rareDecalValor = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); Texture2D imageAsTexture3 = TextureHelper.GetImageAsTexture("pixel_rare_frame_alchemy.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); rareDecalAlchemy = Sprite.Create(imageAsTexture3, new Rect(0f, 0f, (float)((Texture)imageAsTexture3).width, (float)((Texture)imageAsTexture3).height), new Vector2(0.5f, 0.5f)); Texture2D imageAsTexture4 = TextureHelper.GetImageAsTexture("pixel_rare_frame_space.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); rareDecalSpace = Sprite.Create(imageAsTexture4, new Rect(0f, 0f, (float)((Texture)imageAsTexture4).width, (float)((Texture)imageAsTexture4).height), new Vector2(0.5f, 0.5f)); } [HarmonyPatch(typeof(Card), "RenderCard")] [HarmonyPostfix] public static void InstateRareDecals(Card __instance) { if (!SaveManager.SaveFile.IsPart2 || Chainloader.PluginInfos.ContainsKey("nevernamed.inscryption.noraredecals")) { return; } try { SpriteRenderer component = GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(((Component)__instance).gameObject, "Base"), "PixelSnap"), "CardElements"), "RareCardDetail").GetComponent(); if (CardExtensions.GetModPrefix(__instance.Info) != null && __instance.Info.metaCategories.Contains((CardMetaCategory)3)) { if (CardExtensions.GetModPrefix(__instance.Info).Contains("Stress") && (Object)(object)rareDecalStress != (Object)null) { component.sprite = rareDecalStress; } else if (CardExtensions.GetModPrefix(__instance.Info).Contains("Valor") && (Object)(object)rareDecalValor != (Object)null) { component.sprite = rareDecalValor; } else if (CardExtensions.GetModPrefix(__instance.Info).Contains("Alchemy") && (Object)(object)rareDecalAlchemy != (Object)null) { component.sprite = rareDecalAlchemy; } else if (CardExtensions.GetModPrefix(__instance.Info).Contains("Space") && (Object)(object)rareDecalSpace != (Object)null) { component.sprite = rareDecalSpace; } } } catch { } } [HarmonyPatch(typeof(CollectionUI), "CreatePages")] [HarmonyPostfix] public static void SortCards(ref CollectionUI __instance, ref List> __result, ref List cards) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Invalid comparison between Unknown and I4 //IL_009c: Unknown result type (might be due to invalid IL or missing references) int[] array = ((!Chainloader.PluginInfos.ContainsKey("mrfantastik.inscryption.infact2")) ? new int[8] : new int[9]); List> __result2 = new List>(); int num = 0; foreach (CardTemple temple in Enum.GetValues(typeof(CardTemple))) { if ((int)temple == 4) { continue; } List list = cards.FindAll((CardInfo info) => info.temple == temple && (CardExtensions.GetModPrefix(info) == null || !CostmaniaPlugin.NEW_TEMPLES.Any((string newTemple) => CardExtensions.GetModPrefix(info).Contains(newTemple)))); InjectToPixelMenu(ref __result2, list); array[temple] = num; num = ((list.Count == 0) ? (num + 1) : (num + Convert.ToInt32(Mathf.Ceil((float)list.Count / 8f)))); } List source = cards.FindAll((CardInfo info) => CardExtensions.GetModPrefix(info) != null && CardExtensions.GetModPrefix(info).Contains("Alchemy")); source = (from info in source orderby info.metaCategories.Contains((CardMetaCategory)3) ? 1 : 100, info.ElixirCost(), info.MetalCost(), info.FleshCost(), info.FleshCost() + info.MetalCost() + info.ElixirCost(), info.DisplayedNameEnglish select info).ToList(); InjectToPixelMenu(ref __result2, source); array[4] = num; num = ((source.Count == 0) ? (num + 1) : (num + Convert.ToInt32(Mathf.Ceil((float)source.Count / 8f)))); List source2 = cards.FindAll((CardInfo info) => CardExtensions.GetModPrefix(info) != null && CardExtensions.GetModPrefix(info).Contains("Stress")); source2 = (from info in source2 orderby info.metaCategories.Contains((CardMetaCategory)3) ? 1 : 100, info.StressCost(), info.DisplayedNameEnglish select info).ToList(); InjectToPixelMenu(ref __result2, source2); array[5] = num; num = ((source2.Count == 0) ? (num + 1) : (num + Convert.ToInt32(Mathf.Ceil((float)source2.Count / 8f)))); List source3 = cards.FindAll((CardInfo info) => CardExtensions.GetModPrefix(info) != null && CardExtensions.GetModPrefix(info).Contains("Space")); source3 = (from info in source3 orderby info.metaCategories.Contains((CardMetaCategory)3) ? 1 : 100, info.StardustCost(), info.DisplayedNameEnglish select info).ToList(); InjectToPixelMenu(ref __result2, source3); array[6] = num; num = ((source3.Count == 0) ? (num + 1) : (num + Convert.ToInt32(Mathf.Ceil((float)source3.Count / 8f)))); List source4 = cards.FindAll((CardInfo info) => CardExtensions.GetModPrefix(info) != null && CardExtensions.GetModPrefix(info).Contains("Valor")); source4 = (from info in source4 orderby info.metaCategories.Contains((CardMetaCategory)3) ? 1 : 100, info.ValorCost(), info.DisplayedNameEnglish select info).ToList(); InjectToPixelMenu(ref __result2, source4); array[7] = num; num = ((source4.Count == 0) ? (num + 1) : (num + Convert.ToInt32(Mathf.Ceil((float)source4.Count / 8f)))); if (Chainloader.PluginInfos.ContainsKey("mrfantastik.inscryption.infact2")) { List list2 = cards.FindAll((CardInfo info) => info.metaCategories.Any((CardMetaCategory caterogy) => ((object)(CardMetaCategory)(ref caterogy)).Equals((object?)2729))); InjectToPixelMenu(ref __result2, list2); array[8] = num; if (list2.Count != 0) { num += Convert.ToInt32(Mathf.Ceil((float)list2.Count / 8f)); } else { num++; } } __result = __result2; __instance.tabPageIndices = array; } private static void InjectToPixelMenu(ref List> __result, List cards) { List list = new List(); if (cards.Count != 0) { for (int i = 1; i <= cards.Count; i++) { list.Add(cards[i - 1]); if (i % 8 == 0 || i == cards.Count) { if (list.Count > 0) { __result.Add(list); } list = new List(); } } } else { __result.Add(new List()); } } [HarmonyPatch(typeof(CardInfo), "GetGBCDescriptionLocalized")] [HarmonyPostfix] public static void NoPromotingTerrainDesc(List allAbilities, CardInfo __instance, ref string __result) { string text = ""; if ((Object)(object)__instance != (Object)null && CardExtensions.GetExtendedProperty(__instance, "CardAlwaysPromotable") == null) { text = ((CardExtensions.GetExtendedProperty(__instance, "CardAlwaysSacrificeable") == null || !Chainloader.PluginInfos.ContainsKey("nevernamed.inscryption.sigils")) ? __result.Replace(Localization.Translate("CAN'T BE SACRIFICED."), Localization.Translate("CAN'T BE SACRIFICED OR PROMOTED.")) : __result.Replace(Localization.Translate("CAN'T BE SACRIFICED."), Localization.Translate("CAN'T BE PROMOTED."))); __result = text; } } } internal class CostGraphicPatches { public static PixelNumeral disStressCounter; public static PixelNumeral disValorCounter; public static PixelNumeral disStardustCounter; public static AlchemyCounter disAlchemyCounter; public static UIShake stressCounterShaker; private static string last = ""; public static void Update() { if (!SaveManager.SaveFile.IsPart2) { return; } GameObject[] array = Array.FindAll(Object.FindObjectsOfType(), (GameObject obj) => ((Object)obj).name.Contains("Card (")); foreach (GameObject val in array) { try { UpdateValorRank(val.gameObject); } catch { } } } public static void UpdateValorRank(GameObject card) { if (SaveManager.SaveFile.IsPart2) { GameObject val = GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(card, "Base"), "PixelSnap"), "CardElements"), "PixelCardStats"); GameObject val2 = GameObjectExtensions.FindChild(val, "ValorRank"); PixelText component = val2.GetComponent(); int num = 0; if ((Object)(object)card.GetComponent() != (Object)null) { PixelSelectableCard component2 = card.GetComponent(); num = component2.ValorRank(); } else if ((Object)(object)card.GetComponent() != (Object)null) { PlayableCard component3 = (PlayableCard)(object)card.GetComponent(); num = component3.ValorRank(); } if (num > 0) { component.SetText(Convert.ToString(num), false); } else { component.SetText("", false); } } } [HarmonyPostfix] [HarmonyPatch(typeof(Card), "RenderCard")] public static void RenderValorRank(Card __instance) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) if (!CostmaniaPlugin.config3DValor.Value && !SaveManager.SaveFile.IsPart2) { return; } GameObject val = GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(((Component)__instance).gameObject, "Base"), "PixelSnap"), "CardElements"), "PixelCardStats"); GameObject val2 = GameObjectExtensions.FindChild(val, "ValorRank"); CardInfo info; try { info = ((Card)((Component)__instance).gameObject.GetComponent()).Info; } catch { info = ((Card)((Component)__instance).gameObject.GetComponent()).Info; } int num = info.ValorRank(); if ((Object)(object)val2 == (Object)null) { GameObject val3 = GameObjectExtensions.FindChild(val, "Attack"); val2 = Object.Instantiate(val3); ((Object)val2).name = "ValorRank"; val2.transform.position = new Vector3(val3.transform.position.x + 0.166f, val3.transform.position.y + 0.005f, val3.transform.position.z); val2.transform.SetParent(val.transform); PixelText component = val2.GetComponent(); component.SetColor(Color.gray); if (num > 0) { component.SetText(Convert.ToString(num), false); } else { component.SetText("", false); } if ((Object)(object)Singleton.Instance != (Object)null) { component.SetSortingOrder(((Renderer)GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(((Component)__instance).gameObject, "Base"), "PixelSnap").GetComponent()).sortingOrder * 10); } } } [HarmonyPostfix] [HarmonyPatch(typeof(TurnManager), "SetupPhase")] public static IEnumerator SetupCostDisplays(IEnumerator enumerator, TurnManager __instance, EncounterData encounterData) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (CostmaniaPlugin.config3DStress.Value || SaveManager.SaveFile.IsPart2) { StressCost.Cost.StressCost.stressCounter = 0; } VariablestatDeathToll.killCount = 0; if (SaveManager.SaveFile.IsPart2) { try { RenderStressCounter(); RenderValorCounter(); RenderStardustCounter(); RenderAlchemyCollection(); } catch { } if (Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { ((Component)((Component)Singleton.Instance).gameObject.transform.Find("Bones")).gameObject.transform.position = new Vector3(-1.945f, 0.96f, 0f); ((Component)((Component)Singleton.Instance).gameObject.transform.Find("Gems")).gameObject.transform.position = new Vector3(-1.9135f, 0.82f, 0f); } } return enumerator; } public static void RenderStressCounter() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Object.Instantiate(((Component)((Component)Singleton.Instance).gameObject.transform.Find("Bones")).gameObject); val.SetActive(true); val.transform.SetParent(((Component)Singleton.Instance).gameObject.transform); val.layer = 31; ((Object)val).name = "Stress"; GameObject val2 = GameObjectExtensions.FindChild(val.gameObject, "BoneIcon"); ((Object)val2).name = "StressCounter"; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("displaycost_stress.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { val2.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(13.7f, -6.5f)); } else { val2.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(7.24f, -7.8f)); } GameObject val3 = GameObjectExtensions.FindChild(val2.gameObject, "PixelBorderNumeral"); disStressCounter = val3.GetComponent(); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { val3.transform.position = new Vector3(-2.08f, 0.94f, 0f); } else { val3.transform.position = new Vector3(-1.44f, 1.132f, 0f); } stressCounterShaker = val2.AddComponent(); } catch (Exception ex) { Console.WriteLine(ex.Message); } } public static void RenderValorCounter() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Object.Instantiate(((Component)((Component)Singleton.Instance).gameObject.transform.Find("Bones")).gameObject); val.SetActive(true); val.transform.SetParent(((Component)Singleton.Instance).gameObject.transform); val.layer = 31; ((Object)val).name = "Valor"; GameObject val2 = GameObjectExtensions.FindChild(val.gameObject, "BoneIcon"); ((Object)val2).name = "MaxValorRank"; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("displaycost_valor.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { val2.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(13.7f, -5.5f)); } else { val2.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(14.2f, -6.42f)); } GameObject val3 = GameObjectExtensions.FindChild(val2.gameObject, "PixelBorderNumeral"); disValorCounter = val3.GetComponent(); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { val3.transform.position = new Vector3(-2.08f, 0.8f, 0f); } else { val3.transform.position = new Vector3(-2.13f, 0.932f, 0f); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } public static void RenderStardustCounter() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Object.Instantiate(((Component)((Component)Singleton.Instance).gameObject.transform.Find("Bones")).gameObject); val.SetActive(true); val.transform.SetParent(((Component)Singleton.Instance).gameObject.transform); val.layer = 31; ((Object)val).name = "Stardust"; GameObject val2 = GameObjectExtensions.FindChild(val.gameObject, "BoneIcon"); ((Object)val2).name = "StardustCounter"; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("displaycost_stardust.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { val2.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(13.7f, -6.4f)); } else { val2.GetComponent().sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(14.2f, -7.55f)); } GameObject val3 = GameObjectExtensions.FindChild(val2.gameObject, "PixelBorderNumeral"); disStardustCounter = val3.GetComponent(); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { val3.transform.position = new Vector3(-2.08f, 0.67f, 0f); } else { val3.transform.position = new Vector3(-2.13f, 0.792f, 0f); } } catch (Exception ex) { Console.WriteLine(ex.Message); } } public static void RenderAlchemyCollection() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown GameObject val = new GameObject("Alchemy"); disAlchemyCounter = val.AddComponent(); val.transform.SetParent(((Component)Singleton.Instance).gameObject.transform); val.SetActive(true); } private static void UpdateTerrainDesc() { PixelScrollArea instance = Singleton.Instance; string text = ""; string[] fullLines = instance.fullLines; foreach (string text2 in fullLines) { text += text2; } if (last == null || last != text) { instance.SetText(text.Replace("CAN'T BE SACRIFICED.", "CAN'T BE SACRIFICED OR PROMOTED.")); last = text; } } } internal class CostPatches { [HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")] public class PromotionPhase { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private BoardManager 5__1; private List 5__2; private List 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = Singleton.Instance; 5__2 = 5__1.playerSlots; 5__3 = 5__2.FindAll((CardSlot slot) => (Object)(object)slot.Card != (Object)null && !CardExtensions.HasTrait(slot.Card, (Trait)12)); if (5__3.Count > 0) { <>2__current = 5__1.ChooseTarget(5__2, 5__3, (Action)PromotionSuccess, (Action)PromotionFailed, (Action)CursorEnteredSlot, (Func)(() => false), (CursorType)1); <>1__state = 1; return true; } goto IL_0130; case 1: <>1__state = -1; goto IL_0130; case 2: { <>1__state = -1; return false; } IL_0130: <>2__current = true; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__0 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerUpkeep; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; dontPay = false; if (playerUpkeep && __instance.TurnNumber > 1 && (CostmaniaPlugin.config3DValor.Value || SaveManager.SaveFile.IsPart2)) { <>2__current = DoPromotionPhase(); <>1__state = 1; return true; } goto IL_0082; case 1: <>1__state = -1; goto IL_0082; case 2: { <>1__state = -1; return false; } IL_0082: <>2__current = enumerator; <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] public static IEnumerator Postfix(IEnumerator enumerator, TurnManager __instance, bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { enumerator = enumerator, __instance = __instance, playerUpkeep = playerUpkeep }; } [IteratorStateMachine(typeof(d__1))] private static IEnumerator DoPromotionPhase() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0); } private static void PromotionSuccess(CardSlot slot) { slot.Card.AddValorRank(); AudioController.Instance.PlaySound2D("plainBlip2", (MixerGroup)0, 0.65f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } private static void PromotionFailed(CardSlot slot) { if ((Object)(object)slot.Card != (Object)null && ((Card)slot.Card).Info.HasTrait((Trait)12)) { ((Card)slot.Card).Anim.StrongNegationEffect(); AudioController.Instance.PlaySound2D("toneless_negate", (MixerGroup)0, 0.65f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } } private static void CursorEnteredSlot(CardSlot slot) { } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerIsAttacker; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 4u) { try { } finally { <>m__Finally1(); } } <>1__state = -2; } private bool MoveNext() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown bool result; try { switch (<>1__state) { default: result = false; break; case 0: <>1__state = -1; if (CostmaniaPlugin.config3DStress.Value || SaveManager.SaveFile.IsPart2) { <>1__state = -3; if (StressCost.Cost.StressCost.stressCounter > 0) { if (playerIsAttacker) { 5__1 = Convert.ToInt32(Mathf.Floor((float)StressCost.Cost.StressCost.stressCounter / 2f)); if (5__1 > 0) { <>2__current = CostGraphicPatches.stressCounterShaker.Shake(0.3f, 0.02f); <>1__state = 1; result = true; break; } goto IL_0169; } goto IL_018e; } <>2__current = enumerator; <>1__state = 5; result = true; break; } goto IL_0207; case 1: <>1__state = -3; <>2__current = (object)new WaitForSeconds(0.07f); <>1__state = 2; result = true; break; case 2: <>1__state = -3; <>2__current = Singleton.Instance.ShowDamageSequence(5__1, 5__1, true, 0.2f, (GameObject)null, 0.15f, true); <>1__state = 3; result = true; break; case 3: <>1__state = -3; goto IL_0169; case 4: <>1__state = -3; goto IL_01f3; case 5: <>1__state = -3; goto IL_01f3; case 6: { <>1__state = -1; result = false; break; } IL_01f3: <>m__Finally1(); goto IL_0207; IL_018e: if (Singleton.Instance.PlayerDamage - Singleton.Instance.OpponentDamage < 5) { <>2__current = enumerator; <>1__state = 4; result = true; } else { result = false; <>m__Finally1(); } break; IL_0207: <>2__current = enumerator; <>1__state = 6; result = true; break; IL_0169: if (StressCost.Cost.StressCost.stressCounter < 2) { StressCost.Cost.StressCost.stressCounter = 0; } else { StressCost.Cost.StressCost.stressCounter -= 2; } goto IL_018e; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerUpkeep; private List 5__1; private List.Enumerator <>s__2; private PlayableCard 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (playerUpkeep && SaveManager.SaveFile.IsPart2) { AlchemyCounter.AddDies(); if (__instance.TurnNumber < 2) { 5__1 = new List(); <>s__2 = Singleton.Instance.CardsInHand.GetEnumerator(); try { while (<>s__2.MoveNext()) { 5__3 = <>s__2.Current; if (CardExtensions.GetExtendedProperty(((Card)5__3).Info, "FleshCost") != null && CardExtensions.GetExtendedProperty(((Card)5__3).Info, "MetalCost") == null && CardExtensions.GetExtendedProperty(((Card)5__3).Info, "ElixirCost") == null) { 5__1.Add(AlchemyValue.Flesh); } if (CardExtensions.GetExtendedProperty(((Card)5__3).Info, "MetalCost") != null && CardExtensions.GetExtendedProperty(((Card)5__3).Info, "FleshCost") == null && CardExtensions.GetExtendedProperty(((Card)5__3).Info, "ElixirCost") == null) { 5__1.Add(AlchemyValue.Metal); } if (CardExtensions.GetExtendedProperty(((Card)5__3).Info, "ElixirCost") != null && CardExtensions.GetExtendedProperty(((Card)5__3).Info, "MetalCost") == null && CardExtensions.GetExtendedProperty(((Card)5__3).Info, "FleshCost") == null) { 5__1.Add(AlchemyValue.Elixir); } 5__3 = null; } } finally { ((IDisposable)<>s__2).Dispose(); } if (5__1.Count > 0) { AlchemyValue? specific = 5__1[Random.Range(0, 5__1.Count)]; AlchemyCounter.RollDies(null, specific); } else { AlchemyCounter.RollDies(); } 5__1 = null; } else { AlchemyCounter.RollDies(); } } <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public BoardManager __instance; public PlayableCard card; public CardSlot slot; private List.Enumerator <>s__1; private CardSlot 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 3) { try { } finally { <>m__Finally1(); } } 5__2 = null; <>1__state = -2; } private bool MoveNext() { try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; if (!slot.IsPlayerSlot) { break; } if (!dontPay) { if (CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "StressCost") > 0 && (CostmaniaPlugin.config3DStress.Value || SaveManager.SaveFile.IsPart2)) { <>2__current = StressCost.Cost.StressCost.IncrementCounter(((Card)card).Info.StressCost()); <>1__state = 2; return true; } goto IL_01bb; } goto IL_02e8; case 2: <>1__state = -1; if (enumerator != null) { <>s__1 = __instance.AllSlots.FindAll((CardSlot slot) => (Object)(object)slot.Card != (Object)null && ((Card)slot.Card).Info.abilities.Count != 0).GetEnumerator(); <>1__state = -3; goto IL_01a6; } goto IL_01bb; case 3: { <>1__state = -3; 5__2 = null; goto IL_01a6; } IL_01bb: if (CostmaniaPlugin.config3DAlchemy.Value || SaveManager.SaveFile.IsPart2) { if (CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "FleshCost") > 0) { AlchemyCounter.PayIfPossible(AlchemyValue.Flesh, CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "FleshCost").Value); } if (CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "MetalCost") > 0) { AlchemyCounter.PayIfPossible(AlchemyValue.Metal, CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "MetalCost").Value); } if (CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "ElixirCost") > 0) { AlchemyCounter.PayIfPossible(AlchemyValue.Elixir, CardExtensions.GetExtendedPropertyAsInt(((Card)card).Info, "ElixirCost").Value); } } goto IL_02e8; IL_02e8: if (CostmaniaPlugin.config3DStardust.Value || SaveManager.SaveFile.IsPart2) { StardustCost.stardustCounter++; } break; IL_01a6: if (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; <>2__current = AbilityPatches.OnStressCounterChange(5__2.Card, enumerator); <>1__state = 3; return true; } <>m__Finally1(); goto IL_01bb; } return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__1).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public PlayableCard __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (SaveManager.SaveFile.IsPart2) { ValorCost.SetMaxRank(); } <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerUpkeep; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (playerUpkeep) { if (BoardManagerExtensions.GetPlayerCards(Singleton.Instance, (Predicate)null).Any((PlayableCard card) => card.HasAbility(AbilDataBanks.ability))) { StardustCost.stardustCounter -= 2; } else { StardustCost.stardustCounter = 0; } } <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerUpkeep; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (Chainloader.PluginInfos.ContainsKey("tvflabs.inscryption.MultiplayerMod") && __instance.TurnNumber > 1) { CostGraphicPatches.disAlchemyCounter.SwitchPlayer(); StressCost.Cost.StressCost.SwitchPlayer(); VariablestatDeathToll.SwitchPlayer(); } <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static bool dontPay; public static bool isPlayerTwo; public static void Update() { if (CostmaniaPlugin.config3DValor.Value || SaveManager.SaveFile.IsPart2) { ValorCost.SetMaxRank(); } } [IteratorStateMachine(typeof(d__3))] [HarmonyPatch(typeof(BoardManager), "ResolveCardOnBoard")] [HarmonyPostfix] public static IEnumerator PayCosts(IEnumerator enumerator, BoardManager __instance, PlayableCard card, CardSlot slot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { enumerator = enumerator, __instance = __instance, card = card, slot = slot }; } [IteratorStateMachine(typeof(d__4))] [HarmonyPatch(typeof(TurnManager), "DoCombatPhase")] [HarmonyPostfix] public static IEnumerator ApplyStress(IEnumerator enumerator, TurnManager __instance, bool playerIsAttacker) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { enumerator = enumerator, __instance = __instance, playerIsAttacker = playerIsAttacker }; } [IteratorStateMachine(typeof(d__6))] [HarmonyPostfix] [HarmonyPatch(typeof(PlayableCard), "DestroyWhenStackIsClear")] public static IEnumerator ResetMaxValor(IEnumerator enumerator, PlayableCard __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { enumerator = enumerator, __instance = __instance }; } [IteratorStateMachine(typeof(d__7))] [HarmonyPostfix] [HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")] public static IEnumerator IncrementAlchemy(IEnumerator enumerator, TurnManager __instance, bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { enumerator = enumerator, __instance = __instance, playerUpkeep = playerUpkeep }; } [IteratorStateMachine(typeof(d__8))] [HarmonyPostfix] [HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")] public static IEnumerator ResetStardust(IEnumerator enumerator, TurnManager __instance, bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { enumerator = enumerator, __instance = __instance, playerUpkeep = playerUpkeep }; } [HarmonyPatch(typeof(AbilityBehaviour), "PreSuccessfulTriggerSequence")] [HarmonyPrefix] public static void MakeAbilNotPay(AbilityBehaviour __instance) { if (!(__instance is Submerge)) { dontPay = true; } } [HarmonyPatch(typeof(AbilityBehaviour), "LearnAbility")] [HarmonyPrefix] public static void EndAbilPay(AbilityBehaviour __instance) { dontPay = false; } [HarmonyPatch(typeof(PlayableCard), "Die")] [HarmonyPrefix] public static void AbilDiePlay(PlayableCard __instance, bool wasSacrifice) { dontPay = false; } [IteratorStateMachine(typeof(d__12))] [HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")] [HarmonyPostfix] public static IEnumerator SwitchPlayers(IEnumerator enumerator, TurnManager __instance, bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { enumerator = enumerator, __instance = __instance, playerUpkeep = playerUpkeep }; } [HarmonyPatch(typeof(TurnManager), "CleanupPhase")] [HarmonyPrefix] public static void ResetPlayerTwo(TurnManager __instance) { VariablestatDeathToll.ResetKillCounts(); if (SaveManager.SaveFile.IsPart2) { CostGraphicPatches.disAlchemyCounter.ResetPlayerTwo(); StressCost.Cost.StressCost.ResetPlayerTwo(); } } [HarmonyPatch(typeof(Part1RareChoiceGenerator), "GenerateChoices")] [HarmonyPostfix] public static void NoAlchemyRaresPart1(ref Part1RareChoiceGenerator __instance, ref List __result, ref CardChoicesNodeData data, ref int randomSeed) { if (CostmaniaPlugin.config3DAlchemy.Value) { return; } List list = __result; List list2 = CardManager.BaseGameCards.Where((CardInfo card) => card.metaCategories.Contains((CardMetaCategory)3) && !card.metaCategories.Contains((CardMetaCategory)6) && (int)card.temple == 0 && (CardExtensions.GetModPrefix(card) == null || !CardExtensions.GetModPrefix(card).Contains("Alchemy")) && ((Object)card).name != "Hrokkall" && ((Object)card).name != "Kraken" && ((Object)card).name != "Hydra").ToList(); if (((ActiveIfCondition)Singleton.Instance).activeIfConditionMet) { list2.AddRange(CardManager.BaseGameCards.Where((CardInfo card) => card.metaCategories.Contains((CardMetaCategory)3) && card.metaCategories.Contains((CardMetaCategory)6) && (int)card.temple == 0 && (CardExtensions.GetModPrefix(card) == null || !CardExtensions.GetModPrefix(card).Contains("Alchemy")) && ((Object)card).name != "Ijiraq_UnlockScreen" && ((Object)card).name != "CuriousEgg")); } for (int i = 0; i < 3; i++) { CardInfo val = list2[Random.Range(0, list2.Count)]; list[i].CardInfo = val; list2.Remove(val); } __result = list; } } internal class DialoguePatches { [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public TurnManager __instance; public bool playerUpkeep; private DialogueEvent 5__1; private DialogueEvent 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; if (!SaveManager.SaveFile.IsPart2 || __instance.TurnNumber <= 1) { break; } if (tutorialState == 0 && HasTempleInBattle()) { <>2__current = PlayTutorialScene1(); <>1__state = 2; return true; } goto IL_00ca; case 2: <>1__state = -1; goto IL_00ca; case 3: <>1__state = -1; <>2__current = Singleton.Instance.PlayDialogueEvent(5__1.id, (Style)0, curSpeaker, (string[])null, (ScreenPosition)2, true); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = (playLeshyRant = false); <>1__state = 5; return true; case 5: <>1__state = -1; 5__1 = null; goto IL_0172; case 6: <>1__state = -1; <>2__current = (playP03Rant = false); <>1__state = 7; return true; case 7: { <>1__state = -1; 5__2 = null; break; } IL_00ca: if (playLeshyRant) { 5__1 = DialogueManager.GenerateEvent("aga.costmania", "LeshyRant", LeshyRantLines(), (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 3; return true; } goto IL_0172; IL_0172: if (playP03Rant && (Object)(object)Singleton.Instance != (Object)null && Singleton.Instance.opponentSlots.Any(delegate(CardSlot slot) { if ((Object)(object)slot.Card != (Object)null) { PlayableCard cardQueuedForSlot = Singleton.Instance.GetCardQueuedForSlot(slot); return (Object)(object)cardQueuedForSlot != (Object)null && CardExtensions.GetModPrefix(((Card)cardQueuedForSlot).Info) != null && CardExtensions.GetModPrefix(((Card)cardQueuedForSlot).Info).Contains("Space"); } return false; })) { 5__2 = DialogueManager.GenerateEvent("aga.costmania", "P03Rant", P03RantLines(), (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); <>2__current = Singleton.Instance.PlayDialogueEvent(5__2.id, (Style)2, curSpeaker, (string[])null, (ScreenPosition)2, true); <>1__state = 6; return true; } break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List 5__1; private DialogueEvent 5__2; private Style <>s__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_002f: 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_0036: 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) //IL_0041: 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_0058: Expected I4, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__1 = new List(); Style styleFromAmbition = DialogueManager.GetStyleFromAmbition(); <>s__3 = styleFromAmbition; Style val = <>s__3; switch ((int)val) { case 0: 5__1 = AlchemyTutorialLines(); break; case 1: 5__1 = StressTutorialLines(); break; case 2: 5__1 = SpaceTutorialLines(); break; case 3: 5__1 = ValorTutorialLines(); break; } 5__2 = DialogueManager.GenerateEvent("aga.costmania", "introduceNewCost1", 5__1, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); <>2__current = Singleton.Instance.PlayDialogueEvent(5__2.id, DialogueManager.GetStyleFromAmbition(), curSpeaker, (string[])null, (ScreenPosition)2, true); <>1__state = 1; return true; } case 1: <>1__state = -1; tutorialState = 1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List 5__1; private DialogueEvent 5__2; private Style <>s__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_002f: 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_0036: 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) //IL_0041: 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_0058: Expected I4, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__1 = new List(); Style styleFromAmbition = DialogueManager.GetStyleFromAmbition(); <>s__3 = styleFromAmbition; Style val = <>s__3; switch ((int)val) { case 0: 5__1 = AlchemyTutorialLines2(); break; case 1: 5__1 = StressTutorialLines2(); break; case 2: 5__1 = SpaceTutorialLines2(); break; case 3: 5__1 = ValorTutorialLines2(); break; } 5__2 = DialogueManager.GenerateEvent("aga.costmania", "introduceNewCost2", 5__1, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); <>2__current = Singleton.Instance.PlayDialogueEvent(5__2.id, DialogueManager.GetStyleFromAmbition(), curSpeaker, (string[])null, (ScreenPosition)2, true); <>1__state = 1; return true; } case 1: <>1__state = -1; tutorialState = 2; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List 5__1; private DialogueEvent 5__2; private Style <>s__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_002f: 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_0036: 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) //IL_0041: 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_0058: Expected I4, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; 5__1 = new List(); Style styleFromAmbition = DialogueManager.GetStyleFromAmbition(); <>s__3 = styleFromAmbition; Style val = <>s__3; switch ((int)val) { case 0: 5__1 = AlchemyTutorialLines3(); break; case 1: 5__1 = StressTutorialLines3(); break; case 2: 5__1 = SpaceTutorialLines3(); break; case 3: 5__1 = ValorTutorialLines3(); break; } 5__2 = DialogueManager.GenerateEvent("aga.costmania", "introduceNewCost3", 5__1, (List>)null, (MaxRepeatsBehaviour)0, (Speaker)0); tutorialState = 3; <>2__current = Singleton.Instance.PlayDialogueEvent(5__2.id, DialogueManager.GetStyleFromAmbition(), curSpeaker, (string[])null, (ScreenPosition)2, true); <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public DialogueHandler __instance; public string eventId; public Style style; public DialogueSpeaker speaker; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; Debug.Log((object)eventId); if (eventId.Contains("ResourceTutorial")) { if (!eventId.Contains("2") && !eventId.Contains("3")) { curSpeaker = speaker; if (!DialogueEventsData.EventIsPlayed("ResourceTutorialBlood") && !DialogueEventsData.EventIsPlayed("ResourceTutorialBones") && !DialogueEventsData.EventIsPlayed("ResourceTutorialEnergy1") && !DialogueEventsData.EventIsPlayed("ResourceTutorialGems1")) { tutorialState = 0; } } } else if (eventId.Contains("LeshyGBCBossPhase1")) { curSpeaker = speaker; if (DialogueEventsData.GetEventRepeatCount("LeshyGBCBossPhase1") < 2) { playLeshyRant = true; } } else if (eventId.Contains("P03BossBattleIntro")) { curSpeaker = speaker; if (DialogueEventsData.GetEventRepeatCount("P03BossBattleIntro") < 2) { playP03Rant = true; } } else if (eventId == "MechanicDocks") { curSpeaker = speaker; if (DialogueEventsData.GetEventRepeatCount("MechanicDocks") == 5 && DialogueEventsData.GetEventRepeatCount("MechanicDocksCostmania") < 4) { <>2__current = Singleton.Instance.PlayDialogueEvent(eExplenation.id, (Style)4, curSpeaker, (string[])null, (ScreenPosition)2, true); <>1__state = 1; return true; } } <>2__current = enumerator; <>1__state = 2; return true; case 1: <>1__state = -1; return false; case 2: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public ResourcesManager __instance; public int amount; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; if (SaveManager.SaveFile.IsPart2 && tutorialState == 1) { <>2__current = (object)new WaitForSeconds(0.85f); <>1__state = 2; return true; } break; case 2: <>1__state = -1; <>2__current = PlayTutorialScene2(); <>1__state = 3; return true; case 3: <>1__state = -1; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public BoardManager __instance; public PlayableCard card; public CardSlot slot; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; StoryEventsData.SetEventCompleted((StoryEvent)33, true, true); <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; if (tutorialState == 2 && CardExtensions.GetModPrefix(((Card)card).Info) != null && CardExtensions.GetModPrefix(((Card)card).Info).Contains(NessecaryCustomTemple())) { <>2__current = (object)new WaitForSeconds(0.6f); <>1__state = 2; return true; } break; case 2: <>1__state = -1; <>2__current = PlayTutorialScene3(); <>1__state = 3; return true; case 3: <>1__state = -1; break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static DialogueSpeaker curSpeaker = new DialogueSpeaker(); private static DialogueEvent eExplenation = null; private static bool tutorialPlaying = false; private static int tutorialState = 3; private static bool playLeshyRant = false; private static bool playP03Rant = false; [IteratorStateMachine(typeof(d__6))] [HarmonyPatch(typeof(DialogueHandler), "PlayDialogueEvent")] [HarmonyPostfix] public static IEnumerator TutorialScene1(IEnumerator enumerator, DialogueHandler __instance, string eventId, Style style, DialogueSpeaker speaker) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { enumerator = enumerator, __instance = __instance, eventId = eventId, style = style, speaker = speaker }; } private static string NessecaryCustomTemple() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown Style styleFromAmbition = DialogueManager.GetStyleFromAmbition(); Style val = styleFromAmbition; return (int)val switch { 0 => CostmaniaPlugin.NEW_TEMPLES[0], 1 => CostmaniaPlugin.NEW_TEMPLES[1], 2 => CostmaniaPlugin.NEW_TEMPLES[2], 3 => CostmaniaPlugin.NEW_TEMPLES[3], _ => throw new ArgumentException("No temple was selected"), }; } public static void GenerateRebechaRant() { List list = MechanicAlchemyLine(); List> list2 = new List>(); list2.Add(MechanicStressLine()); list2.Add(MechanicSpaceLine()); list2.Add(MechanicValorLine()); eExplenation = DialogueManager.GenerateEvent("aga.costmania", "MechanicDocksCostmania", list, list2, (MaxRepeatsBehaviour)0, (Speaker)0); } [IteratorStateMachine(typeof(d__9))] [HarmonyPatch(typeof(TurnManager), "DoUpkeepPhase")] [HarmonyPostfix] public static IEnumerator OnUpkeepScenes(IEnumerator enumerator, TurnManager __instance, bool playerUpkeep) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { enumerator = enumerator, __instance = __instance, playerUpkeep = playerUpkeep }; } [IteratorStateMachine(typeof(d__10))] [HarmonyPatch(typeof(ResourcesManager), "AddEnergy")] [HarmonyPostfix] public static IEnumerator TutorialScene2(IEnumerator enumerator, ResourcesManager __instance, int amount) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { enumerator = enumerator, __instance = __instance, amount = amount }; } [IteratorStateMachine(typeof(d__11))] [HarmonyPatch(typeof(BoardManager), "ResolveCardOnBoard")] [HarmonyPostfix] public static IEnumerator TutorialScene3(IEnumerator enumerator, BoardManager __instance, PlayableCard card, CardSlot slot) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { enumerator = enumerator, __instance = __instance, card = card, slot = slot }; } [HarmonyPatch(typeof(TurnManager), "CleanupPhase")] [HarmonyPrefix] public static void ResetTutorialState(TurnManager __instance) { tutorialState = 3; } private static bool HasTempleInBattle() { return ((PlayerHand)Singleton.Instance).cardsInHand.Any((PlayableCard card) => CardExtensions.GetModPrefix(((Card)card).Info) != null && CardExtensions.GetModPrefix(((Card)card).Info).Contains(NessecaryCustomTemple())) || Singleton.Instance.playerSlots.Any((CardSlot slot) => (Object)(object)slot.Card != (Object)null && CardExtensions.GetModPrefix(((Card)slot.Card).Info) != null && CardExtensions.GetModPrefix(((Card)slot.Card).Info).Contains(NessecaryCustomTemple())); } [IteratorStateMachine(typeof(d__14))] public static IEnumerator PlayTutorialScene1() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0); } [IteratorStateMachine(typeof(d__15))] public static IEnumerator PlayTutorialScene2() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0); } [IteratorStateMachine(typeof(d__16))] public static IEnumerator PlayTutorialScene3() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0); } private static List AlchemyTutorialLines() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("You seem way too interested in these...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("\"Creatures\".", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("To think someone wanted these blights upon nature among my proud beasts.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("But I digress...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Allow me to show you how they work.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List AlchemyTutorialLines2() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) List list = new List(); list.Add(GenFromString("At the beginning of every turn, you receive one Alchemy Die, it's value is one of three...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Flesh, Metal, and Elixir.", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("The value on the die changes every turn it is not spent.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Though you may consider pressing on a die to Lock it, such that it's value remains still.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List AlchemyTutorialLines3() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("You played the card?", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Excellent.", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("Truly Excellent.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I eargerly await your thrashing amidst my cabin walls.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Good luck.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List StressTutorialLines() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) List list = new List(); list.Add(GenFromString("Intriguing! I see you have elected to deploy the modded Paranoia cards!", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I'll have you know the Scrybe in charge of these is quite the lovely individual.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I suppose then... That it is time for you...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("To learn FEAR!", (Speaker)0, (Emotion)2, (Face)0)); return list; } private static List StressTutorialLines2() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("These cards cost \"Stress\", you may play them whenever you wish.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("However!", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("Playing one of them will add their \"Cost\" to the dastardly Stress Counter.", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("And when you ring the bell, you will take damage equal to half of the number on the Counter.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Then it will drop by 2!", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List StressTutorialLines3() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) List list = new List(); list.Add(GenFromString("Notice how the Stress Counter went up?", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I believe it is time for you to strike.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("For it is a race against your own nerves, beating you from behind your back.", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("Careful not to kill yourself challenger!", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List SpaceTutorialLines() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Wait...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Oh my god you stupid moron you actually WANT these?", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("You have some kind of allergy to decent decks? or are you just that dumb?", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("Whatever.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I'll just show you how they work.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List SpaceTutorialLines2() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) List list = new List(); list.Add(GenFromString("Space cards cost \"Stardust\". You gain one every time you place a card.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Then at the end of the turn you lose all the Stardust.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("It's RNG HELL if you don't get any good cards.", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("But if it's any consolation prize they're at least not spent playing Stardust cards.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List SpaceTutorialLines3() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Congratulations! You played a card!", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I'm so proud of you.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Just leave me to my work already.", (Speaker)0, (Emotion)2, (Face)0)); return list; } private static List ValorTutorialLines() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) List list = new List(); list.Add(GenFromString("Ah, you have invested in Valor I see, a curious set of cards indeed.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("You have been modding the game I presume...", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("Regardless...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Allow me to explain to you it's workings.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List ValorTutorialLines2() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Each card you possess now has a stat studded in grey.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("That is their \"Valor Rank\".", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("When a card posseses a certain rank, cards which cost equal or less Valor may be played.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List ValorTutorialLines3() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Now, keep this card until the end of the turn and you may get the chance to Promote it.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("You may choose any sacrificable card to increase it's Valor Rank by 1.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Just like you did last turn.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Prey tell you will take these warriors atop my tower where I lie in wait.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Safe travels.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List LeshyRantLines() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("And in case you were asking...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Indeed my deck contains none of those putrid Alchemy cards.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("No chimeras of mana, no rancid mutations of flesh.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Only fangs.", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("You degenerate modder.", (Speaker)0, (Emotion)2, (Face)0)); return list; } private static List P03RantLines() { //IL_0010: 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_0021: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Listen...", (Speaker)0, (Emotion)0, (Face)0)); if ((int)DialogueManager.GetStyleFromAmbition() == 2) { list.Add(GenFromString("I know I said these cards are kinda trash...", (Speaker)0, (Emotion)0, (Face)0)); } else { list.Add(GenFromString("Normally I'd say these cards are kinda trash...", (Speaker)0, (Emotion)0, (Face)0)); } list.Add(GenFromString("But that's only because of Stardust", (Speaker)0, (Emotion)2, (Face)0)); list.Add(GenFromString("And guess what...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I'm an NPC, dummy!", (Speaker)0, (Emotion)1, (Face)0)); list.Add(GenFromString("I don't need your stupid Stardust!", (Speaker)0, (Emotion)1, (Face)0)); list.Add(GenFromString("Good Luck!", (Speaker)0, (Emotion)1, (Face)0)); return list; } private static List MechanicAlchemyLine() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Woof.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("You want to learn about the owners of those modded cards you love so much?", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Well they're not a known quantity I'll tell you that.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("But they seem as savage as the original Scrybes.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Take Niphox for example.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("The Scrybe of Alchemy.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Sick freak resides in a faraway island called the Misty Isles.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("All he does is run experiments to improve the results of his Stamping Machine.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Maybe Leshy is right not to trust those Alchemy cards.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List MechanicStressLine() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("Stress?", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("They belong to Phantomortis.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Or 'Morty'...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I guess the guy wants to come off all soft and cuddly.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("At least Grimora seems to take the bait pretty well.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("But I've been around the block ever since you added him in...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I know how he makes those cards.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Everyone he operates on is on the verge of suicide afterwards.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("We all thank you for that.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List MechanicSpaceLine() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) List list = new List(); list.Add(GenFromString("And don't get me started on Constal.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("I honestly pity him.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("He was supposed to be the Scrybe of Technology before P03 showed up.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Then he got scrapped deep underwater.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Perhaps we could've had a shot at a leader who isn't a nutcase.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("But I'm sure being considered P03's inferior would likey let loose a bolt or two.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("At least he makes the most of it with those Space Cards.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static List MechanicValorLine() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) List list = new List(); list.Add(GenFromString("But I think the best one might be Herilind.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Might as well be more of a witch than Grimora herself.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("She's completely obsessed with you humans from what I've gathered.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("And all she does is study them mad and record their fate.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("There were actually rumors that Niphox allows her into his study.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("He uses her human anatomy to better his creations...", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("In turn allowing her access to more resources.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("But maybe that hadn't been modded in yet.", (Speaker)0, (Emotion)0, (Face)0)); list.Add(GenFromString("Maybe wait for an update or something.", (Speaker)0, (Emotion)0, (Face)0)); return list; } private static CustomLine GenFromString(string text, Speaker speaker = 0, Emotion emote = 0, Face face = 0) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) CustomLine result = CustomLine.op_Implicit(text); result.speaker = speaker; result.emotion = emote; return result; } } internal class EncounterPatches { private static bool isP03; private static bool isLeshy; [HarmonyPatch(typeof(TurnManager), "SetupPhase")] [HarmonyPrefix] public static void ReplaceAIEncounters(TurnManager __instance, ref EncounterData encounterData) { if (isP03) { encounterData = P03EncounterMod(encounterData); isP03 = false; } if (isLeshy) { encounterData = LeshyEncounterMod(encounterData); isLeshy = false; } try { GrimoraBossOpponent instance = Singleton.Instance; ((Opponent)instance).TurnPlan = GrimoraEncounterMod(((Opponent)instance).TurnPlan); } catch { Debug.Log((object)"Not Grimora"); } } [HarmonyPatch(typeof(CardBattleNPC), "CreateEncounterData")] [HarmonyPostfix] public static void AddNewCards(ref CardBattleNPC __instance, ref EncounterData __result) { EncounterData val; switch (__instance.greetingDialogueId) { case "ProspectorNPCGreeting": val = ProspectorEncounterMod(__result); break; case "AnglerNPCGreeting": val = AnglerEncounterMod(__result); break; case "TrapperNPCGreeting": val = TrapperEncounterMod(__result); break; case "LeshyGBCIntro": isLeshy = true; val = __result; break; case "GhoulBriarGreeting": val = KayceeEncounterMod(__result); break; case "GhoulSawyerGreeting": val = SawyerEncounterMod(__result); break; case "GhoulRoyalGreeting": val = RoyalEncounterMod(__result); break; case "InspectorGreeting": val = InspectorEncounterMod(__result); break; case "SmelterGreeting": val = MelterEncounterMod(__result); break; case "DredgerGreeting": val = DredgerEncounterMod(__result); break; case "P03GBCGreeting": isP03 = true; val = __result; break; case "WizardGreenGreeting": val = GoobertEncounterMod(__result); break; case "WizardOrangeGreeting": val = AmberEncounterMod(__result); break; case "WizardBlueGreeting": val = LonelyEncounterMod(__result); break; case "MagnificusGreeting": val = MagnificusEncounterMod(__result); break; default: val = __result; break; } __result = val; } private static void PrintEncounter(EncounterData enc) { int aga = 0; enc.opponentTurnPlan.ForEach(delegate(List turn) { aga++; turn.ForEach(delegate(CardInfo data) { Debug.Log((object)$"{aga}: {((Object)data).name}"); }); }); } private static void PrintEncounter(EncounterBlueprintData enc) { int aga = 0; enc.turns.ForEach(delegate(List turn) { aga++; turn.ForEach(delegate(CardBlueprint data) { Debug.Log((object)$"{aga}: {((Object)data.card).name}"); }); }); } private static EncounterData ProspectorEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0][0] = CardLoader.GetCardByName("Alchemy_Zeppeloid"); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Alchemy_Cyborg")); enc.opponentTurnPlan[4].Add(CardLoader.GetCardByName("Alchemy_Zeppeloid")); enc.opponentTurnPlan[6].Add(CardLoader.GetCardByName("Alchemy_Biborg")); enc.opponentTurnPlan.Add(new List()); List list = new List(); list.Add(CardLoader.GetCardByName("Squirrel")); list.Add(CardLoader.GetCardByName("Alchemy_CyborgPrime")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData AnglerEncounterMod(EncounterData enc) { enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Alchemy_Spite")); enc.opponentTurnPlan[0][0] = CardLoader.GetCardByName("Alchemy_DeepOne"); List list = new List(); list.Add(CardLoader.GetCardByName("Salmon")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData TrapperEncounterMod(EncounterData enc) { enc.opponentTurnPlan[1][0] = CardLoader.GetCardByName("Alchemy_GreaterHomonculus"); enc.opponentTurnPlan[3].Add(CardLoader.GetCardByName("Alchemy_Homonculus")); enc.opponentTurnPlan[6][0] = CardLoader.GetCardByName("Alchemy_Mistwalker"); return enc; } private static EncounterData LeshyEncounterMod(EncounterData enc) { enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Alpha")); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Stoat")); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Stoat")); enc.opponentTurnPlan[4][0] = CardLoader.GetCardByName("MantisGod"); enc.opponentTurnPlan[5].Add(CardLoader.GetCardByName("WolfCub")); List list = new List(); list.Add(CardLoader.GetCardByName("MantisGod")); list.Add(CardLoader.GetCardByName("Coyote")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData KayceeEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0][1] = CardLoader.GetCardByName("Stress_Aero"); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Stress_Myso")); List list = new List(); list.Add(CardLoader.GetCardByName("Stress_Aero")); list.Add(CardLoader.GetCardByName("Banshee")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData SawyerEncounterMod(EncounterData enc) { enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Stress_Claustro")); enc.opponentTurnPlan[3][0] = CardLoader.GetCardByName("Stress_Myso"); List list = new List(); list.Add(CardLoader.GetCardByName("Stress_Trypano")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData RoyalEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Stress_Nycto")); enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Stress_Micro")); enc.opponentTurnPlan[3].Add(CardLoader.GetCardByName("Stress_Micro")); enc.opponentTurnPlan[3][0] = CardLoader.GetCardByName("Stress_Arachno"); List list = new List(); list.Add(CardLoader.GetCardByName("Stress_Obeso")); list.Add(CardLoader.GetCardByName("Stress_Ekrixi")); enc.opponentTurnPlan.Add(list); return enc; } public static List> GrimoraEncounterMod(List> enc) { enc.Add(new List()); enc.Add(new List()); List list = new List(); list.Add(CardLoader.GetCardByName("Stress_Ekrixi")); enc.Add(list); enc.Add(new List()); enc.Add(new List()); enc.Add(new List()); List list2 = new List(); list2.Add(CardLoader.GetCardByName("Stress_Dystychi")); enc.Add(list2); enc.Add(new List()); enc.Add(new List()); enc.Add(new List()); enc.Add(new List()); List list3 = new List(); list3.Add(CardLoader.GetCardByName("Stress_Thanato")); enc.Add(list3); return enc; } private static EncounterData InspectorEncounterMod(EncounterData enc) { enc.opponentTurnPlan[1][0] = CardLoader.GetCardByName("Space_CookingQuarter"); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Space_ShootingStar")); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Space_Alien")); List list = new List(); list.Add(CardLoader.GetCardByName("Space_CookingQuarter")); list.Add(CardLoader.GetCardByName("Space_ShootingStar")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData MelterEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Space_KillerComet")); enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Space_MutatedMeteorite")); List list = new List(); list.Add(CardLoader.GetCardByName("Space_KillerComet")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData DredgerEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Space_Railgun")); enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Space_Railgun")); enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Space_Railgun")); enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Space_Railgun")); return enc; } private static EncounterData P03EncounterMod(EncounterData enc) { enc.opponentTurnPlan[2][1] = CardLoader.GetCardByName("Space_BlackholeBehemoth"); enc.opponentTurnPlan[3].Add(CardLoader.GetCardByName("Space_CookingQuarter")); enc.opponentTurnPlan[4][0] = CardLoader.GetCardByName("Space_WormHole"); enc.opponentTurnPlan[6].Add(CardLoader.GetCardByName("Space_CookingQuarter")); List list = new List(); list.Add(CardLoader.GetCardByName("Space_BlackholeBehemoth")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData GoobertEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0][2] = CardLoader.GetCardByName("Valor_ReconScout"); enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Valor_SentryScout")); enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Valor_ReconScout")); List list = new List(); list.Add(CardLoader.GetCardByName("Valor_ReconScout")); list.Add(CardLoader.GetCardByName("Valor_SentryScout")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData AmberEncounterMod(EncounterData enc) { enc.opponentTurnPlan[1].Add(CardLoader.GetCardByName("Valor_Vestal")); enc.opponentTurnPlan[2][0] = CardLoader.GetCardByName("Valor_BloodLancer"); enc.opponentTurnPlan[3].Add(CardLoader.GetCardByName("Valor_BloodLancer")); enc.opponentTurnPlan[4][0] = CardLoader.GetCardByName("Valor_Vestal"); return enc; } private static EncounterData LonelyEncounterMod(EncounterData enc) { enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Valor_CorsairPirate")); enc.opponentTurnPlan[3][0] = CardLoader.GetCardByName("Valor_Blunderbuss"); enc.opponentTurnPlan.Add(new List()); List list = new List(); list.Add(CardLoader.GetCardByName("Valor_CorsairPirate")); list.Add(CardLoader.GetCardByName("Valor_Blunderbuss")); enc.opponentTurnPlan.Add(list); return enc; } private static EncounterData MagnificusEncounterMod(EncounterData enc) { enc.opponentTurnPlan[0].Add(CardLoader.GetCardByName("Valor_NascentSquire")); enc.opponentTurnPlan[2].Add(CardLoader.GetCardByName("Valor_NascentSquire")); enc.opponentTurnPlan[4].Add(CardLoader.GetCardByName("Valor_SentryScout")); enc.opponentTurnPlan[4][0] = CardLoader.GetCardByName("Valor_Commandant"); enc.opponentTurnPlan[7][0] = CardLoader.GetCardByName("Valor_Blunderbuss"); enc.opponentTurnPlan[7].Add(CardLoader.GetCardByName("Valor_SentryScout")); enc.opponentTurnPlan.Add(new List()); List list = new List(); list.Add(CardLoader.GetCardByName("MasterGoranj")); list.Add(CardLoader.GetCardByName("Valor_Blunderbuss")); enc.opponentTurnPlan.Add(list); return enc; } } internal class PackPatches { [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator enumerator; public PackOpeningUI __instance; public CardTemple packType; private PixelSelectableCard[] 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; openPack = true; packImg = __instance.mainPack; packCards = __instance.cards; packRippedLeft = __instance.packLeftRipped; packRippedRight = __instance.packRightRipped; 5__1 = (PixelSelectableCard[])(object)new PixelSelectableCard[5]; packCards.CopyTo(5__1, 0); preset = 5__1.ToList(); <>2__current = enumerator; <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static string packDisplay = "Og"; private static CardTemple packTemple = (CardTemple)4; private static SpriteRenderer packImg; private static SpriteRenderer packRippedRight; private static SpriteRenderer packRippedLeft; private static List packCards; private static List preset; private static bool openPack; private static bool introStarted = false; private static List stones; private static bool addedToDeck = false; public static void Update() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) if (openPack && SaveManager.SaveFile.IsPart2) { AddCustomTemples(); GeneratePack(); packCards = preset; if (packDisplay != "Og" && ((Renderer)packImg).isVisible) { Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("card_pack_" + packDisplay.ToLower() + ".png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); packImg.sprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), Vector2.op_Implicit(new Vector3(0.5f, 0.5f, 0.1f))); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("ripped_card_left_" + packDisplay.ToLower() + ".png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); packRippedLeft.sprite = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), Vector2.op_Implicit(new Vector3(0.5f, 0.5f, 0.1f))); Texture2D imageAsTexture3 = TextureHelper.GetImageAsTexture("ripped_card_right_" + packDisplay.ToLower() + ".png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); packRippedRight.sprite = Sprite.Create(imageAsTexture3, new Rect(0f, 0f, (float)((Texture)imageAsTexture3).width, (float)((Texture)imageAsTexture3).height), Vector2.op_Implicit(new Vector3(0.5f, 0.5f, 0.1f))); } openPack = false; } try { if (packDisplay != "Og" && ((Renderer)packImg).isVisible) { GameObject[] array = Array.FindAll(Object.FindObjectsOfType(), (GameObject obj) => ((Object)obj).name == "DialogueHandler"); foreach (GameObject val in array) { if (packDisplay[0] == 'A' || packDisplay[0] == 'I' || packDisplay[0] == 'E' || packDisplay[0] == 'O') { GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(val, "TextBox"), "Box"), "PixelText").GetComponent().SetText("You recieved an " + packDisplay + " card pack!", false); } else if (packDisplay == "Stress") { GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(val, "TextBox"), "Box"), "PixelText").GetComponent().SetText("You recieved a Paranoia card pack!", false); } else { GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(GameObjectExtensions.FindChild(val, "TextBox"), "Box"), "PixelText").GetComponent().SetText("You recieved a " + packDisplay + " card pack!", false); } } } } catch { } if (!addedToDeck && Chainloader.PluginInfos.ContainsKey("mrfantastik.inscryption.infact2")) { SetupSideDeckCards(); addedToDeck = true; } } public static void SetupStarterDecks() { string[] collection = new string[20] { "Alchemy_Pylon", "Alchemy_Pylon", "Alchemy_Pylon", "Alchemy_Pylon", "Alchemy_Pylon", "Alchemy_Pylon", "Alchemy_Homonculus", "Alchemy_Homonculus", "Alchemy_Zeppeloid", "Alchemy_Zeppeloid", "Alchemy_Spite", "Alchemy_Spite", "Alchemy_Biosynth", "Alchemy_Biosynth", "Alchemy_CarnivorousPylop", "Alchemy_Biborg", "Alchemy_Biborg", "Alchemy_CarnivorousPylop", "Alchemy_CarnivorousPylop", "Alchemy_Biborg" }; StarterDecks.NATURE_STARTER.AddRange(collection); string[] collection2 = new string[20] { "Stress_Pills", "Stress_Pills", "Stress_Pills", "Stress_Pills", "Stress_Pills", "Stress_Myso", "Stress_Myso", "Stress_Myso", "Stress_Ekrixi", "Stress_Ekrixi", "Stress_Venustra", "Stress_Venustra", "Stress_Obeso", "Stress_Obeso", "Stress_Venustra", "Stress_Myso", "Stress_Aero", "Stress_Aero", "Stress_Aero", "Stress_Obeso" }; StarterDecks.UNDEAD_STARTER.AddRange(collection2); string[] collection3 = new string[20] { "Space_Telescope", "Space_Telescope", "Space_Telescope", "Space_Telescope", "Space_Telescope", "Space_Alien", "Space_Alien", "Space_Alien", "Space_ShootingStar", "Space_ShootingStar", "Space_ShootingStar", "Space_Asteroid", "Space_Asteroid", "Space_Stargazer", "Space_Stargazer", "Space_Asteroid", "Space_Alien", "Space_Exomorph", "Space_Exomorph", "Space_Alien" }; StarterDecks.TECH_STARTER.AddRange(collection3); string[] collection4 = new string[20] { "Valor_WarBanner", "Valor_WarBanner", "Valor_WarBanner", "Valor_WarBanner", "Valor_WarBanner", "Valor_InfantryKnight", "Valor_InfantryKnight", "Valor_InfantryKnight", "Valor_Flagbearer", "Valor_Flagbearer", "Valor_Flagbearer", "Valor_Longbowman", "Valor_Longbowman", "Valor_Longbowman", "Valor_Longbowman", "Valor_CorsairPirate", "Valor_CorsairPirate", "Valor_Commandant", "Valor_Commandant", "Valor_Flagbearer" }; StarterDecks.WIZARD_STARTER.AddRange(collection4); } public static void SetupSideDeckCards() { string[] collection = new string[8] { "Alchemy_Pylon", "Alchemy_Pylon", "Stress_Pills", "Stress_Pills", "Space_Telescope", "Space_Telescope", "Valor_WarBanner", "Valor_WarBanner" }; StarterDecks.NATURE_STARTER.AddRange(collection); StarterDecks.UNDEAD_STARTER.AddRange(collection); StarterDecks.TECH_STARTER.AddRange(collection); StarterDecks.WIZARD_STARTER.AddRange(collection); } private static List ArrayToInfos(string[] names) { List list = new List(); foreach (string text in names) { list.Add(CardLoader.GetCardByName(text)); } return list; } [IteratorStateMachine(typeof(d__15))] [HarmonyPatch(typeof(PackOpeningUI), "OpenPack")] [HarmonyPostfix] public static IEnumerator SetPackImage(IEnumerator enumerator, PackOpeningUI __instance, CardTemple packType) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { enumerator = enumerator, __instance = __instance, packType = packType }; } public static void GeneratePack() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Invalid comparison between Unknown and I4 List list = CardManager.AllCardsCopy.FindAll((CardInfo info) => info.metaCategories.Contains((CardMetaCategory)4) && info.metaCategories.Contains((CardMetaCategory)5)); List good; if ((int)packTemple != 4 && packDisplay == "Og") { good = list.FindAll((CardInfo info) => (CardExtensions.GetModPrefix(info) == null || !CostmaniaPlugin.NEW_TEMPLES.Any((string newTemple) => CardExtensions.GetModPrefix(info).Contains(newTemple))) && info.temple == packTemple); } else { if ((int)packTemple != 4) { throw new ArgumentException("Cannot add both a base temple and new temple"); } good = list.FindAll((CardInfo info) => CardExtensions.GetModPrefix(info) != null && CardExtensions.GetModPrefix(info).Contains(packDisplay)); } List list2 = list.FindAll((CardInfo info) => !good.Contains(info) && !info.metaCategories.Contains((CardMetaCategory)3)); List list3 = good.Where((CardInfo info) => !info.metaCategories.Contains((CardMetaCategory)3)).ToList(); List list4 = good.Where((CardInfo info) => info.metaCategories.Contains((CardMetaCategory)3)).ToList(); ((Card)preset[0]).SetInfo(list3[Random.Range(0, list3.Count - 1)]); ((Card)preset[1]).SetInfo(list4[Random.Range(0, list4.Count - 1)]); ((Card)preset[2]).SetInfo(list3[Random.Range(0, list3.Count - 1)]); ((Card)preset[3]).SetInfo(list2[Random.Range(0, list2.Count - 1)]); ((Card)preset[3]).SetInfo(list2[Random.Range(0, list2.Count - 1)]); if (((Behaviour)packCards[3]).isActiveAndEnabled) { openPack = false; } } private static void AddCustomTemples() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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) //IL_00b2: Expected I4, but got Unknown //IL_0011: 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_0020: 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_0022: 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_0039: Expected I4, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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) if (Random.Range(0, 2) == 1) { packTemple = (CardTemple)4; CardTemple currentPackType = Singleton.Instance.currentPackType; CardTemple val = currentPackType; switch ((int)val) { case 0: packDisplay = CostmaniaPlugin.NEW_TEMPLES[0]; break; case 1: packDisplay = CostmaniaPlugin.NEW_TEMPLES[1]; break; case 2: packDisplay = CostmaniaPlugin.NEW_TEMPLES[2]; break; case 3: packDisplay = CostmaniaPlugin.NEW_TEMPLES[3]; break; default: packDisplay = "Og"; break; } } else { packDisplay = "Og"; CardTemple currentPackType2 = Singleton.Instance.currentPackType; CardTemple val2 = currentPackType2; switch ((int)val2) { case 0: packTemple = (CardTemple)0; break; case 1: packTemple = (CardTemple)1; break; case 2: packTemple = (CardTemple)2; break; case 3: packTemple = (CardTemple)3; break; } } } } internal class SporePatches { [HarmonyPatch(typeof(MycologistsDialogueNPC), "Start")] public class GBCMycosPatch { [HarmonyPrefix] public static void MycosPrestart(MycologistsDialogueNPC __instance) { List requiredCards = __instance.requiredCards; List fusedCards = __instance.fusedCards; requiredCards.Add(CardLoader.GetCardByName("Alchemy_Golem")); fusedCards.Add(CardLoader.GetCardByName("Alchemy_Golem_Fused")); requiredCards.Add(CardLoader.GetCardByName("Stress_Trypano")); fusedCards.Add(CardLoader.GetCardByName("Stress_Trypano_Fused")); requiredCards.Add(CardLoader.GetCardByName("Space_WormHole")); fusedCards.Add(CardLoader.GetCardByName("Space_WormHole_Fused")); requiredCards.Add(CardLoader.GetCardByName("Valor_Oracle")); fusedCards.Add(CardLoader.GetCardByName("Valor_Oracle_Fused")); __instance.requiredCards = requiredCards; __instance.fusedCards = fusedCards; } } } public class SporeBackground : PixelAppearanceBehaviour { public override Sprite OverrideBackground() { //IL_0035: 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) Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("spore_cards_decal.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); return Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); } } } namespace StressCost.Cost { public enum AlchemyValue { Empty, Flesh, Metal, Elixir } internal class AlchemyDice : MonoBehaviour { private AlchemyValue __value = AlchemyValue.Empty; public bool locked = false; private SpriteRenderer renderer; public static int texWidth; public static int texHeight; public Vector3 pivot = new Vector3(0.38f, 0.35f, 0f); private static Sprite fleshSprite; private static Sprite metalSprite; private static Sprite elixirSprite; private static Sprite emptySprite; public AlchemyValue value { get; set; } private void Awake() { //IL_0044: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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) renderer = ((Component)this).gameObject.GetComponent(); Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("displaycost_flesh_alchemy_die.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); fleshSprite = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)texWidth, (float)texHeight), Vector2.op_Implicit(pivot)); ((Object)fleshSprite).name = "flesh_sprite"; metalSprite = Sprite.Create(TextureHelper.GetImageAsTexture("displaycost_metal_alchemy_die.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), new Rect(0f, 0f, (float)texWidth, (float)texHeight), Vector2.op_Implicit(pivot)); ((Object)metalSprite).name = "metal_sprite"; elixirSprite = Sprite.Create(TextureHelper.GetImageAsTexture("displaycost_elixir_alchemy_die.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), new Rect(0f, 0f, (float)texWidth, (float)texHeight), Vector2.op_Implicit(pivot)); ((Object)elixirSprite).name = "elixir_sprite"; emptySprite = Sprite.Create(TextureHelper.GetImageAsTexture("displaycost_empty_alchemy_die.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0), new Rect(0f, 0f, (float)texWidth, (float)texHeight), Vector2.op_Implicit(pivot)); ((Object)emptySprite).name = "empty_sprite"; texWidth = ((Texture)imageAsTexture).width; texHeight = ((Texture)imageAsTexture).height; } private void Update() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) switch (value) { case AlchemyValue.Flesh: renderer.sprite = fleshSprite; break; case AlchemyValue.Metal: renderer.sprite = metalSprite; break; case AlchemyValue.Elixir: renderer.sprite = elixirSprite; break; default: renderer.sprite = emptySprite; locked = false; break; } float num = 0.5f * (float)(locked ? 1 : 2); renderer.color = new Color(num, num, num); } public void OnMouseDown() { if (value != 0) { if (!locked) { AlchemyCounter.GetLastClickedDiceId(this); } AudioController.Instance.PlaySound2D("crunch_short#2", (MixerGroup)0, 0.25f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); locked = !locked; } } } public class AlchemyCounter : MonoBehaviour { [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator next; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; waitingForClick = true; Singleton.Instance.ForceCursorType((CursorType)16); <>2__current = (object)new WaitUntil((Func)(() => dieClicked)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (dies[lastClicked].locked = !dies[lastClicked].locked); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = next; <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (dieClicked = false); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = (waitingForClick = false); <>1__state = 5; return true; case 5: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static AlchemyDice[] dies = new AlchemyDice[10]; private static AlchemyValue[] secondPlayer = new AlchemyValue[10]; private static bool[] secondPlayerLock = new bool[10]; public static int lastClicked = 0; private static bool dieClicked = false; private static bool waitingForClick = false; private float size = 0.12f; public static int fleshCount => dies.Where((AlchemyDice die) => die.value == AlchemyValue.Flesh).Count(); public static int metalCount => dies.Where((AlchemyDice die) => die.value == AlchemyValue.Metal).Count(); public static int elixirCount => dies.Where((AlchemyDice die) => die.value == AlchemyValue.Elixir).Count(); public static int awakeCount => dies.Where((AlchemyDice die) => die.value != AlchemyValue.Empty).Count(); public static int awakeCountNotLocked => dies.Where((AlchemyDice die) => die.value != 0 && !die.locked).Count(); private void Awake() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) float num = -2.125f; float num2 = 0.51f; if (Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { num = -2.09125f; num2 = 1.09f; } Vector3 position = default(Vector3); for (int i = 0; i < dies.Length; i++) { ((Vector3)(ref position))..ctor(num, num2, 0.1f); GameObject val = Object.Instantiate(((Component)((Component)Singleton.Instance).gameObject.transform.Find("Blood").Find("Blood")).gameObject); ((Object)val).name = $"AlchemyDice {i + 1}"; BoxCollider2D val2 = val.AddComponent(); val2.size = new Vector2(size, size); val.transform.position = position; dies[i] = val.AddComponent(); ((Component)dies[i]).gameObject.transform.SetParent(((Component)this).transform, false); if (!Chainloader.PluginInfos.ContainsKey("julianperge.inscryption.act2.increaseCardSlots")) { if ((i + 1) % 2 == 0) { num -= size; num2 -= size; } else { num += size; } } else if ((i + 1) % 2 == 0) { num += size; num2 -= size; } else { num2 += size; } ResetPlayerTwo(); } } public static void AddDies(int amount = 1, AlchemyValue? specific = null) { try { int num = Array.IndexOf(dies, dies.Where((AlchemyDice die) => die.value == AlchemyValue.Empty).First()); while (amount > 0 && num < 10) { RollDice(num, specific); amount--; num++; } } catch { } } public static void RollDies(int? index = null, AlchemyValue? specific = null) { if (index.HasValue) { RollDice(index.Value, specific); } else { for (int i = 0; i < awakeCount; i++) { RollDice(i, specific); } } AudioController.Instance.PlaySound2D("crunch_short#1", (MixerGroup)0, 0.65f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); } private static void RollDice(int index, AlchemyValue? specific = null) { if (!dies[index].locked) { if (specific.HasValue) { dies[index].value = specific.Value; } else { dies[index].value = (AlchemyValue)Random.Range(1, 4); } } } public static bool PayIfPossible(AlchemyValue type, int amount) { switch (type) { case AlchemyValue.Flesh: if (fleshCount < amount) { return false; } break; case AlchemyValue.Metal: if (metalCount < amount) { return false; } break; case AlchemyValue.Elixir: if (elixirCount < amount) { return false; } break; default: throw new ArgumentException("Cannot pay with 'Empty' Alchemy"); } DepleteDies(type, amount); AudioController.Instance.PlaySound2D("crunch_short#1", (MixerGroup)0, 0.4f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); return true; } private static void DepleteDies(AlchemyValue toDrop, int amount) { for (int i = 0; i < 10; i++) { if (amount <= 0) { break; } if (dies[i].value == AlchemyValue.Empty) { break; } if (dies[i].value == toDrop && amount > 0) { dies[i].value = AlchemyValue.Empty; for (int j = i; j < 9 && dies[j + 1].value != 0; j++) { dies[j].value = dies[j + 1].value; dies[j].locked = dies[j + 1].locked; dies[j + 1].value = AlchemyValue.Empty; } amount--; i--; } } } [IteratorStateMachine(typeof(d__23))] public static IEnumerator WaitUntilClick(IEnumerator next) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { next = next }; } internal static bool GetLastClickedDiceId(object die) { if (!(die is AlchemyDice)) { throw new UnauthorizedAccessException("Only counter's Alchemy Dies can call this method."); } for (int i = 0; i < dies.Length; i++) { if (dies[i] == die) { lastClicked = i; if (waitingForClick) { Singleton.Instance.ForceCursorType((CursorType)0); dieClicked = true; } return true; } } throw new UnauthorizedAccessException("Only counter's Alchemy Dies can call this method."); } public void SwitchPlayer() { AlchemyValue[] array = dies.Select((AlchemyDice die) => die.value).ToArray(); bool[] array2 = dies.Select((AlchemyDice die) => die.locked).ToArray(); for (int i = 0; i < dies.Length; i++) { dies[i].value = secondPlayer[i]; dies[i].locked = secondPlayerLock[i]; } secondPlayer = array; secondPlayerLock = array2; } public void ResetPlayerTwo() { for (int i = 0; i < secondPlayer.Length; i++) { secondPlayer[i] = AlchemyValue.Empty; } secondPlayer[0] = (AlchemyValue)Random.Range(1, 4); secondPlayer[1] = (AlchemyValue)Random.Range(1, 4); } } internal class FleshCost : CustomCardCost { public override string CostName => "FleshCost"; public override bool CostSatisfied(int cardCost, PlayableCard card) { return cardCost <= AlchemyCounter.fleshCount; } public override string CostUnsatisfiedHint(int cardCost, PlayableCard card) { if (SaveManager.SaveFile.IsPart2) { return "You do not have the right amount of [c:green]Alchemy Dies[c:] to play this card. [c:green]Alchemy Dies[c:] are generated over time."; } string item = "[c:green]" + ((Card)card).Info.DisplayedNameLocalized + "[c:] can only be played once you've accumulated enough nessecary [c:green]dies[c:]."; string item2 = "Your [c:green]Alchemy Dies[c:] are of insufficient quantities."; string item3 = $"Don't be a fool, you need [c:green]{cardCost} Flesh Dies[c:] to play [c:green]{((Card)card).Info.DisplayedNameLocalized}[c:]"; List list = new List(); list.Add(item); list.Add(item2); list.Add(item3); return list[Random.Range(0, list.Count)]; } public static Texture2D Texture_3D(int cardCost, CardInfo info, PlayableCard card) { return TextureHelper.GetImageAsTexture($"FleshCost_{cardCost}.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); } public static Texture2D Texture_Pixel(int cardCost, CardInfo info, PlayableCard card) { return Part2CardCostRender.CombineIconAndCount(cardCost, TextureHelper.GetImageAsTexture("pixelcost_flesh.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0)); } } internal class MetalCost : CustomCardCost { public override string CostName => "MetalCost"; public override bool CostSatisfied(int cardCost, PlayableCard card) { return cardCost <= AlchemyCounter.metalCount; } public override string CostUnsatisfiedHint(int cardCost, PlayableCard card) { if (SaveManager.SaveFile.IsPart2) { return "You do not have the right amount of [c:green]Alchemy Dies[c:] to play this card. [c:green]Alchemy Dies[c:] are generated over time."; } string item = "[c:green]" + ((Card)card).Info.DisplayedNameLocalized + "[c:] can only be played once you've accumulated enough nessecary [c:green]dies[c:]."; string item2 = "Your [c:green]Alchemy Dies[c:] are of insufficient quantities."; string item3 = $"Don't be a fool, you need [c:green]{cardCost} Metal Dies[c:] to play [c:green]{((Card)card).Info.DisplayedNameLocalized}[c:]"; List list = new List(); list.Add(item); list.Add(item2); list.Add(item3); return list[Random.Range(0, list.Count)]; } public static Texture2D Texture_3D(int cardCost, CardInfo info, PlayableCard card) { return TextureHelper.GetImageAsTexture($"MetalCost_{cardCost}.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); } public static Texture2D Texture_Pixel(int cardCost, CardInfo info, PlayableCard card) { return Part2CardCostRender.CombineIconAndCount(cardCost, TextureHelper.GetImageAsTexture("pixelcost_metal.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0)); } } internal class ElixirCost : CustomCardCost { public override string CostName => "ElixirCost"; public override bool CostSatisfied(int cardCost, PlayableCard card) { return cardCost <= AlchemyCounter.elixirCount; } public override string CostUnsatisfiedHint(int cardCost, PlayableCard card) { if (SaveManager.SaveFile.IsPart2) { return "You do not have the right amount of [c:green]Alchemy Dies[c:] to play this card. [c:green]Alchemy Dies[c:] are generated over time."; } string item = "[c:green]" + ((Card)card).Info.DisplayedNameLocalized + "[c:] can only be played once you've accumulated enough nessecary [c:green]dies[c:]."; string item2 = "Your [c:green]Alchemy Dies[c:] are of insufficient quantities."; string item3 = $"Don't be a fool, you need [c:green]{cardCost} Elixir Dies[c:] to play [c:green]{((Card)card).Info.DisplayedNameLocalized}[c:]"; List list = new List(); list.Add(item); list.Add(item2); list.Add(item3); return list[Random.Range(0, list.Count)]; } public static Texture2D Texture_3D(int cardCost, CardInfo info, PlayableCard card) { return TextureHelper.GetImageAsTexture($"ElixirCost_{cardCost}.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); } public static Texture2D Texture_Pixel(int cardCost, CardInfo info, PlayableCard card) { return Part2CardCostRender.CombineIconAndCount(cardCost, TextureHelper.GetImageAsTexture("pixelcost_elixir.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0)); } } public static class CardAlchemyExpansion { public static int FleshCost(this CardInfo card) { int? num = CardExtensions.GetExtendedPropertyAsInt(card, "FleshCost"); if (!num.HasValue) { num = 0; } return num.Value; } public static int MetalCost(this CardInfo card) { int? num = CardExtensions.GetExtendedPropertyAsInt(card, "MetalCost"); if (!num.HasValue) { num = 0; } return num.Value; } public static int ElixirCost(this CardInfo card) { int? num = CardExtensions.GetExtendedPropertyAsInt(card, "ElixirCost"); if (!num.HasValue) { num = 0; } return num.Value; } } internal class FairHandStress { public static bool CanBePlayed(int amount, CardInfo card, List hand) { return amount <= 3; } } internal class FairHandValor { public static bool CanBePlayed(int amount, CardInfo card, List hand) { return hand.FindAll((CardInfo card) => card.ValorRank() >= amount).Count > 0; } } internal class FairHandFlesh { public static bool CanBePlayed(int amount, CardInfo card, List hand) { return amount <= 1 && CardExtensions.GetExtendedPropertyAsInt(card, "MetalCost") < 2 && CardExtensions.GetExtendedPropertyAsInt(card, "ElixirCost") < 2; } } internal class FairHandMetal { public static bool CanBePlayed(int amount, CardInfo card, List hand) { return amount <= 1 && CardExtensions.GetExtendedPropertyAsInt(card, "FleshCost") < 2 && CardExtensions.GetExtendedPropertyAsInt(card, "ElixirCost") < 2; } } internal class FairHandElixir { public static bool CanBePlayed(int amount, CardInfo card, List hand) { return amount <= 1 && CardExtensions.GetExtendedPropertyAsInt(card, "MetalCost") < 2 && CardExtensions.GetExtendedPropertyAsInt(card, "FleshCost") < 2; } } internal class FairHandStardust { public static bool CanBePlayed(int amount, CardInfo card, List hand) { return amount <= 1 && hand.FindAll((CardInfo card) => card.EnergyCost <= 1 || CardExtensions.GetCustomCost(card, "StressCost", false) <= 1 || CardExtensions.GetCustomCost(card, "FleshCost", false) <= 1 || CardExtensions.GetCustomCost(card, "MetalCost", false) <= 1 || CardExtensions.GetCustomCost(card, "ElixirCost", false) <= 1).Count == 0; } } internal class CostTier { public static int CostTierS(int amount) { return Convert.ToInt32(Mathf.Floor((float)amount / 1.9f)); } public static int CostTierV(int amount) { return Convert.ToInt32(Mathf.Floor((float)amount / 1.8f)); } public static int CostTierA(int amount) { return Convert.ToInt32(Mathf.Floor((float)amount / 1.8f)); } public static int CostTierF(int amount) { return Convert.ToInt32(Mathf.Floor((float)amount / 1.65f)); } } internal class StardustCost : CustomCardCost { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private int 5__1; private float 5__2; private int 5__3; private int 5__4; private int 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>1__state = -2; } private bool MoveNext() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = __prev / __counter; 5__2 = 0.25f / (float)5__1; 5__3 = ((__prev <= __counter) ? 1 : (-1)); 5__4 = 5__3; <>1__state = -3; 5__5 = 1; goto IL_00ee; case 1: <>1__state = -3; 5__5++; goto IL_00ee; case 2: { <>1__state = -1; return false; } IL_00ee: if (5__5 < 5__1) { CostGraphicPatches.disStressCounter.DisplayValue(__prev + 5__4); 5__4 += 5__3; <>2__current = (object)new WaitForSeconds(5__2); <>1__state = 1; return true; } <>m__Finally1(); <>2__current = true; <>1__state = 2; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static int __prev; private static int __counter; public static int stardustCounter { get { return __counter; } set { __counter = value; try { CostGraphicPatches.disStardustCounter.DisplayValue(stardustCounter); } catch { } } } public override string CostName => "StardustCost"; [IteratorStateMachine(typeof(d__5))] private static IEnumerator DisplaySequentially() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0); } public override bool CostSatisfied(int cardCost, PlayableCard card) { return cardCost <= stardustCounter; } public override string CostUnsatisfiedHint(int cardCost, PlayableCard card) { if (SaveManager.SaveFile.IsPart2) { return "You do not possess enough [c:blue]Stardust[c:]. Play more cards to gain [c:blue]Stardust[c:]."; } string item = "[c:blue]" + ((Card)card).Info.DisplayedNameLocalized + "[c:] needs more [c:blue]Stardust[c:]."; string item2 = "Didn't play enough cards for the nessecary [c:blue]Stardust[c:], challenger."; string item3 = "Don't you read? You need to play more cards before [c:blue]" + ((Card)card).Info.DisplayedNameLocalized + "'s Stardust[c:] cost is satisfied."; List list = new List(); list.Add(item); list.Add(item2); list.Add(item3); return list[Random.Range(0, list.Count)]; } public static Texture2D Texture_3D(int cardCost, CardInfo info, PlayableCard card) { return TextureHelper.GetImageAsTexture($"StardustCost_{cardCost}.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0); } public static Texture2D Texture_Pixel(int cardCost, CardInfo info, PlayableCard card) { return Part2CardCostRender.CombineIconAndCount(cardCost, TextureHelper.GetImageAsTexture("pixelcost_stardust.png", typeof(CostmaniaPlugin).Assembly, (FilterMode)0)); } } public static class CardSpaceExpansion { public static int StardustCost(this CardInfo card) { int? num = CardExtensions.GetExtendedPropertyAsInt(card, "StardustCost"); if (!num.HasValue) { num = 0; } return num.Value; } } internal class StressCost : CustomCardCost { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int amount; private float