Decompiled source of Xenowood Law v1.1.5
Challenge/OldSa_Battle.dll
Decompiled 20 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Encounters; using InscryptionAPI.Regions; using OLD_SA.Tribes; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Battle")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Battle")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a79770a7-eb75-4467-a2c4-5ab71b61dbe0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Patches { [HarmonyPatch(typeof(RegionData), "GetBlueprintForNode")] public static class EncounterDifficultyPatch { [HarmonyPostfix] public static void Postfix(CardBattleNodeData nodeData, ref EncounterBlueprintData __result, RegionData __instance) { if ((Object)(object)__result == (Object)null || nodeData == null || (Object)(object)__instance == (Object)null) { return; } int difficulty = nodeData.difficulty; int difficultyModifier = RunState.Run.DifficultyModifier; if (!((Object)__result).name.StartsWith("OLD_SA_BATTLE") || (difficulty >= __result.minDifficulty && difficulty <= __result.maxDifficulty)) { return; } List<EncounterBlueprintData> list = new List<EncounterBlueprintData>(); foreach (EncounterBlueprintData encounter in __instance.encounters) { if (!((Object)(object)encounter == (Object)null)) { if (!((Object)encounter).name.StartsWith("OLD_SA_BATTLE")) { list.Add(encounter); } else if (encounter.PrerequisitesMet() && difficulty >= encounter.minDifficulty && difficulty <= encounter.maxDifficulty) { list.Add(encounter); } } } if (list.Count != 0) { __result = list[SeededRandom.Range(0, list.Count, SaveManager.SaveFile.GetCurrentRandomSeed())]; } } } } namespace OLD_SA.Battle { public static class BattleAPI { private const int EASY_MIN = 1; private const int EASY_MAX = 3; private const int LOW_MIN = 4; private const int LOW_MAX = 8; private const int MEDIUM_MIN = 9; private const int MEDIUM_MAX = 12; private const int HIGH_MIN = 13; private const int HIGH_MAX = 20; public static EncounterBlueprintData WolfPack; public static EncounterBlueprintData SwarmCrisis; public static EncounterBlueprintData BoneCrisis; public static EncounterBlueprintData Attack; public static EncounterBlueprintData HoovedPack; public static EncounterBlueprintData Magic; public static EncounterBlueprintData Cat; public static EncounterBlueprintData Snake; public static EncounterBlueprintData Bird; public static EncounterBlueprintData Mosquito; public static EncounterBlueprintData Crab; private static CardBlueprint Card(string cardName, int minDifficulty = 1, int maxDifficulty = 20) { return EncounterManager.NewCardBlueprint(cardName, 0, false, 0, (string)null, minDifficulty, maxDifficulty); } public static void Init() { //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Expected I4, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Expected I4, but got Unknown //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Expected I4, but got Unknown //IL_093d: Unknown result type (might be due to invalid IL or missing references) //IL_0943: Expected I4, but got Unknown try { WolfPack = EncounterManager.New("OLD_SA_BATTLE_WOLF_PACK", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(WolfPack, new List<CardBlueprint>[5] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[4] { Card("OLD_SA_WARG"), Card("Rabbit", 1, 3), Card("WolfCub", 4, 12), Card("Wolf", 13) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("WolfCub", 1, 8), Card("Wolf", 9) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[3] { Card("Mole", 4, 8), Card("WolfCub", 9, 12), Card("Wolf", 13) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_WARG", 4), Card("WolfCub", 13) }), EncounterManager.CreateTurn(Card("Alpha", 13)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(WolfPack, (Tribe[])(object)new Tribe[1] { (Tribe)3 }); SwarmCrisis = EncounterManager.New("OLD_SA_BATTLE_SWARM_CRISIS", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(SwarmCrisis, new List<CardBlueprint>[5] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[3] { Card("OLD_SA_WHORLTOOTH_WORM"), Card("Bee", 4, 8), Card("AntQueen", 9) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Bee", 1, 8), Card("Ant", 9) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Bee", 9, 12), Card("OLD_SA_WASP", 13) }), EncounterManager.CreateTurn(Card("OLD_SA_WHORLTOOTH_WORM", 13)), EncounterManager.CreateTurn(Card("Mole", 4)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(SwarmCrisis, (Tribe[])(object)new Tribe[1] { (Tribe)6 }); BoneCrisis = EncounterManager.New("OLD_SA_BATTLE_BONE_CRISIS", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(BoneCrisis, new List<CardBlueprint>[6] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_GULPER_EEL", 9), Card("OLD_SA_ARMORED_CATFISH") }), EncounterManager.CreateTurn("OLD_SA_BONEGULL"), EncounterManager.CreateTurn((CardBlueprint)null), EncounterManager.CreateTurn("Mole"), EncounterManager.CreateTurn("OLD_SA_BONEGULL"), EncounterManager.CreateTurn(Card("DireWolfCub", 13)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(BoneCrisis, (Tribe[])(object)new Tribe[1] { (Tribe)2 }); Attack = EncounterManager.New("OLD_SA_BATTLE_ATTACK", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Attack, new List<CardBlueprint>[6] { EncounterManager.CreateTurn(new string[2] { "Mantis", "OLD_SA_MANTIS_SHRIMP" }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Mole", 1, 12), Card("Porcupine", 13) }), EncounterManager.CreateTurn("Mantis"), EncounterManager.CreateTurn(Card("OLD_SA_STAG_BEETLE", 9)), EncounterManager.CreateTurn((CardBlueprint)null), EncounterManager.CreateTurn(Card("OLD_SA_MANTIS_SHRIMP", 13)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Attack, (Tribe[])(object)new Tribe[1] { (Tribe)(int)TribesAPI.Crustacean }); HoovedPack = EncounterManager.New("OLD_SA_BATTLE_HoovedPack", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(HoovedPack, new List<CardBlueprint>[6] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Mole", 4), Card("OLD_SA_ANTELOPE") }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[3] { Card("ElkCub", 1, 8), Card("Elk", 9, 12), Card("Bull", 13) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("ElkCub", 4, 8), Card("OLD_SA_ANTELOPE", 9) }), EncounterManager.CreateTurn(Card("Bull", 13)), EncounterManager.CreateTurn(Card("Pronghorn", 13)), EncounterManager.CreateTurn(Card("Elk", 13)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(HoovedPack, (Tribe[])(object)new Tribe[1] { (Tribe)4 }); Magic = EncounterManager.New("OLD_SA_BATTLE_MAGIC", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Magic, new List<CardBlueprint>[5] { EncounterManager.CreateTurn(new string[2] { "OLD_SA_PUPPET_SAD", "OLD_SA_PUPPETEER_FEAR" }), EncounterManager.CreateTurn(new string[2] { "Alpha", "OLD_SA_PUPPETEER_HAPPY" }), EncounterManager.CreateTurn("OLD_SA_PUPPET_SAD"), EncounterManager.CreateTurn("OLD_SA_PUPPETEER_FEAR"), EncounterManager.CreateTurn("Mole") }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Magic, (Tribe[])(object)new Tribe[1] { (Tribe)(int)TribesAPI.Magic }); Cat = EncounterManager.New("OLD_SA_BATTLE_CAT", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Cat, new List<CardBlueprint>[5] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_LYNX"), Card("OLD_SA_BLACK_PANTHER", 9) }), EncounterManager.CreateTurn("Mole"), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_LYNX"), Card("OLD_SA_BLACK_PANTHER", 9) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_BLACK_PANTHER", 4, 12), Card("OLD_SA_LION", 13) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_LYNX", 4, 12), Card("OLD_SA_BLACK_PANTHER", 13) }) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Cat, (Tribe[])(object)new Tribe[1] { (Tribe)(int)TribesAPI.Feline }); Snake = EncounterManager.New("OLD_SA_BATTLE_SNAKE", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Snake, new List<CardBlueprint>[5] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[3] { Card("OLD_SA_DART_FROG"), Card("Skink", 4, 8), Card("OLD_SA_INK_ADDER", 9) }), EncounterManager.CreateTurn("Skink"), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Mole", 4, 8), Card("OLD_SA_INK_ADDER", 9) }), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Skink", 9, 12), Card("OLD_SA_INK_ADDER", 13) }), EncounterManager.CreateTurn(Card("OLD_SA_TRICERATOPS", 13)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Snake, (Tribe[])(object)new Tribe[1] { (Tribe)5 }); Bird = EncounterManager.New("OLD_SA_BATTLE_BIRD", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Bird, new List<CardBlueprint>[5] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[3] { Card("Raven"), Card("Porcupine", 9, 12), Card("RavenEgg", 13) }), EncounterManager.CreateTurn("Sparrow"), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("RavenEgg", 9, 12), Card("OLD_SA_HUNTER_DOVE", 13) }), EncounterManager.CreateTurn(Card("MoleMan", 13)), EncounterManager.CreateTurn(Card("Kingfisher", 9, 12)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Bird, (Tribe[])(object)new Tribe[1] { (Tribe)2 }); Mosquito = EncounterManager.New("OLD_SA_BATTLE_MOSQUITO", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Mosquito, new List<CardBlueprint>[1] { EncounterManager.CreateTurn("OLD_SA_MOSQUITO_DUKE") }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Mosquito, (Tribe[])(object)new Tribe[1] { (Tribe)6 }); Crab = EncounterManager.New("OLD_SA_BATTLE_CRAB", true); EncounterExtensions.AddTurns<EncounterBlueprintData>(Crab, new List<CardBlueprint>[5] { EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("OLD_SA_CRAB"), Card("OLD_SA_LOBSTER", 4, 8) }), EncounterManager.CreateTurn(Card("OLD_SA_HERMIT_CRAB", 4, 8)), EncounterManager.CreateTurn((CardBlueprint[])(object)new CardBlueprint[2] { Card("Mole", 4), Card("Kingfisher", 9) }), EncounterManager.CreateTurn(Card("OLD_SA_LOBSTER", 9)), EncounterManager.CreateTurn(Card("OLD_SA_CRAB", 13)) }); EncounterExtensions.AddDominantTribes<EncounterBlueprintData>(Crab, (Tribe[])(object)new Tribe[1] { (Tribe)(int)TribesAPI.Crustacean }); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(WolfPack, 1, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(SwarmCrisis, 1, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(BoneCrisis, 6, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Attack, 6, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(HoovedPack, 1, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Magic, 9, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Cat, 1, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Snake, 4, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Bird, 1, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Mosquito, 8, 20); EncounterExtensions.SetDifficulty<EncounterBlueprintData>(Crab, 1, 20); RegionManager.ModifyRegionsList += AddEncountersToRegions; RegionManager.SyncRegionList(); } catch (Exception ex) { Debug.LogError((object)("[OLD_SA] BattleAPI 初始化失败:\n" + ex)); } } private static List<RegionData> AddEncountersToRegions(List<RegionData> regions) { if (regions == null) { return regions; } RegionData val = regions.Find((RegionData x) => (Object)(object)x != (Object)null && ((Object)x).name == "Forest"); if ((Object)(object)val != (Object)null) { if (val.encounters == null) { val.encounters = new List<EncounterBlueprintData>(); } if (!val.encounters.Contains(WolfPack)) { val.encounters.Add(WolfPack); } if (!val.encounters.Contains(Magic)) { val.encounters.Add(Magic); } if (!val.encounters.Contains(Cat)) { val.encounters.Add(Cat); } if (!val.encounters.Contains(Mosquito)) { val.encounters.Add(Mosquito); } } RegionData val2 = regions.Find((RegionData x) => (Object)(object)x != (Object)null && ((Object)x).name == "Wetlands"); if ((Object)(object)val2 != (Object)null) { if (val2.encounters == null) { val2.encounters = new List<EncounterBlueprintData>(); } if (!val2.encounters.Contains(SwarmCrisis)) { val2.encounters.Add(SwarmCrisis); } if (!val2.encounters.Contains(BoneCrisis)) { val2.encounters.Add(BoneCrisis); } if (!val2.encounters.Contains(Attack)) { val2.encounters.Add(Attack); } if (!val2.encounters.Contains(Mosquito)) { val2.encounters.Add(Mosquito); } if (!val2.encounters.Contains(Crab)) { val2.encounters.Add(Crab); } } RegionData val3 = regions.Find((RegionData x) => (Object)(object)x != (Object)null && ((Object)x).name == "alpine"); if ((Object)(object)val3 != (Object)null) { if (val3.encounters == null) { val3.encounters = new List<EncounterBlueprintData>(); } if (!val3.encounters.Contains(HoovedPack)) { val3.encounters.Add(HoovedPack); } if (!val3.encounters.Contains(Snake)) { val3.encounters.Add(Snake); } if (!val3.encounters.Contains(Bird)) { val3.encounters.Add(Bird); } if (!val3.encounters.Contains(Mosquito)) { val3.encounters.Add(Mosquito); } } return regions; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("OLD_SA.Battle", "OLD SA Battle", "1.0.0")] public class Plugin : BaseUnityPlugin { public static Plugin Instance; private void Awake() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Instance = this; BattleAPI.Init(); Harmony val = new Harmony("OLD_SA.Battle"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Battle loaded."); } } }
Challenge/OldSa_Challenge.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Ascension; using InscryptionAPI.Helpers; using InscryptionAPI.Slots; using OLD_SA.Dialogue; using OLD_SA.Random; using OLD_SA.RedirectStrike; using OldSa_Challenge; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Challenge")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Challenge")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7bddb5c6-b65b-44d7-8bf7-754e15af94f3")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Combat { [HarmonyPatch(typeof(CombatPhaseManager), "DealOverkillDamage")] public static class EnemyOverkillHandDamagePatch { public static bool Prefix(int damage, CardSlot attackingSlot, CardSlot opposingSlot, ref IEnumerator __result) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) if (damage <= 0) { return true; } if ((Object)(object)attackingSlot == (Object)null || (Object)(object)attackingSlot.Card == (Object)null) { return true; } if (attackingSlot.IsPlayerSlot) { return true; } if ((Object)(object)opposingSlot == (Object)null || !opposingSlot.IsPlayerSlot) { return true; } if (attackingSlot.Card.HasAbility(RedirectStrikeAPI.ability.Id)) { return true; } bool flag = false; try { flag = AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.OverkillPunishmentChallengeType); } catch { flag = false; } if (!flag) { return true; } ChallengeActivationUI.TryShowActivation(ChallengeRegistry.OverkillPunishmentChallengeType); __result = EnemyOverkillHandResolver.Resolve(damage, attackingSlot.Card); return false; } } public static class EnemyOverkillHandResolver { public static IEnumerator Resolve(int damage, PlayableCard attacker) { PlayerHand hand = Singleton<PlayerHand>.Instance; if ((Object)(object)hand == (Object)null || hand.CardsInHand.Count == 0) { yield break; } PlayableCard card = hand.CardsInHand[0]; if (!((Object)(object)card == (Object)null)) { if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.DefaultView, false, false); yield return (object)new WaitForSeconds(0.3f); } PlayableCard dialogueCard = card; yield return HandDamageResolver.Deal(card, damage, attacker); yield return SigilDialogueAPI.ShowFirstTime("EnemyOverkillHandDamage", "Surprised? My overkill damage can reach your hand now. Be careful with your first card.", dialogueCard); } } } [HarmonyPatch(typeof(PlayableCard), "Die")] public static class HandDeathSlotWrapper { private static FieldInfo slotField = typeof(PlayableCard).GetField("slot", BindingFlags.Instance | BindingFlags.NonPublic); public static void Prefix(PlayableCard __instance, ref CardSlot __state) { __state = null; if ((Object)(object)__instance == (Object)null || slotField == null) { return; } PlayerHand instance = Singleton<PlayerHand>.Instance; if (!((Object)(object)instance == (Object)null) && instance.CardsInHand.Contains(__instance)) { BoardManager instance2 = Singleton<BoardManager>.Instance; if (!((Object)(object)instance2 == (Object)null) && instance2.PlayerSlotsCopy.Count != 0) { __state = null; slotField.SetValue(__instance, instance2.PlayerSlotsCopy[0]); } } } public static void Postfix(PlayableCard __instance, CardSlot __state) { if (!((Object)(object)__instance == (Object)null) && !(slotField == null)) { PlayerHand instance = Singleton<PlayerHand>.Instance; if (!((Object)(object)instance == (Object)null) && instance.CardsInHand.Contains(__instance)) { slotField.SetValue(__instance, null); } } } } public static class HandDamageResolver { public static IEnumerator Deal(PlayableCard card, int damage, PlayableCard attacker) { if ((Object)(object)card == (Object)null) { yield break; } PlayableCardStatus status = card.Status; status.damageTaken += damage; if (card.TriggerHandler.RespondsToTrigger((Trigger)8, new object[1] { attacker })) { yield return card.TriggerHandler.OnTrigger((Trigger)8, new object[1] { attacker }); } if (card.Health > 0) { if ((Object)(object)((Card)card).Anim != (Object)null) { ((Card)card).Anim.PlayHitAnimation(); } yield break; } card.Dead = true; if ((Object)(object)((Card)card).Anim != (Object)null) { ((Card)card).Anim.PlayDeathAnimation(true); yield return (object)new WaitForSeconds(1f); } BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)Singleton<ResourcesManager>.Instance != (Object)null && (Object)(object)board != (Object)null && board.PlayerSlotsCopy.Count > 0) { yield return Singleton<ResourcesManager>.Instance.AddBones(1, board.PlayerSlotsCopy[0]); } if (card.TriggerHandler.RespondsToTrigger((Trigger)12, new object[2] { false, attacker })) { yield return card.TriggerHandler.OnTrigger((Trigger)12, new object[2] { false, attacker }); } if ((Object)(object)Singleton<GlobalTriggerHandler>.Instance != (Object)null) { yield return Singleton<GlobalTriggerHandler>.Instance.TriggerAll((Trigger)11, false, new object[4] { card, board.PlayerSlotsCopy[0], true, attacker }); } PlayerHand hand = Singleton<PlayerHand>.Instance; if ((Object)(object)hand != (Object)null) { hand.CardsInHand.Remove(card); } Object.Destroy((Object)(object)((Component)card).gameObject); } } } namespace OldSa_Challenge { [HarmonyPatch(typeof(AscensionSaveData), "NewRun")] public static class BadThingsChallengePatch { private const string BrokenPeltName = "OLD_SA_BROKEN_PELT"; [HarmonyPrefix] private static void Prefix(List<CardInfo> starterDeck) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!SaveFile.IsAscension || starterDeck == null || starterDeck.Count == 0) { return; } int numChallengesOfTypeActive = AscensionSaveData.Data.GetNumChallengesOfTypeActive(ChallengeRegistry.BadThingsChallengeType); if (numChallengesOfTypeActive <= 0) { return; } CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_BROKEN_PELT"); List<CardInfo> list = starterDeck.Where((CardInfo card) => (Object)(object)card != (Object)null && !card.HasTrait((Trait)13) && ((Object)card).name != "OLD_SA_BROKEN_PELT").ToList(); if (list.Count == 0) { return; } int num = Math.Min(numChallengesOfTypeActive, list.Count); for (int num2 = 0; num2 < num; num2++) { int index = Random.Range(0, list.Count); CardInfo val = list[index]; if (!((Object)(object)val == (Object)null)) { int num3 = starterDeck.IndexOf(val); if (num3 >= 0) { starterDeck[num3] = cardByName; list.RemoveAt(index); } } } if (numChallengesOfTypeActive <= num) { } } } [HarmonyPatch(typeof(GainConsumablesSequencer), "ReplenishConsumables")] public static class BrokenBackpackPatch { private static readonly FieldInfo BackpackField = AccessTools.Field(typeof(GainConsumablesSequencer), "backpack"); private static readonly MethodInfo FullConsumablesSequenceMethod = AccessTools.Method(typeof(GainConsumablesSequencer), "FullConsumablesSequence", (Type[])null, (Type[])null); private static readonly MethodInfo TutorialGainConsumablesMethod = AccessTools.Method(typeof(GainConsumablesSequencer), "TutorialGainConsumables", (Type[])null, (Type[])null); private static readonly MethodInfo RegularGainConsumablesMethod = AccessTools.Method(typeof(GainConsumablesSequencer), "RegularGainConsumables", (Type[])null, (Type[])null); [HarmonyPrefix] public static bool Prefix(GainConsumablesSequencer __instance, GainConsumablesNodeData nodeData, ref IEnumerator __result) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ChallengeRegistry.BrokenBagChallenge == (Object)null || AscensionSaveData.Data == null || !AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.BrokenBagChallengeType)) { return true; } __result = ReplenishConsumablesWithDialogue(__instance, nodeData); return false; } private static IEnumerator ReplenishConsumablesWithDialogue(GainConsumablesSequencer instance, GainConsumablesNodeData nodeData) { Singleton<ViewManager>.Instance.SwitchToView((View)1, false, true); yield return (object)new WaitForEndOfFrame(); Singleton<ExplorableAreaManager>.Instance.SetHandLightRange(17f, 0.25f); Singleton<ExplorableAreaManager>.Instance.SetHangingLightRange(7f, 0.25f); GameObject backpack = GetBackpack(instance); if ((Object)(object)backpack != (Object)null) { backpack.SetActive(true); } yield return (object)new WaitForSeconds(0.25f); if ((Object)(object)Singleton<GameFlowManager>.Instance != (Object)null) { yield return (object)new WaitUntil((Func<bool>)(() => !Singleton<GameFlowManager>.Instance.Transitioning)); } ChallengeActivationUI.TryShowActivation(ChallengeRegistry.BrokenBagChallengeType); yield return ChallengeDialogueManager.ShowFirstTime("Broken Bag", "Not much for you to choose from this time."); if (RunState.Run.consumables.Count == RunState.Run.MaxConsumables) { yield return InvokeCoroutine(FullConsumablesSequenceMethod, instance); } else if (!ProgressionData.LearnedMechanic((MechanicsConcept)33)) { yield return InvokeCoroutine(TutorialGainConsumablesMethod, instance); ProgressionData.SetMechanicLearned((MechanicsConcept)33); } else { yield return InvokeCoroutine(RegularGainConsumablesMethod, instance, nodeData); ProgressionData.SetMechanicLearned((MechanicsConcept)34); } Singleton<ExplorableAreaManager>.Instance.ResetHandLightRange(0.25f); Singleton<ExplorableAreaManager>.Instance.ResetHangingLightRange(0.25f); if ((Object)(object)backpack != (Object)null) { Animator animator = backpack.GetComponentInChildren<Animator>(); if ((Object)(object)animator != (Object)null) { animator.SetTrigger("exit"); } CustomCoroutine.WaitThenExecute(0.25f, (Action)delegate { backpack.SetActive(false); }, false); } if ((Object)(object)Singleton<GameFlowManager>.Instance != (Object)null) { Singleton<GameFlowManager>.Instance.TransitionToGameState((GameState)1, (NodeData)null); } } private static GameObject GetBackpack(GainConsumablesSequencer instance) { if ((Object)(object)instance == (Object)null || BackpackField == null) { return null; } object? value = BackpackField.GetValue(instance); return (GameObject)((value is GameObject) ? value : null); } private static IEnumerator InvokeCoroutine(MethodInfo method, object instance, params object[] parameters) { if (method == null) { yield break; } object result = method.Invoke(instance, parameters); if (result is IEnumerator sequence) { while (sequence.MoveNext()) { yield return sequence.Current; } } } } public static class BrokenBagPatch { private static readonly HashSet<string> ForbiddenConsumables = new HashSet<string> { "Hourglass", "Scissors", "CuckooClock", "PocketWatch" }; public static void Apply(Harmony harmony) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(GainConsumablesSequencer), "GenerateItemChoices", (Type[])null, (Type[])null); if (methodInfo == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find GainConsumablesSequencer.GenerateItemChoices."); } else { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(BrokenBagPatch), "GenerateItemChoices_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo2 = AccessTools.Method(typeof(ItemsUtil), "GetRandomUnlockedConsumable", (Type[])null, (Type[])null); if (methodInfo2 == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find ItemsUtil.GetRandomUnlockedConsumable."); } else { harmony.Patch((MethodBase)methodInfo2, new HarmonyMethod(typeof(BrokenBagPatch), "GetRandomUnlockedConsumable_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } PatchBuyPeltsStateMachine(harmony); MethodInfo methodInfo3 = AccessTools.Method(typeof(BuyPeltsSequencer), "OnPurchaseKnifePressed", (Type[])null, (Type[])null); if (methodInfo3 == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find BuyPeltsSequencer.OnPurchaseKnifePressed."); } else { harmony.Patch((MethodBase)methodInfo3, new HarmonyMethod(typeof(BrokenBagPatch), "OnPurchaseKnifePressed_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } private static bool GenerateItemChoices_Prefix(GainConsumablesNodeData nodeData, int randomSeed, ref List<ConsumableItemData> __result) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 if (!IsBrokenBagActive()) { return true; } List<ConsumableItemData> list = new List<ConsumableItemData>(ItemsUtil.GetUnlockedConsumablesForRegion(RunState.CurrentMapRegion)); List<ConsumableItemData> list2 = new List<ConsumableItemData>(); if (StoryEventsData.EventCompleted((StoryEvent)15) && !StoryEventsData.EventCompleted((StoryEvent)30) && ((int)RunState.Run.eyeState == 0 || (int)RunState.Run.eyeState == 3) && !RunState.Run.consumables.Contains("SpecialDagger")) { list2.Add(ItemsUtil.GetConsumableByName("SpecialDagger")); } while (list2.Count < 3) { if (list.Count == 0) { ConsumableItemData consumableByName = ItemsUtil.GetConsumableByName("SquirrelBottle"); list2.Add(consumableByName); continue; } int num = ((RunState.Run != null) ? (RunState.Run.consumables.Count * 1000) : 0); int num2 = randomSeed + num; int powerLevelRoll = SeededRandom.Range(1, 6, num2++); List<ConsumableItemData> list3 = list.FindAll((ConsumableItemData x) => (Object)(object)x != (Object)null && x.powerLevel <= powerLevelRoll && !IsForbidden(((Object)x).name)); if (list3.Count == 0) { randomSeed++; continue; } int index = SeededRandom.Range(0, list3.Count, num2++); ConsumableItemData val = list3[index]; list.Remove(val); if ((Object)(object)val != (Object)null) { list2.Add(val); } randomSeed += 2; } if (RunState.Run.regionTier > 0 && StoryEventsData.EventCompleted((StoryEvent)5) && !StoryEventsData.EventCompleted((StoryEvent)80) && !RunState.Run.consumables.Contains("GooBottle") && RunState.Run.consumables.Count == 2 && !SaveFile.IsAscension) { list2[1] = ItemsUtil.GetConsumableByName("GooBottle"); } for (int num3 = 0; num3 < list2.Count; num3++) { ConsumableItemData val2 = list2[num3]; if (!((Object)(object)val2 == (Object)null) && IsForbidden(((Object)val2).name)) { Plugin.Log.LogError((object)("[OldSa Challenge] Forbidden consumable reached bag result: " + ((Object)val2).name)); ConsumableItemData replacementConsumable = GetReplacementConsumable(randomSeed + num3); if ((Object)(object)replacementConsumable != (Object)null) { list2[num3] = replacementConsumable; } } } __result = list2; return false; } private static bool GetRandomUnlockedConsumable_Prefix(int randomSeed, ref ConsumableItemData __result) { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (!IsBrokenBagActive()) { return true; } List<ConsumableItemData> list = new List<ConsumableItemData>(ItemsUtil.GetUnlockedConsumables()); list.RemoveAll((ConsumableItemData item) => (Object)(object)item == (Object)null || item.notRandomlyGiven || IsForbidden(((Object)item).name)); if (list.Count == 0) { ConsumableItemData consumableByName = ItemsUtil.GetConsumableByName("SquirrelBottle"); if ((Object)(object)consumableByName != (Object)null) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.BrokenBagChallengeType); __result = consumableByName; return false; } return true; } int index = SeededRandom.Range(0, list.Count, randomSeed); ConsumableItemData val = list[index]; ChallengeActivationUI.TryShowActivation(ChallengeRegistry.BrokenBagChallengeType); __result = val; return false; } private static ConsumableItemData GetReplacementConsumable(int randomSeed) { List<ConsumableItemData> list = new List<ConsumableItemData>(ItemsUtil.GetUnlockedConsumablesForRegion(RunState.CurrentMapRegion)); list.RemoveAll((ConsumableItemData item) => (Object)(object)item == (Object)null || item.notRandomlyGiven || IsForbidden(((Object)item).name)); if (list.Count == 0) { return ItemsUtil.GetConsumableByName("SquirrelBottle"); } int index = SeededRandom.Range(0, list.Count, randomSeed); return list[index]; } private static bool IsForbidden(string itemName) { return !string.IsNullOrEmpty(itemName) && ForbiddenConsumables.Contains(itemName); } private static bool IsBrokenBagActive() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (AscensionSaveData.Data == null) { return false; } return AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.BrokenBagChallengeType); } private static void PatchBuyPeltsStateMachine(Harmony harmony) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown Type type = typeof(BuyPeltsSequencer).GetNestedTypes(BindingFlags.NonPublic).FirstOrDefault((Type type2) => type2.Name.StartsWith("<BuyPelts>d__", StringComparison.Ordinal)); if (type == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find BuyPelts state machine."); return; } MethodInfo methodInfo = AccessTools.Method(type, "MoveNext", (Type[])null, (Type[])null); if (methodInfo == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find MoveNext() in BuyPelts state machine."); } else { harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(BrokenBagPatch), "BuyPelts_MoveNext_Transpiler", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null); } } private static IEnumerable<CodeInstruction> BuyPelts_MoveNext_Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); MethodInfo methodInfo = AccessTools.Method(typeof(GameObject), "SetActive", (Type[])null, (Type[])null); MethodInfo target = AccessTools.Method(typeof(GenericMainInputInteractable), "SetEnabled", (Type[])null, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(BrokenBagPatch), "ShouldShowKnife", (Type[])null, (Type[])null); MethodInfo methodInfo3 = AccessTools.Method(typeof(BrokenBagPatch), "ShouldEnableKnife", (Type[])null, (Type[])null); MethodInfo methodInfo4 = AccessTools.Method(typeof(BrokenBagPatch), "ShowHunterActivation", (Type[])null, (Type[])null); if (methodInfo == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find GameObject.SetActive."); } if (methodInfo2 == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find ShouldShowKnife."); } if (methodInfo3 == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find ShouldEnableKnife."); } if (methodInfo4 == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find ShowHunterActivation."); } bool flag = false; bool flag2 = false; bool flag3 = false; for (int i = 0; i < list.Count - 1; i++) { if (IsLdcI4One(list[i].opcode) && CallsMethod(list[i + 1], methodInfo)) { list.Insert(i, new CodeInstruction(OpCodes.Call, (object)methodInfo4)); i++; list[i] = new CodeInstruction(OpCodes.Call, (object)methodInfo2); flag = true; flag3 = true; break; } } for (int j = 0; j < list.Count - 1; j++) { if (IsLdcI4One(list[j].opcode) && CallsMethod(list[j + 1], target)) { list[j] = new CodeInstruction(OpCodes.Call, (object)methodInfo3); flag2 = true; break; } } if (!flag) { Plugin.Log.LogWarning((object)"[OldSa Challenge] Could not patch hunter knife GameObject.SetActive."); } if (!flag2) { Plugin.Log.LogWarning((object)"[OldSa Challenge] Could not patch hunter knife SetEnabled."); } if (!flag3) { Plugin.Log.LogWarning((object)"[OldSa Challenge] Could not patch hunter activation display."); } return list; } private static void ShowHunterActivation() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (IsBrokenBagActive()) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.BrokenBagChallengeType); } } private static bool IsLdcI4One(OpCode opcode) { return opcode == OpCodes.Ldc_I4_1; } private static bool CallsMethod(CodeInstruction instruction, MethodInfo target) { if (instruction == null || target == null) { return false; } if (instruction.opcode != OpCodes.Call && instruction.opcode != OpCodes.Callvirt) { return false; } if (!(instruction.operand is MethodInfo methodInfo)) { return false; } return methodInfo == target; } private static bool ShouldShowKnife() { if (IsBrokenBagActive()) { return false; } return true; } private static bool ShouldEnableKnife() { if (IsBrokenBagActive()) { return false; } return true; } private static bool OnPurchaseKnifePressed_Prefix() { if (!IsBrokenBagActive()) { return true; } return false; } } public static class BrokenStartPatch { [HarmonyPatch(typeof(AscensionSaveData), "NewRun", new Type[] { typeof(List<CardInfo>) })] private static class NewRunPatch { [HarmonyPrefix] private static void Prefix(AscensionSaveData __instance) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) remainingReplacements = 0; if (__instance != null && SaveFile.IsAscension) { int numChallengesOfTypeActive = __instance.GetNumChallengesOfTypeActive(ChallengeRegistry.BrokenStartChallengeType); if (numChallengesOfTypeActive > 0) { remainingReplacements = numChallengesOfTypeActive; } } } [HarmonyPostfix] private static void Postfix() { if (remainingReplacements > 0) { } remainingReplacements = 0; } } [HarmonyPatch(typeof(CardLoader), "GetCardByName", new Type[] { typeof(string) })] private static class GetCardByNamePatch { [HarmonyPrefix] private static bool Prefix(ref string name) { if (remainingReplacements <= 0) { return true; } if (name != "PeltHare") { return true; } name = "OLD_SA_BROKEN_PELT"; remainingReplacements--; return true; } } private const string BrokenPeltName = "OLD_SA_BROKEN_PELT"; private static int remainingReplacements; } public static class ChallengeIncompatibilities { public static void RegisterAll() { RegisterMutual(ChallengeRegistry.ElephantModeChallenge, (AscensionChallenge)13); RegisterMutual(ChallengeRegistry.BadThingsChallenge, ChallengeRegistry.DizzyStartersChallenge); RegisterMutual(ChallengeRegistry.BadThingsChallenge, (AscensionChallenge)9); } private static void RegisterMutual(AscensionChallengeInfo customChallenge, AscensionChallenge vanillaChallenge) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected I4, but got Unknown //IL_0025: 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_003a: Expected I4, but got Unknown if (!((Object)(object)customChallenge == (Object)null)) { ChallengeManager.GetFullChallenge(customChallenge).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)(int)vanillaChallenge }); ChallengeManager.GetFullChallenge(vanillaChallenge).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)(int)customChallenge.challengeType }); } } private static void RegisterMutual(AscensionChallengeInfo first, AscensionChallengeInfo second) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected I4, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected I4, but got Unknown if (!((Object)(object)first == (Object)null) && !((Object)(object)second == (Object)null)) { ChallengeManager.GetFullChallenge(first).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)(int)second.challengeType }); ChallengeManager.GetFullChallenge(second).SetIncompatibleChallengeGetterStatic((AscensionChallenge[])(object)new AscensionChallenge[1] { (AscensionChallenge)(int)first.challengeType }); } } } public static class ChallengeDialogueAPI { public static IEnumerator ShowFirstTime(string challengeName, string dialogue) { if (!string.IsNullOrEmpty(challengeName) && !string.IsNullOrEmpty(dialogue) && !ChallengeDialogueSaveData.HasTriggered(challengeName)) { ChallengeDialogueSaveData.AddTriggered(challengeName); OLD_SA_SaveManager.Save(); TextDisplayer textDisplayer = Singleton<TextDisplayer>.Instance; if (!((Object)(object)textDisplayer == (Object)null)) { yield return textDisplayer.ShowUntilInput(dialogue, -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } } } public static class ChallengeDialogueConfig { public const string NoGrowthDialogue = "NoGrowthChallenge"; public const string NoWoodcarverDialogue = "NoWoodcarverChallenge"; public const string DizzyStartersDialogue = "DizzyStartersChallenge"; public const string DoubleTrialDialogue = "DoubleTrialChallenge"; public const string BrokenStartDialogue = "BrokenStartChallenge"; public const string BadThingsDialogue = "BadThingsChallenge"; public const string ElephantModeDialogue = "ElephantModeChallenge"; public const string BrokenBagDialogue = "BrokenBagChallenge"; public const string NeverStarvationDialogue = "NeverStarvationChallenge"; } public static class ChallengeDialogueManager { public static IEnumerator ShowFirstTime(string challengeName, string dialogue) { if (string.IsNullOrEmpty(challengeName) || string.IsNullOrEmpty(dialogue) || ChallengeDialogueSaveData.HasTriggered(challengeName)) { yield break; } ChallengeDialogueSaveData.AddTriggered(challengeName); OLD_SA_SaveManager.Save(); if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null) { Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1; } if ((Object)(object)Singleton<PlayerHand>.Instance != (Object)null) { Singleton<PlayerHand>.Instance.PlayingLocked = true; } try { if ((Object)(object)Singleton<TextDisplayer>.Instance != (Object)null) { yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(dialogue, -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } finally { if ((Object)(object)Singleton<PlayerHand>.Instance != (Object)null) { Singleton<PlayerHand>.Instance.PlayingLocked = false; } if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null) { Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; } } } } public static class ChallengeDialogueSaveData { private static readonly HashSet<string> TriggeredChallenges = new HashSet<string>(); public static bool HasTriggered(string challengeName) { if (string.IsNullOrEmpty(challengeName)) { return false; } return TriggeredChallenges.Contains(challengeName); } public static void AddTriggered(string challengeName) { if (!string.IsNullOrEmpty(challengeName)) { TriggeredChallenges.Add(challengeName); } } public static List<string> GetSaveList() { return new List<string>(TriggeredChallenges); } public static void LoadFromList(List<string> list) { TriggeredChallenges.Clear(); if (list == null) { return; } foreach (string item in list) { if (!string.IsNullOrEmpty(item)) { TriggeredChallenges.Add(item); } } } } public static class ChallengeRegistry { public static AscensionChallengeInfo NoGrowthChallenge; public const string NoGrowthName = "No Growth"; public const string NoGrowthDescription = "Fledgling sigils no longer evolve. They only grant +1 Power and +1 Health."; public static AscensionChallengeInfo NoWoodcarverChallenge; public const string NoWoodcarverName = "No Woodcarver"; public const string NoWoodcarverDescription = "You will no longer encounter Woodcarver choice nodes."; public static AscensionChallengeInfo DizzyStartersChallenge; public const string DizzyStartersName = "Dizzy Starters"; public const string DizzyStartersDescription = "All creatures in your starting deck gain the Random sigil."; public static AscensionChallengeInfo DoubleTrialChallenge; public const string DoubleTrialName = "Double Trial"; public const string DoubleTrialDescription = "All Totem battles in this run have bases with the Double Strike sigil."; public static AscensionChallengeInfo BrokenStartChallenge; public const string BrokenStartName = "Broken Start"; public const string BrokenStartDescription = "One of your starting pelts is replaced with a Broken Pelt."; public static AscensionChallengeInfo BadThingsChallenge; public const string BadThingsName = "Bad Things"; public const string BadThingsDescription = "One of your starting creatures is replaced with a Broken Pelt."; public static AscensionChallengeInfo ElephantModeChallenge; public const string ElephantModeName = "Elephant Bosses"; public const string ElephantModeDescription = "On the second turn, the Boss will fill the board with Elephants."; public static AscensionChallengeInfo BrokenBagChallenge; public const string BrokenBagName = "Broken Bag"; public const string BrokenBagDescription = "You will not encounter the Hourglass, Skinning Knife, Scissors, or CuckooClock."; public static AscensionChallengeInfo NeverStarvationChallenge; public const string NeverStarvationName = "Never Starvation"; public const string NeverStarvationDescription = "You will never encounter starvation, even when there are no cards left to draw."; public static AscensionChallengeInfo WaterForestChallenge; public const string WaterForestName = "Water Forest"; public const string WaterForestDescription = "Turn one of your spaces into a Submerge Slot."; public static AscensionChallengeInfo HallucinationSlotChallenge; public const string HallucinationSlotName = "Hallucination Forest"; public const string HallucinationSlotDescription = "Turn one of your spaces into a Hallucination Slot."; public static AscensionChallengeInfo StartledSlotChallenge; public const string StartledSlotName = "Startled Forest"; public const string StartledSlotDescription = "Turn one of your spaces into a Startled Slot."; public static AscensionChallengeInfo OverkillPunishmentChallenge; public const string OverkillPunishmentName = "Overkill Punishment"; public const string OverkillPunishmentDescription = "Leshy's overkill damage also affects your hand."; public static AscensionChallenge NoGrowthChallengeType => (AscensionChallenge)(((Object)(object)NoGrowthChallenge != (Object)null) ? ((int)NoGrowthChallenge.challengeType) : 0); public static AscensionChallenge NoWoodcarverChallengeType => (AscensionChallenge)(((Object)(object)NoWoodcarverChallenge != (Object)null) ? ((int)NoWoodcarverChallenge.challengeType) : 0); public static AscensionChallenge DizzyStartersChallengeType => (AscensionChallenge)(((Object)(object)DizzyStartersChallenge != (Object)null) ? ((int)DizzyStartersChallenge.challengeType) : 0); public static AscensionChallenge DoubleTrialChallengeType => (AscensionChallenge)(((Object)(object)DoubleTrialChallenge != (Object)null) ? ((int)DoubleTrialChallenge.challengeType) : 0); public static AscensionChallenge BrokenStartChallengeType => (AscensionChallenge)(((Object)(object)BrokenStartChallenge != (Object)null) ? ((int)BrokenStartChallenge.challengeType) : 0); public static AscensionChallenge BadThingsChallengeType => (AscensionChallenge)(((Object)(object)BadThingsChallenge != (Object)null) ? ((int)BadThingsChallenge.challengeType) : 0); public static AscensionChallenge ElephantModeChallengeType => (AscensionChallenge)(((Object)(object)ElephantModeChallenge != (Object)null) ? ((int)ElephantModeChallenge.challengeType) : 0); public static AscensionChallenge BrokenBagChallengeType => (AscensionChallenge)(((Object)(object)BrokenBagChallenge != (Object)null) ? ((int)BrokenBagChallenge.challengeType) : 0); public static AscensionChallenge NeverStarvationChallengeType => (AscensionChallenge)(((Object)(object)NeverStarvationChallenge != (Object)null) ? ((int)NeverStarvationChallenge.challengeType) : 0); public static AscensionChallenge WaterForestChallengeType => (AscensionChallenge)(((Object)(object)WaterForestChallenge != (Object)null) ? ((int)WaterForestChallenge.challengeType) : 0); public static AscensionChallenge HallucinationSlotChallengeType => (AscensionChallenge)(((Object)(object)HallucinationSlotChallenge != (Object)null) ? ((int)HallucinationSlotChallenge.challengeType) : 0); public static AscensionChallenge StartledSlotChallengeType => (AscensionChallenge)(((Object)(object)StartledSlotChallenge != (Object)null) ? ((int)StartledSlotChallenge.challengeType) : 0); public static AscensionChallenge OverkillPunishmentChallengeType => (AscensionChallenge)(((Object)(object)OverkillPunishmentChallenge != (Object)null) ? ((int)OverkillPunishmentChallenge.challengeType) : 0); public static void Register() { NoGrowthChallenge = FullChallenge.op_Implicit(ChallengeManager.Add("OLD_SA.Challenge", "No Growth", "Fledgling sigils no longer evolve. They only grant +1 Power and +1 Health.", 15, TextureHelper.GetImageAsTexture("NoGrowth.png", (FilterMode)0), TextureHelper.GetImageAsTexture("NoGrowth_Activated.png", (FilterMode)0), 0, false)); NoWoodcarverChallenge = FullChallenge.op_Implicit(ChallengeManager.Add("OLD_SA.Challenge", "No Woodcarver", "You will no longer encounter Woodcarver choice nodes.", 15, TextureHelper.GetImageAsTexture("NoWoodcarver.png", (FilterMode)0), TextureHelper.GetImageAsTexture("NoWoodcarver_Activated.png", (FilterMode)0), 0, false)); DizzyStartersChallenge = FullChallenge.op_Implicit(ChallengeManager.Add("OLD_SA.Challenge", "Dizzy Starters", "All creatures in your starting deck gain the Random sigil.", 0, TextureHelper.GetImageAsTexture("DizzyStarters.png", (FilterMode)0), TextureHelper.GetImageAsTexture("DizzyStarters_Activated.png", (FilterMode)0), 0, false)); DoubleTrialChallenge = FullChallenge.op_Implicit(ChallengeManager.Add("OLD_SA.Challenge", "Double Trial", "All Totem battles in this run have bases with the Double Strike sigil.", 100, TextureHelper.GetImageAsTexture("DoubleTrial.png", (FilterMode)0), TextureHelper.GetImageAsTexture("DoubleTrial_Activated.png", (FilterMode)0), 0, false)); BrokenStartChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Broken Start", "One of your starting pelts is replaced with a Broken Pelt.", 15, TextureHelper.GetImageAsTexture("BrokenStart.png", (FilterMode)0), TextureHelper.GetImageAsTexture("BrokenStart_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 2)); BadThingsChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Bad Things", "One of your starting creatures is replaced with a Broken Pelt.", 20, TextureHelper.GetImageAsTexture("BadThings.png", (FilterMode)0), TextureHelper.GetImageAsTexture("BadThings_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 3)); ElephantModeChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Elephant Bosses", "On the second turn, the Boss will fill the board with Elephants.", 50, TextureHelper.GetImageAsTexture("ElephantMode.png", (FilterMode)0), TextureHelper.GetImageAsTexture("ElephantMode_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); BrokenBagChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Broken Bag", "You will not encounter the Hourglass, Skinning Knife, Scissors, or CuckooClock.", 50, TextureHelper.GetImageAsTexture("BrokenBag.png", (FilterMode)0), TextureHelper.GetImageAsTexture("BrokenBag_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); NeverStarvationChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Never Starvation", "You will never encounter starvation, even when there are no cards left to draw.", -15, TextureHelper.GetImageAsTexture("NeverStarvation.png", (FilterMode)0), TextureHelper.GetImageAsTexture("NeverStarvation_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); WaterForestChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Water Forest", "Turn one of your spaces into a Submerge Slot.", 25, TextureHelper.GetImageAsTexture("WaterForest.png", (FilterMode)0), TextureHelper.GetImageAsTexture("WaterForest_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); HallucinationSlotChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Hallucination Forest", "Turn one of your spaces into a Hallucination Slot.", 25, TextureHelper.GetImageAsTexture("HallucinationSlot.png", (FilterMode)0), TextureHelper.GetImageAsTexture("HallucinationSlot_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); StartledSlotChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Startled Forest", "Turn one of your spaces into a Startled Slot.", 20, TextureHelper.GetImageAsTexture("StartledSlot.png", (FilterMode)0), TextureHelper.GetImageAsTexture("StartledSlot_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); OverkillPunishmentChallenge = FullChallenge.op_Implicit(ChallengeManager.AddSpecific("OLD_SA.Challenge", "Overkill Punishment", "Leshy's overkill damage also affects your hand.", 50, TextureHelper.GetImageAsTexture("OverkillPunishment.png", (FilterMode)0), TextureHelper.GetImageAsTexture("OverkillPunishment_Activated.png", (FilterMode)0), (Type)null, 0, (List<object>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, (Func<FullChallenge[], IEnumerable<AscensionChallenge>>)null, 1)); ChallengeIncompatibilities.RegisterAll(); } } [HarmonyPatch] public static class ChallengeIntroDialoguePatch { internal static bool InRunIntro; internal static bool IntroDeckShown; [HarmonyPatch(typeof(RunIntroSequencer), "RunIntroSequence")] [HarmonyPrefix] private static void RunIntroPrefix() { InRunIntro = true; IntroDeckShown = false; } [HarmonyPatch(typeof(RunIntroSequencer), "RunIntroSequence")] [HarmonyPostfix] private static void RunIntroPostfix(ref IEnumerator __result) { if (__result == null) { InRunIntro = false; } else { __result = WrapRunIntro(__result); } } private static IEnumerator WrapRunIntro(IEnumerator original) { while (original.MoveNext()) { yield return original.Current; } InRunIntro = false; } [HarmonyPatch(typeof(DeckReviewSequencer), "SetDeckReviewShown", new Type[] { typeof(bool), typeof(Transform), typeof(Vector3), typeof(bool), typeof(bool) })] [HarmonyPostfix] private static void SetDeckReviewShownPostfix(DeckReviewSequencer __instance, bool shown) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (shown && InRunIntro && SaveFile.IsAscension && !IntroDeckShown) { IntroDeckShown = true; bool flag = IsChallengeActive(ChallengeRegistry.BadThingsChallengeType); bool flag2 = IsChallengeActive(ChallengeRegistry.BrokenStartChallengeType); bool flag3 = IsChallengeActive(ChallengeRegistry.DizzyStartersChallengeType); if ((flag || flag2 || flag3) && !((Object)(object)__instance == (Object)null)) { ((MonoBehaviour)__instance).StartCoroutine(ShowIntroDialogues(flag, flag2, flag3)); } } } private static bool IsChallengeActive(AscensionChallenge challenge) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (AscensionSaveData.Data == null) { return false; } return AscensionSaveData.Data.ChallengeIsActive(challenge); } private static IEnumerator ShowIntroDialogues(bool badThings, bool brokenStart, bool dizzyStarters) { yield return (object)new WaitForSeconds(0.3f); if (badThings) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.BadThingsChallengeType); yield return ChallengeDialogueManager.ShowFirstTime("Bad Things", "Your creature has left you.I kept this for you."); } if (brokenStart) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.BrokenStartChallengeType); yield return ChallengeDialogueManager.ShowFirstTime("Broken Start", "Sorry,I don't have anything better.Good luck."); } if (dizzyStarters) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.DizzyStartersChallengeType); yield return ChallengeDialogueManager.ShowFirstTime("Dizzy Starters", "They have all lost their sense of direction."); } } } [HarmonyPatch(typeof(AscensionSaveData), "NewRun")] public static class DizzyStartersPatch { [HarmonyPostfix] public static void Postfix(AscensionSaveData __instance) { //IL_0002: 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_0044: Invalid comparison between Unknown and I4 //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown if (!__instance.ChallengeIsActive(ChallengeRegistry.DizzyStartersChallengeType) || __instance.currentRun == null || __instance.currentRun.playerDeck == null) { return; } Ability randomAbility = RandomAPI.RandomAbility; if ((int)randomAbility == 0) { Plugin.Log.LogError((object)"[OldSa Challenge] Dizzy Starters: Random ability is invalid."); return; } foreach (CardInfo card in ((CardCollectionInfo)__instance.currentRun.playerDeck).Cards) { if (!((Object)(object)card == (Object)null) && !card.HasTrait((Trait)13) && !card.HasAbility(randomAbility)) { CardModificationInfo val = new CardModificationInfo(randomAbility); __instance.currentRun.playerDeck.ModifyCard(card, val); } } } } [HarmonyPatch(typeof(TotemsUtil), "AssignAbilityToBottom")] public static class DoubleTrialPatch { [HarmonyPostfix] public static void Postfix(TotemBottomData bottom) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)bottom == (Object)null) && bottom.effectParams != null) { AscensionSaveData data = AscensionSaveData.Data; if (data != null && data.ChallengeIsActive(ChallengeRegistry.DoubleTrialChallengeType)) { bottom.effectParams.ability = (Ability)100; } } } } [HarmonyPatch(typeof(Part1Opponent), "AssembleTotem")] public static class DoubleTrialTotemPatch { [HarmonyPrefix] public static void Prefix(Part1Opponent __instance, TotemItemData totemData) { //IL_002d: 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) if (!((Object)(object)__instance == (Object)null) && !((Object)(object)ChallengeRegistry.DoubleTrialChallenge == (Object)null) && AscensionSaveData.Data != null && AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.DoubleTrialChallenge.challengeType)) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.DoubleTrialChallengeType); } } } [HarmonyPatch] public static class ElephantGrizzlyPhasePatch { private static MethodBase TargetMethod() { MethodInfo method = typeof(Part1BossOpponent).GetMethod("HasGrizzlyGlitchPhase", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method == null) { Plugin.Log.LogError((object)"[OLD SA Elephant] HasGrizzlyGlitchPhase NOT FOUND!"); return null; } return method; } [HarmonyPostfix] private static void HasGrizzlyGlitchPhasePostfix(ref bool __result) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (AscensionSaveData.Data != null && AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.ElephantModeChallengeType)) { __result = true; } } } [HarmonyPatch] public static class ElephantBearGlitchPatch { private static MethodBase TargetMethod() { MethodInfo method = typeof(Tutorial4BattleSequencer).GetMethod("BearGlitchSequence", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (method == null) { Plugin.Log.LogError((object)"[OLD SA Elephant] BearGlitchSequence NOT FOUND!"); return null; } return method; } [HarmonyPrefix] private static bool BearGlitchSequencePrefix(ref IEnumerator __result) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (AscensionSaveData.Data == null) { Plugin.Log.LogWarning((object)"[OLD SA Elephant] AscensionSaveData.Data == null."); return true; } if (!AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.ElephantModeChallengeType)) { return true; } __result = ElephantGlitchSequence(); return false; } private static IEnumerator ElephantGlitchSequence() { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.ElephantModeChallengeType); CardInfo elephantInfo = CardLoader.GetCardByName("OLD_SA_Elephant"); if ((Object)(object)elephantInfo == (Object)null) { Plugin.Log.LogError((object)"[OLD SA Elephant] OLD_SA_Elephant NOT FOUND!"); yield break; } ((ScreenEffect)Singleton<UIManager>.Instance.Effects.GetEffect<ScreenGlitchEffect>()).SetIntensity(1f, 1f); Singleton<CameraEffects>.Instance.Shake(0.1f, 1f); AudioController.Instance.PlaySound2D("broken_hum", (MixerGroup)0, 1f, 0f, (Pitch)null, (Repetition)null, (Randomization)null, (Distortion)null, false); foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if (!Singleton<TurnManager>.Instance.Opponent.QueuedSlots.Contains(slot)) { yield return Singleton<TurnManager>.Instance.Opponent.QueueCard(elephantInfo, slot, false, false, false); } if ((Object)(object)slot.Card == (Object)null) { yield return Singleton<BoardManager>.Instance.CreateCardInSlot(elephantInfo, slot, 0f, true); } if ((Object)(object)slot.Card != (Object)null) { GiveCardReachAndRedColor(slot.Card); } } foreach (PlayableCard playableCard in Singleton<TurnManager>.Instance.Opponent.Queue) { if ((Object)(object)playableCard != (Object)null && (Object)(object)((Card)playableCard).Info != (Object)null && ((Object)((Card)playableCard).Info).name == "OLD_SA_Elephant") { GiveCardReachAndRedColor(playableCard); } } yield return (object)new WaitForSeconds(0.5f); } private static void GiveCardReachAndRedColor(PlayableCard card) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)card == (Object)null)) { CardModificationInfo val = new CardModificationInfo((Ability)23); val.fromTotem = true; if ((Object)(object)((Card)card).StatsLayer != (Object)null) { ((Card)card).StatsLayer.SetEmissionColor(GameColors.Instance.glowRed); } card.AddTemporaryMod(val); } } } [HarmonyPatch(typeof(PlayableCard), "GetOpposingSlots")] public static class HallucinationPatch { private static int randomCounter; [HarmonyPostfix] public static void Postfix(PlayableCard __instance, ref List<CardSlot> __result) { if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.Slot == (Object)null || __result == null || !HasHallucinationSlot(__instance.Slot)) { return; } List<CardSlot> list = (__instance.OpponentCard ? Singleton<BoardManager>.Instance.PlayerSlotsCopy : Singleton<BoardManager>.Instance.OpponentSlotsCopy); if (list == null || list.Count == 0) { return; } int count = __result.Count; if (count > 0) { List<CardSlot> list2 = new List<CardSlot>(); for (int i = 0; i < count; i++) { int seed = GetSeed(__instance, i); float num = SeededRandom.Value(seed); int num2 = Mathf.FloorToInt(num * (float)list.Count); num2 = Mathf.Clamp(num2, 0, list.Count - 1); list2.Add(list[num2]); } __result = list2; } } private static bool HasHallucinationSlot(CardSlot slot) { if ((Object)(object)slot == (Object)null) { return false; } return (Object)(object)((Component)slot).GetComponent<HallucinationSlot>() != (Object)null; } private static int GetSeed(PlayableCard card, int index) { int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed(); int index2 = card.Slot.Index; int num = randomCounter++; currentRandomSeed = currentRandomSeed * 31 + index2; currentRandomSeed = currentRandomSeed * 31 + index; return currentRandomSeed * 31 + num; } } public class HallucinationSlot : SlotModificationBehaviour { public static ModificationType SlotType; private static bool initialized; public static void Add_HallucinationSlot() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { initialized = true; SlotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("OLD_SA.Challenge", "HallucinationSlot", typeof(HallucinationSlot), TextureHelper.GetImageAsTexture("hallucination_slot.png", (FilterMode)0)), "Hallucination Slot", "Creatures on this space attack random targets.", TextureHelper.GetImageAsTexture("hallucination_rulebook.png", (FilterMode)0), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); } } } public static class NeverHungryPatch { public static void Apply(Harmony harmony) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown Type type = typeof(CardDrawPiles).GetNestedTypes(BindingFlags.NonPublic).FirstOrDefault((Type type3) => type3.Name.StartsWith("<ExhaustedSequence>d__", StringComparison.Ordinal)); if (type == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find the compiler-generated state machine for CardDrawPiles.ExhaustedSequence."); Type[] nestedTypes = typeof(CardDrawPiles).GetNestedTypes(BindingFlags.NonPublic); Type[] array = nestedTypes; foreach (Type type2 in array) { } } else { MethodInfo methodInfo = AccessTools.Method(type, "MoveNext", (Type[])null, (Type[])null); if (methodInfo == null) { Plugin.Log.LogError((object)"[OldSa Challenge] Could not find MoveNext() in ExhaustedSequence state machine."); } else { harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(NeverHungryPatch), "ExhaustedSequence_MoveNext_Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } private static bool IsNeverHungryActive() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) try { return AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.NeverStarvationChallengeType); } catch (Exception ex) { Plugin.Log.LogError((object)("[OldSa Challenge] Failed to check NeverHungry challenge: " + ex)); return false; } } private static bool ExhaustedSequence_MoveNext_Prefix() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!IsNeverHungryActive()) { return true; } ChallengeActivationUI.TryShowActivation(ChallengeRegistry.NeverStarvationChallengeType); return false; } } [HarmonyPatch(typeof(Evolve), "OnUpkeep")] public static class NoGrowthPatch { private static readonly FieldRef<Evolve, int> NumTurnsInPlay = AccessTools.FieldRefAccess<Evolve, int>("numTurnsInPlay"); private static readonly MethodInfo PreSuccessfulTriggerSequenceMethod = AccessTools.Method(typeof(AbilityBehaviour), "PreSuccessfulTriggerSequence", (Type[])null, (Type[])null); private static readonly PropertyInfo CardProperty = AccessTools.Property(typeof(AbilityBehaviour), "Card"); private static readonly HashSet<Evolve> ProcessedEvolves = new HashSet<Evolve>(); [HarmonyPrefix] public static bool Prefix(Evolve __instance, bool playerUpkeep, ref IEnumerator __result) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)ChallengeRegistry.NoGrowthChallenge == (Object)null || AscensionSaveData.Data == null || !AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.NoGrowthChallenge.challengeType)) { return true; } PlayableCard card = GetCard(__instance); if ((Object)(object)card == (Object)null || card.Dead) { return true; } if (card.OpponentCard) { return true; } if (ProcessedEvolves.Contains(__instance)) { __result = EmptySequence(); return false; } __result = NoGrowthOnUpkeep(__instance, card, playerUpkeep); return false; } private static IEnumerator EmptySequence() { yield break; } private static PlayableCard GetCard(Evolve evolve) { if ((Object)(object)evolve == (Object)null || CardProperty == null) { return null; } object? value = CardProperty.GetValue(evolve, null); return (PlayableCard)((value is PlayableCard) ? value : null); } private static IEnumerator NoGrowthOnUpkeep(Evolve evolve, PlayableCard card, bool playerUpkeep) { if ((Object)(object)evolve == (Object)null || (Object)(object)card == (Object)null || card.Dead || card.OpponentCard == playerUpkeep) { yield break; } int turnsToEvolve = ((!((Object)(object)((Card)card).Info != (Object)null) || ((Card)card).Info.evolveParams == null) ? 1 : ((Card)card).Info.evolveParams.turnsToEvolve); int numTurnsInPlay = NumTurnsInPlay.Invoke(evolve); numTurnsInPlay++; NumTurnsInPlay.Invoke(evolve) = numTurnsInPlay; int remaining = Mathf.Max(1, turnsToEvolve - numTurnsInPlay); ((Card)card).RenderInfo.OverrideAbilityIcon((Ability)5, ResourceBank.Get<Texture>("Art/Cards/AbilityIcons/ability_evolve_" + remaining)); ((Card)card).RenderCard(); if (numTurnsInPlay >= turnsToEvolve) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.NoGrowthChallenge.challengeType); ProcessedEvolves.Add(evolve); yield return InvokePreSuccessfulTriggerSequence(evolve); if (!((Object)(object)card == (Object)null) && !card.Dead) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); ((Card)card).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.15f); CardModificationInfo growth = new CardModificationInfo { attackAdjustment = 1, healthAdjustment = 1, singletonId = "OLD_SA_NoGrowth_StatIncrease" }; card.AddTemporaryMod(growth); HideEvolve(card); card.OnStatsChanged(); ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); yield return ChallengeDialogueManager.ShowFirstTime("No Growth", "They were meant to evolve... but only an echo answered."); } } } private static void HideEvolve(PlayableCard card) { if (!((Object)(object)card == (Object)null) && card.Status != null) { if (card.Status.hiddenAbilities == null) { card.Status.hiddenAbilities = new List<Ability>(); } if (!card.Status.hiddenAbilities.Contains((Ability)5)) { card.Status.hiddenAbilities.Add((Ability)5); } ((Card)card).RenderInfo.OverrideAbilityIcon((Ability)5, (Texture)null); ((Card)card).RenderCard(); } } private static IEnumerator InvokePreSuccessfulTriggerSequence(Evolve evolve) { if ((Object)(object)evolve == (Object)null || PreSuccessfulTriggerSequenceMethod == null) { yield break; } object result = PreSuccessfulTriggerSequenceMethod.Invoke(evolve, null); if (result is IEnumerator sequence) { while (sequence.MoveNext()) { yield return sequence.Current; } } } } [HarmonyPatch(typeof(GameMap), "ShowMapSequence")] public static class NoWoodcarverDialoguePatch { private static readonly MethodInfo UnrollingSequenceMethod = AccessTools.Method(typeof(GameMap), "UnrollingSequence", (Type[])null, (Type[])null); [HarmonyPrefix] public static bool Prefix(GameMap __instance, float unrollSpeed, ref IEnumerator __result) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)ChallengeRegistry.NoWoodcarverChallenge == (Object)null || AscensionSaveData.Data == null || !AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.NoWoodcarverChallenge.challengeType)) { return true; } __result = ShowMapSequenceWithDialogue(__instance, unrollSpeed); return false; } private static IEnumerator ShowMapSequenceWithDialogue(GameMap map, float unrollSpeed) { SetFullyUnrolled(map, value: false); IEnumerator sequence = InvokeUnrollingSequence(map, unrollSpeed); if (sequence != null) { while (sequence.MoveNext()) { yield return sequence.Current; } } ((AnimatedGameMapMarker)PlayerMarker.Instance).Show(); SetFullyUnrolled(map, value: true); yield return ChallengeDialogueManager.ShowFirstTime("No Woodcarver", "Sorry,she doesn't have enough wood."); } private static IEnumerator InvokeUnrollingSequence(GameMap map, float unrollSpeed) { if ((Object)(object)map == (Object)null || UnrollingSequenceMethod == null) { yield break; } object result = UnrollingSequenceMethod.Invoke(map, new object[1] { unrollSpeed }); if (result is IEnumerator sequence) { while (sequence.MoveNext()) { yield return sequence.Current; } } } private static void SetFullyUnrolled(GameMap map, bool value) { if (!((Object)(object)map == (Object)null)) { PropertyInfo propertyInfo = AccessTools.Property(typeof(GameMap), "FullyUnrolled"); if (!(propertyInfo == null)) { propertyInfo.SetValue(map, value, null); } } } } [HarmonyPatch(typeof(MapGenerator), "GenerateMap")] public static class NoWoodcarverMapGeneratePatch { [HarmonyPostfix] public static void Postfix() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (SaveFile.IsAscension && !((Object)(object)ChallengeRegistry.NoWoodcarverChallenge == (Object)null) && AscensionSaveData.Data != null && AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.NoWoodcarverChallenge.challengeType)) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.NoWoodcarverChallenge.challengeType); } } } [HarmonyPatch(typeof(MapGenerator), "ChooseSpecialNodeFromPossibilities")] public static class NoWoodcarverPatch { [HarmonyPrefix] public static void Prefix(List<NodeData> possibilities) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (possibilities != null && !((Object)(object)ChallengeRegistry.NoWoodcarverChallenge == (Object)null) && SaveFile.IsAscension && AscensionSaveData.Data.ChallengeIsActive(ChallengeRegistry.NoWoodcarverChallenge.challengeType)) { possibilities.RemoveAll((NodeData node) => node is BuildTotemNodeData); } } } public static class OpeningHandSlotPatch { [HarmonyPatch(typeof(CardDrawPiles3D), "DrawOpeningHand")] public static class DrawOpeningHandPatch { private static IEnumerator Postfix(IEnumerator result) { yield return result; yield return (object)new WaitForSeconds(0.5f); yield return SlotChallengePatch.GenerateChallengeSlots(); } } } [BepInPlugin("OLD_SA.Challenge", "OLD SA Challenge", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Challenge"; public const string PluginName = "OLD SA Challenge"; public const string PluginVersion = "1.0.0"; internal static ManualLogSource Log; private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; ChallengeRegistry.Register(); Harmony val = new Harmony("OLD_SA.Challenge"); NeverHungryPatch.Apply(val); BrokenBagPatch.Apply(val); val.PatchAll(); WaterForestSlot.Add_WaterForestSlot(); StartledSlot.Add_StartledSlot(); HallucinationSlot.Add_HallucinationSlot(); } public static Texture2D LoadTexture(string name) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("OldSa_Challenge.Resources." + name); if (stream == null) { Log.LogError((object)("[OldSa Challenge] Missing texture: " + name)); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array); ((Object)val).name = name; return val; } } [HarmonyPatch(typeof(PlayableCard), "GetPassiveAttackBuffs")] public static class StartledPatch { [HarmonyPostfix] public static void Postfix(PlayableCard __instance, ref int __result) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.Slot == (Object)null) && HasStartledSlot(__instance.Slot)) { __result--; } } private static bool HasStartledSlot(CardSlot slot) { if ((Object)(object)slot == (Object)null) { return false; } return (Object)(object)((Component)slot).GetComponent<StartledSlot>() != (Object)null; } } public class StartledSlot : SlotModificationBehaviour { public static ModificationType SlotType; public static void Add_StartledSlot() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) SlotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("OLD_SA.Challenge", "StartledSlot", typeof(StartledSlot), TextureHelper.GetImageAsTexture("startled_slot.png", (FilterMode)0)), "Startled Slot", "Creatures on this space lose 1 attack.", TextureHelper.GetImageAsTexture("startled_rulebook.png", (FilterMode)0), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); } } public static class SlotChallengePatch { public static List<CardSlot> ModifiedSlots = new List<CardSlot>(); public static IEnumerator GenerateChallengeSlots() { if (!SaveFile.IsAscension) { yield break; } BoardManager3D board = Singleton<BoardManager3D>.Instance; if (!((Object)(object)board == (Object)null)) { ModifiedSlots.Clear(); List<CardSlot> availableSlots = ((BoardManager)board).PlayerSlotsCopy.ToList(); Random slotRandom = new Random(SaveManager.SaveFile.GetCurrentRandomSeed() + 777); int waterForestCount = AscensionSaveData.Data.GetNumChallengesOfTypeActive(ChallengeRegistry.WaterForestChallengeType); if (waterForestCount > 0) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.WaterForestChallengeType); yield return ApplySlot(availableSlots, waterForestCount, WaterForestSlot.SlotType, slotRandom); } int hallucinationCount = AscensionSaveData.Data.GetNumChallengesOfTypeActive(ChallengeRegistry.HallucinationSlotChallengeType); if (hallucinationCount > 0) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.HallucinationSlotChallengeType); yield return ApplySlot(availableSlots, hallucinationCount, HallucinationSlot.SlotType, slotRandom); } int startledCount = AscensionSaveData.Data.GetNumChallengesOfTypeActive(ChallengeRegistry.StartledSlotChallengeType); if (startledCount > 0) { ChallengeActivationUI.TryShowActivation(ChallengeRegistry.StartledSlotChallengeType); yield return ApplySlot(availableSlots, startledCount, StartledSlot.SlotType, slotRandom); } } } private static IEnumerator ApplySlot(List<CardSlot> availableSlots, int count, ModificationType slotType, Random random) { //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) if (availableSlots == null || availableSlots.Count == 0 || count <= 0) { yield break; } List<CardSlot> selectedSlots = availableSlots.OrderBy((CardSlot x) => random.Next()).Take(count).ToList(); foreach (CardSlot slot in selectedSlots) { ((HighlightedInteractable)slot).SetShown(false, false); } yield return (object)new WaitForSeconds(0.45f); foreach (CardSlot slot2 in selectedSlots) { yield return SlotModificationExtensions.SetSlotModification(slot2, slotType); if (!ModifiedSlots.Contains(slot2)) { ModifiedSlots.Add(slot2); } availableSlots.Remove(slot2); } foreach (CardSlot slot3 in selectedSlots) { ((HighlightedInteractable)slot3).SetShown(true, false); yield return (object)new WaitForSeconds(0.05f); } } } public class WaterForestSlot : SlotModificationBehaviour { public static ModificationType SlotType; private const string WATER_FOREST_ID = "oldsa_water_forest_submerge"; private readonly CardModificationInfo waterMod = new CardModificationInfo { abilities = new List<Ability> { (Ability)13 }, singletonId = "oldsa_water_forest_submerge", nonCopyable = true, RemoveOnUpkeep = false }; private static bool initialized; public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) { return (Object)(object)otherCard != (Object)null && (Object)(object)((SlotModificationBehaviour)this).Slot.Card == (Object)(object)otherCard && !HasWaterForestMod(otherCard); } public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { if (!((Object)(object)otherCard == (Object)null) && !HasWaterForestMod(otherCard) && !otherCard.HasAbility((Ability)13) && !otherCard.HasAbility((Ability)89)) { otherCard.Status.hiddenAbilities.Add((Ability)13); otherCard.AddTemporaryMod(waterMod); otherCard.OnStatsChanged(); } yield break; } private bool HasWaterForestMod(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod.singletonId == "oldsa_water_forest_submerge") { return true; } } return false; } public static void Add_WaterForestSlot() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (!initialized) { initialized = true; ModificationType slotType = SlotModificationExtensions.SetRulebook(SlotModificationManager.New("OLD_SA.Challenge", "WaterForestSlot", typeof(WaterForestSlot), TextureHelper.GetImageAsTexture("water_forest_slot.png", (FilterMode)0)), "Submerge Slot", "Creatures that enter this space gain the Submerge sigil for this battle.", TextureHelper.GetImageAsTexture("water_forest_rulebook.png", (FilterMode)0), (ModificationMetaCategory[])(object)new ModificationMetaCategory[1]); SlotType = slotType; } } } }
Chinese/OldSa_Chinese.dll
Decompiled 20 hours agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using InscryptionAPI.Ascension; using SimplifiedChineseLanguagePack; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Chinese")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Chinese")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f3343b17-e15c-4e94-ab2d-b5615a847f48")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA { [HarmonyPatch(typeof(ChallengeDisplayerPlus), "DisplayText")] public static class ChallengeDisplayerPlusPatch { private static void Prefix(ref string incompatibility) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Invalid comparison between Unknown and I4 //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Invalid comparison between Unknown and I4 if (!string.IsNullOrEmpty(incompatibility) && incompatibility.StartsWith("Incompatible with: ")) { string text = incompatibility.Substring("Incompatible with: ".Length); if ((int)Localization.CurrentLanguage == 10) { incompatibility = "与以下挑战互斥:" + text; } else if ((int)Localization.CurrentLanguage == 11) { incompatibility = "與以下挑戰互斥:" + text; } } } } } namespace OLD_SA_Chinese { public static class AbilityTranslations { public static void Init() { SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Ring Fort", "环形之壁", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Dragon's Rumble", "龙吟", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blood Recompense", "分解者", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Royalty", "王族", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Martyr's Sting", "自杀刺", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hive Will", "蜂群意志", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Retribution", "报偿", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Wind's Blessing", "风神祝福", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Tempest", "飓风打击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Cunning", "狡诈", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Wolf and Warg", "狼狈为奸", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Greed's Sin", "贪婪之罪", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bloodlust Rising", "吞噬", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Immolate", "焚尽", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Inferno", "炼狱", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Deadly Fang", "毒牙", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Death Spray", "死亡喷射", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blaze", "烈火", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Poison", "剧毒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Gluttony", "暴食", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Strafe Strike", "奔袭", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Infinite", "无尽", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Random", "不定", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Penalty", "代价", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blood Strike", "血袭", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Writhe", "挣扎", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Proliferation", "增殖", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Entangle", "纠缠", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Pitfall Trap", "诱杀", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Cache", "藏秘", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bones Feast", "吞骨殆尽", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Collect Bones", "拾骨", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Crimson Rush", "猩红狂袭", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Fileswarm", "蝇群", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bones Armored", "坚骨硬甲", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Incorporal", "无形之物", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Submerge Slot", "水袭格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Perseverance", "坚定", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Shell Defense", "硬壳防护", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bloody Gear", "猩红齿", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blood", "血腥", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Gorebound", "血腥结合", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bone Devourer", "食骨者", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Fighter", "斗士", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Annihilation", "终焉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Balance", "平衡", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Flying Strike", "腾飞打击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Prosperity", "繁荣", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Coiled", "蓄势", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Oak", "橡树之奖", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "BonesCarnival", "骨宴之奖", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Cenotaph", "铭墓之奖", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blood Acolyte", "血徒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Slow", "缓慢", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Slow Strike", "缓慢打击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Healing Armor", "再愈之甲", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppeteer", "操偶师", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet Happy", "傀儡_喜", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Memorial", "纪念品", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet Sad", "傀儡_哀", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Denial", "套中人", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet Fear", "傀儡_惧", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "RagePuppeteer", "上位者", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet Rage", "傀儡_怒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Stubborn Resistance", "负隅顽抗", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet Rejection", "傀儡_狂欢", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Carnival Master", "狂欢之主", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bell Toes", "脚趾铃铛", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Toe Bell", "铃铛脚趾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Speed", "极速", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Raid", "突袭", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blitz", "闪袭", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Redirect Strike", "转向直击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Diagonal Block", "对角格挡", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bone Strike", "骨袭打击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sweep", "横扫", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Vampire", "吸血鬼", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Frenzy", "狂热", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hallucinogenic", "迷幻粉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Death Roll", "死亡翻滚", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Devouring Maw", "吞世之胃", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Split", "分裂", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Double Draw", "二连抽", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Enrage", "激怒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Arbiter", "仲裁者", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Startled Slot", "恐惧格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hallucination Slot", "迷幻格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Water Music", "水之歌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Imitator", "模仿者", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Molting", "蜕壳", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Osteophagia", "食骨癖", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sage", "慧者", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Wondrous Brush", "妙笔", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Twisted Growth", "畸形成长", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Lightning", "风驰电掣", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Forced March", "急行军", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Armor Strike", "硬壳打击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Enrage Armor", "愤怒之甲", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Fatal Bargain", "致命交易", (Language)10); } } public static class CardTranslations { public static void Init() { SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Ring Dragon", "环形龙", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Wasp", "杀人蜂", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bee Worker", "工蜂", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bee Queen", "蜂后", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Broken Bird", "碎骨鸟", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Quetzalcoatlus", "风神翼龙", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Warg", "狈", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Wolf With Warg", "狼与狈", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Dart Frog", "箭毒蛙", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hungry Wolf", "饿狼", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Infero Dog", "地狱犬", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Antelope", "羚羊", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "World Snake", "世界蛇", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Lynx", "猞猁", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Cat Of Ulthar", "乌撒之猫", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Whorltooth Worm", "旋齿蠕虫", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Nepenthes", "猪笼草", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Stranglevien", "绞藤", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Broken Pelt", "残破皮毛", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Broken {0}", "残破{0}", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Spirit Bear", "灵熊", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bonepod Bloom", "繁花骨荚", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Consumable Squirrel", "背包松鼠", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Holy Pelt", "神圣皮毛", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bonegull", "拾骨雀", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hollowgaze", "林瞳鸦", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Files", "苍蝇", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Carrion Fly", "食腐蝇", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Broken Flesh", "残破血肉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Aberration Flesh", "畸形血肉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Geargrass", "锯齿草", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Gulper eel", "吞噬鳗", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Stitched Spores", "缝合孢子", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Stag Beetle", "锹甲", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Nidhogg", "尼德霍格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Ratatoslk", "拉塔托斯克", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Vedrfolnir", "韦德弗尔尼尔", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Mantis shrimp", "螳螂虾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Shaman Totem", "萨满图腾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blood Fox", "血魇狐", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Baron Slug", "蛞蝓男爵", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet", "人偶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppeteer Happy", "愚笑假偶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppeteer Sad", "悲祷瓷人", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppeteer Rage", "怒咆狂铸", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppeteer Fear", "忧惧纸影", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Jester", "弄臣", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bell Toes", "铃铛脚趾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Carnival Master", "狂欢剧主", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Swift", "雨燕", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Lion", "雄狮", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Black Panther", "黑豹", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Triceratops", "三角龙", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Ink Adder", "墨纹黑蛇", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hunter Dove", "猎鸠", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Mosquito Duke", "骨蚊公爵", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Crocodile", "鳄鱼", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hallucination Moth", "催幻绒蛾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Devourer World", "吞世魔", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Slime", "史莱姆", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bone Cicada", "骨翅蝉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Pure {0}", "纯洁{0}", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Honey Badger", "蜜獾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hyena", "鬣狗", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Tailsaur Fiend", "尾蜥恶犾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Snail", "蛞蝓", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Pure Pelt", "纯洁毛皮", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Lobster", "龙虾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Crab", "螃蟹", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Siren", "塞壬", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Armored catfish", "非洲骨鲶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Parrot", "鹦鹉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Giraffe", "长颈鹿", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hermit Crab", "寄居蟹", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Marvelous bear", "神奇的熊", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Puppet Tail", "断线的尾巴", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Aborted Idol", "畸胎圣像", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blood Bolete", "吸血牛肝菌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Cheetah", "猎豹", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Ostrich", "鸵鸟", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Rageclaw Crabspider", "怒爪蟹蛛", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Kampert", "坎珀特", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Mercenary Squirrel", "松鼠雇佣兵", (Language)10); } } public static class ChallengeTranslations { public static void Init() { SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "No Growth", "禁止成长", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Fledgling sigils no longer evolve. They only grant +1 Power and +1 Health.", "幼雏印记将不会进化为成长体且只提供1攻击与1生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "No Woodcarver", "禁止木雕", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "You will no longer encounter Woodcarver choice nodes.", "你将无法遇见木雕师的选择节点", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Dizzy Starters", "晕头转向", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "All creatures in your starting deck gain the Random sigil.", "你初始卡组的造物都将拥有不定印记", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Double Trial", "双重试炼", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "All Totem battles in this run have bases with the Double Strike sigil.", "你遇到的所有图腾战斗都将是双重打击印记", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Broken Start", "残破开局", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "One of your starting pelts is replaced with a Broken Pelt.", "将你的一张初始毛皮替换成残破毛皮", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Bad Things", "坏事多多", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "One of your starting creatures is replaced with a Broken Pelt.", "将你的初始卡组一张卡替换为残破毛皮", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Elephant Bosses", "巨象头目", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "On the second turn, the Boss will fill the board with Elephants.", "在第二阶段,敌方场上将铺满大象", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Broken Bag", "破碎背包", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "You will not encounter the Hourglass, Skinning Knife, Scissors, or CuckooClock.", "你将无法拿到沙漏,剥皮刀,剪刀与顺时针", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Never Starvation", "永不饥饿", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "You will never encounter starvation, even when there are no cards left to draw.", "即使无牌可抽,你也不会遭遇饥饿", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Water Forest", "水之森", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Turn one of your spaces into a Submerge Slot.", "将你的一个格子变为水袭格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sorry,she doesn't have enough wood.", "抱歉,她没有那么多木头了", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "They were meant to evolve... but only an echo answered.", "它们本应蜕变...却只有一次微弱的回响", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Your creature has left you.I kept this for you.", "你的造物离你而去,我帮你留下了一些东西", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sorry,I don't have anything better.Good luck.", "抱歉,我没有更好的了,祝你好运", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "They have all lost their sense of direction.", "它们都失去了方向感", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Not much for you to choose from this time.", "这次可没那么多给你选了", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hallucination Forest", "幻觉森林", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Turn one of your spaces into a Hallucination Slot.", "将你的一个格子变为迷幻格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Startled Forest", "忧惧森林", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Turn one of your spaces into a Startled Slot.", "将你的一个格子变为恐惧格", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Overkill Punishment", "溢出惩戒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Leshy's overkill damage also affects your hand.", "莱西的溢出伤害将可以作用于你的手牌", (Language)10); } } public static class DialogueTranslations { public static void Init() { SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A new cycle begins... Even death can give birth to new life.", "一个新的循环……死亡亦能孕育新生。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It departs, leaving its enemies to suffer the consequences. But the Ring never ends, and neither does its return.", "它离开了,为敌人带来惨痛的代价。但环永不止息,它会再次归来。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A pitiful creature... yet this time, it managed to protect everything.", "可悲的生物……但这一次,它成功守护了一切。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This... this is impossible?", "这……这怎么可能?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "They always attack at the cost of their own lives.", "它们总是舍命攻击。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "They will give everything for their loyalty.", "它们会为了忠诚而奉献一切。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Her massive body symbolizes the nobility within the hive.", "她硕大的身躯代表着她在蜂群中的尊贵。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "She shall lead her swarm to victory.", "她会带领自己的子民走向胜利。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A pitiful creature. Its right to fly was taken from it by those who abused it.", "一个可怜的生物,因遭受施暴从而失去了飞翔的权利", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It makes all who commit violence pay the price.", "它会让所有施暴者付出代价", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "They are the rulers of the sky, destroying enemies with hurricanes.", "它们是天空的霸主,以飓风摧毁敌人", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It spreads its wings, sending creatures soaring into the sky.", "它展开双翼,令生物翻飞而起", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "The wind god rejects your gift. It will soar by its own power.", "风神拒绝了你的恩赐,并决定自己乘风而起", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It spreads its wings, but they have long been broken.", "它试图扇动翅膀,但它们早已满目疮痍", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Where the Wolf treads, the Wrag is near.", "狼之所至,狈影随行", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A cunning creature that exists only in legends.", "一个狡诈并且只在传说中出现的造物", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It is cloaked in venom — keep your distance.", "它剧毒裹身,最好不要靠近", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Right now, it could swallow anything.", "现在它几乎什么都能吃下", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It commands the flames — even Hell fears it.", "它是火焰的掌控者,连地狱都畏惧于它", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Watch its horns,sometimes they strike true.", "小心它的角,有时候总是非常致命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "I really don't know if I should let you pick this one...", "我真不知道该不该让你选择它...", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It never knows contentment.", "它永远不懂得知足", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "To make it obey you, you must pay a price.", "想要使用它,总得付出点什么", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Habituated to life, he struggles on.", "它已经习惯了活着,因此挣扎求生", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Attack with care. More of its kind may lurk in the dark.", "谨慎攻击,你并不知道黑暗里还有多少一样的猫", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Little aggression, but entanglement brings trouble.", "它几乎没有攻击性,但是被缠上总会很麻烦", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It did nothing. The insects fell in of their own accord.", "它什么也没做,这些虫子是自己进去的", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "What's this?!", "这是什么鬼?!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "What good do you think I have to offer you?", "你难道觉得我会给你什么好东西吗?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Blooms and thorns hide an old‑god's bone.", "繁花与荆棘掩藏着邪神之骨", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Ice‑age ghost, keeper of old rainforest secrets.", "它是冰河世纪的遗魂,藏在雨林深处的秘宝", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Your creatures have all been driven wild by this.", "你的造物们因此激发了野性", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Your creatures are purged of impurity and grow stronger.", "你的造物们洗涤杂质,并且变得更加强大", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It carries bone back to its nest.", "它会将骸骨带回自己的巢穴", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "One, two... or maybe more?", "一只,两只,或许更多?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "They feed on carrion. They are everywhere.", "它们以腐肉为食,无处不在", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "You really think this will work?", "你真觉得这会成功?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Attracted some annoying stuff...", "招来了一些惹人烦的东西...", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "The creatures shrink from it in fear.", "造物们都对它望而生畏", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Join me! Become part of me!", "加入我!成为我!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This time, it answers more than a call.", "它这次不再只是听从召唤", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "You pick!", "你来选择!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "We stitch!", "我们缝合!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Choose your stats.", "选择你的属性", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Choose your cost.", "选择你的成本", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Choose your sigils.", "选择你的印记", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Not enough! We need more!", "不够!我们需要更多!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Come back next time!", "下次再来!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "I really hate them.", "我真的很讨厌它们", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sorry. You can't draw anymore.", "抱歉,不准抽牌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "What did you do?", "你干了什么?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Never mind. The Angler should like this.", "算了,钓鱼人应该会喜欢的", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It is fiercely competitive and always seeks to prove itself against its opponents.", "它拥有极强和好胜心,时常想与对手一决胜负", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Beware its fists. They often seek a one-hit kill.", "当心它的拳头,它们总是追求一击毙命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "You can't smoke this.", "你不能抽这个", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A shaman totem standing on the battlefield, its power enough to awaken the most primal instincts.", "矗立于战场上的萨满图腾,其蕴含的力量足以唤起最原始的本能", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It hungers. It thirsts.", "它正在渴望,它正在渴求", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It moves slowly, but it is enough to hold the enemy back.", "它虽说行动缓慢,但也足够拖住敌人", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Joy, anger, sorrow, fear—it smiles foolishly, it sneers.", "喜怒哀惧,它在愚笑,它在嗤笑", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Joy, anger, sorrow, fear—it weeps bitterly, it prays in grief.", "喜怒哀惧,它在痛哭,它在悲祷", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Joy, anger, sorrow, fear—it flees, it dreads.", "喜怒哀惧,它在逃避,它在忧惧", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Joy, anger, sorrow, fear—it roars in rage, it howls in fury.", "喜怒哀惧,它在怒咆,它在怒啸", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "See his toes of bells! See his bells of toes!", "他的脚趾像铃铛,他的铃铛像脚趾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Covet joy, abuse wrath, swallow sorrow, bring fear—next comes an endless revelry!!!", "觊觎欢喜,滥用愤怒,吞咽哀伤,带来恐惧,接下来是永不停息的狂欢!!!", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Its performance has come to an end.", "它的演出已然落幕", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It is like a lone commander...", "它如同一个光杆司令般怒咆", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It is extremely fast. Enemies had better beware its assault.", "它的速度极快,敌人可得当心它的攻势了", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "The mighty lion prefers to eliminate the root of problems rather than solve them", "强壮的雄狮比起解决问题,更会解决问题的源头", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It moves so fast none can catch it.", "它的速度快得没有谁能捉住它", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Its horns can withstand all powerful attacks.", "它的角可以抵挡许多强势的攻击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Its body is highly toxic, and it is very difficult to catch.", "它的体表含有剧毒,且十分不易被抓住", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Its gaze is sharp, and it can often pursue its prey.", "它的眼神锐利异常,对猎物穷追不舍", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sharp teeth, biting enemies to death.", "伶牙俐齿,死咬敌人", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It does not fight on its own, but the hallucinogenic powder on its body is enough to cloud the mind.", "它虽说不会主动厮杀,但身上的迷粉足以让人神志不清", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It hungers. It feeds. It never ends.", "它在饥饿,它在啃食,永无止境", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sometimes trouble just keeps multiplying.", "有时候麻烦总是越来越多", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "There are more and more of them...", "它们变得越来越多了...", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hiding away... until the ground turns into a graveyard.", "蛰伏,直到地底变成坟墓", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Not bird, not wolf. What is it? What is it not?", "似鸟非鸟,似狼非狼,它究是何,何究是它", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It always likes to provoke powerful creatures.", "它总是喜欢去招惹强大的生物", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Hyenas always like to travel in packs with their companions.", "鬣狗总是喜欢和它的同伴们成群结队", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Surprised? My overkill damage can reach your hand now. Be careful with your first card.", "很意外吗?我的溢出伤害现在也对你有效了,小心你的第一张手牌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Arloph Sterling, the Dark Arbiter Beast, also known as the Tailsaur Fiend.", "阿尔洛浦·斯特林,暗黑的仲裁之兽,又称之为尾蜥恶犾", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Given the chance, they will heal.", "只要有机会,它终会痊愈", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Its hard shell blocks attacks, and its claws can pin enemies.", "它的壳无坚不摧,它的钳无物不碎", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It will keep holding on until the eve of victory.", "它会一直坚持,直到胜利的朝夕", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "I love you. Beneath the waves, I hide a kiss and a heart.", "我爱你,在水下,我藏着一个吻和一颗心", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A parrot that loves to mimic—is it a bit too noisy?", "一个爱模仿的鹦鹉,但似乎有点太吵了?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A parrot that loves to mimic—is it a bit too noisy?", "一个爱模仿的鹦鹉,但似乎有点太吵了?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "A tall giraffe... it seems to be craving bones?", "一只高大的长颈鹿,它似乎正在渴望骨头?", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This hermit crab is looking for its shell.", "这只寄居蟹正在寻找自己的壳", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Though never trained by a master, his innate magic compels him to draw wonders.", "他并非大师门下,但他的魔法天赋依然驱使他画出了不可思议的东西", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Viska's mind is filled with mad whispers, and they grow worse as its flesh grows.", "维斯卡的脑子里全是痴语,这会伴随它血肉的生长愈演愈烈", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "The cheetah is swift as lightning—a hundred meters in a flash.", "猎豹的速度风驰电掣,百米犹如一瞬", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It's different from other birds—you'd better watch out for those legs of its.", "它其他的鸟不同,你可得小心它的那双粗壮的大腿了", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Don't touch it... The stimulation of blood will only make it grow larger and larger.", "别碰它...鲜血的刺激会让它越长越大", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Sometimes, even without blood...", "有时候,哪怕无需鲜血的滋养...", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "It seems to be in a constant state of rage, eager to tear its enemies apart...", "它似乎无时无刻处于愤怒状态,渴望将敌人撕碎...", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Opportunity seldom exists without its toll.", "机会总与代价常相伴", (Language)10); } } [BepInPlugin("OLD_SA.Chinese", "OLD SA Chinese", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown RulebookTranslations.Init(); AbilityTranslations.Init(); CardTranslations.Init(); DialogueTranslations.Init(); ChallengeTranslations.Init(); Harmony val = new Harmony("OLD_SA.Chinese"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Chinese loaded"); } } public static class RulebookTranslations { public static void Init() { SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills another creature, a card is created.", "当[creature]消灭另一个造物时,持有者会获得一张卡牌。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] dies, it deals 1 damage to a random enemy, increasing each time it takes damage.", "当[creature]死亡时,对随机一个敌方造物造成1点伤害。每当它受到伤害时,将会增加", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] takes damage, it intercepts the attack and reduces that damage by 1.", "[creature]会拦截敌方造物的攻击,并使受到的伤害降低1点。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This creature's attack is determined by the number of different tribes present on the board.", "该造物的攻击力由场上存在的不同种族数量决定。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "The lower this creature's health, the higher its attack.", "该造物的生命越低,它的攻击就越高。", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When a specific card is played on [creature], they fuse with each other.", "当你对[creature]打出特定卡牌时,它们会融合", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When an enemy creature attacks the player, [creature] causes it to lose Power.", "当一个敌方造物攻击持牌人时,[creature]会令其失去力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of the turn, [creature] grants Wind Blessing to itself and adjacent creatures.", "当回合开始时,[creature]会给予相邻和自身风祝福效果.", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "For each flying ally, [creature] attacks an additional time.", "友方每有一个空中造物,[creature]便额外攻击一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When another sigil on [creature] triggers, it triggers an additional time.", "当[creature]的其他印记触发时,它们会额外触发一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When there is a creature opposite [creature], [creature] gains Power equal to the number of sigils on that creature.", "当[creature]对面有其他造物时,[creature]会根据目标的印记数量而增加力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills another creature, a random opposing creature gains 5 Gluttony.", "当[creature]击杀一个造物时,一个友方获得1点暴食,共5次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills a creature, it gains 2 Gluttony.", "当[creature]击杀时,获得2点暴食", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of the end, [creature] gives the opposing creature 3 Blaze.", "回合结束时,[creature]会给予对面造物3点烈火", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of the turn, [creature] gives 1 Blaze to all opposing creatures.", "回合开始时,[creature]会给予所有敌方1点烈火", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, it gives Poison equal to 4 minus its Power to the target.", "当[creature]攻击时,会给予目标4减去自身攻击的剧毒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] dies, it gives 4 Poison to a random enemy.", "当[creature]死亡时,给予一个随机敌人4点剧毒", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Every 2 Blaze, the bearer takes 1 damage.", "每有2点烈火,则受到1点伤害", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Every 4 Poison, the bearer dies.", "每有4点剧毒,则自身毒发身亡", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Every 3 Gluttony, the bearer gains 1 Power and 1 Health.After triggering 3 times in a battle, the bearer dies.", "每有3点暴食,则获得1生命与1攻击,每累计触发3次,则死亡", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "After [creature] moves, it attacks.", "当[creature]移动时,它会攻击一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of each turn, [creature] regains lost sigils.", "当回合开始时,[creature]将会恢复印记", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, its target is random.", "[creature]的攻击目标是随机的", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is played, its owner takes 1 damage.", "当[creature]上场时,对持有者造成1点伤害", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills, it gains 1 attack.", "当[creature]击杀时,它会获得1次攻击次数", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] would take lethal damage, it survives with 1 health and loses attack equal to the excess damage. If its attack is 0, it dies.", "当[creature]受到致命伤害时,会保留1生命并且以攻击来抵挡伤害", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] takes damage, a 1/1 copy of it is created in the owner's hand for 2 Bone.", "当[creature]受伤时,在你的手中创造一张该卡的副本,副本拥有1/1的属性与2骨头的消耗", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is killed, the creature that killed it permanently loses 2 attack.", "当[creature]被击杀时,击杀者将会失去2点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is attacked by an Insect, it takes no damage and kills the attacker. It gains 1 Power and 1 Health.", "当[creature]被虫族攻击时,它不会受到伤害反而吞噬敌方并且获得1点力量与生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills a creature, gain a random item.", "当[creature]击杀时,获得一个随机道具", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When a creature is sacrificed to summon [creature], gain 3 Bones from it.", "当一个造物被献祭以召唤[creature],获得3根骨头", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When another creature dies, if [creature] is on the board, gain 1 Bone.", "当其他造物死亡时,如果[creature]在场,则获得1根骨头", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, it targets opposing creatures first and gains 1 additional attack after a kill.", "当[creature]攻击时,优先锁定敌方造物,并且击杀后获得1次额外攻击次数", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When an ally dies, [creature] summons a card in its place.", "当友方阵亡时,[creature]在其位置召唤一张卡牌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] takes damage, if bones are available, it consumes them to prevent that damage.", "当[creature]受到攻击时,如果数量允许,则消耗骨头来抵挡攻击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is on the board, it cannot be hit, and it cannot hit enemies.", "当[creature]在场时,它不会受到敌方造物的攻击,同样它对敌方造物造成伤害", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Creatures that enter this space gain the Submerge sigil for this battle.", "进入过此格的造物将拥有水袭", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When an ally takes damage, if that damage is less than 2, [creature] gives it 1 Health.", "当友方受伤时,若伤害低于2,则[creature]给予其1点生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] would take 1 damage, prevent it and deal 1 damage to the attacker.", "当[creature]受伤时,如果伤害量为1,则免疫并反弹", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] deals damage, give the struck creature 1 Blood. When it dies, create a Flesh in your hand.", "当[creature]造成伤害时,施加1点血腥,且它在死亡时在你的手中创造一张血肉", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Crimson everywhere, flesh growing wild.", "猩红遍地,血肉横生", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] sacrifices another creature, it gains 1 Power and 1 Health for each tribe that sacrificed creature has.", "当[creature]献祭时,被献祭者每个种族为它提供1点生命与力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When a bone appears, [creature] devours one. For every 3 bones devoured, [creature] gains 1 Power and 1 Health.", "当出现骨头时,[creature]会吞掉1根,每吞掉3根,[creature]则获得1点力量与生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills another creature, randomly gain 1 Power or 2 Health.", "当[creature]击杀时,获得1点力量或者2点生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the end of the turn, [creature] kills all creatures with less than 2 Health. For each creature killed this way, [creature] gains 1 Power.", "当回合结束时,[creature]会击杀所有生命值不足2的敌方,每次击杀[creature]将获得1点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When a creature is played, [creature] balances its stats, giving allies the highest value and enemies the lowest value.", "当造物出场时,[creature]会令它们的数值保持平衡", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, make an additional Flying Strike.", "当[creature]攻击时,将额外攻击一次,并视为空袭效果", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills another creature, it and adjacent friendly creatures gain 1 Health.", "当[creature]击杀时,其相邻友方和自身获得1点生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When an ally deals damage, [creature] gains 1 Power until the end of the turn.", "当友方造成伤害时,[creature]获得1点力量,持续至回合结束", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Add 1 Squirrel to your hand.", "获得1张松鼠", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Gain 4 Bones.", "获得4根骨头", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Once per battle, when a friendly card dies, create a Grave in its place.", "友方造物阵亡时,在其位置创建一张墓碑", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "[creature] grows stronger with each sacrifice.", "[creature]可以从献祭中变得更加强大", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] deals damage, the struck creature gains 2 Slow.", "当[creature]造成造成伤害时,施加2层缓慢", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Every 3 Slow, the bearer loses its attack this turn.", "每有3点缓慢,此造物将在攻击时抵消一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of the turn, if [creature] took no damage during the last enemy turn, it restores 2 Health.", "回合开始时,若[creature]在上一个敌方回合没有受伤,则恢复2点生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When the Puppeteer's stats change, [creature] changes as well.", "当操偶师发生属性修改时,[creature]也会一同获得", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is played, place a Puppet on its left.", "当[creature]上场时,在其左侧放置一张人偶,若被阻挡,则会先使其回到手中", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This creature's attack is determined by the number of puppets bound to it.", "该值取决于场上与其绑定的人偶数量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is played, place a Puppet opposite it.", "当[creature]上场时,在其对位放置一张人偶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills, it returns to your hand and leaves a card in its place.", "当[creature]击杀时,回到手中并留下一张卡牌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] dies, a chosen card from your hand is placed in its position.", "当[creature]阵亡时,你手中的一张卡来到其位置", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is on the board, adjacent allies lose 1 Power.", "与[creature]相邻的造物将降低1点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When an ally takes damage, [creature] gives an ally 1 Power.", "当友方受到伤害时,[creature]使一个友方获得1点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] has this sigil, it does not attack its Puppeteer.", "[creature]不会攻击其主人", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is played, it transforms an allied creature into a Puppet.", "当[creature]上场时,令一个友方变为人偶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "For every two sacrifices made, [creature] adds a Puppet to your hand.", "每执行两次献祭,[creature]会为你添加一张人偶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When another creature is played, [creature] turns it into a Puppet.", "当其他卡上场时,[creature]将其变为人偶", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When an ally is about to die, [creature] dies in its place.", "当其他卡即将死亡,[creature]将代替其死亡", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "For every 3 Speed, attacks once.", "每有3点极速,就攻击一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is played, it gains 2 Speed. Then, at the end of each turn, it gains 2 Speed.", "当[creature]上场时,获得2点极速,过后每回合结束时获得2点极速", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is about to be attacked, it counterattacks once and moves.", "当[creature]即将受到攻击时,反击一次并移动", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "[creature] excess damage is dealt directly to the player.", "[creature]的溢出伤害将直接作用于牌手", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "[creature] the damage it ultimately takes is 5 minus its stat.", "[creature]受到的最终伤害将为5减去其数值", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, spend 1 Bone. For every 2 Bones spent, attack an additional time.", "当[creature]攻击时,消耗1根骨头,每消耗2根,获得一次攻击次数", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, it deals 1 damage to all enemy creatures.", "当[creature]攻击时,对所有敌方造成1点伤害", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] deals damage, it heals 1 damage.", "当[creature]造成伤害时,恢复1点生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills another creature, it moves.", "当[creature]击杀时,移动一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is about to be attacked, the attacker's target is randomized.", "当[creature]被攻击时,使攻击者的目标随机化,敌我不分", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of the turn, [creature] deals 1 damage to the card opposite it, repeated for each time it has attacked.", "当回合开始时,[creature]对对位卡造成1点伤害,重复次数为[creature]对其的攻击次数", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills a creature, it gains that creature's Power, Health, and sigils.", "当[creature]击杀时,获得被击杀造物的力量,生命与印记", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] dies, place a Split card on its left and right. The Split card's stats are half of this card's.", "当[creature]阵亡时,在左侧与右侧各放置一张分裂卡,分裂卡的数值为该卡的一半", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] is drawn, draw an additional card.", "当[creature]被抽到时,从主牌堆再抽一张牌", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] deals damage, the target gains 1 Power.", "当[creature]造成伤害时,受击者获得1点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the start of the turn, [creature] deals 1 damage to a random enemy. If it does not kill, the next trigger repeats one additional time.", "当回合开始时,[creature]对一个随机敌方造成1点伤害,如若未击杀,则下一次触发次数+1", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Creatures on this space attack random targets.", "该格上的造物的攻击目标是随机的", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Creatures on this space lose 1 attack.", "该格上的造物将损失1点攻击", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When a creature emerges, if it is an ally, [creature] gives it 1 Power; if it is an enemy, [creature] reduces it by 1.", "当造物浮出水面时,如果是友方,[creature]给予其1点力量,如果是敌方,[creature]减少其1点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This creature's attack is equal to the attack of the creature that attacked most recently while it was on the board.", "该造物的攻击等于它在场上时最近执行过攻击行为的造物的力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the end of the turn, [creature] takes 1 additional damage. At the end of the next turn, remove this effect and gain Armored. This repeats.", "当回合结束时,[creature]受到的伤害增加1,再下一个回合结束时,解除此状态并获得身披坚甲,循环往复", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When you click [creature], consume 1 bone and gain 1 Health.", "当点击[creature]时,消耗1根骨头并获得1生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] kills another creature, it gains Power and Health equal to the number of sigils that creature had.", "当[creature]击杀时,被击杀者每有一个印记便获得一点力量与生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "This creature's Power is equal to the number of sigils on all creatures on the board.", "该造物的力量等于场上所有造物印记数量的总和", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the end of the owner's turn, [creature] gains 1 Health. If [creature] killed a creature this turn, it gains 1 Power and 2 Health instead.", "回合结束时,[creature]获得1点生命,如果[creature]在本回合击杀过造物,则改为获得1点力量与2点生命", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When a friendly creature moves, [creature] gains 1 Power until the end of its next turn.", "当一个友方移动时,[creature]获得1点力量,持续至下个回合结束", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "At the end of the owner's turn, [creature] moves repeatedly in one direction until it can move no further.", "回合结束时,[creature]会移动至可以移动到的最远处", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "When [creature] attacks, it attacks once more for each layer of Armor.", "当[creature]攻击时,每有一层身披坚甲则额外攻击一次", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "Whenever [creature] loses 1 stack of DeathShield, it gains 2 Power.", "当[creature]损失身披坚甲时,每损失1层则获得2点力量", (Language)10); SimplifiedChineseLanguagePackPlugin.Translate("OLD_SA", (string)null, "While [creature] is on the field, the player cannot draw a card at the start of each turn.", "当[creature]在场时,玩家将无法在回合开始时抽牌", (Language)10); } } }
Sigil/OldSa_Annihilation_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Annihilation_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Annihilation_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("795f6556-1ddc-446e-8cf0-2c04f724a510")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Annihilation; public static class AnnihilationAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Annihilation"; val.rulebookName = "Annihilation"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Annihilation.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the end of the turn, [creature] kills all creatures with less than 2 Health. For each creature killed this way, [creature] gains 1 Power."); } ability = AbilityManager.Add("OLD_SA", val, typeof(AnnihilationBehaviour), imageAsTexture); } } public class AnnihilationBehaviour : AbilityBehaviour { public static Ability ability; public override Ability Ability => AnnihilationAPI.ability.Id; public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return true; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); List<PlayableCard> targets = GetAnnihilationTargets(); foreach (PlayableCard target in targets) { if (!((Object)(object)target == (Object)null) && !target.Dead && target.OnBoard && target.Health < 2) { yield return target.Die(false, ((AbilityBehaviour)this).Card, true); yield return (object)new WaitForSeconds(0.25f); if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { CardModificationInfo mod = new CardModificationInfo(1, 0); ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); ((Card)((AbilityBehaviour)this).Card).RenderCard(); ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); } } } if (!((AbilityBehaviour)this).Card.Dead) { yield return ((AbilityBehaviour)this).LearnAbility(0f); } } private List<PlayableCard> GetAnnihilationTargets() { List<PlayableCard> list = new List<PlayableCard>(); List<CardSlot> enemySlots = GetEnemySlots(); foreach (CardSlot item in enemySlots) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Card == (Object)null)) { PlayableCard card = item.Card; if (!card.Dead && card.OnBoard && card.Health < 2) { list.Add(card); } } } return list; } private List<CardSlot> GetEnemySlots() { BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return new List<CardSlot>(); } if (((AbilityBehaviour)this).Card.OpponentCard) { return instance.PlayerSlotsCopy; } return instance.OpponentSlotsCopy; } } [BepInPlugin("OLD_SA.Annihilation", "OLD SA Annihilation", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { AnnihilationAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Annihilation loaded."); } }
Sigil/OldSa_Balance_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Balance_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Balance_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1b083245-323f-440b-b777-4d61ae69dcd5")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Balance; public static class BalanceAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Balance"; val.rulebookName = "Balance"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Balance.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When a creature is played, [creature] balances its stats, giving allies the highest value and enemies the lowest value."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BalanceBehaviour), imageAsTexture); } } public class BalanceBehaviour : ExtendedAbilityBehaviour { private static HashSet<PlayableCard> calculating = new HashSet<PlayableCard>(); public override Ability Ability => BalanceAPI.ability.Id; private int GetRawAttack(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return 0; } return ((Card)card).Info.Attack; } private int GetCurrentHealth(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } return card.Health; } public override int GetPassiveAttackBuff(PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return 0; } if ((Object)(object)target == (Object)null || target.Dead || !target.OnBoard) { return 0; } if ((Object)(object)target == (Object)(object)((AbilityBehaviour)this).Card) { return 0; } if (calculating.Contains(target)) { return 0; } calculating.Add(target); try { int rawAttack = GetRawAttack(target); int currentHealth = GetCurrentHealth(target); int num = ((target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) ? Mathf.Min(rawAttack, currentHealth) : Mathf.Max(rawAttack, currentHealth)); return num - rawAttack; } finally { calculating.Remove(target); } } public override int GetPassiveHealthBuff(PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return 0; } if ((Object)(object)target == (Object)null || target.Dead || !target.OnBoard) { return 0; } if ((Object)(object)target == (Object)(object)((AbilityBehaviour)this).Card) { return 0; } if (calculating.Contains(target)) { return 0; } calculating.Add(target); try { int rawAttack = GetRawAttack(target); int currentHealth = GetCurrentHealth(target); int num; if (target.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard) { num = Mathf.Max(rawAttack, currentHealth); } else { num = Mathf.Min(rawAttack, currentHealth); if (rawAttack == 0 && num == 0) { num = 1; } } return num - currentHealth; } finally { calculating.Remove(target); } } } [BepInPlugin("OLD_SA.Balance", "OLD SA Balance", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { BalanceAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Balance loaded."); } }
Sigil/OldSa_Blessing.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Blessing")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Blessing")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("6d19ef0e-8b62-4cde-b8c7-49a209400275")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Blessing; public static class BlessingEffectManager { private static readonly Dictionary<BlessingType, IBlessingEffect> Effects = new Dictionary<BlessingType, IBlessingEffect>(); public static void Register(BlessingType type, IBlessingEffect effect) { Effects[type] = effect; } public static IBlessingEffect GetEffect(BlessingType type) { if (Effects.TryGetValue(type, out var value)) { return value; } return null; } public static void Apply(PlayableCard card, BlessingType type) { GetEffect(type)?.Apply(card); } } public static class BlessingManager { private static readonly Dictionary<PlayableCard, List<BlessingType>> Blessings = new Dictionary<PlayableCard, List<BlessingType>>(); public static void AddBlessing(PlayableCard card, BlessingType type) { if (!((Object)(object)card == (Object)null)) { if (!Blessings.ContainsKey(card)) { Blessings.Add(card, new List<BlessingType>()); } if (!Blessings[card].Contains(type)) { Blessings[card].Add(type); } } } public static bool HasBlessing(PlayableCard card, BlessingType type) { if ((Object)(object)card == (Object)null) { return false; } if (!Blessings.ContainsKey(card)) { return false; } return Blessings[card].Contains(type); } public static void RemoveBlessing(PlayableCard card, BlessingType type) { if (!((Object)(object)card == (Object)null) && Blessings.ContainsKey(card)) { Blessings[card].Remove(type); } } public static void ClearCard(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Blessings.Remove(card); } } public static void ClearAll() { Blessings.Clear(); } } public static class BlessingRegister { public static void Register() { BlessingEffectManager.Register(BlessingType.Wind, new WindBlessingEffect()); } } public enum BlessingType { Wind, Fire, Water, Earth } public interface IBlessingEffect { void Apply(PlayableCard card); void Remove(PlayableCard card); } [BepInPlugin("OLD_SA.Blessing", "OLD SA Blessing", "1.0.0")] public class Plugin : BaseUnityPlugin { public static Plugin Instance; private Harmony harmony; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Instance = this; harmony = new Harmony("OLD_SA.Blessing"); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD_SA.Blessing] Loaded."); } } public class WindBlessingEffect : IBlessingEffect { public void Apply(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { WindBlessingRuntime.Add(card); card.UpdateFaceUpOnBoardEffects(); } } public void Remove(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { WindBlessingRuntime.Remove(card); card.UpdateFaceUpOnBoardEffects(); } } } [HarmonyPatch(typeof(PlayableCard), "HasAbility")] public static class WindBlessingHasAbilityPatch { public static void Postfix(PlayableCard __instance, Ability ability, ref bool __result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Invalid comparison between Unknown and I4 if ((int)ability == 19 && WindBlessingRuntime.HasWind(__instance)) { __result = true; } } } public static class WindBlessingRuntime { private static readonly HashSet<PlayableCard> WindCards = new HashSet<PlayableCard>(); public static void Add(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { WindCards.Add(card); } } public static void Remove(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { WindCards.Remove(card); } } public static bool HasWind(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } return WindCards.Contains(card); } public static void RemoveDeadCards() { WindCards.RemoveWhere((PlayableCard card) => (Object)(object)card == (Object)null || card.Dead); } public static void Clear() { WindCards.Clear(); } } [HarmonyPatch(typeof(PlayableCard), "OnUpkeep")] public static class WindBlessingUpkeepPatch { public static void Postfix(PlayableCard __instance, bool playerUpkeep) { if (!((Object)(object)__instance == (Object)null) && __instance.OpponentCard == playerUpkeep && WindBlessingRuntime.HasWind(__instance)) { WindBlessingRuntime.Remove(__instance); __instance.UpdateFaceUpOnBoardEffects(); ((Card)__instance).RenderCard(); } } }
Sigil/OldSa_Blitz_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Blitz_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Blitz_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("55aa65b6-2f8c-4363-8dce-5d1ef76ae984")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Blitz; public static class BlitzAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Blitz"; val.rulebookName = "Blitz"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OLD_SA_Blitz.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is about to be attacked, it counterattacks once and moves."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BlitzBehaviour), imageAsTexture); } } public class BlitzBehaviour : AbilityBehaviour { public override Ability Ability => BlitzAPI.ability.Id; public override bool RespondsToSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { return false; } if ((Object)(object)slot != (Object)(object)((AbilityBehaviour)this).Card.Slot) { return false; } BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return false; } CardSlot adjacent = instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true); CardSlot adjacent2 = instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false); return ((Object)(object)adjacent2 != (Object)null && (Object)(object)adjacent2.Card == (Object)null) || ((Object)(object)adjacent != (Object)null && (Object)(object)adjacent.Card == (Object)null); } public override IEnumerator OnSlotTargetedForAttack(CardSlot slot, PlayableCard attacker) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null || (Object)(object)slot != (Object)(object)((AbilityBehaviour)this).Card.Slot) { yield break; } BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } CardSlot left = board.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true); CardSlot right = board.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false); CardSlot target = null; if ((Object)(object)right != (Object)null && (Object)(object)right.Card == (Object)null) { target = right; } else if ((Object)(object)left != (Object)null && (Object)(object)left.Card == (Object)null) { target = left; } if (!((Object)(object)target == (Object)null)) { CardSlot opposingSlot = ((AbilityBehaviour)this).Card.Slot.opposingSlot; if ((Object)(object)opposingSlot != (Object)null && (Object)(object)opposingSlot.Card != (Object)null) { yield return opposingSlot.Card.TakeDamage(1, ((AbilityBehaviour)this).Card); } if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) && !((Object)(object)target.Card != (Object)null)) { yield return board.AssignCardToSlot(((AbilityBehaviour)this).Card, target, 0.1f, (Action)null, true); ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } } [BepInPlugin("OLD_SA.Blitz", "OLD SA Blitz", "1.0.0")] public class BlitzPlugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BlitzAPI.Init(); Harmony val = new Harmony("OLD_SA.Blitz"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Blitz loaded"); } }
Sigil/OldSa_Blood Strike_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Combat; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Blood Strike_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Blood Strike_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5220cd9b-f564-40be-bae0-549090a841ec")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BloodStrike; public static class BloodStrikeAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Blood Strike"; val.rulebookName = "Blood Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Blood_Strike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills, it gains 1 attack."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BloodStrikeBehaviour), imageAsTexture); } } public class BloodStrikeBehaviour : ExtendedAbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } if ((Object)(object)card == (Object)null) { return false; } return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead) { ExtraAttackState.AddStored(((AbilityBehaviour)this).Card, 1); } } } [BepInPlugin("OLD_SA.BloodStrike", "OLD SA Blood Strike", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.BloodStrike"); val.PatchAll(); BloodStrikeAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Blood Strike Loaded"); } }
Sigil/OldSa_BloodRecompense_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.BloodRecompense; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Blood Recompense")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Blood Recompense")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("cc6d3245-7eca-4c79-b54b-b4a2e4110b2f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace BloodRecompense { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.oldsa.BloodRecompense", "OLD_SA_BloodRecompense", "1.0.0")] public class Plugin : BaseUnityPlugin { private static ManualLogSource Log; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"OLD_SA_BloodRecompense Mod loaded successfully."); BloodRecompenseAPI.Init(); BloodRecompenseRegistry.Init(); Log.LogInfo((object)"Blood Recompense ability initialized."); } } } namespace OLD_SA.BloodRecompense { public static class BloodRecompenseAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Blood Recompense"; val.rulebookName = "Blood Recompense"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Blood_Recompense.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, a card is created."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BloodRecompenseBehaviour), imageAsTexture); } } public static class BloodRecompenseRegistry { private static Dictionary<string, string> SpawnTable = new Dictionary<string, string>(); public static void Init() { Register("Wolf", "WolfCub"); Register("AntQueen", "Ant"); Register("Beehive", "Bee"); Register("Cockroach", "Cockroach"); Register("Elk", "ElkCub"); Register("FieldMouse", "FieldMouse"); Register("MantisGod", "Mantis"); Register("MoldMan", "Mold"); Register("Moose", "ElkCub"); Register("Mothman_Stage3", "Mothman_Stage1"); Register("Raven", "RavenEgg"); Register("Smoke_Improved", "Smoke"); Register("Snelk", "ElkCub"); Register("SquidBell", "DausBell"); Register("Warren", "Rabbit"); Register("DireWolf", "DireWolfCub"); Register("RedHart", "ElkCub"); Register("Bullfrog", "Tadpole"); Register("Hydra", "HydraEgg"); Register("Alpha", "WolfCub"); Register("CagedWolf", "WolfCub"); Register("Daus", "DausBell"); Register("Pronghorn", "ElkCub"); } public static void Register(string cardName, string spawnName) { if (!string.IsNullOrEmpty(cardName) && !string.IsNullOrEmpty(spawnName) && !SpawnTable.ContainsKey(cardName)) { SpawnTable.Add(cardName, spawnName); } } public static CardInfo GetSpawn(CardInfo source) { if ((Object)(object)source == (Object)null) { return null; } if (!SpawnTable.TryGetValue(((Object)source).name, out var value)) { return null; } CardInfo cardByName = CardLoader.GetCardByName(value); if ((Object)(object)cardByName == (Object)null) { return null; } object obj = cardByName.Clone(); return (CardInfo)((obj is CardInfo) ? obj : null); } } public class BloodRecompenseBehaviour : AbilityBehaviour { public override Ability Ability => BloodRecompenseAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard deadCard, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)deadCard == (Object)null) { yield break; } string spawnName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "OLD_SA.BloodRecompenseInfo"); CardInfo spawn = null; if (!string.IsNullOrEmpty(spawnName)) { spawn = CardLoader.GetCardByName(spawnName); } if ((Object)(object)spawn == (Object)null) { spawn = BloodRecompenseRegistry.GetSpawn(((Card)((AbilityBehaviour)this).Card).Info); } if ((Object)(object)spawn == (Object)null) { spawn = CardLoader.GetCardByName("Skeleton"); } if ((Object)(object)spawn == (Object)null) { yield break; } object obj = spawn.Clone(); spawn = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)spawn == (Object)null) { yield break; } CopyAbilities(spawn); if (!((AbilityBehaviour)this).Card.OpponentCard) { PlayableCard playerCard = CardSpawner.SpawnPlayableCard(spawn); if (!((Object)(object)playerCard == (Object)null)) { yield return Singleton<PlayerHand>.Instance.AddCardToHand(playerCard, Vector3.zero, 0.25f); } } else { yield return SpawnEnemyCard(spawn); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } private IEnumerator SpawnEnemyCard(CardInfo spawn) { Opponent opponent = Singleton<TurnManager>.Instance.Opponent; if ((Object)(object)opponent == (Object)null) { yield break; } CardSlot freeSlot = FindFreeQueueSlot(opponent); if ((Object)(object)freeSlot != (Object)null) { yield return opponent.QueueCard(spawn, freeSlot, true, true, true); yield break; } PlayableCard same = FindSameQueuedCard(opponent, ((Object)spawn).name); if (!((Object)(object)same == (Object)null)) { PlayableCard temp = CardSpawner.SpawnPlayableCard(spawn); if (!((Object)(object)temp == (Object)null)) { MergeCardStats(same, temp); Object.Destroy((Object)(object)((Component)temp).gameObject); } } } private CardSlot FindFreeQueueSlot(Opponent opponent) { foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if (!opponent.Queue.Exists((PlayableCard x) => (Object)(object)x != (Object)null && (Object)(object)x.QueuedSlot == (Object)(object)slot)) { return slot; } } return null; } private PlayableCard FindSameQueuedCard(Opponent opponent, string name) { List<PlayableCard> list = new List<PlayableCard>(); foreach (PlayableCard item in opponent.Queue) { if (!((Object)(object)item == (Object)null) && ((Object)((Card)item).Info).name == name) { list.Add(item); } } if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } private void MergeCardStats(PlayableCard target, PlayableCard source) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null || (Object)(object)source == (Object)null) { return; } CardModificationInfo val = new CardModificationInfo(); val.fromCardMerge = true; val.abilities = new List<Ability>(); val.attackAdjustment = source.Attack; val.healthAdjustment = source.Health; if (((Card)source).Info.Abilities != null) { foreach (Ability ability in ((Card)source).Info.Abilities) { if ((int)ability != 0 && !target.HasAbility(ability) && !val.abilities.Contains(ability)) { val.abilities.Add(ability); } } } if (((Card)source).Info.Mods != null) { foreach (CardModificationInfo mod in ((Card)source).Info.Mods) { if (mod == null || mod.abilities == null) { continue; } foreach (Ability ability2 in mod.abilities) { if ((int)ability2 != 0 && !target.HasAbility(ability2) && !val.abilities.Contains(ability2)) { val.abilities.Add(ability2); } } } } if (val.attackAdjustment != 0 || val.healthAdjustment != 0 || val.abilities.Count != 0) { target.AddTemporaryMod(val); target.OnStatsChanged(); ((Card)target).RenderCard(); } } private void CopyAbilities(CardInfo spawn) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) CardModificationInfo val = new CardModificationInfo(); val.fromCardMerge = true; val.abilities = new List<Ability>(); foreach (Ability ability in ((Card)((AbilityBehaviour)this).Card).Info.Abilities) { if (ability != ((AbilityBehaviour)this).Ability) { val.abilities.Add(ability); } } if (((AbilityBehaviour)this).Card.TemporaryMods != null) { foreach (CardModificationInfo temporaryMod in ((AbilityBehaviour)this).Card.TemporaryMods) { if (temporaryMod.abilities == null) { continue; } foreach (Ability ability2 in temporaryMod.abilities) { if (!val.abilities.Contains(ability2)) { val.abilities.Add(ability2); } } } } if (val.abilities.Count != 0) { spawn.Mods.Add(val); } } } }
Sigil/OldSa_Blood_Acolyte_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.BloodAcolyte; using OLD_SA.CardTraits; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Blood_Acolyte_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Blood_Acolyte_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3a2a00f5-aca6-402b-bfa7-101c15c24f4a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OldSa_Blood_Acolyte_sigil { [BepInPlugin("OLD_SA.Blood_Acolyte", "OLD SA Blood Acolyte", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Blood Acolyte] Loading..."); BloodAcolyteAPI.Init(); Harmony val = new Harmony("OLD_SA.Blood_Acolyte"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Blood Acolyte] Loaded!"); } } } namespace OLD_SA.BloodAcolyte { public static class BloodAcolyteAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Blood Acolyte"; val.rulebookName = "Blood Acolyte"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OLD_SA_Blood_Acolyte.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "[creature] grows stronger with each sacrifice."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BloodAcolyteBehaviour), imageAsTexture); } } public class BloodAcolyteBehaviour : AbilityBehaviour { public override Ability Ability => BloodAcolyteAPI.ability.Id; } [HarmonyPatch(typeof(PlayableCard), "Sacrifice")] public static class BloodAcolyteSacrificeTriggerPatch { public static void Prefix(PlayableCard __instance) { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown if ((Object)(object)__instance == (Object)null || (Object)(object)Singleton<BoardManager>.Instance == (Object)null) { return; } PlayableCard currentSacrificeDemandingCard = Singleton<BoardManager>.Instance.CurrentSacrificeDemandingCard; if ((Object)(object)currentSacrificeDemandingCard == (Object)null) { return; } bool flag = OLD_SA_TraitAPI.HasOldSaTrait(currentSacrificeDemandingCard, "OLD_SA_BLOOD_DEVOURER"); BoardManager instance = Singleton<BoardManager>.Instance; List<PlayableCard> list = new List<PlayableCard>(); foreach (CardSlot allSlot in instance.AllSlots) { if ((Object)(object)allSlot.Card != (Object)null) { list.Add(allSlot.Card); } } if ((Object)(object)Singleton<PlayerHand>.Instance != (Object)null) { foreach (PlayableCard item in Singleton<PlayerHand>.Instance.CardsInHand) { if ((Object)(object)item != (Object)null) { list.Add(item); } } } foreach (PlayableCard item2 in list) { if ((Object)(object)((Card)item2).Info == (Object)null || !((Card)item2).Info.Abilities.Contains(BloodAcolyteAPI.ability.Id)) { continue; } CardModificationInfo val = new CardModificationInfo(); val.attackAdjustment = 1; CardModificationInfo val2 = new CardModificationInfo(); if (CardExtensions.BloodCost(item2) > 0) { val2.bloodCostAdjustment = -1; } if (flag) { if (((Card)item2).Info.Mods == null) { ((Card)item2).Info.Mods = new List<CardModificationInfo>(); } ((Card)item2).Info.Mods.Add(val); item2.AddTemporaryMod(val2); continue; } CardModificationInfo val3 = new CardModificationInfo(); val3.attackAdjustment = 1; if (CardExtensions.BloodCost(item2) > 0) { val3.bloodCostAdjustment = -1; } item2.AddTemporaryMod(val3); } } } }
Sigil/OldSa_Bloodlust Rising_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Bloodlust Rising_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Bloodlust Rising_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c833c51f-3b0b-4b13-b19e-49596ad94f6c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BloodlustRising; public static class BloodlustRisingAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bloodlust Rising"; val.rulebookName = "Bloodlust Rising"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Bloodlust_Rising.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills a creature, it gains 2 Gluttony."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BloodlustRisingBehaviour), imageAsTexture); } } public class BloodlustRisingBehaviour : AbilityBehaviour { public override Ability Ability => BloodlustRisingAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); SmallSigilManager.AddStacks(((AbilityBehaviour)this).Card, (SmallSigilType)2, 2); yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } [BepInPlugin("OLD_SA.BloodlustRising", "OLD SA Bloodlust Rising", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { BloodlustRisingAPI.Init(); } }
Sigil/OldSa_Bloody_Gear_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Bloody_Gear_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Bloody_Gear_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("072ebb55-b632-4135-8de6-6cafa189d64a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BloodyGear; public static class BloodyGearAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bloody Gear"; val.rulebookName = "Bloody Gear"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Bloody_Gear.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] deals damage, give the struck creature 1 Blood. When it dies, create a Flesh in your hand."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BloodyGearBehaviour), imageAsTexture); } } public class BloodyGearBehaviour : AbilityBehaviour { private readonly HashSet<PlayableCard> BloodTargets = new HashSet<PlayableCard>(); public override Ability Ability => BloodyGearAPI.ability.Id; public override bool RespondsToDealDamage(int amount, PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (amount <= 0) { return false; } if ((Object)(object)target == (Object)null) { return false; } return true; } public override IEnumerator OnDealDamage(int amount, PlayableCard target) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((Object)(object)target == (Object)null)) { SmallSigilManager.AddStacks(target, (SmallSigilType)3, 1); BloodTargets.Add(target); yield return (object)new WaitForSeconds(0.15f); } } public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if ((Object)(object)card == (Object)null) { return false; } return BloodTargets.Contains(card) || (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)card == (Object)null || (!BloodTargets.Contains(card) && (Object)(object)killer != (Object)(object)((AbilityBehaviour)this).Card)) { yield break; } int bloodStacks = SmallSigilManager.GetStacks(card, (SmallSigilType)3); int finalBloodStacks = bloodStacks + (((Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card) ? 1 : 0); List<Tribe> inheritedTribes = null; if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.tribes != null) { inheritedTribes = new List<Tribe>(((Card)card).Info.tribes); } BloodTargets.Remove(card); if (finalBloodStacks <= 0) { yield break; } CardInfo flesh = CardLoader.GetCardByName("OLD_SA_BROKEN_FLESH"); if ((Object)(object)flesh == (Object)null) { yield break; } object obj = flesh.Clone(); CardInfo clone = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)clone == (Object)null) { yield break; } CardModificationInfo statMod = new CardModificationInfo(); statMod.attackAdjustment = finalBloodStacks - clone.Attack; statMod.healthAdjustment = finalBloodStacks - clone.Health; clone.Mods.Add(statMod); if (inheritedTribes != null) { clone.tribes = new List<Tribe>(inheritedTribes); } List<Ability> inheritedAbilities = new List<Ability>(); if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Abilities != null) { foreach (Ability ability in ((Card)card).Info.Abilities) { AddInheritedAbility(inheritedAbilities, ability); } } if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Mods != null) { foreach (CardModificationInfo mod in ((Card)card).Info.Mods) { if (mod == null || mod.abilities == null) { continue; } foreach (Ability ability2 in mod.abilities) { AddInheritedAbility(inheritedAbilities, ability2); } } } FieldInfo temporaryModsField = AccessTools.Field(typeof(PlayableCard), "temporaryMods"); if (temporaryModsField != null && temporaryModsField.GetValue(card) is List<CardModificationInfo> temporaryMods) { foreach (CardModificationInfo mod2 in temporaryMods) { if (mod2 == null || mod2.abilities == null) { continue; } foreach (Ability ability3 in mod2.abilities) { AddInheritedAbility(inheritedAbilities, ability3); } } } if (inheritedAbilities.Count > 0) { CardModificationInfo abilityMod = new CardModificationInfo(); foreach (Ability ability4 in inheritedAbilities) { abilityMod.abilities.Add(ability4); } clone.Mods.Add(abilityMod); } if ((int)Singleton<ViewManager>.Instance.CurrentView > 0) { yield return (object)new WaitForSeconds(0.2f); Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); yield return (object)new WaitForSeconds(0.2f); } yield return Singleton<CardSpawner>.Instance.SpawnCardToHand(clone, (List<CardModificationInfo>)null, 0.25f, (Action<PlayableCard>)null); yield return (object)new WaitForSeconds(0.45f); yield return ((AbilityBehaviour)this).LearnAbility(0.1f); yield return (object)new WaitForSeconds(0.2f); if ((int)Singleton<ViewManager>.Instance.CurrentView == 0) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); } } private static void AddInheritedAbility(List<Ability> abilities, Ability ability) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((int)ability != 0 && !abilities.Contains(ability)) { abilities.Add(ability); } } } [BepInPlugin("OLD_SA.Bloody_Gear_sigil", "OldSa Bloody Gear Sigil", "1.0.0")] public class BloodyGearPlugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Bloody_Gear_sigil"; public const string PluginName = "OldSa Bloody Gear Sigil"; public const string PluginVersion = "1.0.0"; private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BloodyGearAPI.Init(); Harmony val = new Harmony("OLD_SA.Bloody_Gear_sigil"); val.PatchAll(Assembly.GetExecutingAssembly()); } }
Sigil/OldSa_Bone_Devourer_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using Pixelplacement; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Bone_Devourer_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Bone_Devourer_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("499f2d57-312a-4735-b826-444696765434")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BoneDevourer; [HarmonyPatch(typeof(PlayableCard), "Die")] public static class BoneDevourerRemovePatch { [HarmonyPrefix] private static void Prefix(PlayableCard __instance) { if (!((Object)(object)__instance == (Object)null)) { BoneDevourerBehaviour component = ((Component)__instance).GetComponent<BoneDevourerBehaviour>(); if ((Object)(object)component != (Object)null) { component.RemoveDevourer(); } } } } public static class BoneDevourerAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bone Devourer"; val.rulebookName = "Bone Devourer"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Bone_Devourer.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When a bone appears, [creature] devours one. For every 3 bones devoured, [creature] gains 1 Power and 1 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BoneDevourerBehaviour), imageAsTexture); } } public class BoneDevourerBehaviour : AbilityBehaviour { public static List<BoneDevourerBehaviour> ActiveDevourers = new List<BoneDevourerBehaviour>(); private int bonesDevoured; public override Ability Ability => BoneDevourerAPI.ability.Id; private void Awake() { RegisterDevourer(); } public void RegisterDevourer() { if (!ActiveDevourers.Contains(this)) { ActiveDevourers.Add(this); } } public void RemoveDevourer() { ActiveDevourers.Remove(this); } private void OnDestroy() { RemoveDevourer(); } public PlayableCard GetCard() { return ((AbilityBehaviour)this).Card; } public bool IsActive() { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard; } public IEnumerator DevourBone() { bonesDevoured++; if (bonesDevoured % 3 == 0) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); CardModificationInfo mod = new CardModificationInfo(1, 1); ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); ((Card)((AbilityBehaviour)this).Card).RenderCard(); } } } [HarmonyPatch(typeof(Part1ResourcesManager), "ShowAddBones")] public static class BoneDevourerBonePatch { [HarmonyPrefix] private static bool Prefix(Part1ResourcesManager __instance, int amount, CardSlot slot, ref IEnumerator __result) { __result = ShowAddBonesWithDevourer(__instance, amount, slot); return false; } private static IEnumerator ShowAddBonesWithDevourer(Part1ResourcesManager instance, int amount, CardSlot slot) { if (!ProgressionData.LearnedMechanic((MechanicsConcept)0)) { yield break; } BoneDevourerBehaviour devourer = FindBoneDevourer(); GetBoneTokens(instance); bool devoured = false; for (int i = 0; i < amount; i++) { GameObject gameObject = Object.Instantiate<GameObject>(GetBoneTokenPrefab(instance)); BoneTokenInteractable component = gameObject.GetComponent<BoneTokenInteractable>(); Component tokenRB = gameObject.GetComponent("Rigidbody"); if ((Object)(object)slot != (Object)null) { InvokeRigidbodyMethod(tokenRB, "Sleep"); gameObject.transform.position = ((Component)slot).transform.position + Vector3.up; InvokePushTokenDown(instance, tokenRB); Vector3 landingPosition = GetRandomLandingPosition(instance) + Vector3.up; Tween.Position(((Component)component).transform, landingPosition, 0.25f, 0.5f, Tween.EaseInOut, (LoopType)0, (Action)null, (Action)delegate { InvokeRigidbodyMethod(tokenRB, "WakeUp"); InvokePushTokenDown(instance, tokenRB); }, true); } else { gameObject.transform.position = GetRandomLandingPosition(instance) + Vector3.up * 5f; InvokePushTokenDown(instance, tokenRB); } if (!devoured && (Object)(object)devourer != (Object)null && (Object)(object)component != (Object)null) { devoured = true; GetBoneTokens(instance)?.Remove(component); ResourcesManager resources = Singleton<ResourcesManager>.Instance; if ((Object)(object)resources != (Object)null) { try { BoneDevourerState.SilentSpend = true; yield return resources.SpendBones(1); } finally { BoneDevourerState.SilentSpend = false; } } yield return DevourBoneAnimation(component, devourer); yield return devourer.DevourBone(); } else { GetBoneTokens(instance)?.Add(component); SetOrganizedFalse(instance); } yield return (object)new WaitForSeconds(0.05f); } } private static IEnumerator DevourBoneAnimation(BoneTokenInteractable token, BoneDevourerBehaviour devourer) { if (!((Object)(object)token == (Object)null) && !((Object)(object)devourer == (Object)null)) { ((InteractableBase)token).SetEnabled(false); Component rigidbody = ((Component)token).GetComponent("Rigidbody"); if ((Object)(object)rigidbody != (Object)null) { Object.Destroy((Object)(object)rigidbody); } Vector3 target = ((Component)devourer).transform.position + Vector3.up; Tween.Position(((Component)token).transform, target, 0.3f, 0f, Tween.EaseInOut, (LoopType)0, (Action)null, (Action)null, true); Tween.Rotate(((Component)token).transform, new Vector3(90f, 0f, 90f), (Space)0, 0.3f, 0f, (AnimationCurve)null, (LoopType)0, (Action)null, (Action)null, true); AudioController.Instance.PlaySound3D("token_enter_higher", (MixerGroup)4, ((Component)token).transform.position, 1f, 0f, new Pitch((Variation)0), new Repetition(0.05f, ""), (Randomization)null, (Distortion)null, false); yield return (object)new WaitForSeconds(0.3f); Object.Destroy((Object)(object)((Component)token).gameObject); } } private static BoneDevourerBehaviour FindBoneDevourer() { foreach (BoneDevourerBehaviour activeDevourer in BoneDevourerBehaviour.ActiveDevourers) { if ((Object)(object)activeDevourer == (Object)null || !activeDevourer.IsActive()) { continue; } return activeDevourer; } return null; } private static GameObject GetBoneTokenPrefab(Part1ResourcesManager instance) { FieldInfo field = typeof(Part1ResourcesManager).GetField("boneTokenPrefab", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { return null; } object? value = field.GetValue(instance); return (GameObject)((value is GameObject) ? value : null); } private static List<BoneTokenInteractable> GetBoneTokens(Part1ResourcesManager instance) { FieldInfo field = typeof(Part1ResourcesManager).GetField("boneTokens", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { return null; } return field.GetValue(instance) as List<BoneTokenInteractable>; } private static Vector3 GetRandomLandingPosition(Part1ResourcesManager instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_007d: Unknown result type (might be due to invalid IL or missing references) FieldInfo field = typeof(Part1ResourcesManager).GetField("boneTokenArea", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { return Vector3.zero; } object? value = field.GetValue(instance); Transform val = (Transform)((value is Transform) ? value : null); if ((Object)(object)val == (Object)null) { return Vector3.zero; } return val.position + new Vector3(Random.value * 0.6f, 0f, Random.value * 0.6f); } private static void InvokePushTokenDown(Part1ResourcesManager instance, Component tokenRB) { if (!((Object)(object)instance == (Object)null) && !((Object)(object)tokenRB == (Object)null)) { MethodInfo method = typeof(Part1ResourcesManager).GetMethod("PushTokenDown", BindingFlags.Instance | BindingFlags.NonPublic); if (!(method == null)) { method.Invoke(instance, new object[1] { tokenRB }); } } } private static void InvokeRigidbodyMethod(Component component, string methodName) { if (!((Object)(object)component == (Object)null)) { MethodInfo method = ((object)component).GetType().GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public); if (!(method == null)) { method.Invoke(component, null); } } } private static void SetOrganizedFalse(Part1ResourcesManager instance) { FieldInfo field = typeof(Part1ResourcesManager).GetField("isOrganized", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(instance, false); } } } [HarmonyPatch(typeof(Part1ResourcesManager), "ShowSpendBones")] public static class BoneDevourerSpendBonesViewPatch { public static bool Prefix(Part1ResourcesManager __instance, int amount, ref IEnumerator __result) { if (!BoneDevourerState.SilentSpend) { return true; } __result = SilentRemoveBones(__instance, amount); return false; } private static IEnumerator SilentRemoveBones(Part1ResourcesManager manager, int amount) { MethodInfo method = AccessTools.Method(typeof(Part1ResourcesManager), "RemoveBones", (Type[])null, (Type[])null); if (method != null && method.Invoke(manager, new object[1] { amount }) is IEnumerator routine) { while (routine.MoveNext()) { yield return routine.Current; } } } } public static class BoneDevourerState { public static bool SilentSpend; } [BepInPlugin("OLD_SA.Bone_Devourer_sigil", "OldSa Bone Devourer Sigil", "1.0.0")] public class BoneDevourerPlugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Bone_Devourer_sigil"; public const string PluginName = "OldSa Bone Devourer Sigil"; public const string PluginVersion = "1.0.0"; private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BoneDevourerAPI.Init(); Harmony val = new Harmony("OLD_SA.Bone_Devourer_sigil"); val.PatchAll(Assembly.GetExecutingAssembly()); } }
Sigil/OldSa_Bone_Strike_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Combat; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Bone_Strike_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Bone_Strike_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("6c22bce7-2107-42e9-b3ee-7adaa47a7aa8")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BoneStrike; public static class BoneStrikeAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bone Strike"; val.rulebookName = "Bone Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Bone_Strike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, spend 1 Bone. For every 2 Bones spent, attack an additional time."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BoneStrikeBehaviour), imageAsTexture); } } public class BoneStrikeBehaviour : ExtendedAbilityBehaviour { public static Ability ability; private int bonesSpent = 0; public override Ability Ability => ability; public IEnumerator OnAttack() { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } ResourcesManager resources = Singleton<ResourcesManager>.Instance; if ((Object)(object)resources == (Object)null) { yield break; } int before = resources.PlayerBones; if (before <= 0) { Debug.Log((object)"[BoneStrike] No bones"); yield break; } bool spent = false; try { BoneStrikeState.SilentSpend = true; yield return resources.SpendBones(1); int after = resources.PlayerBones; Debug.Log((object)("[BoneStrike] before=" + before + " after=" + after)); if (after < before) { spent = true; } } finally { BoneStrikeState.SilentSpend = false; } if (!spent) { Debug.Log((object)"[BoneStrike] Spend failed"); yield break; } bonesSpent++; Debug.Log((object)("[BoneStrike] spent count=" + bonesSpent)); if (bonesSpent % 2 == 0) { ExtraAttackState.AddStored(((AbilityBehaviour)this).Card, 1); Debug.Log((object)"[BoneStrike] Attack +1"); } } } [HarmonyPatch(typeof(Part1ResourcesManager), "ShowSpendBones")] public static class BoneStrikeSpendBonesViewPatch { public static bool Prefix(Part1ResourcesManager __instance, int amount, ref IEnumerator __result) { if (!BoneStrikeState.SilentSpend) { return true; } __result = SilentRemoveBones(__instance, amount); return false; } private static IEnumerator SilentRemoveBones(Part1ResourcesManager manager, int amount) { MethodInfo method = AccessTools.Method(typeof(Part1ResourcesManager), "RemoveBones", (Type[])null, (Type[])null); if (method != null) { IEnumerator routine = method.Invoke(manager, new object[1] { amount }) as IEnumerator; while (routine.MoveNext()) { yield return routine.Current; } } } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class BoneStrikeAttackPatch { public static IEnumerator Postfix(IEnumerator result, CardSlot attackingSlot) { while (result.MoveNext()) { yield return result.Current; } if (!((Object)(object)attackingSlot == (Object)null) && !((Object)(object)attackingSlot.Card == (Object)null)) { BoneStrikeBehaviour behaviour = ((Component)attackingSlot.Card).GetComponent<BoneStrikeBehaviour>(); if (!((Object)(object)behaviour == (Object)null)) { yield return behaviour.OnAttack(); } } } } public static class BoneStrikeState { public static bool SilentSpend; } [BepInPlugin("OLD_SA.BoneStrike", "OLD SA Bone Strike", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BoneStrikeAPI.Init(); Harmony val = new Harmony("OLD_SA.BoneStrike"); val.PatchAll(); } }
Sigil/OldSa_Bones_Armored_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Bones_Armored_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Bones_Armored_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("26c0943b-8651-422c-bc3a-dd4ee3e65005")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BonesArmored; public static class BonesArmoredAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bones Armored"; val.rulebookName = "Bones Armored"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Bones_Armored.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] takes damage, if bones are available, it consumes them to prevent that damage."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BonesArmoredBehaviour), imageAsTexture); } } public class BonesArmoredBehaviour : AbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToTakeDamage(PlayableCard source) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (((AbilityBehaviour)this).Card.Dead) { return false; } if (!((AbilityBehaviour)this).Card.OnBoard) { return false; } if ((Object)(object)source == (Object)null) { return false; } return true; } public override IEnumerator OnTakeDamage(PlayableCard source) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public static class BonesArmoredPatch { private static readonly MethodInfo PreSuccessfulTriggerSequenceMethod = AccessTools.Method(typeof(AbilityBehaviour), "PreSuccessfulTriggerSequence", (Type[])null, (Type[])null); [HarmonyPrefix] public static bool Prefix(PlayableCard __instance, int damage, PlayableCard attacker, ref IEnumerator __result) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return true; } if (!__instance.HasAbility(BonesArmoredAPI.ability.Id)) { return true; } if (__instance.Dead) { return true; } if (damage <= 0) { return true; } int num = damage * 2; if (Singleton<ResourcesManager>.Instance.PlayerBones < num) { return true; } __result = BonesArmoredTakeDamageSequence(__instance, damage, attacker, num); return false; } private static IEnumerator BonesArmoredTakeDamageSequence(PlayableCard card, int damage, PlayableCard attacker, int requiredBones) { if ((Object)(object)card == (Object)null || card.Dead) { yield break; } BonesArmoredBehaviour behaviour = ((Component)card).GetComponent<BonesArmoredBehaviour>(); if ((Object)(object)behaviour != (Object)null && PreSuccessfulTriggerSequenceMethod != null) { object result = PreSuccessfulTriggerSequenceMethod.Invoke(behaviour, null); if (result is IEnumerator sequence) { while (sequence.MoveNext()) { yield return sequence.Current; } } } if (!((Object)(object)card == (Object)null) && !card.Dead && Singleton<ResourcesManager>.Instance.PlayerBones >= requiredBones) { yield return Singleton<ResourcesManager>.Instance.SpendBones(requiredBones); if (card.Health > 0) { ((Card)card).Anim.PlayHitAnimation(); } card.OnStatsChanged(); ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); if ((Object)(object)card.TriggerHandler != (Object)null && card.TriggerHandler.RespondsToTrigger((Trigger)8, new object[1] { attacker })) { yield return card.TriggerHandler.OnTrigger((Trigger)8, new object[1] { attacker }); } } } } [BepInPlugin("OLD_SA.BonesArmored", "OLD SA Bones Armored", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.BonesArmored"; public const string PluginName = "OLD SA Bones Armored"; public const string PluginVersion = "1.0.0"; internal static ManualLogSource Log; private void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"[OLD SA Bones Armored] Plugin loaded."); BonesArmoredAPI.Init(); Log.LogInfo((object)"[OLD SA Bones Armored] Bones Armored registered."); Harmony val = new Harmony("OLD_SA.BonesArmored"); val.PatchAll(); Log.LogInfo((object)"[OLD SA Bones Armored] Harmony patches applied."); Log.LogInfo((object)"[OLD SA Bones Armored] Loaded successfully."); } }
Sigil/OldSa_Bones_Feast_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Bones_Feast_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Bones_Feast_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1512c82c-bf7f-48fc-a9f4-68fa5cf86dae")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.BonesFeast; public static class BonesFeastAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bones Feast"; val.rulebookName = "Bones Feast"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Bones_Feast.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When a creature is sacrificed to summon [creature], gain 3 Bones from it."); } ability = AbilityManager.Add("OLD_SA", val, typeof(BonesFeastBehaviour), imageAsTexture); } } public class BonesFeastBehaviour : AbilityBehaviour { public override Ability Ability => BonesFeastAPI.ability.Id; public IEnumerator OnSacrifice(PlayableCard sacrificedCard) { Debug.Log((object)("[OLD SA Bones] OnSacrifice ENTER " + ((Object)((Card)((AbilityBehaviour)this).Card).Info).name)); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((Object)(object)sacrificedCard == (Object)null)) { yield return Singleton<ResourcesManager>.Instance.AddBones(3, sacrificedCard.Slot); Debug.Log((object)"[OLD SA Bones] Added bones"); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } [HarmonyPatch(typeof(PlayableCard), "Sacrifice")] public static class BonesFeastSacrificePatch { public static void Prefix(PlayableCard __instance) { if ((Object)(object)__instance == (Object)null) { return; } PlayableCard currentSacrificeDemandingCard = Singleton<BoardManager>.Instance.CurrentSacrificeDemandingCard; if (!((Object)(object)currentSacrificeDemandingCard == (Object)null)) { BonesFeastBehaviour component = ((Component)currentSacrificeDemandingCard).GetComponent<BonesFeastBehaviour>(); if (!((Object)(object)component == (Object)null)) { ((MonoBehaviour)currentSacrificeDemandingCard).StartCoroutine(component.OnSacrifice(__instance)); } } } } [BepInPlugin("OLD_SA.BonesFeast", "OLD SA Bones Feast", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BonesFeastAPI.Init(); Harmony val = new Harmony("OLD_SA.BonesFeast"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA] Bones Feast loaded."); } }
Sigil/OldSa_Cache_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Cache_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Cache_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a730f331-acfb-4291-9da1-08fbe66ea620")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Cache; public static class CacheAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Cache"; val.rulebookName = "Cache"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Cache.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills a creature, gain a random item."); } ability = AbilityManager.Add("OLD_SA", val, typeof(CacheBehaviour), imageAsTexture); } } public class CacheBehaviour : DrawCreatedCard { public override Ability Ability => CacheAPI.ability.Id; protected override CardInfo CardToDraw { get { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected I4, but got Unknown CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_CONSUMABLE_SQUIRREL"); if ((Object)(object)cardByName != (Object)null) { cardByName.Mods.AddRange(((AbilityBehaviour)this).GetNonDefaultModsFromSelf((Ability[])(object)new Ability[1] { (Ability)(int)((AbilityBehaviour)this).Ability })); } return cardByName; } } public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (RunState.Run.consumables.Count < RunState.Run.MaxConsumables) { RunState.Run.consumables.Add(((Object)ItemsUtil.GetRandomUnlockedConsumable(((TriggerReceiver)this).GetRandomSeed())).name); Singleton<ItemsManager>.Instance.UpdateItems(false); yield return (object)new WaitForSeconds(0.2f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } else { yield return ((DrawCreatedCard)this).CreateDrawnCard(); } } } [BepInPlugin("OLD_SA.Cache", "OLD SA Cache", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Cache"; public const string PluginName = "OLD SA Cache"; public const string PluginVersion = "1.0.0"; private void Awake() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Cache] Plugin loaded."); try { CacheAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Cache] Cache initialized successfully."); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)"[OLD SA Cache] Failed to initialize:"); ((BaseUnityPlugin)this).Logger.LogError((object)ex); } } }
Sigil/OldSa_Coiled_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Coiled_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Coiled_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8812912a-6c71-42a8-a276-53aed62c0498")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Coiled; public static class CoiledAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Coiled"; val.rulebookName = "Coiled"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Coiled.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Coiled_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When an ally deals damage, [creature] gains 1 Power until the end of the turn."); } ability = AbilityManager.Add("OLD_SA", val, typeof(CoiledBehaviour), imageAsTexture); } } public class CoiledBehaviour : ExtendedAbilityBehaviour { public static List<CoiledBehaviour> ActiveCoiled = new List<CoiledBehaviour>(); private int coiledStacks = 0; public override Ability Ability => CoiledAPI.ability.Id; private void Awake() { RegisterCoiled(); } private void RegisterCoiled() { if (!ActiveCoiled.Contains(this)) { ActiveCoiled.Add(this); } } private void RemoveCoiled() { ActiveCoiled.Remove(this); } private void OnDestroy() { RemoveCoiled(); } public bool IsActiveForCoiled() { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead; } public override int GetPassiveAttackBuff(PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return 0; } if ((Object)(object)target != (Object)(object)((AbilityBehaviour)this).Card) { return 0; } return coiledStacks; } public override bool RespondsToOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } if ((Object)(object)attacker == (Object)null || attacker.Dead) { return false; } if (attacker.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return false; } return amount > 0; } public override IEnumerator OnOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); coiledStacks++; yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } public IEnumerator OnWaterborneOtherCardDealtDamage(PlayableCard attacker, int amount, PlayableCard target) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)attacker == (Object)null) && !attacker.Dead && !((Object)(object)attacker == (Object)(object)((AbilityBehaviour)this).Card) && attacker.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard && amount > 0) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); coiledStacks++; yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } bool flag = !((AbilityBehaviour)this).Card.OpponentCard; return playerTurnEnd == flag; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { coiledStacks = 0; yield break; } } [BepInPlugin("OLD_SA.Coiled", "OLD SA Coiled", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { CoiledAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Coiled loaded."); } }
Sigil/OldSa_Collect_Bones_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Collect_Bones_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Collect_Bones_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("eb1d6f4a-081a-4f5f-9aa1-8c345c9ff1e2")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Collect_Bones; public static class CollectBonesAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Collect Bones"; val.rulebookName = "Collect Bones"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Collect_Bones.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Collect_Bones_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When another creature dies, if [creature] is on the board, gain 1 Bone."); } ability = AbilityManager.Add("OLD_SA", val, typeof(CollectBonesBehaviour), imageAsTexture); } } public class CollectBonesBehaviour : AbilityBehaviour { public override Ability Ability => CollectBonesAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return ((AbilityBehaviour)this).Card.OnBoard && (Object)(object)card != (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); yield return Singleton<ResourcesManager>.Instance.AddBones(1, deathSlot); yield return ((AbilityBehaviour)this).LearnAbility(0f); yield return (object)new WaitForSeconds(0.25f); } } [BepInPlugin("OLD_SA.Collect_Bones", "OLD SA Collect Bones", "1.0.0")] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"[OLD SA] Loading Collect Bones..."); CollectBonesAPI.Init(); Log.LogInfo((object)"[OLD SA] Collect Bones loaded successfully."); } }
Sigil/OldSa_Crimson_Rush_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Crimson_Rush_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Crimson_Rush_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("06293b9e-8de2-401c-8d9c-f9bd1db0b842")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.CrimsonRush; public static class CrimsonRushAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Crimson Rush"; val.rulebookName = "Crimson Rush"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Crimson_Rush.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, it targets opposing creatures first and gains 1 additional attack after a kill."); } ability = AbilityManager.Add("OLD_SA", val, typeof(CrimsonRushBehaviour), imageAsTexture); } } public class CrimsonRushBehaviour : AbilityBehaviour { private static readonly Dictionary<PlayableCard, int> KillCounts = new Dictionary<PlayableCard, int>(); public override Ability Ability => CrimsonRushAPI.ability.Id; public static int GetKillCount(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } if (KillCounts.TryGetValue(card, out var value)) { return value; } return 0; } public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead) { int count = GetKillCount(((AbilityBehaviour)this).Card); KillCounts[((AbilityBehaviour)this).Card] = count + 1; yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } public static void Clear(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { KillCounts.Remove(card); } } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class CrimsonRushPatch { private static readonly HashSet<PlayableCard> InternalAttack = new HashSet<PlayableCard>(); private static void Prefix(CardSlot attackingSlot, ref CardSlot opposingSlot, float waitAfter) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)attackingSlot == (Object)null) { return; } PlayableCard card = attackingSlot.Card; if ((Object)(object)card == (Object)null || !card.HasAbility(CrimsonRushAPI.ability.Id)) { return; } List<CardSlot> list = ((!attackingSlot.IsPlayerSlot) ? Singleton<BoardManager>.Instance.PlayerSlotsCopy : Singleton<BoardManager>.Instance.OpponentSlotsCopy); foreach (CardSlot item in list) { if ((Object)(object)item == (Object)null || (Object)(object)item.Card == (Object)null || item.Card.Dead) { continue; } opposingSlot = item; break; } } private static void Postfix(CardSlot attackingSlot, CardSlot opposingSlot, float waitAfter, ref IEnumerator __result) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)attackingSlot == (Object)null) { return; } PlayableCard card = attackingSlot.Card; if (!((Object)(object)card == (Object)null) && card.HasAbility(CrimsonRushAPI.ability.Id) && !card.Dead) { int killCount = CrimsonRushBehaviour.GetKillCount(card); if (killCount > 0) { IEnumerator original = __result; __result = CrimsonRushAttackRoutine(original, card, attackingSlot, killCount); } } } private static IEnumerator CrimsonRushAttackRoutine(IEnumerator original, PlayableCard attackingCard, CardSlot attackingSlot, int killCount) { yield return original; if ((Object)(object)attackingCard == (Object)null || attackingCard.Dead || (Object)(object)attackingCard.Slot == (Object)null) { yield break; } CombatPhaseManager combat = Singleton<CombatPhaseManager>.Instance; if ((Object)(object)combat == (Object)null) { yield break; } int remaining = killCount; while (remaining > 0) { CardSlot target = FindEnemyCreature(attackingSlot); if ((Object)(object)target == (Object)null) { break; } InternalAttack.Add(attackingCard); yield return combat.SlotAttackSlot(attackingSlot, target, 0f); InternalAttack.Remove(attackingCard); remaining--; if ((Object)(object)attackingCard == (Object)null || attackingCard.Dead || (Object)(object)attackingCard.Slot == (Object)null) { break; } } } private static CardSlot FindEnemyCreature(CardSlot attackingSlot) { if ((Object)(object)attackingSlot == (Object)null) { return null; } List<CardSlot> list = ((!attackingSlot.IsPlayerSlot) ? Singleton<BoardManager>.Instance.PlayerSlotsCopy : Singleton<BoardManager>.Instance.OpponentSlotsCopy); foreach (CardSlot item in list) { if ((Object)(object)item == (Object)null || (Object)(object)item.Card == (Object)null || item.Card.Dead) { continue; } return item; } return null; } } [BepInPlugin("OLD_SA.CrimsonRush", "OLD SA Crimson Rush", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.CrimsonRush"; public const string PluginName = "OLD SA Crimson Rush"; public const string PluginVersion = "1.0.0"; private void Awake() { Debug.Log((object)"[OLD SA Crimson Rush] Plugin loaded."); try { CrimsonRushAPI.Init(); Debug.Log((object)"[OLD SA Crimson Rush] Crimson Rush registered."); } catch (Exception ex) { Debug.LogError((object)"[OLD SA Crimson Rush] Failed to initialize:"); Debug.LogError((object)ex); } } }
Sigil/OldSa_Cunning_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Cunning_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Cunning_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8c1adbcf-028b-4655-bd78-77375f2d87d0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Cunning; public static class CunningAPI { public static FullAbility ability; public unsafe static void Init() { //IL_0079: 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_00ef: 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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Cunning"; val.rulebookName = "Cunning"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 2; val.opponentUsable = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Cunning.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Cunning_px.png", (FilterMode)0); val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When there is a creature opposite [creature], [creature] gains Power equal to the number of sigils on that creature."); } ability = AbilityManager.Add("OLD_SA", val, typeof(CunningBehaviour), imageAsTexture); Ability id = ability.Id; Debug.Log((object)("Cunning registered ID=" + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } public class CunningBehaviour : ExtendedAbilityBehaviour { public static Ability ability; public override Ability Ability => CunningAPI.ability.Id; public override int GetPassiveAttackBuff(PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return 0; } if (((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return 0; } if ((Object)(object)target != (Object)(object)((AbilityBehaviour)this).Card) { return 0; } if ((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot.opposingSlot == (Object)null) { return 0; } PlayableCard card = ((AbilityBehaviour)this).Card.Slot.opposingSlot.Card; if ((Object)(object)card == (Object)null || card.Dead) { return 0; } return GetSigilCount(card); } private static int GetSigilCount(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } int num = 0; if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Abilities != null) { num += ((Card)card).Info.Abilities.Count; } if (card.TemporaryMods != null) { foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod != null && temporaryMod.abilities != null) { num += temporaryMod.abilities.Count; } } } return num; } } [BepInPlugin("OLD_SA.Cunning", "OLD SA Cunning", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Debug.Log((object)"OLD SA Cunning Loading..."); CunningAPI.Init(); Harmony val = new Harmony("OLD_SA.Cunning"); val.PatchAll(); Debug.Log((object)"OLD SA Cunning Loaded!"); } }
Sigil/OldSa_Deadly Fang_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Deadly Fang_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Deadly Fang_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e6c3083e-0bee-46d6-949d-33660cb4fdb5")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.DeadlyFang; public static class DeadlyFangAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Deadly Fang"; val.rulebookName = "Deadly Fang"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Deadly_Fang.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, it gives Poison equal to 4 minus its Power to the target."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DeadlyFangBehaviour), imageAsTexture); } } public class DeadlyFangBehaviour : AbilityBehaviour { public override Ability Ability => DeadlyFangAPI.ability.Id; public override bool RespondsToDealDamage(int amount, PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)target == (Object)null || target.Dead) { return false; } return amount > 0; } public override IEnumerator OnDealDamage(int amount, PlayableCard target) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)target == (Object)null) && !target.Dead) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); int attack = ((AbilityBehaviour)this).Card.Attack; int poison = 4 - attack; if (poison < 0) { poison = 0; } SmallSigilManager.AddStacks(target, (SmallSigilType)1, poison); yield return SmallSigilRuleManager.ProcessAndWait(target); yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } [BepInPlugin("OLD_SA.DeadlyFang", "OLD SA Deadly Fang", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { Debug.Log((object)"[OLD SA] Initializing Deadly Fang..."); DeadlyFangAPI.Init(); Debug.Log((object)"[OLD SA] Deadly Fang initialized."); } }
Sigil/OldSa_Death Spray_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Death Spray_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Death Spray_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("11770e47-5aec-4f45-b449-5b81d4f62b0f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.DeathSpray; public static class DeathSprayAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Death Spray"; val.rulebookName = "Death Spray"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Death_Spray.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] dies, it gives 4 Poison to a random enemy."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DeathSprayBehaviour), imageAsTexture); } } public class DeathSprayBehaviour : AbilityBehaviour { public override Ability Ability => DeathSprayAPI.ability.Id; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return !wasSacrifice; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); List<PlayableCard> targets = new List<PlayableCard>(); if (!((AbilityBehaviour)this).Card.OpponentCard) { foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if ((Object)(object)slot != (Object)null && (Object)(object)slot.Card != (Object)null && !slot.Card.Dead) { targets.Add(slot.Card); } } } else { foreach (CardSlot slot2 in Singleton<BoardManager>.Instance.PlayerSlotsCopy) { if ((Object)(object)slot2 != (Object)null && (Object)(object)slot2.Card != (Object)null && !slot2.Card.Dead) { targets.Add(slot2.Card); } } } if (targets.Count != 0) { PlayableCard target = targets[Random.Range(0, targets.Count)]; if (!((Object)(object)target == (Object)null) && !target.Dead) { SmallSigilManager.AddStacks(target, (SmallSigilType)1, 4); yield return SmallSigilRuleManager.ProcessAndWait(target); } } } } [BepInPlugin("OLD_SA.DeathSpray", "OLD SA Death Spray", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { DeathSprayAPI.Init(); } }
Sigil/OldSa_Death_Roll_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Death_Roll_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Death_Roll_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("49d1ea1c-dafc-4bae-b214-4cc574d533a2")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.DeathRoll; public static class DeathRollAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Death Roll"; val.rulebookName = "Death Roll"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OLD_SA_DeathRoll.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the start of the turn, [creature] deals 1 damage to the card opposite it, repeated for each time it has attacked."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DeathRollBehaviour), imageAsTexture); } } public class DeathRollBehaviour : AbilityBehaviour { private Dictionary<PlayableCard, int> attackCount = new Dictionary<PlayableCard, int>(); public override Ability Ability => DeathRollAPI.ability.Id; public override bool RespondsToUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard != playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); CardSlot opposingSlot = ((AbilityBehaviour)this).Card.Slot.opposingSlot; if ((Object)(object)opposingSlot == (Object)null || (Object)(object)opposingSlot.Card == (Object)null) { yield break; } PlayableCard target = opposingSlot.Card; if ((Object)(object)target == (Object)null || target.Dead || !target.OnBoard) { yield break; } int count = 1; if (attackCount.ContainsKey(target)) { count += attackCount[target]; } for (int i = 0; i < count; i++) { if ((Object)(object)target == (Object)null) { break; } if (target.Dead) { break; } if (!target.OnBoard) { break; } yield return target.TakeDamage(1, ((AbilityBehaviour)this).Card); yield return (object)new WaitForSeconds(0.15f); } yield return ((AbilityBehaviour)this).LearnAbility(0f); } public void RecordAttack(PlayableCard target) { if (!((Object)(object)target == (Object)null)) { if (attackCount.ContainsKey(target)) { attackCount[target]++; } else { attackCount.Add(target, 1); } } } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class DeathRollPatch { [HarmonyPrefix] public static void Prefix(CardSlot attackingSlot, CardSlot opposingSlot) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)attackingSlot == (Object)null) && !((Object)(object)attackingSlot.Card == (Object)null) && !((Object)(object)opposingSlot == (Object)null) && !((Object)(object)opposingSlot.Card == (Object)null) && attackingSlot.Card.HasAbility(DeathRollAPI.ability.Id)) { DeathRollBehaviour component = ((Component)attackingSlot.Card).GetComponent<DeathRollBehaviour>(); if ((Object)(object)component != (Object)null) { component.RecordAttack(opposingSlot.Card); } } } } [BepInPlugin("OLD_SA.DeathRoll", "OLD SA Death Roll", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.DeathRoll"; public const string NAME = "OLD SA Death Roll"; public const string VERSION = "1.0.0"; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.DeathRoll"); val.PatchAll(); DeathRollAPI.Init(); } }
Sigil/OldSa_Devouring_Maw_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Devouring_Maw_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Devouring_Maw_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("822ea6a2-3aff-4a3f-8e46-bef094283320")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.DevouringMaw; public static class DevouringMawAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Devouring Maw"; val.rulebookName = "Devouring Maw"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Devouring_Maw.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills a creature, it gains that creature's Power, Health, and sigils."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DevouringMawBehaviour), imageAsTexture); } } public class DevouringMawBehaviour : AbilityBehaviour { public override Ability Ability => DevouringMawAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)card == (Object)null) { return false; } return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } private bool IsNegativeAbility(Ability ability) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) if ((int)ability == 0) { return true; } AbilityInfo info = AbilitiesUtil.GetInfo(ability); if ((Object)(object)info == (Object)null) { return false; } return info.powerLevel < 0; } private void AddInheritedAbility(List<Ability> abilities, Ability ability) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_000c: 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_0027: Unknown result type (might be due to invalid IL or missing references) if ((int)ability != 0 && !IsNegativeAbility(ability) && !abilities.Contains(ability)) { abilities.Add(ability); } } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || (Object)(object)card == (Object)null || (Object)(object)killer != (Object)(object)((AbilityBehaviour)this).Card) { yield break; } int attack = card.Attack; int health = ((Card)card).Info.Health; List<Ability> abilities = new List<Ability>(); if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Abilities != null) { foreach (Ability ability in ((Card)card).Info.Abilities) { AddInheritedAbility(abilities, ability); } } if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Mods != null) { foreach (CardModificationInfo cardMod in ((Card)card).Info.Mods) { if (cardMod == null || cardMod.abilities == null) { continue; } foreach (Ability ability2 in cardMod.abilities) { AddInheritedAbility(abilities, ability2); } } } FieldInfo temporaryModsField = AccessTools.Field(typeof(PlayableCard), "temporaryMods"); if (temporaryModsField != null && temporaryModsField.GetValue(card) is List<CardModificationInfo> temporaryMods) { foreach (CardModificationInfo cardMod2 in temporaryMods) { if (cardMod2 == null || cardMod2.abilities == null) { continue; } foreach (Ability ability3 in cardMod2.abilities) { AddInheritedAbility(abilities, ability3); } } } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } CardModificationInfo mod = new CardModificationInfo(); mod.attackAdjustment = attack; mod.healthAdjustment = health; foreach (Ability ability4 in abilities) { mod.abilities.Add(ability4); } yield return PlayDevouringAnimation(mod); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead) { yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } private IEnumerator PlayDevouringAnimation(CardModificationInfo mod) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null)) { ((Card)((AbilityBehaviour)this).Card).Anim.PlayTransformAnimation(); ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); ((Card)((AbilityBehaviour)this).Card).RenderCard(); yield return (object)new WaitForSeconds(0.5f); } } } [BepInPlugin("OLD_SA.DevouringMaw", "OLD SA DevouringMaw", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.DevouringMaw"; public const string NAME = "OLD SA DevouringMaw"; public const string VERSION = "1.0.0"; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.DevouringMaw"); val.PatchAll(); DevouringMawAPI.Init(); } }
Sigil/OldSa_Diagonal_Block_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using InscryptionAPI.Triggers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Diagonal_Block_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Diagonal_Block_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("19eecc50-4756-4978-a9a0-6a080ff94d6c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.DiagonalBlock; public static class DiagonalBlockAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Diagonal Block"; val.rulebookName = "Diagonal Block"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Diagonal_Block.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Diagonal_Block_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "[creature] the damage it ultimately takes is 5 minus its stat."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DiagonalBlockBehaviour), imageAsTexture); } } public class DiagonalBlockBehaviour : AbilityBehaviour, IModifyDamageTaken { private int lastDamage = -1; private int lastResult = -1; public override Ability Ability => DiagonalBlockAPI.ability.Id; public bool RespondsToModifyDamageTaken(PlayableCard card, int damage, PlayableCard attacker, int amount) { return (Object)(object)card == (Object)(object)((AbilityBehaviour)this).Card && damage > 0; } public int OnModifyDamageTaken(PlayableCard card, int damage, PlayableCard attacker, int amount) { if (damage == lastResult) { return lastResult; } lastDamage = damage; lastResult = Mathf.Max(0, 5 - damage); return lastResult; } public int TriggerPriority(PlayableCard card, int damage, PlayableCard attacker) { return 0; } } [BepInPlugin("OLD_SA.ShellDefense", "OLD SA Shell Defense", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { DiagonalBlockAPI.Init(); } }
Sigil/OldSa_Dragon's Rumble_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Dialogue; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Dragon's Rumble_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Dragon's Rumble_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("bf186182-ce7f-4319-9508-a81b593ffaa4")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.DragonsRumble; public class DragonRumbleAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "DragonsRumble"; val.rulebookName = "Dragon's Rumble"; val.powerLevel = 4; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("OldSa_Dragons_Rumble.png", (FilterMode)0); ability = AbilityManager.Add("OLD_SA", val, typeof(DragonRumbleBehaviour), (Texture)(object)imageAsTexture); val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] dies, it deals 1 damage to a random enemy, increasing each time it takes damage."); } } public static IEnumerator DealDamage(PlayableCard source) { List<CardSlot> targets = new List<CardSlot>(); foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if ((Object)(object)slot.Card != (Object)null && !slot.Card.Dead) { targets.Add(slot); } } if (targets.Count != 0) { CardSlot target = targets[Random.Range(0, targets.Count)]; PlayableCard victim = target.Card; if (!((Object)(object)victim == (Object)null) && !victim.Dead) { yield return victim.TakeDamage(1, source); } } } } public class DragonRumbleBehaviour : AbilityBehaviour { public int triggerCount = 1; public override Ability Ability => DragonRumbleAPI.ability.Id; public void IncreaseTrigger() { triggerCount++; } public int GetTriggerCount() { return triggerCount; } public void ResetTrigger() { triggerCount = 1; } public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return !wasSacrifice; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); int count = triggerCount; for (int i = 0; i < count; i++) { yield return DragonRumbleAPI.DealDamage(((AbilityBehaviour)this).Card); } yield return SigilDialogueAPI.ShowFirstTime("DragonRumble", "It departs, leaving its enemies to suffer the consequences. But the Ring never ends, and neither does its return."); ResetTrigger(); } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public class DragonRumbleDamagePatch { public static void Prefix(PlayableCard __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && __instance.HasAbility(DragonRumbleAPI.ability.Id)) { DragonRumbleBehaviour component = ((Component)__instance).GetComponent<DragonRumbleBehaviour>(); if (!((Object)(object)component == (Object)null)) { component.IncreaseTrigger(); } } } } [BepInPlugin("oldsa.dragonsrumble", "Old SA Dragon's Rumble", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown DragonRumbleAPI.Init(); Harmony val = new Harmony("OLD_SA.DragonsRumble"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Dragon's Rumble Loaded"); } }
Sigil/OldSa_Enrage_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using InscryptionAPI.Triggers; using OLD_SA.Arbiter; using OLD_SA.ArmorStrike; using OLD_SA.CardTraits; using OLD_SA.DoubleDraw; using OLD_SA.EnrageArmor; using OLD_SA.FatalBargain; using OLD_SA.ForcedMarch; using OLD_SA.Lightning; using OLD_SA.Molting; using OLD_SA.Osteophagia; using OLD_SA.TwistedGrowth; using OLD_SA.WaterMusic; using OLD_SA.WondrousBrush; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Enrage_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Enrage_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7c16529d-197e-4a29-8c29-1179bf898236")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.WondrousBrush { public static class WondrousBrushAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Wondrous Brush"; val.rulebookName = "Wondrous Brush"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_WondrousBrush.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, it gains Power and Health equal to the number of sigils that creature had."); } ability = AbilityManager.Add("OLD_SA", val, typeof(WondrousBrushBehaviour), imageAsTexture); } } public class WondrousBrushBehaviour : ExtendedAbilityBehaviour { public override Ability Ability => WondrousBrushAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if (!((Object)(object)card == (Object)null)) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); int count = GetSigilCount(card); if (count > 0) { CardModificationInfo mod = new CardModificationInfo(); mod.attackAdjustment = count; mod.healthAdjustment = count; ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); ((Card)((AbilityBehaviour)this).Card).RenderCard(); ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } private int GetSigilCount(PlayableCard card) { int num = 0; if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Abilities != null) { num += ((Card)card).Info.Abilities.Count; } if (card.TemporaryMods != null) { foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod != null && temporaryMod.abilities != null) { num += temporaryMod.abilities.Count; } } } return num; } } } namespace OLD_SA.WaterMusic { public static class WaterMusicAPI { public static FullAbility ability; public static Ability WaterMusicAbility; public static void Init() { //IL_009f: 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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Water Music"; val.rulebookName = "Water Music"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Water_Music.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When a creature emerges, if it is an ally, [creature] gives it 1 Power; if it is an enemy, [creature] reduces it by 1."); } ability = AbilityManager.Add("OLD_SA", val, typeof(WaterMusicBehaviour), imageAsTexture); WaterMusicAbility = val.ability; } } public class WaterMusicBehaviour : ExtendedAbilityBehaviour { public static List<WaterMusicBehaviour> ActiveWaterMusic = new List<WaterMusicBehaviour>(); private Dictionary<PlayableCard, int> AppliedBuff = new Dictionary<PlayableCard, int>(); public override Ability Ability => WaterMusicAPI.ability.Id; private void Awake() { if (!ActiveWaterMusic.Contains(this)) { ActiveWaterMusic.Add(this); } } private void OnDestroy() { ActiveWaterMusic.Remove(this); AppliedBuff.Clear(); } public bool IsValid() { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead; } public void OnCreatureResurface(PlayableCard creature) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown if (IsValid() && !((Object)(object)creature == (Object)null) && !creature.Dead) { int num = ((((AbilityBehaviour)this).Card.OpponentCard == creature.OpponentCard) ? 1 : (-1)); if (AppliedBuff.ContainsKey(creature)) { AppliedBuff[creature] += num; } else { AppliedBuff.Add(creature, num); } CardModificationInfo val = new CardModificationInfo(); val.attackAdjustment = num; creature.AddTemporaryMod(val); creature.OnStatsChanged(); } } } [HarmonyPatch(typeof(Submerge), "OnResurface")] public static class WaterMusicResurfacePatch { [HarmonyPostfix] public static void Postfix(Submerge __instance) { if ((Object)(object)__instance == (Object)null) { return; } PlayableCard card = GetCard(__instance); if ((Object)(object)card == (Object)null) { return; } foreach (WaterMusicBehaviour item in new List<WaterMusicBehaviour>(WaterMusicBehaviour.ActiveWaterMusic)) { if (!((Object)(object)item == (Object)null)) { item.OnCreatureResurface(card); } } } private static PlayableCard GetCard(Submerge submerge) { Type type = ((object)submerge).GetType(); while (type != null) { PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo[] array = properties; foreach (PropertyInfo propertyInfo in array) { if (propertyInfo.PropertyType == typeof(PlayableCard)) { object? value = propertyInfo.GetValue(submerge); return (PlayableCard)((value is PlayableCard) ? value : null); } } FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array2 = fields; foreach (FieldInfo fieldInfo in array2) { if (fieldInfo.FieldType == typeof(PlayableCard)) { object? value2 = fieldInfo.GetValue(submerge); return (PlayableCard)((value2 is PlayableCard) ? value2 : null); } } type = type.BaseType; } return null; } } } namespace OLD_SA.TwistedGrowth { public static class TwistedGrowthAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Twisted Growth"; val.rulebookName = "Twisted Growth"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Twisted_Growth.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the end of the owner's turn, [creature] gains 1 Health. If [creature] killed a creature this turn, it gains 1 Power and 2 Health instead."); } ability = AbilityManager.Add("OLD_SA", val, typeof(TwistedGrowthBehaviour), imageAsTexture); } } public class TwistedGrowthBehaviour : ExtendedAbilityBehaviour { private bool killedThisTurn; public override Ability Ability => TwistedGrowthAPI.ability.Id; public override bool RespondsToUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard == playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { killedThisTurn = false; yield break; } public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card) { killedThisTurn = true; } yield break; } public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); CardModificationInfo mod = new CardModificationInfo(); if (killedThisTurn) { mod.attackAdjustment = 1; mod.healthAdjustment = 2; } else { mod.healthAdjustment = 1; } ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); killedThisTurn = false; yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } } namespace OLD_SA.Osteophagia { public static class OsteophagiaAPI { public static FullAbility ability; public static Ability OsteophagiaAbility; public static void Init() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Osteophagia"; val.rulebookName = "Osteophagia"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 1; val.opponentUsable = false; val.canStack = false; val.activated = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Osteophagia.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When you click [creature], consume 1 bone and gain 1 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(OsteophagiaBehaviour), imageAsTexture); OsteophagiaAbility = ability.Id; } } public class OsteophagiaBehaviour : ExtendedActivatedAbilityBehaviour { public override Ability Ability => OsteophagiaAPI.ability.Id; public override int StartingBonesCost => 1; public override IEnumerator Activate() { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); CardModificationInfo mod = new CardModificationInfo(0, 1); ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); if ((Object)(object)((Card)((AbilityBehaviour)this).Card).Anim != (Object)null) { ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } } namespace OLD_SA.Molting { public static class MoltingAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Molting"; val.rulebookName = "Molting"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Molting.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the end of the turn, [creature] takes 1 additional damage. At the end of the next turn, remove this effect and gain Armored. This repeats."); } ability = AbilityManager.Add("OLD_SA", val, typeof(MoltingBehaviour), imageAsTexture); } } public class MoltingBehaviour : ExtendedAbilityBehaviour, IModifyDamageTaken { public static List<MoltingBehaviour> ActiveMolting = new List<MoltingBehaviour>(); private bool molting; private bool processingTurnEnd; public override Ability Ability => MoltingAPI.ability.Id; private void Awake() { RegisterMolting(); } private void RegisterMolting() { if (!ActiveMolting.Contains(this)) { ActiveMolting.Add(this); } } private void RemoveMolting() { ActiveMolting.Remove(this); } private void OnDestroy() { RemoveMolting(); } public bool IsActiveForMolting() { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead; } public bool RespondsToModifyDamageTaken(PlayableCard card, int damage, PlayableCard attacker, int amount) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard || (Object)(object)card != (Object)(object)((AbilityBehaviour)this).Card) { return false; } return molting; } public int OnModifyDamageTaken(PlayableCard card, int damage, PlayableCard attacker, int amount) { if (!molting) { return damage; } return damage + 1; } public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard || processingTurnEnd) { return false; } bool flag = !((AbilityBehaviour)this).Card.OpponentCard; return playerTurnEnd == flag; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { yield return ProcessTurnEnd(); } public IEnumerator OnWaterborneTurnEnd(bool playerTurnEnd) { if (IsActiveForMolting()) { bool isPlayerCard = !((AbilityBehaviour)this).Card.OpponentCard; if (playerTurnEnd == isPlayerCard) { yield return ProcessTurnEnd(); } } } private IEnumerator ProcessTurnEnd() { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || processingTurnEnd) { yield break; } processingTurnEnd = true; try { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } if (molting) { molting = false; if (OLD_SA_TraitAPI.HasOldSaTrait(((AbilityBehaviour)this).Card, "OLD_SA_BLOOD_BOLETE_ARMOR")) { OLD_SA_LifeShield shield = ((Component)((AbilityBehaviour)this).Card).GetComponent<OLD_SA_LifeShield>(); if ((Object)(object)shield == (Object)null) { shield = ((Component)((AbilityBehaviour)this).Card).gameObject.AddComponent<OLD_SA_LifeShield>(); } shield.AddShield(1); } else { CardModificationInfo armor = new CardModificationInfo((Ability)54); ((AbilityBehaviour)this).Card.AddTemporaryMod(armor); } if ((Object)(object)((Card)((AbilityBehaviour)this).Card).Anim != (Object)null) { ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); } ((Card)((AbilityBehaviour)this).Card).RenderCard(); yield return null; if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead) { ((AbilityBehaviour)this).Card.UpdateFaceUpOnBoardEffects(); yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } else { molting = true; if ((Object)(object)((Card)((AbilityBehaviour)this).Card).Anim != (Object)null) { ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } finally { processingTurnEnd = false; } } public int TriggerPriority(PlayableCard card, int damage, PlayableCard attacker) { return 0; } } } namespace OLD_SA.Lightning { public static class LightningAPI { public static FullAbility ability; public static Ability LightningAbility; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Lightning"; val.rulebookName = "Lightning"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 2; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OLD_SA_Lightning.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OLD_SA_Lightning_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the end of the owner's turn, [creature] moves repeatedly in one direction until it can move no further."); } ability = AbilityManager.Add("OLD_SA", val, typeof(LightningBehaviour), imageAsTexture); LightningAbility = val.ability; } } public class LightningBehaviour : Strafe { public override Ability Ability => LightningAPI.ability.Id; protected override IEnumerator DoStrafe(CardSlot toLeft, CardSlot toRight) { bool leftAvailable = (Object)(object)toLeft != (Object)null && (Object)(object)toLeft.Card == (Object)null; bool rightAvailable = (Object)(object)toRight != (Object)null && (Object)(object)toRight.Card == (Object)null; if (base.movingLeft && !leftAvailable) { base.movingLeft = false; } if (!base.movingLeft && !rightAvailable) { base.movingLeft = true; } CardSlot currentSlot = ((AbilityBehaviour)this).Card.Slot; bool moved = false; if (base.movingLeft) { while (true) { CardSlot next = Singleton<BoardManager>.Instance.GetAdjacent(currentSlot, true); if ((Object)(object)next == (Object)null || (Object)(object)next.Card != (Object)null) { break; } yield return ((Strafe)this).MoveToSlot(next, true); currentSlot = next; moved = true; yield return (object)new WaitForSeconds(0.05f); } } else { while (true) { CardSlot next2 = Singleton<BoardManager>.Instance.GetAdjacent(currentSlot, false); if ((Object)(object)next2 == (Object)null || (Object)(object)next2.Card != (Object)null) { break; } yield return ((Strafe)this).MoveToSlot(next2, true); currentSlot = next2; moved = true; yield return (object)new WaitForSeconds(0.05f); } } if (moved) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return ((AbilityBehaviour)this).LearnAbility(0f); } else { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.15f); } } } } namespace OLD_SA.ForcedMarch { public static class ForcedMarchAPI { public static FullAbility ability; public static Ability ForcedMarchAbility; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Forced March"; val.rulebookName = "Forced March"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Forced_March.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Forced_March_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When a friendly creature moves, [creature] gains 1 Power until the end of its next turn."); } ability = AbilityManager.Add("OLD_SA", val, typeof(ForcedMarchBehaviour), imageAsTexture); ForcedMarchAbility = val.ability; } } public class ForcedMarchBehaviour : ExtendedAbilityBehaviour { public static List<ForcedMarchBehaviour> ActiveForcedMarch = new List<ForcedMarchBehaviour>(); private int expiringStacks = 0; private int currentTurnStacks = 0; public override Ability Ability => ForcedMarchAPI.ability.Id; private void Awake() { if (!ActiveForcedMarch.Contains(this)) { ActiveForcedMarch.Add(this); } } private void OnDestroy() { ActiveForcedMarch.Remove(this); } public override int GetPassiveAttackBuff(PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard || (Object)(object)target != (Object)(object)((AbilityBehaviour)this).Card) { return 0; } return expiringStacks + currentTurnStacks; } public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } if ((Object)(object)otherCard == (Object)null || otherCard.Dead || (Object)(object)otherCard.Slot == (Object)null) { return false; } if (otherCard.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return false; } if (!ForcedMarchPatch.IsActualMovement(otherCard)) { return false; } return true; } public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard && !((Object)(object)otherCard == (Object)null) && !otherCard.Dead && !((Object)(object)otherCard.Slot == (Object)null) && otherCard.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard && ForcedMarchPatch.IsActualMovement(otherCard)) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); currentTurnStacks++; yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } bool flag = !((AbilityBehaviour)this).Card.OpponentCard; return playerTurnEnd == flag; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { bool isPlayerCard = !((AbilityBehaviour)this).Card.OpponentCard; if (playerTurnEnd == isPlayerCard) { expiringStacks = currentTurnStacks; currentTurnStacks = 0; } } yield break; } } [HarmonyPatch(typeof(BoardManager), "AssignCardToSlot")] public static class ForcedMarchPatch { public class AssignmentRecord { public CardSlot PreviousSlot; public CardSlot DestinationSlot; public bool IsMovement => (Object)(object)PreviousSlot != (Object)null && (Object)(object)DestinationSlot != (Object)null && (Object)(object)PreviousSlot != (Object)(object)DestinationSlot; public AssignmentRecord(CardSlot previousSlot, CardSlot destinationSlot) { PreviousSlot = previousSlot; DestinationSlot = destinationSlot; } } public static readonly Dictionary<PlayableCard, AssignmentRecord> Assignments = new Dictionary<PlayableCard, AssignmentRecord>(); [HarmonyPrefix] public static void Prefix(PlayableCard card, CardSlot slot) { if (!((Object)(object)card == (Object)null)) { Assignments[card] = new AssignmentRecord(card.Slot, slot); } } public static bool IsActualMovement(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)card.Slot == (Object)null) { return false; } if (!Assignments.TryGetValue(card, out var value)) { return false; } if ((Object)(object)value.DestinationSlot != (Object)(object)card.Slot) { return false; } return value.IsMovement; } } } namespace OLD_SA.FatalBargain { public static class FatalBargainAPI { public static FullAbility ability; public static Ability FatalBargainAbility; public static void Init() { //IL_00a0: 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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Fatal Bargain"; val.rulebookName = "Fatal Bargain"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = -5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_FatalBargain.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "While [creature] is on the field, the player cannot draw a card at the start of each turn."); } ability = AbilityManager.Add("OLD_SA", val, typeof(FatalBargainBehaviour), imageAsTexture); FatalBargainAbility = val.ability; } } public class FatalBargainBehaviour : AbilityBehaviour { public override Ability Ability => FatalBargainAPI.FatalBargainAbility; } [HarmonyPatch] public static class FatalBargainPatch { private static bool HasFatalBargain() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Singleton<BoardManager>.Instance == (Object)null) { return false; } List<CardSlot> playerSlotsCopy = Singleton<BoardManager>.Instance.PlayerSlotsCopy; if (playerSlotsCopy == null) { return false; } foreach (CardSlot item in playerSlotsCopy) { if ((Object)(object)item == (Object)null || (Object)(object)item.Card == (Object)null || !item.Card.HasAbility(FatalBargainAPI.FatalBargainAbility)) { continue; } return true; } return false; } private static MethodBase TargetMethod() { Type type = typeof(CardDrawPiles).GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault((Type t) => t.Name.StartsWith("<DrawPhaseSequence>", StringComparison.Ordinal)); if (type == null) { return null; } return AccessTools.Method(type, "MoveNext", (Type[])null, (Type[])null); } private static CardDrawPiles GetOwner(object stateMachine) { if (stateMachine == null) { return null; } FieldInfo fieldInfo = AccessTools.Field(stateMachine.GetType(), "<>4__this"); if (fieldInfo == null) { return null; } object? value = fieldInfo.GetValue(stateMachine); return (CardDrawPiles)((value is CardDrawPiles) ? value : null); } private static bool IsExhausted(CardDrawPiles piles) { if ((Object)(object)piles == (Object)null) { return false; } PropertyInfo propertyInfo = AccessTools.Property(typeof(CardDrawPiles), "Exhausted"); if (propertyInfo != null) { return Convert.ToBoolean(propertyInfo.GetValue(piles, null)); } FieldInfo fieldInfo = AccessTools.Field(typeof(CardDrawPiles), "Exhausted"); if (fieldInfo != null) { return Convert.ToBoolean(fieldInfo.GetValue(piles)); } return false; } [HarmonyPrefix] public static bool Prefix(object __instance, ref bool __result) { CardDrawPiles owner = GetOwner(__instance); if ((Object)(object)owner == (Object)null) { return true; } if (!HasFatalBargain()) { return true; } if (IsExhausted(owner)) { return true; } __result = false; return false; } } } namespace OLD_SA.EnrageArmor { public static class EnrageArmorAPI { public static FullAbility ability; public static Ability EnrageArmorAbility; public static void Init() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Enrage Armor"; val.rulebookName = "Enrage Armor"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_EnrageArmor.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "Whenever [creature] loses 1 stack of DeathShield, it gains 2 Power."); } ability = AbilityManager.Add("OLD_SA", val, typeof(EnrageArmorBehaviour), imageAsTexture); EnrageArmorAbility = val.ability; } } public class EnrageArmorBehaviour : AbilityBehaviour { public override Ability Ability => EnrageArmorAPI.EnrageArmorAbility; } [HarmonyPatch(typeof(ShieldManager), "BreakShield")] public static class EnrageArmorPatch { [HarmonyPostfix] public static void Postfix(PlayableCard target, int damage, PlayableCard attacker) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown if (!((Object)(object)target == (Object)null) && !((Object)(object)((Card)target).Info == (Object)null) && !target.Dead && target.HasAbility(EnrageArmorAPI.EnrageArmorAbility)) { CardModificationInfo val = new CardModificationInfo(); val.attackAdjustment = 2; target.AddTemporaryMod(val); if ((Object)(object)((Card)target).Anim != (Object)null) { ((Card)target).Anim.LightNegationEffect(); } ((Card)target).RenderCard(); } } } } namespace OLD_SA.Enrage { public static class EnrageAPI { public static FullAbility ability; public static Ability EnrageAbility; public static void Init() { //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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Enrage"; val.rulebookName = "Enrage"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = -2; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Enrage.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Enrage_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] deals damage, the target gains 1 Power."); } ability = AbilityManager.Add("OLD_SA", val, typeof(EnrageBehaviour), imageAsTexture); EnrageAbility = val.ability; } } public class EnrageBehaviour : AbilityBehaviour { public override Ability Ability => EnrageAPI.ability.Id; public override bool RespondsToDealDamage(int amount, PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (amount <= 0) { return false; } if ((Object)(object)target == (Object)null) { return false; } return true; } public override IEnumerator OnDealDamage(int amount, PlayableCard target) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((Object)(object)target == (Object)null)) { CardModificationInfo mod = new CardModificationInfo(); mod.attackAdjustment = 1; target.AddTemporaryMod(mod); yield return (object)new WaitForSeconds(0.15f); } } } public class Imitator : VariableStatBehaviour { public static SpecialStatIcon iconType; protected override SpecialStatIcon IconType => iconType; public static void Init() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>(); val.rulebookName = "Imitator"; val.rulebookDescription = "This creature's attack is equal to the attack of the creature that attacked most recently while it was on the board."; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("imitator.png", (FilterMode)0); val.iconGraphic = (Texture)(object)imageAsTexture; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.appliesToAttack = true; val.appliesToHealth = false; FullStatIcon val2 = StatIconManager.Add("OLD_SA", val, typeof(Imitator)); iconType = val2.Id; } protected override int[] GetStatValues() { int num = ImitatorAttackTracker.GetAttack(((SpecialCardBehaviour)this).PlayableCard); if (num < 0) { num = 0; } return new int[2] { num, 0 }; } private void Awake() { if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard != (Object)null) { ImitatorAttackTracker.Register(((SpecialCardBehaviour)this).PlayableCard); } } private void OnDestroy() { if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard != (Object)null) { ImitatorAttackTracker.Unregister(((SpecialCardBehaviour)this).PlayableCard); } } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class ImitatorAttackPatch { public static IEnumerator Postfix(IEnumerator result, CardSlot attackingSlot) { while (result.MoveNext()) { yield return result.Current; } if ((Object)(object)attackingSlot == (Object)null || (Object)(object)attackingSlot.Card == (Object)null) { yield break; } PlayableCard attacker = attackingSlot.Card; int attack = attacker.Attack; List<PlayableCard> imitators = new List<PlayableCard>(); foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(true)) { AddImitator(slot, imitators); } foreach (CardSlot slot2 in Singleton<BoardManager>.Instance.GetSlots(false)) { AddImitator(slot2, imitators); } foreach (PlayableCard imitator in imitators) { if (!((Object)(object)imitator == (Object)(object)attacker)) { ImitatorAttackTracker.RecordAttack(imitator, attack); } } } private static void AddImitator(CardSlot slot, List<PlayableCard> imitators) { if ((Object)(object)slot == (Object)null || (Object)(object)slot.Card == (Object)null) { return; } PlayableCard card = slot.Card; if (card.OnBoard && !card.Dead) { Imitator component = ((Component)card).GetComponent<Imitator>(); if (!((Object)(object)component == (Object)null) && !imitators.Contains(card)) { imitators.Add(card); } } } } public static class ImitatorAttackTracker { private static Dictionary<PlayableCard, int> LastAttackValues = new Dictionary<PlayableCard, int>(); public static void Register(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !LastAttackValues.ContainsKey(card)) { LastAttackValues.Add(card, -1); } } public static int GetAttack(PlayableCard card) { if ((Object)(object)card == (Object)null) { return -1; } if (LastAttackValues.TryGetValue(card, out var value)) { return value; } return -1; } public static void RecordAttack(PlayableCard card, int attack) { if (!((Object)(object)card == (Object)null)) { if (!LastAttackValues.ContainsKey(card)) { LastAttackValues.Add(card, -1); } LastAttackValues[card] = attack; } } public static void Unregister(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { LastAttackValues.Remove(card); } } public static void Reset() { LastAttackValues.Clear(); } } [BepInPlugin("OLD_SA.Enrage", "OLD SA Enrage", "1.0.0")] public class EnragePlugin : BaseUnityPlugin { private void Awake() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown EnrageAPI.Init(); DoubleDrawAPI.Init(); ArbiterAPI.Init(); WaterMusicAPI.Init(); MoltingAPI.Init(); Imitator.Init(); SageBehaviour.Init(); OsteophagiaAPI.Init(); WondrousBrushAPI.Init(); ArmorStrikeAPI.Init(); EnrageArmorAPI.Init(); ForcedMarchAPI.Init(); LightningAPI.Init(); TwistedGrowthAPI.Init(); FatalBargainAPI.Init(); Harmony val = new Harmony("OLD_SA.Enrage"); val.PatchAll(); } } public class SageBehaviour : VariableStatBehaviour { public static SpecialStatIcon iconType; protected override SpecialStatIcon IconType => iconType; public static void Init() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>(); val.rulebookName = "Sage"; val.rulebookDescription = "This creature's Power is equal to the number of sigils on all creatures on the board."; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("sage.png", (FilterMode)0); val.iconGraphic = (Texture)(object)imageAsTexture; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.appliesToAttack = true; val.appliesToHealth = false; FullStatIcon val2 = StatIconManager.Add("OLD_SA", val, typeof(SageBehaviour)); iconType = val2.Id; } protected override int[] GetStatValues() { int num = 0; foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(true)) { if ((Object)(object)slot.Card != (Object)null) { num += GetSigilCount(slot.Card); } } foreach (CardSlot slot2 in Singleton<BoardManager>.Instance.GetSlots(false)) { if ((Object)(object)slot2.Card != (Object)null) { num += GetSigilCount(slot2.Card); } } return new int[2] { num, 0 }; } private int GetSigilCount(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } int num = 0; if ((Object)(object)((Card)card).Info != (Object)null && ((Card)card).Info.Abilities != null) { num += ((Card)card).Info.Abilities.Count; } if (card.TemporaryMods != null) { foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod != null && temporaryMod.abilities != null) { num += temporaryMod.abilities.Count; } } } return num; } } } namespace OLD_SA.DoubleDraw { public static class DoubleDrawAPI { public static FullAbility ability; public static Ability DoubleDrawAbility; public static void Init() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Double Draw"; val.rulebookName = "Double Draw"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_DoubleDraw.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is drawn, draw an additional card."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DoubleDrawBehaviour), imageAsTexture); DoubleDrawAbility = val.ability; } } public class DoubleDrawBehaviour : AbilityBehaviour { public static bool IsOpeningHandDrawing; public static int PendingExtraDraws; public override Ability Ability => DoubleDrawAPI.ability.Id; public override bool RespondsToDrawn() { return true; } public override IEnumerator OnDrawn() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null)) { if (IsOpeningHandDrawing) { PendingExtraDraws++; } else { yield return DrawOneExtraCard(); } } } public static IEnumerator DrawOneExtraCard() { CardDrawPiles3D piles = CardDrawPiles3D.Instance; if (!((Object)(object)piles == (Object)null) && !((Object)(object)((CardDrawPiles)piles).Deck == (Object)null) && ((CardDrawPiles)piles).Deck.CardsInDeck > 0) { if ((Object)(object)piles.Pile != (Object)null) { piles.Pile.Draw(); } yield return ((CardDrawPiles)piles).DrawCardFromDeck((CardInfo)null, (Action<PlayableCard>)null); } } public static void ClearPending() { PendingExtraDraws = 0; } } [HarmonyPatch(typeof(CardDrawPiles3D), "DrawOpeningHand")] public static class DoubleDrawOpeningHandPatch { [HarmonyPrefix] public static void Prefix() { DoubleDrawBehaviour.ClearPending(); DoubleDrawBehaviour.IsOpeningHandDrawing = true; } [HarmonyPostfix] public static void Postfix(ref IEnumerator __result) { if (__result == null) { DoubleDrawBehaviour.IsOpeningHandDrawing = false; } else { __result = WrapOpeningHand(__result); } } private static IEnumerator WrapOpeningHand(IEnumerator original) { while (true) { bool hasNext; try { hasNext = original.MoveNext(); } catch { DoubleDrawBehaviour.IsOpeningHandDrawing = false; throw; } if (!hasNext) { break; } yield return original.Current; } DoubleDrawBehaviour.IsOpeningHandDrawing = false; int extraDraws = DoubleDrawBehaviour.PendingExtraDraws; DoubleDrawBehaviour.PendingExtraDraws = 0; for (int i = 0; i < extraDraws; i++) { yield return DoubleDrawBehaviour.DrawOneExtraCard(); } } } } namespace OLD_SA.ArmorStrike { public static class ArmorStrikeAPI { public static FullAbility ability; public static Ability ArmorStrikeAbility; public static void Init() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Armor Strike"; val.rulebookName = "Armor Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_ArmorStrike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, it attacks once more for each layer of Armor."); } ability = AbilityManager.Add("OLD_SA", val, typeof(ArmorStrikeBehaviour), imageAsTexture); ArmorStrikeAbility = val.ability; } } public class ArmorStrikeBehaviour : AbilityBehaviour { public override Ability Ability => ArmorStrikeAPI.ArmorStrikeAbility; } } namespace OLD_SA.Arbiter { public class ArbiterAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Arbiter"; val.rulebookName = "Arbiter"; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("OldSa_Arbiter.png", (FilterMode)0); ability = AbilityManager.Add("OLD_SA", val, typeof(ArbiterBehaviour), (Texture)(object)imageAsTexture); val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the start of the turn, [creature] deals 1 damage to a random enemy. If it does not kill, the next trigger repeats one additional time."); } } public static IEnumerator DealDamage(PlayableCard source, Action<bool> killedCallback) { List<CardSlot> targets = new List<CardSlot>(); foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if ((Object)(object)slot.Card != (Object)null && !slot.Card.Dead) { targets.Add(slot); } } if (targets.Count == 0) { killedCallback?.Invoke(obj: false); yield break; } CardSlot target = targets[Random.Range(0, targets.Count)]; PlayableCard victim = target.Card; if ((Object)(object)victim == (Object)null || victim.Dead) { killedCallback?.Invoke(obj: false); yield break; } yield return victim.TakeDamage(1, source); bool killed = victim.Dead; killedCallback?.Invoke(killed); } } public class ArbiterBehaviour : AbilityBehaviour { public int triggerCount = 1; private bool killedThisTrigger = false; public override Ability Ability => ArbiterAPI.ability.Id; public override bool RespondsToUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard == playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); killedThisTrigger = false; int count = triggerCount; for (int i = 0; i < count; i++) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { break; } if (((AbilityBehaviour)this).Card.Dead) { break; } if (!((AbilityBehaviour)this).Card.OnBoard) { break; } yield return ArbiterAPI.DealDamage(((AbilityBehaviour)this).Card, delegate(bool killed) { if (killed) { killedThisTrigger = true; } }); yield return (object)new WaitForSeconds(0.15f); } if (!killedThisTrigger) { triggerCount++; } } } }
Sigil/OldSa_Entangle_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Entangle_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Entangle_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8d842e27-b6fa-4e64-8a4e-544a73a8f7d7")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Entangle; public static class EntangleAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Entangle"; val.rulebookName = "Entangle"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Entangle.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Entangle_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is killed, the creature that killed it permanently loses 2 attack."); } ability = AbilityManager.Add("OLD_SA", val, typeof(EntangleBehaviour), imageAsTexture); } } public class EntangleBehaviour : AbilityBehaviour { public override Ability Ability => EntangleAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)card != (Object)(object)((AbilityBehaviour)this).Card) { return false; } if ((Object)(object)killer == (Object)null) { return false; } return true; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)killer == (Object)null) && !killer.Dead) { EntangleManager.ApplyAttackPenalty(killer); ((Card)killer).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.15f); } } } public static class EntangleManager { public static void ApplyAttackPenalty(PlayableCard killer) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (!((Object)(object)killer == (Object)null) && !killer.Dead) { CardModificationInfo val = new CardModificationInfo { attackAdjustment = -2 }; killer.AddTemporaryMod(val); } } } [BepInPlugin("OLD_SA.Entangle", "OLD SA Entangle", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Entangle"; public const string PluginName = "OLD SA Entangle"; public const string PluginVersion = "1.0.0"; public static ManualLogSource Log; private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"[OLD_SA] Loading Entangle..."); EntangleAPI.Init(); Harmony val = new Harmony("OLD_SA.Entangle"); val.PatchAll(); Log.LogInfo((object)"[OLD_SA] Entangle loaded successfully."); } }
Sigil/OldSa_Fighter_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Fighter_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Fighter_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a5e41553-6637-42a2-ae52-50ef781b12b9")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Fighter; public static class FighterAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Fighter"; val.rulebookName = "Fighter"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Fighter.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Fighter_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, randomly gain 1 Power or 2 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(FighterBehaviour), imageAsTexture); } } public class FighterBehaviour : AbilityBehaviour { public override Ability Ability => FighterAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return (object)new WaitForSeconds(0.3f); bool gainAttack = Random.value < 0.5f; CardModificationInfo mod = new CardModificationInfo(); if (gainAttack) { mod.attackAdjustment = 1; } else { mod.healthAdjustment = 2; } ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); if (!((AbilityBehaviour)this).Card.Dead) { ((Card)((AbilityBehaviour)this).Card).Anim.LightNegationEffect(); yield return (object)new WaitForSeconds(0.3f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } [BepInPlugin("OLD_SA.Fighter", "OLD SA Fighter", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { FighterAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Fighter loaded."); } }
Sigil/OldSa_Fileswarm_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Dialogue; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Fileswarm_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Fileswarm_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3f6db44f-2c66-4b89-8024-9fe90b8daf9f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Fileswarm; public static class FileswarmAPI { public static FullAbility ability; public static void Init() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Fileswarm"; val.rulebookName = "Fileswarm"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Fileswarm.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Fileswarm_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When an ally dies, [creature] summons a card in its place."); } ability = AbilityManager.Add("OLD_SA", val, typeof(FileswarmBehaviour), imageAsTexture); FileswarmBehaviour.ability = ability.Id; } } public class FileswarmBehaviour : AbilityBehaviour { private class FileswarmSpawnMarker : MonoBehaviour { public int SourceId; } public static Ability ability; private const string EXTENDED_PROPERTY = "Fileswarm"; private const string DEFAULT_CARD = "Squirrel"; private const string REJECT_DIALOGUE = "FileswarmReject"; private const string SUCCESS_DIALOGUE = "FileswarmSuccess"; public override Ability Ability => ability; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || !((AbilityBehaviour)this).Card.OnBoard || ((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)card == (Object)null || (Object)(object)deathSlot == (Object)null) { return false; } if (!fromCombat) { return false; } if (card.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return false; } if ((Object)(object)card == (Object)(object)((AbilityBehaviour)this).Card) { return false; } if ((Object)(object)((Card)card).Info == (Object)null) { return false; } FileswarmSpawnMarker component = ((Component)card).GetComponent<FileswarmSpawnMarker>(); if ((Object)(object)component != (Object)null && component.SourceId == ((Object)this).GetInstanceID()) { return false; } return true; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null || (Object)(object)deathSlot == (Object)null) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (((Card)card).Info.HasTrait((Trait)12) || ((Card)card).Info.HasTrait((Trait)13)) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.15f); yield return SigilDialogueAPI.ShowFirstTime("FileswarmReject", "You really think this will work?"); yield break; } yield return (object)new WaitForSeconds(0.5f); if ((Object)(object)deathSlot == (Object)null) { yield break; } string spawnedCardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Fileswarm"); if (string.IsNullOrWhiteSpace(spawnedCardName)) { spawnedCardName = "Squirrel"; } CardInfo spawnedCard = CardLoader.GetCardByName(spawnedCardName); if ((Object)(object)spawnedCard == (Object)null || ((Object)(object)deathSlot.Card != (Object)null && !deathSlot.Card.Dead)) { yield break; } yield return Singleton<BoardManager>.Instance.CreateCardInSlot(spawnedCard, deathSlot, 0.15f, true); if (!((Object)(object)deathSlot.Card == (Object)null)) { FileswarmSpawnMarker marker = ((Component)deathSlot.Card).gameObject.GetComponent<FileswarmSpawnMarker>(); if ((Object)(object)marker == (Object)null) { marker = ((Component)deathSlot.Card).gameObject.AddComponent<FileswarmSpawnMarker>(); } marker.SourceId = ((Object)this).GetInstanceID(); yield return SigilDialogueAPI.ShowFirstTime("FileswarmSuccess", "Attracted some annoying stuff..."); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } [BepInPlugin("OLD_SA.Fileswarm", "OLD SA Fileswarm", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Fileswarm"; public const string PluginName = "OLD SA Fileswarm"; public const string PluginVersion = "1.0.0"; internal static ManualLogSource Log; private void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"[OLD SA Fileswarm] Plugin loaded."); FileswarmAPI.Init(); Log.LogInfo((object)"[OLD SA Fileswarm] Fileswarm registered."); Harmony val = new Harmony("OLD_SA.Fileswarm"); val.PatchAll(); Log.LogInfo((object)"[OLD SA Fileswarm] Harmony patches applied."); Log.LogInfo((object)"[OLD SA Fileswarm] Loaded successfully."); } }
Sigil/OldSa_Flying_Strike_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Flying_Strike_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Flying_Strike_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("26a1651a-f4f5-4764-9138-7b4ab925a161")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.FlyingStrike; public static class FlyingStrikeAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Flying Strike"; val.rulebookName = "Flying Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Flying_Strike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, make an additional Flying Strike."); } ability = AbilityManager.Add("OLD_SA", val, typeof(FlyingStrikeBehaviour), imageAsTexture); } } public class FlyingStrikeBehaviour : ExtendedAbilityBehaviour { public static Ability ability; private int flyingCharges = 1; public override Ability Ability => FlyingStrikeAPI.ability.Id; public bool HasCharge() { return flyingCharges > 0; } public void ConsumeCharge() { if (flyingCharges > 0) { flyingCharges--; } } public override bool RespondsToGetOpposingSlots() { return true; } public override List<CardSlot> GetOpposingSlots(List<CardSlot> originalSlots, List<CardSlot> otherAddedSlots) { List<CardSlot> list = new List<CardSlot>(); CardSlot val = CardExtensions.OpposingSlot(((AbilityBehaviour)this).Card); if ((Object)(object)val != (Object)null) { FlyingStrikePatch.MarkFlyingStrikeAttack(((AbilityBehaviour)this).Card, val); list.Add(val); } return list; } public override bool RespondsToUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard == playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { flyingCharges = 1; yield break; } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class FlyingStrikePatch { private const string FLYING_STRIKE_MOD_ID = "OLD_SA_FlyingStrike_TemporaryFlying"; private static readonly HashSet<PlayableCard> pendingFlyingAttacks = new HashSet<PlayableCard>(); public static void MarkFlyingStrikeAttack(PlayableCard card, CardSlot targetSlot) { if (!((Object)(object)card == (Object)null)) { FlyingStrikeBehaviour component = ((Component)card).GetComponent<FlyingStrikeBehaviour>(); if (!((Object)(object)component == (Object)null) && component.HasCharge()) { component.ConsumeCharge(); pendingFlyingAttacks.Add(card); } } } [HarmonyPostfix] private static void Postfix(CardSlot attackingSlot, CardSlot opposingSlot, float waitAfter, ref IEnumerator __result) { if (!((Object)(object)attackingSlot == (Object)null) && !((Object)(object)attackingSlot.Card == (Object)null)) { PlayableCard card = attackingSlot.Card; if (pendingFlyingAttacks.Contains(card)) { pendingFlyingAttacks.Remove(card); __result = ExecuteFlyingStrikeAttack(__result, card); } } } private static IEnumerator ExecuteFlyingStrikeAttack(IEnumerator originalRoutine, PlayableCard card) { bool alreadyFlying = card.HasAbility((Ability)19); bool addedFlying = false; try { if (!alreadyFlying && !card.Dead) { CardModificationInfo mod = new CardModificationInfo((Ability)19); mod.singletonId = "OLD_SA_FlyingStrike_TemporaryFlying"; if (card.Status != null && !card.Status.hiddenAbilities.Contains((Ability)19)) { card.Status.hiddenAbilities.Add((Ability)19); } card.AddTemporaryMod(mod); addedFlying = true; } if (originalRoutine != null) { while (originalRoutine.MoveNext()) { yield return originalRoutine.Current; } } } finally { if (addedFlying && (Object)(object)card != (Object)null) { RemoveFlyingMod(card); } } } private static void RemoveFlyingMod(PlayableCard card) { if ((Object)(object)card == (Object)null) { return; } List<CardModificationInfo> list = CardExtensions.AllCardModificationInfos(card); foreach (CardModificationInfo item in list) { if (item != null && item.singletonId == "OLD_SA_FlyingStrike_TemporaryFlying") { CardExtensions.RemoveCardModificationInfo(card, item, true); } } if (card.Status != null) { card.Status.hiddenAbilities.Remove((Ability)19); } } } [BepInPlugin("OLD_SA.FlyingStrike", "OLD SA Flying Strike", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FlyingStrikeAPI.Init(); Harmony val = new Harmony("OLD_SA.FlyingStrike"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Flying Strike loaded."); } }
Sigil/OldSa_Frenzy_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Frenzy_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Frenzy_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f4c9ff12-92b2-40f2-b204-b8b0082873dd")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Frenzy; public static class FrenzyAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Frenzy"; val.rulebookName = "Frenzy"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Frenzy.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, it moves."); } ability = AbilityManager.Add("OLD_SA", val, typeof(FrenzyBehaviour), imageAsTexture); } } public class FrenzyBehaviour : AbilityBehaviour { protected bool movingLeft; public override Ability Ability => FrenzyAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null)) { CardSlot toLeft = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true); CardSlot toRight = Singleton<BoardManager>.Instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, false); bool leftValid = (Object)(object)toLeft != (Object)null && (Object)(object)toLeft.Card == (Object)null; bool rightValid = (Object)(object)toRight != (Object)null && (Object)(object)toRight.Card == (Object)null; if (movingLeft && !leftValid) { movingLeft = false; } if (!movingLeft && !rightValid) { movingLeft = true; } CardSlot destination = (movingLeft ? toLeft : toRight); bool destinationValid = (movingLeft ? leftValid : rightValid); if ((Object)(object)destination == (Object)null || !destinationValid) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield return (object)new WaitForSeconds(0.15f); } else { CardSlot oldSlot = ((AbilityBehaviour)this).Card.Slot; yield return Singleton<BoardManager>.Instance.AssignCardToSlot(((AbilityBehaviour)this).Card, destination, 0.1f, (Action)null, true); yield return PostSuccessfulMoveSequence(oldSlot); } } } protected virtual IEnumerator PostSuccessfulMoveSequence(CardSlot oldSlot) { yield break; } } [BepInPlugin("OLD_SA.Frenzy", "OLD SA Frenzy", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FrenzyAPI.Init(); Harmony val = new Harmony("OLD_SA.Frenzy"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Frenzy Loaded"); } }
Sigil/OldSa_Gorebound_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Gorebound_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Gorebound_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("16df888a-f3a1-42d4-8390-95bc5a89743f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Gorebound; public static class GoreboundAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Gorebound"; val.rulebookName = "Gorebound"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Gorebound.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] sacrifices another creature, it gains 1 Power and 1 Health for each tribe that sacrificed creature has."); } ability = AbilityManager.Add("OLD_SA", val, typeof(GoreboundBehaviour), imageAsTexture); } } public class GoreboundBehaviour : AbilityBehaviour { public override Ability Ability => GoreboundAPI.ability.Id; public IEnumerator OnSacrifice(PlayableCard sacrificedCard) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)sacrificedCard == (Object)null) && !((Object)(object)sacrificedCard == (Object)(object)((AbilityBehaviour)this).Card)) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); int tribeCount = 0; if (((Card)sacrificedCard).Info.tribes != null) { tribeCount = ((Card)sacrificedCard).Info.tribes.Count; } Debug.Log((object)("[OLD SA Gorebound] Tribe count = " + tribeCount)); if (tribeCount > 0) { CardModificationInfo mod = new CardModificationInfo(tribeCount, tribeCount); ((AbilityBehaviour)this).Card.AddTemporaryMod(mod); ((Card)((AbilityBehaviour)this).Card).RenderCard(); } yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } [HarmonyPatch(typeof(PlayableCard), "Sacrifice")] public static class GoreboundSacrificePatch { public static void Prefix(PlayableCard __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)Singleton<BoardManager>.Instance == (Object)null) { return; } PlayableCard currentSacrificeDemandingCard = Singleton<BoardManager>.Instance.CurrentSacrificeDemandingCard; if (!((Object)(object)currentSacrificeDemandingCard == (Object)null) && !((Object)(object)currentSacrificeDemandingCard == (Object)(object)__instance)) { GoreboundBehaviour component = ((Component)currentSacrificeDemandingCard).GetComponent<GoreboundBehaviour>(); if (!((Object)(object)component == (Object)null)) { ((MonoBehaviour)currentSacrificeDemandingCard).StartCoroutine(component.OnSacrifice(__instance)); } } } } [BepInPlugin("OLD_SA.Gorebound", "OLD SA Gorebound", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GoreboundAPI.Init(); Harmony val = new Harmony("OLD_SA.Gorebound"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA] Gorebound loaded."); } }
Sigil/OldSa_Greed's Sin_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Greed's Sin_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Greed's Sin_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3d4de877-48c9-4c43-ac54-9c4981726cd4")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.GreedSin; public static class GreedSinAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Greed's Sin"; val.rulebookName = "Greed's Sin"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Greed_Sin.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, a random opposing creature gains 5 Gluttony."); } ability = AbilityManager.Add("OLD_SA", val, typeof(GreedSinBehaviour), imageAsTexture); } } public class GreedSinBehaviour : AbilityBehaviour { public override Ability Ability => GreedSinAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); for (int i = 0; i < 5; i++) { List<PlayableCard> allies = new List<PlayableCard>(); if ((Object)(object)Singleton<BoardManager>.Instance != (Object)null) { List<CardSlot> slots = Singleton<BoardManager>.Instance.GetSlots(((AbilityBehaviour)this).Card.OpponentCard); foreach (CardSlot slot in slots) { if (!((Object)(object)slot == (Object)null) && !((Object)(object)slot.Card == (Object)null) && !slot.Card.Dead) { allies.Add(slot.Card); } } } if (allies.Count == 0) { break; } PlayableCard target = allies[Random.Range(0, allies.Count)]; if (!((Object)(object)target == (Object)null) && !target.Dead) { SmallSigilManager.AddStacks(target, (SmallSigilType)2, 1); yield return SmallSigilRuleManager.ProcessAndWait(target); yield return (object)new WaitForSeconds(0.1f); } } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } [BepInPlugin("OLD_SA.GreedSin", "OLD SA Greed's Sin", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Greed's Sin] Loading..."); GreedSinAPI.Init(); Harmony val = new Harmony("OLD_SA.GreedSin"); val.PatchAll(); } }
Sigil/OldSa_Hallucinogenic_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Hallucinogenic_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Hallucinogenic_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("47fe31fe-4a65-485f-8e11-007c2dc7eba4")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Hallucinogenic; public static class HallucinogenicAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Hallucinogenic"; val.rulebookName = "Hallucinogenic"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Hallucinogenic.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is about to be attacked, the attacker's target is randomized."); } ability = AbilityManager.Add("OLD_SA", val, typeof(HallucinogenicBehaviour), imageAsTexture); } } public class HallucinogenicBehaviour : AbilityBehaviour { public override Ability Ability => HallucinogenicAPI.ability.Id; } [HarmonyPatch(typeof(PlayableCard), "GetOpposingSlots")] public static class HallucinogenicPatch { private static int randomCounter; [HarmonyPostfix] public static void Postfix(PlayableCard __instance, ref List<CardSlot> __result) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.Slot == (Object)null || __result == null || __result.Count == 0) { return; } foreach (CardSlot item in __result) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Card == (Object)null) && HallucinogenicAPI.ability != null && item.Card.HasAbility(HallucinogenicAPI.ability.Id)) { List<CardSlot> randomTargets = GetRandomTargets(__instance, item); if (randomTargets.Count > 0) { int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed(); currentRandomSeed = currentRandomSeed * 31 + randomCounter++; float num = SeededRandom.Value(currentRandomSeed); int num2 = Mathf.FloorToInt(num * (float)randomTargets.Count); num2 = Mathf.Clamp(num2, 0, randomTargets.Count - 1); __result = new List<CardSlot> { randomTargets[num2] }; break; } } } } private static List<CardSlot> GetRandomTargets(PlayableCard attacker, CardSlot hallucinogenicSlot) { List<CardSlot> list = new List<CardSlot>(); BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return list; } List<CardSlot> list2 = new List<CardSlot>(); list2.AddRange(instance.PlayerSlotsCopy); list2.AddRange(instance.OpponentSlotsCopy); foreach (CardSlot item in list2) { if (!((Object)(object)item == (Object)null) && !((Object)(object)attacker.Slot == (Object)(object)item) && !((Object)(object)hallucinogenicSlot == (Object)(object)item)) { list.Add(item); } } return list; } } [BepInPlugin("OLD_SA.Hallucinogenic", "OLD SA Hallucinogenic", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.Hallucinogenic"; public const string NAME = "OLD SA Hallucinogenic"; public const string VERSION = "1.0.0"; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.Hallucinogenic"); val.PatchAll(); HallucinogenicAPI.Init(); } }
Sigil/OldSa_Healing Armor_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.HealingArmor; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Healing Armor_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Healing Armor_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("376829af-6343-471f-98ce-d962884b6704")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OldSa_HealingArmor { [BepInPlugin("OLD_SA.HealingArmor", "OLD SA Healing Armor", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.HealingArmor"; public const string NAME = "OLD SA Healing Armor"; public const string VERSION = "1.0.0"; private void Awake() { HealingArmorAPI.Init(); } } } namespace OLD_SA.HealingArmor { public static class HealingArmorAPI { public static FullAbility ability; public static void Init() { //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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Healing Armor"; val.rulebookName = "Healing Armor"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Healing_Armor.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Healing_Armor_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the start of the turn, if [creature] took no damage during the last enemy turn, it restores 2 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(HealingArmorBehaviour), imageAsTexture); } } public class HealingArmorBehaviour : ExtendedAbilityBehaviour { private bool trackingOpposingTurn; private bool damagedDuringOpposingTurn; private bool previousOpposingTurnValid; public override Ability Ability => HealingArmorAPI.ability.Id; public override bool RespondsToUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } bool flag = !((AbilityBehaviour)this).Card.OpponentCard; return playerUpkeep == flag; } public override IEnumerator OnUpkeep(bool playerUpkeep) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard && previousOpposingTurnValid && ((AbilityBehaviour)this).Card.Health < ((Card)((AbilityBehaviour)this).Card).Info.Health) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); int missingHealth = ((Card)((AbilityBehaviour)this).Card).Info.Health - ((AbilityBehaviour)this).Card.Health; int healAmount = Math.Min(2, missingHealth); if (healAmount > 0) { ((AbilityBehaviour)this).Card.HealDamage(healAmount); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); previousOpposingTurnValid = false; } } public override bool RespondsToTakeDamage(PlayableCard source) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } return trackingOpposingTurn; } public override IEnumerator OnTakeDamage(PlayableCard source) { damagedDuringOpposingTurn = true; yield break; } public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { return false; } bool flag = !((AbilityBehaviour)this).Card.OpponentCard; if (playerTurnEnd == flag) { return true; } return trackingOpposingTurn; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { yield break; } bool isPlayerCard = !((AbilityBehaviour)this).Card.OpponentCard; if (playerTurnEnd == isPlayerCard) { trackingOpposingTurn = ((AbilityBehaviour)this).Card.OnBoard; damagedDuringOpposingTurn = false; previousOpposingTurnValid = false; yield break; } if (trackingOpposingTurn) { previousOpposingTurnValid = !damagedDuringOpposingTurn && ((AbilityBehaviour)this).Card.OnBoard; } trackingOpposingTurn = false; damagedDuringOpposingTurn = false; } } }
Sigil/OldSa_Hive Will_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Dialogue; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Hive Will_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Hive Will_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("014ad8de-ec23-4e3d-82f6-36fbdce503a7")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.HiveWill; public static class HiveWillAPI { public static FullAbility ability; public unsafe static void Init() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "HiveWill"; val.rulebookName = "Hive Will"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Hive_Will.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Hive_Will_px.png", (FilterMode)0); val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When a specific card is played on [creature], they fuse with each other."); } val.opponentUsable = false; val.powerLevel = 0; ability = AbilityManager.Add("OLD_SA", val, typeof(HiveWillBehaviour), imageAsTexture); Ability id = ability.Id; Debug.Log((object)("HiveWill registered ID=" + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } public static class HiveWillAssets { public static Sprite LoadSprite(string name) { //IL_0032: 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) Texture2D imageAsTexture = TextureHelper.GetImageAsTexture(name, (FilterMode)0); if ((Object)(object)imageAsTexture == (Object)null) { return null; } return Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); } } public static class HiveWillAudio { public static AudioClip LoadBuzz() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown string text = Path.Combine(Path.GetDirectoryName(typeof(HiveWillAudio).Assembly.Location), "Audio", "hive_buzz.wav"); if (!File.Exists(text)) { return null; } WWW val = new WWW("file:///" + text); while (!val.isDone) { } return val.GetAudioClip(false, false); } } public class HiveWillBehaviour : AbilityBehaviour { public override Ability Ability => HiveWillAPI.ability.Id; } [HarmonyPatch(typeof(TurnManager), "set_GameEnded")] public static class HiveWillCombatEndPatch { public static void Postfix(bool value) { if (value) { Debug.Log((object)"HiveWill Combat End Clear Trigger"); HiveWillTemporaryManager.Clear(); } } } public class HiveWillIconShake : MonoBehaviour { private float angle = 4f; private float speed = 35f; private Quaternion startRotation; public void StartShake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) startRotation = ((Component)this).transform.localRotation; } private void Update() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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) float num = Mathf.Sin(Time.time * speed) * angle; ((Component)this).transform.localRotation = startRotation * Quaternion.Euler(0f, 0f, num); } } public static class HiveWillManager { public static IEnumerator Merge(PlayableCard host, PlayableCard material) { if ((Object)(object)host == (Object)null || (Object)(object)material == (Object)null) { HiveWillPatch.Merging = false; yield break; } CardModificationInfo statMod = new CardModificationInfo(); statMod.attackAdjustment = material.Attack; statMod.healthAdjustment = material.Health; statMod.fromCardMerge = true; host.AddTemporaryMod(statMod); if (ShouldInherit(host)) { InheritAbilities(host, material); } Singleton<PlayerHand>.Instance.RemoveCardFromHand(material); ((Component)material).gameObject.SetActive(false); yield return (object)new WaitForSeconds(0.2f); ((Card)host).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.8f); ((Card)host).RenderCard(); try { yield return SigilDialogueAPI.ShowFirstTime("HiveWill", "She shall lead her swarm to victory.", host); } finally { HiveWillSelectionPatch.DisableFlying(); ((Card)host).Anim.SetSelectedToPlay(false); HiveWillPatch.Merging = false; Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); } } private static bool ShouldInherit(PlayableCard host) { string extendedProperty = CardExtensions.GetExtendedProperty(((Card)host).Info, "OLD_SA.HiveWillInherit"); if (extendedProperty == "false") { return false; } return true; } private static void InheritAbilities(PlayableCard host, PlayableCard material) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //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) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) List<Ability> list = new List<Ability>(); foreach (CardModificationInfo mod in ((Card)material).Info.Mods) { if (mod.abilities == null || !mod.fromCardMerge) { continue; } foreach (Ability ability in mod.abilities) { if (!host.HasAbility(ability) && !list.Contains(ability)) { list.Add(ability); } } } if (list.Count != 0) { CardModificationInfo val = new CardModificationInfo(); val.abilities = new List<Ability>(list); val.fromCardMerge = true; val.singletonId = "OLD_SA_HIVEWILL"; Debug.Log((object)("HiveWill Add Temporary Mod: " + ((Object)((Card)host).Info).name + " ID=" + val.singletonId + " Abilities=" + string.Join(",", list))); host.AddTemporaryMod(val); CardModificationInfo val2 = new CardModificationInfo(); val2.abilities = new List<Ability>(list); val2.fromCardMerge = true; val2.singletonId = "OLD_SA_HIVEWILL"; ((Card)host).Info.Mods.Add(val2); Debug.Log((object)("HiveWill Add Display Mod: " + ((Object)((Card)host).Info).name + " ID=" + val2.singletonId)); HiveWillTemporaryManager.Register(host); host.OnStatsChanged(); ((Card)host).RenderCard(); } } } [HarmonyPatch(typeof(BoardManager))] public static class HiveWillPatch { public static bool Merging; [HarmonyPatch("ChooseSlot")] [HarmonyPrefix] public static void ChooseSlotPrefix(List<CardSlot> validSlots) { if (validSlots == null) { return; } PlayableCard choosingSlotCard = Singleton<PlayerHand>.Instance.ChoosingSlotCard; if ((Object)(object)choosingSlotCard == (Object)null) { return; } foreach (CardSlot item in Singleton<BoardManager>.Instance.PlayerSlotsCopy) { if (!((Object)(object)item.Card == (Object)null)) { PlayableCard card = item.Card; if (HasHiveWill(card) && IsHiveWillTarget(card, choosingSlotCard) && !validSlots.Contains(item)) { validSlots.Add(item); } } } } [HarmonyPatch("OnSlotSelected")] [HarmonyPrefix] public static bool OnSlotSelectedPrefix(CardSlot slot) { if (Merging) { return false; } if ((Object)(object)slot == (Object)null) { return true; } if ((Object)(object)slot.Card == (Object)null) { return true; } PlayableCard card = slot.Card; if (!HasHiveWill(card)) { return true; } PlayableCard choosingSlotCard = Singleton<PlayerHand>.Instance.ChoosingSlotCard; if ((Object)(object)choosingSlotCard == (Object)null) { return true; } if (!IsHiveWillTarget(card, choosingSlotCard)) { return true; } Merging = true; HiveWillSelectionPatch.DisableFlying(); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); ((MonoBehaviour)card).StartCoroutine(HiveWillManager.Merge(card, choosingSlotCard)); return false; } private static bool IsHiveWillTarget(PlayableCard host, PlayableCard card) { string text = CardExtensions.GetExtendedProperty(((Card)host).Info, "OLD_SA.HiveWillTarget"); if (string.IsNullOrEmpty(text)) { text = "Squirrel"; } return ((Object)((Card)card).Info).name == text; } private static bool HasHiveWill(PlayableCard card) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (((Card)card).Info.Abilities.Contains(HiveWillAPI.ability.Id)) { return true; } foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod.abilities.Contains(HiveWillAPI.ability.Id)) { return true; } } return false; } } public static class HiveWillSelectionEffect { private static GameObject currentIcon; public static void Show(PlayableCard card) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)card == (Object)null) && !((Object)(object)currentIcon != (Object)null)) { Sprite val = HiveWillAssets.LoadSprite("HiveIcon.png"); if ((Object)(object)val == (Object)null) { Debug.Log((object)"Missing HiveIcon"); return; } currentIcon = new GameObject("HiveWillIcon"); currentIcon.transform.position = ((Component)card).transform.position + new Vector3(0f, 0.8f, 0f); currentIcon.transform.rotation = Quaternion.Euler(90f, 0f, 0f); SpriteRenderer val2 = currentIcon.AddComponent<SpriteRenderer>(); val2.sprite = val; ((Renderer)val2).sortingOrder = 999; HiveWillIconShake hiveWillIconShake = currentIcon.AddComponent<HiveWillIconShake>(); hiveWillIconShake.StartShake(); } } public static void Hide() { if ((Object)(object)currentIcon != (Object)null) { Object.Destroy((Object)(object)currentIcon); } currentIcon = null; } public static bool IsShowing() { return (Object)(object)currentIcon != (Object)null; } } public static class HiveWillSelectionManager { public static PlayableCard Material; public static PlayableCard Target; public static bool Choosing; public static void StartSelection(PlayableCard material, PlayableCard target) { Material = material; Target = target; Choosing = true; if ((Object)(object)Target != (Object)null && (Object)(object)((Card)Target).Anim != (Object)null) { ((Card)Target).Anim.SetSelectedToPlay(true); } } public static void Finish() { if (!((Object)(object)Material == (Object)null) && !((Object)(object)Target == (Object)null)) { ((MonoBehaviour)Target).StartCoroutine(HiveWillManager.Merge(Target, Material)); Choosing = false; Material = null; Target = null; } } private static bool IsHiveWillTarget(PlayableCard host, PlayableCard card) { string text = CardExtensions.GetExtendedProperty(((Card)host).Info, "OLD_SA.HiveWillTarget"); if (string.IsNullOrEmpty(text)) { text = "Squirrel"; } return ((Object)((Card)card).Info).name == text; } private static void InheritAbilities(PlayableCard host, PlayableCard material) { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"=== HiveWill Ability Inherit ==="); Debug.Log((object)("Material: " + ((Object)((Card)material).Info).name)); Debug.Log((object)("TemporaryMods Count: " + material.TemporaryMods.Count)); HashSet<Ability> hashSet = new HashSet<Ability>(); foreach (CardModificationInfo temporaryMod in material.TemporaryMods) { if (temporaryMod.abilities == null) { continue; } Debug.Log((object)("Found Mod Abilities: " + string.Join(", ", temporaryMod.abilities))); foreach (Ability ability in temporaryMod.abilities) { hashSet.Add(ability); } } hashSet.Remove(HiveWillAPI.ability.Id); if (hashSet.Count == 0) { Debug.Log((object)"No extra abilities found."); return; } CardModificationInfo val = new CardModificationInfo(); val.fromCardMerge = true; val.abilities = new List<Ability>(hashSet); host.AddTemporaryMod(val); } } [HarmonyPatch(typeof(PlayerHand))] public static class HiveWillSelectionPatch { private static HashSet<PlayableCard> ActiveCards = new HashSet<PlayableCard>(); [HarmonyPatch("ManagedUpdate")] [HarmonyPostfix] public static void UpdateCheck() { PlayerHand instance = Singleton<PlayerHand>.Instance; if (!((Object)(object)instance == (Object)null)) { if ((Object)(object)instance.ChoosingSlotCard != (Object)null) { CheckHiveWill(instance.ChoosingSlotCard); } else { DisableFlying(); } } } private static void CheckHiveWill(PlayableCard material) { HashSet<PlayableCard> hashSet = new HashSet<PlayableCard>(); foreach (CardSlot item in Singleton<BoardManager>.Instance.PlayerSlotsCopy) { if ((Object)(object)item.Card == (Object)null) { continue; } PlayableCard card = item.Card; if (HasHiveWill(card)) { string text = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.HiveWillTarget"); if (string.IsNullOrEmpty(text)) { text = "Squirrel"; } if (!(((Object)((Card)material).Info).name != text)) { hashSet.Add(card); EnableFlying(card); } } } foreach (PlayableCard item2 in new List<PlayableCard>(ActiveCards)) { if (!hashSet.Contains(item2)) { RemoveFlying(item2); } } } private static void EnableFlying(PlayableCard card) { if (!ActiveCards.Contains(card)) { HiveWillSelectionEffect.Show(card); ActiveCards.Add(card); } } private static void RemoveFlying(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { HiveWillSelectionEffect.Hide(); ActiveCards.Remove(card); } } public static void DisableFlying() { foreach (PlayableCard item in new List<PlayableCard>(ActiveCards)) { RemoveFlying(item); } } private static bool HasHiveWill(PlayableCard card) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (((Card)card).Info.Abilities.Contains(HiveWillAPI.ability.Id)) { return true; } foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod.abilities.Contains(HiveWillAPI.ability.Id)) { return true; } } return false; } } public static class HiveWillTemporaryManager { private static List<CardInfo> Cards = new List<CardInfo>(); public static void Register(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null)) { Debug.Log((object)("HiveWill Register CardInfo = " + ((Object)((Card)card).Info).name)); if (!Cards.Contains(((Card)card).Info)) { Cards.Add(((Card)card).Info); } } } public static void Clear() { Debug.Log((object)("HiveWill Clear Start Count = " + Cards.Count)); foreach (CardInfo card in Cards) { if (!((Object)(object)card == (Object)null)) { Debug.Log((object)("HiveWill Clearing CardInfo = " + ((Object)card).name)); int count = card.Mods.Count; card.Mods.RemoveAll((CardModificationInfo x) => x.singletonId == "OLD_SA_HIVEWILL"); int count2 = card.Mods.Count; Debug.Log((object)("HiveWill Remove Display Mods: " + (count - count2))); } } Cards.Clear(); Debug.Log((object)"HiveWill Clear Finished"); } } [BepInPlugin("OLD_SA.HiveWill", "OLD_SA Hive Will", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HiveWillAPI.Init(); Harmony val = new Harmony("OLD_SA.HiveWill"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD_SA Hive Will Loaded"); } }
Sigil/OldSa_Immolate_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Immolate_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Immolate_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("41436ad8-9195-43e8-ba27-c14a8582321d")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Immolate; public static class ImmolateAPI { public static FullAbility ability; public unsafe static void Init() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Immolate"; val.rulebookName = "Immolate"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Immolate.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the start of the end, [creature] gives the opposing creature 3 Blaze."); } ability = AbilityManager.Add("OLD_SA", val, typeof(ImmolateBehaviour), imageAsTexture); Ability id = ability.Id; Debug.Log((object)("[OLD SA] Immolate registered. ID=" + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } public class ImmolateBehaviour : AbilityBehaviour { public static Ability AbilityID => ImmolateAPI.ability.Id; public override Ability Ability => AbilityID; public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard != playerTurnEnd; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } CardSlot opposingSlot = ((AbilityBehaviour)this).Card.Slot.opposingSlot; if ((Object)(object)opposingSlot == (Object)null || (Object)(object)opposingSlot.Card == (Object)null) { yield break; } PlayableCard target = opposingSlot.Card; if (!((Object)(object)target == (Object)null) && !target.Dead) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)target != (Object)null && !target.Dead) { SmallSigilManager.AddStacks(target, (SmallSigilType)0, 3); yield return SmallSigilRuleManager.ProcessAndWait(target); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } [BepInPlugin("OLD_SA.Immolate", "OLD SA Immolate Sigil", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { Debug.Log((object)"[OLD SA Immolate] Loading..."); ImmolateAPI.Init(); Debug.Log((object)"[OLD SA Immolate] Loaded."); } }
Sigil/OldSa_Inferno_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Inferno_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Inferno_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f922c8b9-44d0-47d2-9c0b-c7807a8cbfad")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Inferno; public static class InfernoAPI { public static FullAbility ability; public unsafe static void Init() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Inferno"; val.rulebookName = "Inferno"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Inferno.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the start of the turn, [creature] gives 1 Blaze to all opposing creatures."); } ability = AbilityManager.Add("OLD_SA", val, typeof(InfernoBehaviour), imageAsTexture); Ability id = ability.Id; Debug.Log((object)("Inferno registered ID=" + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } public class InfernoBehaviour : AbilityBehaviour { public static Ability AbilityID => InfernoAPI.ability.Id; public override Ability Ability => AbilityID; public override bool RespondsToUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { return false; } return ((AbilityBehaviour)this).Card.OpponentCard == playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } List<PlayableCard> opposingCards = new List<PlayableCard>(); foreach (CardSlot slot in Singleton<BoardManager>.Instance.AllSlotsCopy) { if (!((Object)(object)slot == (Object)null) && !((Object)(object)slot.Card == (Object)null) && !slot.Card.Dead) { PlayableCard target = slot.Card; if (target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { opposingCards.Add(target); } } } foreach (PlayableCard target2 in opposingCards) { if (!((Object)(object)target2 == (Object)null) && !target2.Dead) { SmallSigilManager.AddStacks(target2, (SmallSigilType)0, 1); yield return SmallSigilRuleManager.ProcessAndWait(target2); yield return null; } } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } [BepInPlugin("OLD_SA.Inferno", "OLD SA Inferno Sigil", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { Debug.Log((object)"[OLD SA Inferno] Loading..."); InfernoAPI.Init(); Debug.Log((object)"[OLD SA Inferno] Loaded."); } }
Sigil/OldSa_Martyr's Sting_station.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Martyr's Sting_station")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Martyr's Sting_station")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("292d45ee-add0-4f6e-b6d7-c6be983e9d4a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.MartyrsSting; public class MartyrsSting : VariableStatBehaviour { public static SpecialStatIcon iconType; protected override SpecialStatIcon IconType => iconType; public static void Init() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>(); val.rulebookName = "Martyr's Sting"; val.rulebookDescription = "The lower this creature's health, the higher its attack."; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("Martyr's Sting.png", (FilterMode)0); val.iconGraphic = (Texture)(object)imageAsTexture; Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("Martyr's Sting_px.png", (FilterMode)0); AbilityExtensions.SetPixelIcon(val, imageAsTexture2, (FilterMode?)null); val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.appliesToAttack = true; val.appliesToHealth = false; FullStatIcon val2 = StatIconManager.Add("OLD_SA", val, typeof(MartyrsSting)); iconType = val2.Id; } protected override int[] GetStatValues() { if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null || !((SpecialCardBehaviour)this).PlayableCard.OnBoard) { return new int[2]; } int maxHealth = ((SpecialCardBehaviour)this).PlayableCard.MaxHealth; int health = ((SpecialCardBehaviour)this).PlayableCard.Health; int num = maxHealth - health; return new int[2] { 1 + Mathf.Max(0, num), 0 }; } } [BepInPlugin("OLD_SA.MartyrsSting", "OLD_SA Martyr's Sting", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown MartyrsSting.Init(); Harmony val = new Harmony("OLD_SA.MartyrsSting"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD_SA Martyr's Sting Loaded"); } }
Sigil/OldSa_Penalty_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Penalty_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Penalty_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3abb0a06-3397-4edd-a979-83e4c193ba69")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Penalty; public static class PenaltyAPI { public static FullAbility ability; public static void Init() { //IL_0079: 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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Penalty"; val.rulebookName = "Penalty"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = -2; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Penalty.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Penalty_px.png", (FilterMode)0); val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is played, its owner takes 1 damage."); } ability = AbilityManager.Add("OLD_SA", val, typeof(PenaltyBehaviour), imageAsTexture); } } public class PenaltyBehaviour : AbilityBehaviour { private static readonly MethodInfo PreSuccessfulTriggerSequenceMethod = AccessTools.Method(typeof(AbilityBehaviour), "PreSuccessfulTriggerSequence", (Type[])null, (Type[])null); public override Ability Ability => PenaltyAPI.ability.Id; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((Object)(object)Singleton<LifeManager>.Instance == (Object)null)) { yield return InvokePreSuccessfulTriggerSequence(); bool toPlayer = !((AbilityBehaviour)this).Card.OpponentCard; yield return Singleton<LifeManager>.Instance.ShowDamageSequence(1, 1, toPlayer, 0.125f, (GameObject)null, 0f, true); } } private IEnumerator InvokePreSuccessfulTriggerSequence() { if (PreSuccessfulTriggerSequenceMethod == null) { yield break; } object result = PreSuccessfulTriggerSequenceMethod.Invoke(this, null); if (result is IEnumerator sequence) { while (sequence.MoveNext()) { yield return sequence.Current; } } } } [BepInPlugin("OLD_SA.Penalty", "OLD SA Penalty", "1.0.0")] public class Plugin : BaseUnityPlugin { private Harmony harmony; private unsafe void Awake() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Penalty] Loading..."); PenaltyAPI.Init(); if (PenaltyAPI.ability == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"[OLD SA Penalty] Failed to register Penalty ability!"); return; } ManualLogSource logger = ((BaseUnityPlugin)this).Logger; Ability id = PenaltyAPI.ability.Id; logger.LogInfo((object)("[OLD SA Penalty] Penalty ability registered. ID = " + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); harmony = new Harmony("OLD_SA.Penalty"); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Penalty] Harmony patches applied."); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Penalty] Loaded successfully."); } private void OnDestroy() { if (harmony != null) { harmony.UnpatchSelf(); harmony = null; } ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Penalty] Unloaded."); } }
Sigil/OldSa_Perseverance_sigil.dll.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using InscryptionAPI.Triggers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Perseverance_sigil.dll")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Perseverance_sigil.dll")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("941850e0-847b-458c-9cf7-29b1fceb516a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Perseverance; public static class PerseveranceAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Perseverance"; val.rulebookName = "Perseverance"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Perseverance.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When an ally takes damage, if that damage is less than 2, [creature] gives it 1 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(PerseveranceBehaviour), imageAsTexture); } } public class PerseveranceBehaviour : AbilityBehaviour, IModifyDamageTaken { public override Ability Ability => PerseveranceAPI.ability.Id; public bool RespondsToModifyDamageTaken(PlayableCard target, int damage, PlayableCard attacker, int originalDamage) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || !((AbilityBehaviour)this).Card.OnBoard || ((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)target == (Object)null) { return false; } if (target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return false; } if (damage >= 2) { return false; } return true; } public int TriggerPriority(PlayableCard target, int damage, PlayableCard attacker) { return 0; } public int OnModifyDamageTaken(PlayableCard target, int damage, PlayableCard attacker, int originalDamage) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || !((AbilityBehaviour)this).Card.OnBoard || ((AbilityBehaviour)this).Card.Dead) { return damage; } if ((Object)(object)target == (Object)null) { return damage; } if (target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return damage; } if (damage >= 2) { return damage; } if ((Object)(object)((Card)target).Anim != (Object)null) { ((Card)target).Anim.StrongNegationEffect(); } CardModificationInfo val = new CardModificationInfo(0, 1); target.AddTemporaryMod(val); return damage; } } [BepInPlugin("OLD_SA.Perseverance", "OLD SA Perseverance", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { PerseveranceAPI.Init(); Debug.Log((object)"[OLD SA] Perseverance loaded."); } }
Sigil/OldSa_Pitfall_Trap_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Pitfall_Trap_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Pitfall_Trap_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b5f5bff9-b1b2-4cb1-9e58-784a743b478b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.PitfallTrap; public static class PitfallTrapAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Pitfall Trap"; val.rulebookName = "Pitfall Trap"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 2; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Pitfall_Trap.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Pitfall_Trap_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is attacked by an Insect, it takes no damage and kills the attacker. It gains 1 Power and 1 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(PitfallTrapBehaviour), imageAsTexture); } } public class PitfallTrapBehaviour : AbilityBehaviour { public override Ability Ability => PitfallTrapAPI.ability.Id; public IEnumerator TriggerPitfall(PlayableCard attacker) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)attacker == (Object)null) && !attacker.Dead) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)attacker == (Object)null) && !attacker.Dead) { yield return attacker.Die(false, ((AbilityBehaviour)this).Card, true); CardModificationInfo bonus = new CardModificationInfo { attackAdjustment = 1, healthAdjustment = 1, singletonId = "OLD_SA_PitfallTrap_Bonus_" + Guid.NewGuid() }; ((AbilityBehaviour)this).Card.AddTemporaryMod(bonus); ((AbilityBehaviour)this).Card.OnStatsChanged(); ((Card)((AbilityBehaviour)this).Card).RenderCard(); ((AbilityBehaviour)this).Card.UpdateFaceUpOnBoardEffects(); } } } } internal static class PitfallTrapAttackContext { internal static PlayableCard AttackingCard; internal static PlayableCard TargetCard; internal static void Set(PlayableCard attackingCard, PlayableCard targetCard) { AttackingCard = attackingCard; TargetCard = targetCard; } internal static void Clear() { AttackingCard = null; TargetCard = null; } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] internal static class PitfallTrap_SlotAttackSlot_Patch { [HarmonyPostfix] private static void Postfix(CardSlot attackingSlot, CardSlot opposingSlot, ref IEnumerator __result) { if (__result != null) { PlayableCard attackingCard = (((Object)(object)attackingSlot != (Object)null) ? attackingSlot.Card : null); PlayableCard targetCard = (((Object)(object)opposingSlot != (Object)null) ? opposingSlot.Card : null); __result = WrapAttackCoroutine(__result, attackingCard, targetCard); } } private static IEnumerator WrapAttackCoroutine(IEnumerator original, PlayableCard attackingCard, PlayableCard targetCard) { try { while (true) { PitfallTrapAttackContext.Set(attackingCard, targetCard); bool hasNext; try { hasNext = original.MoveNext(); } finally { PitfallTrapAttackContext.Clear(); } if (!hasNext) { break; } yield return original.Current; } } finally { PitfallTrapAttackContext.Clear(); } } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public static class PitfallTrapPatch { [HarmonyPrefix] public static bool Prefix(PlayableCard __instance, int damage, PlayableCard attacker, ref IEnumerator __result) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)attacker == (Object)null) { return true; } if ((Object)(object)PitfallTrapAttackContext.AttackingCard == (Object)null || (Object)(object)PitfallTrapAttackContext.TargetCard == (Object)null) { return true; } if ((Object)(object)attacker != (Object)(object)PitfallTrapAttackContext.AttackingCard) { return true; } if ((Object)(object)__instance != (Object)(object)PitfallTrapAttackContext.TargetCard) { return true; } if (__instance.Dead) { return true; } if (!__instance.HasAbility(PitfallTrapAPI.ability.Id)) { return true; } if ((Object)(object)((Card)attacker).Info == (Object)null || ((Card)attacker).Info.tribes == null || !((Card)attacker).Info.tribes.Contains((Tribe)6)) { return true; } PitfallTrapBehaviour pitfallBehaviour = GetPitfallBehaviour(__instance); if ((Object)(object)pitfallBehaviour == (Object)null) { return true; } __result = pitfallBehaviour.TriggerPitfall(attacker); return false; } private static PitfallTrapBehaviour GetPitfallBehaviour(PlayableCard card) { if ((Object)(object)card == (Object)null) { return null; } AbilityBehaviour[] components = ((Component)card).GetComponents<AbilityBehaviour>(); if (components == null) { return null; } AbilityBehaviour[] array = components; foreach (AbilityBehaviour val in array) { PitfallTrapBehaviour pitfallTrapBehaviour = val as PitfallTrapBehaviour; if ((Object)(object)pitfallTrapBehaviour != (Object)null) { return pitfallTrapBehaviour; } } return null; } } [BepInPlugin("OLD_SA.PitfallTrap", "OLD SA Pitfall Trap", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown PitfallTrapAPI.Init(); Harmony val = new Harmony("OLD_SA.PitfallTrap"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Pitfall Trap loaded."); } }
Sigil/OldSa_Prosperity_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Prosperity_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Prosperity_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("bf8f7560-4f77-47f9-a3d7-8a782b962f33")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Prosperity; [BepInPlugin("OLD_SA.Prosperity", "OLD SA Prosperity", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { ProsperityAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Prosperity loaded."); } } public static class ProsperityAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Prosperity"; val.rulebookName = "Prosperity"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Prosperity.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills another creature, it and adjacent friendly creatures gain 1 Health."); } ability = AbilityManager.Add("OLD_SA", val, typeof(ProsperityBehaviour), imageAsTexture); } } public class ProsperityBehaviour : AbilityBehaviour { public static Ability ability; public override Ability Ability => ProsperityAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { return (Object)(object)killer == (Object)(object)((AbilityBehaviour)this).Card && (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { yield return GiveHealth(((AbilityBehaviour)this).Card); CardSlot leftSlot = GetAdjacentSlot(-1); if ((Object)(object)leftSlot != (Object)null && (Object)(object)leftSlot.Card != (Object)null) { yield return GiveHealth(leftSlot.Card); } CardSlot rightSlot = GetAdjacentSlot(1); if ((Object)(object)rightSlot != (Object)null && (Object)(object)rightSlot.Card != (Object)null) { yield return GiveHealth(rightSlot.Card); } if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead) { yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } private IEnumerator GiveHealth(PlayableCard target) { if (!((Object)(object)target == (Object)null) && !target.Dead && target.OnBoard) { CardModificationInfo mod = new CardModificationInfo(); mod.healthAdjustment = 1; target.AddTemporaryMod(mod); target.OnStatsChanged(); ((Card)target).RenderCard(); target.UpdateFaceUpOnBoardEffects(); yield return (object)new WaitForSeconds(0.15f); } } private CardSlot GetAdjacentSlot(int offset) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { return null; } CardSlot slot = ((AbilityBehaviour)this).Card.Slot; int num = slot.Index + offset; List<CardSlot> slots = Singleton<BoardManager>.Instance.GetSlots(slot.IsPlayerSlot); if (num < 0 || num >= slots.Count) { return null; } return slots[num]; } }
Sigil/OldSa_Puppeteer_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using InscryptionAPI.Triggers; using OLD_SA.CarnivalMaster; using OLD_SA.Jester; using OLD_SA.Puppet; using OLD_SA.PuppetFear; using OLD_SA.Puppeteer; using OLD_SA.RagePuppet; using OLD_SA.SorrowPuppet; using OLD_SA.StubbornResistance; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Puppeteer_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Puppeteer_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("68ad490a-c487-4007-a2b7-613033a2115a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OldSa_Puppeteer { [BepInPlugin("OLD_SA.Puppeteer", "OLD SA Puppeteer", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.Puppeteer"; public const string NAME = "OLD SA Puppeteer"; public const string VERSION = "1.0.0"; private void Awake() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown PuppeteerAPI.Init(); PuppetAPI.Init(); DenialAPI.Init(); JesterAPI.Init(); CarnivalMasterAttack.Init(); PuppetFearAPI.Init(); PuppetRageAPI.Init(); PuppetRejectionAPI.Init(); RagePuppetAPI.Register(); SorrowPuppetAPI.Register(); StubbornResistanceAPI.Init(); Harmony val = new Harmony("OLD_SA.Puppeteer"); val.PatchAll(); } } } namespace OLD_SA.StubbornResistance { public static class StubbornResistanceAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Stubborn Resistance"; val.rulebookName = "Stubborn Resistance"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Stubborn_Resistance.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When another creature is played, [creature] turns it into a Puppet."); } ability = AbilityManager.Add("OLD_SA", val, typeof(StubbornResistanceBehaviour), imageAsTexture); } } public class StubbornResistanceBehaviour : ExtendedAbilityBehaviour { private const string EXTENDED_PROPERTY = "Puppeteer"; private const string DEFAULT_CARD = "OLD_SA_PUPPET"; public override Ability Ability => StubbornResistanceAPI.ability.Id; public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (!((AbilityBehaviour)this).Card.OnBoard) { return false; } if (((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)otherCard == (Object)null) { return false; } if ((Object)(object)otherCard == (Object)(object)((AbilityBehaviour)this).Card) { return false; } if ((Object)(object)otherCard.Slot == (Object)null) { return false; } if (otherCard.Dead) { return false; } return true; } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { if ((Object)(object)otherCard == (Object)null || otherCard.Dead) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); string cardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Puppeteer"); if (string.IsNullOrEmpty(cardName)) { cardName = "OLD_SA_PUPPET"; } CardInfo puppetInfo = CardLoader.GetCardByName(cardName); if ((Object)(object)puppetInfo == (Object)null) { yield break; } object obj = puppetInfo.Clone(); puppetInfo = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)puppetInfo == (Object)null) { yield break; } int finalAttack = otherCard.Attack; int finalHealth = otherCard.Health; if (puppetInfo.Mods == null) { puppetInfo.Mods = new List<CardModificationInfo>(); } else { puppetInfo.Mods.Clear(); } if (((Card)otherCard).Info.Mods != null) { foreach (CardModificationInfo mod in ((Card)otherCard).Info.Mods) { if (mod != null && !mod.nonCopyable) { object obj2 = mod.Clone(); CardModificationInfo clone = (CardModificationInfo)((obj2 is CardModificationInfo) ? obj2 : null); if (clone != null) { clone.attackAdjustment = 0; clone.healthAdjustment = 0; puppetInfo.Mods.Add(clone); } } } } yield return otherCard.TransformIntoCard(puppetInfo, (Action)null, (Action)null); otherCard.SwitchToPortrait(((Card)otherCard).Info.portraitTex); ((Card)otherCard).RenderCard(); int attackFix = finalAttack - otherCard.Attack; int healthFix = finalHealth - otherCard.Health; if (attackFix != 0 || healthFix != 0) { CardModificationInfo fix = new CardModificationInfo(); fix.attackAdjustment = attackFix; fix.healthAdjustment = healthFix; otherCard.AddTemporaryMod(fix); } yield return (object)new WaitForSeconds(0.2f); PuppetHelper.Bind(((AbilityBehaviour)this).Card, otherCard); yield return ((AbilityBehaviour)this).LearnAbility(0.1f); } } } namespace OLD_SA.Jester { public class BellToesBehaviour : AbilityBehaviour { public static Ability ability; private const string EXTENDED_PROPERTY = "BellToes"; private const string DEFAULT_CARD = "Squirrel"; public override Ability Ability => JesterAPI.BellToesAbility.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || !((AbilityBehaviour)this).Card.OnBoard || ((AbilityBehaviour)this).Card.Dead || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { return false; } if ((Object)(object)card == (Object)null) { return false; } if (!fromCombat) { return false; } if (card.OpponentCard == ((AbilityBehaviour)this).Card.OpponentCard) { return false; } if ((Object)(object)killer != (Object)(object)((AbilityBehaviour)this).Card) { return false; } return true; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { CardSlot targetSlot = ((AbilityBehaviour)this).Card.Slot; if ((Object)(object)targetSlot == (Object)null) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); string spawnedCardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "BellToes"); if (string.IsNullOrEmpty(spawnedCardName)) { spawnedCardName = "Squirrel"; } CardInfo spawnedInfo = CardLoader.GetCardByName(spawnedCardName); if ((Object)(object)spawnedInfo == (Object)null) { yield break; } object obj = spawnedInfo.Clone(); spawnedInfo = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)spawnedInfo == (Object)null) { yield break; } PlayerHand hand = Singleton<PlayerHand>.Instance; if (!((Object)(object)hand == (Object)null)) { Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); yield return (object)new WaitForSeconds(0.1f); yield return hand.AddCardToHand(((AbilityBehaviour)this).Card, Vector3.zero, 0.25f); yield return (object)new WaitForSeconds(0.1f); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.25f); PlayableCard spawned = CardSpawner.SpawnPlayableCard(spawnedInfo); if (!((Object)(object)spawned == (Object)null)) { yield return Singleton<BoardManager>.Instance.ResolveCardOnBoard(spawned, targetSlot, 0.1f, (Action)null, true); yield return (object)new WaitForSeconds(0.1f); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } } public static class JesterAPI { public static FullAbility BellToesAbility; public static FullAbility ToeBellAbility; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Bell Toes"; val.rulebookName = "Bell Toes"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_BellToes.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] kills, it returns to your hand and leaves a card in its place."); } BellToesAbility = AbilityManager.Add("OLD_SA", val, typeof(BellToesBehaviour), imageAsTexture); AbilityInfo val2 = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val2).name = "Toe Bell"; val2.rulebookName = "Toe Bell"; val2.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val2.powerLevel = 0; val2.opponentUsable = false; Texture imageAsTexture2 = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_ToeBell.png", (FilterMode)0); FieldInfo field2 = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field2 != null) { field2.SetValue(val2, "When [creature] dies, a chosen card from your hand is placed in its position."); } ToeBellAbility = AbilityManager.Add("OLD_SA", val2, typeof(ToeBellBehaviour), imageAsTexture2); } } public class ToeBellBehaviour : AbilityBehaviour { public static Ability ability; private const string EXTENDED_PROPERTY = "ToeBell"; public override Ability Ability => JesterAPI.ToeBellAbility.Id; public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { return false; } PlayerHand instance = Singleton<PlayerHand>.Instance; if ((Object)(object)instance == (Object)null) { return false; } foreach (PlayableCard item in instance.CardsInHand) { if ((Object)(object)item != (Object)null && (Object)(object)((Card)item).Info != (Object)null) { return true; } } return false; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { CardSlot deathSlot = ((AbilityBehaviour)this).Card.Slot; if ((Object)(object)deathSlot == (Object)null) { yield break; } PlayerHand hand = Singleton<PlayerHand>.Instance; if ((Object)(object)hand == (Object)null) { yield break; } PlayableCard selectedCard = null; string targetName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "ToeBell"); if (!string.IsNullOrEmpty(targetName)) { foreach (PlayableCard card in hand.CardsInHand) { if ((Object)(object)card != (Object)null && (Object)(object)((Card)card).Info != (Object)null && ((Object)((Card)card).Info).name == targetName) { selectedCard = card; break; } } } if ((Object)(object)selectedCard == (Object)null) { List<PlayableCard> candidates = new List<PlayableCard>(); foreach (PlayableCard card2 in hand.CardsInHand) { if ((Object)(object)card2 != (Object)null && (Object)(object)((Card)card2).Info != (Object)null) { candidates.Add(card2); } } if (candidates.Count == 0) { yield break; } selectedCard = candidates[Random.Range(0, candidates.Count)]; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return hand.PlayCardOnSlot(selectedCard, deathSlot); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } } namespace OLD_SA.SorrowPuppet { public class RagePuppetBehaviour : ExtendedAbilityBehaviour { private const string EXTENDED_PROPERTY = "Puppeteer"; private const string DEFAULT_CARD = "OLD_SA_PUPPET"; private bool triggered; public override Ability Ability => RagePuppetAPI.ability.Id; public override bool RespondsToResolveOnBoard() { return !triggered; } public override IEnumerator OnResolveOnBoard() { triggered = true; yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || !((AbilityBehaviour)this).Card.OnBoard) { yield break; } List<CardSlot> allTargets = new List<CardSlot>(); List<CardSlot> validTargets = new List<CardSlot>(); BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } foreach (CardSlot slot in board.PlayerSlotsCopy) { allTargets.Add(slot); if (!((Object)(object)slot.Card == (Object)null) && !((Object)(object)slot.Card == (Object)(object)((AbilityBehaviour)this).Card)) { validTargets.Add(slot); } } if (validTargets.Count == 0) { string dialogue = "It is like a lone commander..."; try { if ((Object)(object)Singleton<TextDisplayer>.Instance != (Object)null) { yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(dialogue, -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } yield break; } finally { } } CardSlot selectedSlot = null; GameObject currentTargetIcon = null; GameObject targetIconPrefab = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/CannonTargetIcon"); Singleton<ViewManager>.Instance.Controller.SwitchToControlMode(board.ChoosingSlotViewMode, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1; yield return board.ChooseTarget(allTargets, validTargets, (Action<CardSlot>)delegate(CardSlot val) { selectedSlot = val; if ((Object)(object)currentTargetIcon != (Object)null) { Object.Destroy((Object)(object)currentTargetIcon); currentTargetIcon = null; } }, (Action<CardSlot>)delegate { }, (Action<CardSlot>)delegate(CardSlot val) { //IL_0072: 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) if (!((Object)(object)val == (Object)null) && !((Object)(object)targetIconPrefab == (Object)null)) { if ((Object)(object)currentTargetIcon != (Object)null) { Object.Destroy((Object)(object)currentTargetIcon); } currentTargetIcon = Object.Instantiate<GameObject>(targetIconPrefab, ((Component)val).transform); currentTargetIcon.transform.localPosition = new Vector3(0f, 0.25f, 0f); currentTargetIcon.transform.localRotation = Quaternion.identity; } }, (Func<bool>)(() => false), (CursorType)16); if ((Object)(object)currentTargetIcon != (Object)null) { Object.Destroy((Object)(object)currentTargetIcon); } Singleton<ViewManager>.Instance.Controller.SwitchToControlMode(board.DefaultViewMode, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; if ((Object)(object)selectedSlot == (Object)null || (Object)(object)selectedSlot.Card == (Object)null) { yield break; } PlayableCard target = selectedSlot.Card; int savedAttack = target.Attack; int savedHealth = target.Health; string cardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Puppeteer"); if (string.IsNullOrEmpty(cardName)) { cardName = "OLD_SA_PUPPET"; } CardInfo puppetInfo = CardLoader.GetCardByName(cardName); if ((Object)(object)puppetInfo == (Object)null) { yield break; } object obj = puppetInfo.Clone(); puppetInfo = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)puppetInfo == (Object)null) { yield break; } if (puppetInfo.Mods == null) { puppetInfo.Mods = new List<CardModificationInfo>(); } if (((Card)target).Info.Mods != null) { foreach (CardModificationInfo mod in ((Card)target).Info.Mods) { if (mod != null && !mod.nonCopyable) { object obj2 = mod.Clone(); CardModificationInfo clone = (CardModificationInfo)((obj2 is CardModificationInfo) ? obj2 : null); if (clone != null) { clone.attackAdjustment = 0; clone.healthAdjustment = 0; puppetInfo.Mods.Add(clone); } } } } yield return target.TransformIntoCard(puppetInfo, (Action)null, (Action)null); target.SwitchToPortrait(((Card)target).Info.portraitTex); ((Card)target).RenderCard(); int attackFix = savedAttack - target.Attack; int healthFix = savedHealth - target.Health; if (attackFix != 0 || healthFix != 0) { CardModificationInfo fix = new CardModificationInfo(); fix.attackAdjustment = attackFix; fix.healthAdjustment = healthFix; target.AddTemporaryMod(fix); } yield return (object)new WaitForSeconds(0.2f); PuppetHelper.Bind(((AbilityBehaviour)this).Card, target); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } public class MemorialBehaviour : ExtendedAbilityBehaviour { private const string EXTENDED_PROPERTY = "Puppeteer"; private const string DEFAULT_CARD = "OLD_SA_PUPPET"; private int sacrificeCount = 0; public override Ability Ability => SorrowPuppetAPI.MemorialAbility.Id; public void OnSacrificeExecuted() { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && ((AbilityBehaviour)this).Card.OnBoard && !((AbilityBehaviour)this).Card.Dead) { sacrificeCount++; if (sacrificeCount >= 2) { sacrificeCount = 0; ((MonoBehaviour)this).StartCoroutine(GeneratePuppet()); } } } private IEnumerator GeneratePuppet() { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || !((AbilityBehaviour)this).Card.OnBoard || ((AbilityBehaviour)this).Card.Dead) { yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); string cardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Puppeteer"); if (string.IsNullOrEmpty(cardName)) { cardName = "OLD_SA_PUPPET"; } CardInfo puppetInfo = CardLoader.GetCardByName(cardName); if ((Object)(object)puppetInfo == (Object)null) { yield break; } object obj = puppetInfo.Clone(); puppetInfo = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)puppetInfo == (Object)null) { yield break; } PlayableCard puppet = CardSpawner.SpawnPlayableCard(puppetInfo); if (!((Object)(object)puppet == (Object)null)) { PuppetHelper.Bind(((AbilityBehaviour)this).Card, puppet); PlayerHand hand = Singleton<PlayerHand>.Instance; if ((Object)(object)hand == (Object)null) { PuppetHelper.Unbind(((AbilityBehaviour)this).Card, puppet); yield break; } yield return hand.AddCardToHand(puppet, Vector3.zero, 0.25f); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } } [HarmonyPatch(typeof(PlayableCard), "Sacrifice")] public static class MemorialSacrificePatch { public static void Prefix(PlayableCard __instance) { if ((Object)(object)__instance == (Object)null) { return; } BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return; } foreach (CardSlot allSlot in instance.AllSlots) { if ((Object)(object)allSlot == (Object)null) { continue; } PlayableCard card = allSlot.Card; if (!((Object)(object)card == (Object)null) && card.OnBoard && !card.Dead) { MemorialBehaviour component = ((Component)card).GetComponent<MemorialBehaviour>(); if (!((Object)(object)component == (Object)null)) { component.OnSacrificeExecuted(); } } } } } public static class SorrowPuppetAPI { public static FullAbility MemorialAbility; public static FullAbility SorrowPuppetAbility; public static void Register() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Memorial"; val.rulebookName = "Memorial"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Memorial.png", (FilterMode)0); typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, "For every two sacrifices made, [creature] adds a Puppet to your hand."); MemorialAbility = AbilityManager.Add("OLD_SA", val, typeof(MemorialBehaviour), imageAsTexture); AbilityInfo val2 = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val2).name = "Puppet Sad"; val2.rulebookName = "Puppet Sad"; val2.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val2.powerLevel = 2; val2.opponentUsable = false; Texture imageAsTexture2 = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Puppet_Sad.png", (FilterMode)0); typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val2, "When an ally is about to die, [creature] dies in its place."); SorrowPuppetAbility = AbilityManager.Add("OLD_SA", val2, typeof(SorrowPuppetBehaviour), imageAsTexture2); } } public class SorrowPuppetBehaviour : ExtendedAbilityBehaviour { public static Ability ability; public override Ability Ability => SorrowPuppetAPI.SorrowPuppetAbility.Id; public IEnumerator TriggerPreSuccessfulSequence() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); } } [HarmonyPatch(typeof(PlayableCard), "Die")] public static class SorrowPuppetDiePatch { private static readonly HashSet<PlayableCard> ForcedDeaths = new HashSet<PlayableCard>(); public static bool Prefix(PlayableCard __instance, bool wasSacrifice, PlayableCard killer, bool playSound, ref IEnumerator __result) { if ((Object)(object)__instance == (Object)null) { return true; } if (ForcedDeaths.Contains(__instance)) { return true; } if (wasSacrifice) { return true; } if (__instance.Dead) { return true; } if (IsSorrowPuppet(__instance)) { return true; } PlayableCard val = FindSorrowPuppet(__instance); if ((Object)(object)val == (Object)null) { return true; } __result = ReplaceDeath(__instance, val, killer, playSound); return false; } private static PlayableCard FindSorrowPuppet(PlayableCard target) { if ((Object)(object)target == (Object)null) { return null; } BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return null; } foreach (CardSlot allSlot in instance.AllSlots) { if (!((Object)(object)allSlot == (Object)null)) { PlayableCard card = allSlot.Card; if (!((Object)(object)card == (Object)null) && card.OpponentCard == target.OpponentCard && card.OnBoard && !card.Dead && !((Object)(object)card == (Object)(object)target) && IsSorrowPuppet(card)) { return card; } } } return null; } private static bool IsSorrowPuppet(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } return (Object)(object)((Component)card).GetComponent<SorrowPuppetBehaviour>() != (Object)null; } private static IEnumerator ReplaceDeath(PlayableCard target, PlayableCard sorrowPuppet, PlayableCard killer, bool playSound) { if (!((Object)(object)target == (Object)null) && !((Object)(object)sorrowPuppet == (Object)null)) { SorrowPuppetBehaviour behaviour = ((Component)sorrowPuppet).GetComponent<SorrowPuppetBehaviour>(); if ((Object)(object)behaviour != (Object)null) { yield return behaviour.TriggerPreSuccessfulSequence(); } ForcedDeaths.Add(sorrowPuppet); try { yield return sorrowPuppet.Die(false, killer, playSound); } finally { ForcedDeaths.Remove(sorrowPuppet); } } } } } namespace OLD_SA.RagePuppet { public static class RagePuppetAPI { public static FullAbility ability; public static void Register() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "RagePuppeteer"; val.rulebookName = "RagePuppeteer"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Rage_Puppeteer.png", (FilterMode)0); typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, "When [creature] is played, it transforms an allied creature into a Puppet."); ability = AbilityManager.Add("OLD_SA", val, typeof(RagePuppetBehaviour), imageAsTexture); } } } namespace OLD_SA.CarnivalMaster { public class CarnivalMasterAttack : VariableStatBehaviour { public static SpecialStatIcon iconType; protected override SpecialStatIcon IconType => iconType; public static void Init() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>(); val.rulebookName = "Carnival Master"; val.rulebookDescription = "This creature's attack is determined by the number of puppets bound to it."; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("OldSa_Carnival_Master.png", (FilterMode)0); val.iconGraphic = (Texture)(object)imageAsTexture; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.appliesToAttack = true; val.appliesToHealth = false; FullStatIcon val2 = StatIconManager.Add("OLD_SA", val, typeof(CarnivalMasterAttack)); iconType = val2.Id; } protected override int[] GetStatValues() { if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null) { return new int[2] { 2, 0 }; } int num = 0; List<PlayableCard> puppets = PuppetHelper.GetPuppets(((SpecialCardBehaviour)this).PlayableCard); if (puppets != null) { foreach (PlayableCard item in puppets) { if (!((Object)(object)item == (Object)null) && !item.Dead && item.OnBoard) { num++; } } } int num2 = num * 2 + 2; return new int[2] { num2, 0 }; } } } namespace OLD_SA.PuppetFear { [HarmonyPatch(typeof(PlayableCard), "AttackIsBlocked")] public static class PuppetRejectionPatch { public static void Postfix(PlayableCard __instance, CardSlot opposingSlot, ref bool __result) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || (Object)(object)opposingSlot == (Object)null || !__instance.HasAbility(PuppetRejectionAPI.ability.Id)) { return; } PlayableCard card = opposingSlot.Card; if (!((Object)(object)card == (Object)null)) { PlayableCard owner = PuppetHelper.GetOwner(__instance); if (!((Object)(object)owner == (Object)null) && !((Object)(object)card != (Object)(object)owner)) { __result = true; } } } } public static class PuppetFearAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Puppet Fear"; val.rulebookName = "Puppet Fear"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 2; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Puppet_Fear.png", (FilterMode)0); typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(val, "When [creature] is on the board, adjacent allies lose 1 Power."); ability = AbilityManager.Add("OLD_SA", val, typeof(PuppetFearBehaviour), imageAsTexture); } } public static class DenialAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Denial"; val.rulebookName = "Denial"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Denial.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is played, place a Puppet opposite it."); } ability = AbilityManager.Add("OLD_SA", val, typeof(DenialBehaviour), imageAsTexture); } } public class DenialBehaviour : ExtendedAbilityBehaviour { private const string EXTENDED_PROPERTY = "Puppeteer"; private const string DEFAULT_CARD = "OLD_SA_PUPPET"; public override Ability Ability => DenialAPI.ability.Id; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.1f); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { yield break; } CardSlot targetSlot = ((AbilityBehaviour)this).Card.Slot.opposingSlot; if ((Object)(object)targetSlot == (Object)null) { yield break; } if ((Object)(object)targetSlot.Card != (Object)null) { ((Card)((AbilityBehaviour)this).Card).Anim.StrongNegationEffect(); yield break; } yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); string cardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Puppeteer"); if (string.IsNullOrEmpty(cardName)) { cardName = "OLD_SA_PUPPET"; } CardInfo puppetInfo = CardLoader.GetCardByName(cardName); if ((Object)(object)puppetInfo == (Object)null) { yield break; } object obj = puppetInfo.Clone(); puppetInfo = (CardInfo)((obj is CardInfo) ? obj : null); if (!((Object)(object)puppetInfo == (Object)null)) { PlayableCard puppet = CardSpawner.SpawnPlayableCard(puppetInfo); if (!((Object)(object)puppet == (Object)null)) { PuppetHelper.Bind(((AbilityBehaviour)this).Card, puppet); yield return Singleton<BoardManager>.Instance.ResolveCardOnBoard(puppet, targetSlot, 0.15f, (Action)null, true); yield return ((AbilityBehaviour)this).LearnAbility(0f); } } } } public class PuppetFearBehaviour : ExtendedAbilityBehaviour { public override Ability Ability => PuppetFearAPI.ability.Id; public override int GetPassiveAttackBuff(PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return 0; } if (!((AbilityBehaviour)this).Card.OnBoard || ((AbilityBehaviour)this).Card.Dead) { return 0; } if ((Object)(object)target == (Object)null) { return 0; } if ((Object)(object)target == (Object)(object)((AbilityBehaviour)this).Card) { return 0; } if (target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return 0; } if ((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null || (Object)(object)target.Slot == (Object)null) { return 0; } foreach (CardSlot adjacentSlot in Singleton<BoardManager>.Instance.GetAdjacentSlots(((AbilityBehaviour)this).Card.Slot)) { if ((Object)(object)adjacentSlot.Card == (Object)(object)target) { return -1; } } return 0; } } public static class PuppetRejectionAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Puppet Rejection"; val.rulebookName = "Puppet Rejection"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 2; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Puppet_Rejection.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] has this sigil, it does not attack its Puppeteer."); } ability = AbilityManager.Add("OLD_SA", val, typeof(PuppetRejectionBehaviour), imageAsTexture); } } public class PuppetRejectionBehaviour : ExtendedAbilityBehaviour { public override Ability Ability => PuppetRejectionAPI.ability.Id; } } namespace OLD_SA.Puppeteer { internal static class PuppeteerQueueFix { internal static readonly HashSet<PlayableCard> ReturnedCards = new HashSet<PlayableCard>(); internal static void MarkReturned(PlayableCard card) { if ((Object)(object)card != (Object)null) { ReturnedCards.Add(card); } } } [HarmonyPatch] internal static class OriginalPlayCardsInQueuePatch { [HarmonyReversePatch(/*Could not decode attribute arguments.*/)] [HarmonyPatch(typeof(Opponent), "PlayCardsInQueue")] internal static IEnumerator Original(Opponent instance, float tweenLength = 0.1f) { throw new NotImplementedException("Harmony reverse patch stub"); } } [HarmonyPatch(typeof(Opponent), "PlayCardsInQueue")] internal static class OpponentPlayCardsInQueuePatch { [HarmonyPrefix] private static bool Prefix(Opponent __instance, ref IEnumerator __result, float tweenLength = 0.1f) { __result = PlayAndRestore(__instance, tweenLength); return false; } private static IEnumerator PlayAndRestore(Opponent opponent, float tweenLength) { PuppeteerQueueFix.ReturnedCards.Clear(); yield return OriginalPlayCardsInQueuePatch.Original(opponent, tweenLength); foreach (PlayableCard card in PuppeteerQueueFix.ReturnedCards) { if ((Object)(object)card != (Object)null && !opponent.Queue.Contains(card)) { opponent.Queue.Add(card); } } PuppeteerQueueFix.ReturnedCards.Clear(); } } public static class PuppeteerAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Puppeteer"; val.rulebookName = "Puppeteer"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Puppeteer.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is played, place a Puppet on its left."); } ability = AbilityManager.Add("OLD_SA", val, typeof(PuppeteerBehaviour), imageAsTexture); } } public class PuppeteerBehaviour : ExtendedAbilityBehaviour { private const string EXTENDED_PROPERTY = "Puppeteer"; private const string DEFAULT_CARD = "OLD_SA_PUPPET"; private PlayableCard puppet; private bool puppetCreated; public override Ability Ability => PuppeteerAPI.ability.Id; public override bool RespondsToResolveOnBoard() { return !puppetCreated; } public override IEnumerator OnResolveOnBoard() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return CreatePuppet(); yield return ((AbilityBehaviour)this).LearnAbility(0f); } private IEnumerator CreatePuppet() { if (puppetCreated || (Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { yield break; } BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } CardSlot targetSlot = GetPuppetTargetSlot(); if ((Object)(object)targetSlot == (Object)null) { yield break; } if ((Object)(object)targetSlot.Card != (Object)null) { PlayableCard occupyingCard = targetSlot.Card; if (occupyingCard.OpponentCard) { yield return ReturnCardToOpponentQueue(occupyingCard); } else { yield return ReturnCardToPlayerHand(occupyingCard); } int waitFrames = 0; while ((Object)(object)targetSlot.Card == (Object)(object)occupyingCard && waitFrames < 10) { waitFrames++; yield return null; } } string spawnedCardName = CardExtensions.GetExtendedProperty(((Card)((AbilityBehaviour)this).Card).Info, "Puppeteer"); if (string.IsNullOrEmpty(spawnedCardName)) { spawnedCardName = "OLD_SA_PUPPET"; } CardInfo puppetInfo = CardLoader.GetCardByName(spawnedCardName); if ((Object)(object)puppetInfo == (Object)null) { yield break; } object obj = puppetInfo.Clone(); puppetInfo = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)puppetInfo == (Object)null) { yield break; } puppet = CardSpawner.SpawnPlayableCardWithCopiedMods(puppetInfo, ((AbilityBehaviour)this).Card, PuppeteerAPI.ability.Id); if (!((Object)(object)puppet == (Object)null)) { PuppetHelper.Bind(((AbilityBehaviour)this).Card, puppet); ((Component)puppet).transform.position = ((Component)targetSlot).transform.position + Vector3.back * 2f + Vector3.up * 2f; ((Component)puppet).transform.rotation = Quaternion.Euler(110f, 90f, 90f); yield return board.ResolveCardOnBoard(puppet, targetSlot, 0.1f, (Action)null, true); PuppetHelper.SyncCurrentResults(((AbilityBehaviour)this).Card, puppet); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.2f); if ((Object)(object)puppet != (Object)null && (Object)(object)((Card)puppet).Anim != (Object)null) { ((Card)puppet).Anim.StrongNegationEffect(); } puppetCreated = true; } } public void NotifyPuppetModification(CardModificationInfo modification, bool temporary) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || modification == null) { return; } List<PlayableCard> puppets = PuppetHelper.GetPuppets(((AbilityBehaviour)this).Card); foreach (PlayableCard item in puppets) { if (!((Object)(object)item == (Object)null)) { PuppetBehaviour component = ((Component)item).GetComponent<PuppetBehaviour>(); if (!((Object)(object)component == (Object)null)) { component.OnOwnerModified(((AbilityBehaviour)this).Card, modification, temporary); } } } } public void NotifyPuppetStatsChanged() { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null)) { PuppetHelper.SyncAllPuppets(((AbilityBehaviour)this).Card); } } private CardSlot GetPuppetTargetSlot() { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { return null; } BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return null; } CardSlot adjacent = instance.GetAdjacent(((AbilityBehaviour)this).Card.Slot, true); if ((Object)(object)adjacent != (Object)null) { return adjacent; } List<CardSlot> list = ((!((AbilityBehaviour)this).Card.OpponentCard) ? instance.PlayerSlotsCopy : instance.OpponentSlotsCopy); if (list == null || list.Count == 0) { return null; } return list[list.Count - 1]; } private IEnumerator ReturnCardToPlayerHand(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { PlayerHand hand = Singleton<PlayerHand>.Instance; if (!((Object)(object)hand == (Object)null)) { Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); yield return (object)new WaitForSeconds(0.1f); yield return hand.AddCardToHand(card, Vector3.zero, 0.25f); yield return (object)new WaitForSeconds(0.1f); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.25f); } } } private IEnumerator ReturnCardToOpponentQueue(PlayableCard card) { if ((Object)(object)card == (Object)null) { yield break; } TurnManager turnManager = Singleton<TurnManager>.Instance; if ((Object)(object)turnManager == (Object)null || (Object)(object)turnManager.Opponent == (Object)null) { yield break; } Opponent opponent = turnManager.Opponent; BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } CardSlot originalSlot = card.Slot; opponent.Queue.RemoveAll((PlayableCard queuedCard) => (Object)(object)queuedCard == (Object)(object)card); PlayableCard existingQueuedCard = opponent.Queue.Find((PlayableCard queuedCard) => (Object)(object)queuedCard != (Object)null && (Object)(object)queuedCard != (Object)(object)card && (Object)(object)queuedCard.QueuedSlot == (Object)(object)originalSlot); if ((Object)(object)existingQueuedCard != (Object)null) { ((Card)existingQueuedCard).ExitBoard(0.25f, new Vector3(-1f, -2f, 5f)); opponent.Queue.RemoveAll((PlayableCard queuedCard) => (Object)(object)queuedCard == (Object)(object)existingQueuedCard); } if ((Object)(object)originalSlot != (Object)null && (Object)(object)originalSlot.Card == (Object)(object)card) { originalSlot.Card = null; } PuppeteerQueueFix.MarkReturned(card); board.ReturnCardToQueue(card, 0.25f); opponent.Queue.RemoveAll((PlayableCard queuedCard) => (Object)(object)queuedCard == (Object)(object)card); opponent.Queue.Add(card); yield return (object)new WaitForSeconds(0.25f); } } [HarmonyPatch(typeof(PlayableCard), "AddTemporaryMod")] public static class PuppeteerAddTemporaryModPatch { [HarmonyPostfix] private static void Postfix(PlayableCard __instance, CardModificationInfo mod) { if (!((Object)(object)__instance == (Object)null) && mod != null) { PuppeteerBehaviour component = ((Component)__instance).GetComponent<PuppeteerBehaviour>(); if (!((Object)(object)component == (Object)null)) { component.NotifyPuppetModification(mod, temporary: true); } } } } } namespace OLD_SA.Puppet { public interface IRagePreTakeDamage { bool RespondsToRagePreTakeDamage(PlayableCard target, int damage, PlayableCard attacker); IEnumerator OnRagePreTakeDamage(PlayableCard target, int damage, PlayableCard attacker); } public static class PuppetRageAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Puppet Rage"; val.rulebookName = "Puppet Rage"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Puppet_Rage.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When an ally takes damage, [creature] gives an ally 1 Power."); } ability = AbilityManager.Add("OLD_SA", val, typeof(RageBehaviour), imageAsTexture); } } public class RageBehaviour : AbilityBehaviour, IModifyDamageTaken, IRagePreTakeDamage { private bool triggering; private GameObject targetIconPrefab; private GameObject currentIcon; public override Ability Ability => PuppetRageAPI.ability.Id; public bool RespondsToModifyDamageTaken(PlayableCard target, int damage, PlayableCard attacker, int originalDamage) { if (triggering) { return false; } if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (!((AbilityBehaviour)this).Card.OnBoard) { return false; } if (((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)target == (Object)null) { return false; } if (target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return false; } return true; } public int TriggerPriority(PlayableCard target, int damage, PlayableCard attacker) { return 0; } public int OnModifyDamageTaken(PlayableCard target, int damage, PlayableCard attacker, int originalDamage) { RageTakeDamagePatch.RegisterRage(target, this); return damage; } public bool RespondsToRagePreTakeDamage(PlayableCard target, int damage, PlayableCard attacker) { if (triggering) { return false; } if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (!((AbilityBehaviour)this).Card.OnBoard) { return false; } if (((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)target == (Object)null) { return false; } if (target.OpponentCard != ((AbilityBehaviour)this).Card.OpponentCard) { return false; } return true; } public IEnumerator OnRagePreTakeDamage(PlayableCard target, int damage, PlayableCard attacker) { triggering = true; yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return GiveRage(); yield return ((AbilityBehaviour)this).LearnAbility(0.5f); triggering = false; } private IEnumerator GiveRage() { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { yield break; } BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } List<CardSlot> allTargets = new List<CardSlot>(); List<CardSlot> validTargets = new List<CardSlot>(); List<CardSlot> slots = ((!((AbilityBehaviour)this).Card.OpponentCard) ? board.PlayerSlotsCopy : board.OpponentSlotsCopy); foreach (CardSlot slot in slots) { if (!((Object)(object)slot == (Object)null)) { allTargets.Add(slot); if ((Object)(object)slot.Card != (Object)null) { validTargets.Add(slot); } } } if (validTargets.Count != 0) { CardSlot selected = null; if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null && (Object)(object)Singleton<ViewManager>.Instance.Controller != (Object)null) { Singleton<ViewManager>.Instance.Controller.SwitchToControlMode(board.ChoosingSlotViewMode, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1; } yield return board.ChooseTarget(allTargets, validTargets, (Action<CardSlot>)delegate(CardSlot val) { selected = val; }, (Action<CardSlot>)delegate { }, (Action<CardSlot>)delegate(CardSlot slot2) { CreateTargetIcon(slot2); }, (Func<bool>)(() => false), (CursorType)16); ClearTargetIcon(); if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null && (Object)(object)Singleton<ViewManager>.Instance.Controller != (Object)null) { Singleton<ViewManager>.Instance.Controller.SwitchToControlMode(board.DefaultViewMode, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; } if (!((Object)(object)selected == (Object)null) && !((Object)(object)selected.Card == (Object)null)) { CardModificationInfo mod = new CardModificationInfo(); mod.attackAdjustment = 1; selected.Card.AddTemporaryMod(mod); ((Card)selected.Card).Anim.LightNegationEffect(); ((Card)selected.Card).RenderCard(); } } } private void CreateTargetIcon(CardSlot slot) { //IL_007d: 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) if (!((Object)(object)slot == (Object)null)) { if ((Object)(object)targetIconPrefab == (Object)null) { targetIconPrefab = ResourceBank.Get<GameObject>("Prefabs/Cards/SpecificCardModels/CannonTargetIcon"); } if (!((Object)(object)targetIconPrefab == (Object)null)) { ClearTargetIcon(); currentIcon = Object.Instantiate<GameObject>(targetIconPrefab, ((Component)slot).transform); currentIcon.transform.localPosition = new Vector3(0f, 0.25f, 0f); currentIcon.transform.localRotation = Quaternion.identity; } } } private void ClearTargetIcon() { if ((Object)(object)currentIcon != (Object)null) { Object.Destroy((Object)(object)currentIcon); currentIcon = null; } } } public static class PuppetAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Puppet Happy"; val.rulebookName = "Puppet Happy"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Puppet_Happy.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When the Puppeteer's stats change, [creature] changes as well."); } ability = AbilityManager.Add("OLD_SA", val, typeof(PuppetBehaviour), imageAsTexture); } } public class PuppetBehaviour : ExtendedAbilityBehaviour { public override Ability Ability => PuppetAPI.ability.Id; public void OnOwnerModified(PlayableCard owner, CardModificationInfo modification, bool temporary) { if (!((Object)(object)owner == (Object)null) && !((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && modification != null) { PuppetHelper.SyncModification(owner, modification, temporary); } } public void OnOwnerStatsChanged(PlayableCard owner) { if (!((Object)(object)owner == (Object)null) && !((Object)(object)((AbilityBehaviour)this).Card == (Object)null)) { PuppetHelper.SyncCurrentResults(owner, ((AbilityBehaviour)this).Card); } } } [HarmonyPatch(typeof(PlayableCard), "OnStatsChanged")] public static class PuppeteerStatsChangedPatch { [HarmonyPostfix] private static void Postfix(PlayableCard __instance) { if (!((Object)(object)__instance == (Object)null)) { PuppeteerBehaviour component = ((Component)__instance).GetComponent<PuppeteerBehaviour>(); if (!((Object)(object)component == (Object)null)) { component.NotifyPuppetStatsChanged(); } } } } public static class PuppetHelper { private class PuppetBinding { public PlayableCard Owner; public PlayableCard Puppet; } private static readonly List<PuppetBinding> bindings = new List<PuppetBinding>(); public static void Bind(PlayableCard owner, PlayableCard puppet) { if (!((Object)(object)owner == (Object)null) && !((Object)(object)puppet == (Object)null) && !IsBound(owner, puppet)) { bindings.Add(new PuppetBinding { Owner = owner, Puppet = puppet }); } } public static bool IsBound(PlayableCard owner, PlayableCard puppet) { if ((Object)(object)owner == (Object)null || (Object)(object)puppet == (Object)null) { return false; } return bindings.Any((PuppetBinding x) => (Object)(object)x.Owner == (Object)(object)owner && (Object)(object)x.Puppet == (Object)(object)puppet); } public static List<PlayableCard> GetPuppets(PlayableCard owner) { if ((Object)(object)owner == (Object)null) { return new List<PlayableCard>(); } return (from x in bindings where (Object)(object)x.Owner == (Object)(object)owner select x.Puppet into x where (Object)(object)x != (Object)null select x).ToList(); } public static PlayableCard GetOwner(PlayableCard puppet) { if ((Object)(object)puppet == (Object)null) { return null; } return bindings.FirstOrDefault((PuppetBinding x) => (Object)(object)x.Puppet == (Object)(object)puppet)?.Owner; } public static void Unbind(PlayableCard owner, PlayableCard puppet) { if (!((Object)(object)owner == (Object)null) && !((Object)(object)puppet == (Object)null)) { bindings.RemoveAll((PuppetBinding x) => (Object)(object)x.Owner == (Object)(object)owner && (Object)(object)x.Puppet == (Object)(object)puppet); } } public static void UnbindAll(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { bindings.RemoveAll((PuppetBinding x) => (Object)(object)x.Owner == (Object)(object)card || (Object)(object)x.Puppet == (Object)(object)card); } } public static void CopyAllModifications(PlayableCard owner, PlayableCard puppet) { if ((Object)(object)owner == (Object)null || (Object)(object)puppet == (Object)null) { return; } if ((Object)(object)((Card)owner).Info != (Object)null && ((Card)owner).Info.Mods != null) { if (((Card)puppet).Info.Mods == null) { ((Card)puppet).Info.Mods = new List<CardModificationInfo>(); } foreach (CardModificationInfo mod in ((Card)owner).Info.Mods) { CopyModificationToCard(mod, puppet); } } if (owner.TemporaryMods != null) { foreach (CardModificationInfo temporaryMod in owner.TemporaryMods) { CopyTemporaryModificationToCard(temporaryMod, puppet); } } puppet.OnStatsChanged(); } public static CardModificationInfo CopyModificationToCard(CardModificationInfo sourceMod, PlayableCard target) { if (sourceMod == null || (Object)(object)target == (Object)null) { return null; } if (sourceMod.nonCopyable) { return null; } object obj = sourceMod.Clone(); CardModificationInfo val = (CardModificationInfo)((obj is CardModificationInfo) ? obj : null); if (val == null) { return null; } if (((Card)target).Info.Mods == null) { ((Card)target).Info.Mods = new List<CardModificationInfo>(); } ((Card)target).Info.Mods.Add(val); target.OnStatsChanged(); return val; } public static CardModificationInfo CopyTemporaryModificationToCard(CardModificationInfo sourceMod, PlayableCard target) { if (sourceMod == null || (Object)(object)target == (Object)null) { return null; } if (sourceMod.nonCopyable) { return null; } object obj = sourceMod.Clone(); CardModificationInfo val = (CardModificationInfo)((obj is CardModificationInfo) ? obj : null); if (val == null) { return null; } target.AddTemporaryMod(val); return val; } public static void SyncModification(PlayableCard owner, CardModificationInfo modification, bool temporary = true) { if ((Object)(object)owner == (Object)null || modification == null) { return; } List<PlayableCard> puppets = GetPuppets(owner); foreach (PlayableCard item in puppets) { if (!((Object)(object)item == (Object)null)) { if (temporary) { CopyTemporaryModificationToCard(modification, item); } else { CopyModificationToCard(modification, item); } } } } public static void SyncCurrentResults(PlayableCard owner, PlayableCard puppet) { if (!((Object)(object)owner == (Object)null) && !((Object)(object)puppet == (Object)null) && IsBound(owner, puppet)) { puppet.OnStatsChanged(); } } public static void SyncAllPuppets(PlayableCard owner) { if ((Object)(object)owner == (Object)null) { return; } List<PlayableCard> puppets = GetPuppets(owner); foreach (PlayableCard item in puppets) { if (!((Object)(object)item == (Object)null)) { SyncCurrentResults(owner, item); } } } public static void SyncAll(PlayableCard owner, PlayableCard puppet) { if (!((Object)(object)owner == (Object)null) && !((Object)(object)puppet == (Object)null) && IsBound(owner, puppet)) { SyncCurrentResults(owner, puppet); } } } [HarmonyPatch] [HarmonyPriority(0)] public static class PuppetPassiveAttackPatch { private static readonly MethodInfo GetPassiveAttackBuffsMethod = AccessTools.Method(typeof(PlayableCard), "GetPassiveAttackBuffs", (Type[])null, (Type[])null); private static readonly HashSet<PlayableCard> evaluating = new HashSet<PlayableCard>(); private static MethodBase TargetMethod() { return GetPassiveAttackBuffsMethod; } [HarmonyPostfix] private static void Postfix(PlayableCard __instance, ref int __result) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || evaluating.Contains(__instance) || !__instance.HasAbility(PuppetAPI.ability.Id)) { return; } PlayableCard owner = PuppetHelper.GetOwner(__instance); if ((Object)(object)owner == (Object)null || (Object)(object)owner == (Object)(object)__instance) { return; } evaluating.Add(__instance); try { int num = __result; int ownerPassiveAttack = GetOwnerPassiveAttack(owner); __result = num + ownerPassiveAttack; } finally { evaluating.Remove(__instance); } } private static int GetOwnerPassiveAttack(PlayableCard owner) { if ((Object)(object)owner == (Object)null) { return 0; } if (evaluating.Contains(owner)) { return 0; } evaluating.Add(owner); try { if (!(GetPassiveAttackBuffsMethod.Invoke(owner, null) is int result)) { return 0; } return result; } finally { evaluating.Remove(owner); } } } [HarmonyPatch] [HarmonyPriority(0)] public static class PuppetPassiveHealthPatch { private static readonly MethodInfo GetPassiveHealthBuffsMethod = AccessTools.Method(typeof(PlayableCard), "GetPassiveHealthBuffs", (Type[])null, (Type[])null); private static readonly HashSet<PlayableCard> evaluating = new HashSet<PlayableCard>(); private static MethodBase TargetMethod() { return GetPassiveHealthBuffsMethod; } [HarmonyPostfix] private static void Postfix(PlayableCard __instance, ref int __result) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || evaluating.Contains(__instance) || !__instance.HasAbility(PuppetAPI.ability.Id)) { return; } PlayableCard owner = PuppetHelper.GetOwner(__instance); if ((Object)(object)owner == (Object)null || (Object)(object)owner == (Object)(object)__instance) { return; } evaluating.Add(__instance); try { int num = __result; int ownerPassiveHealth = GetOwnerPassiveHealth(owner); __result = num + ownerPassiveHealth; } finally { evaluating.Remove(__instance); } } private static int GetOwnerPassiveHealth(PlayableCard owner) { if ((Object)(object)owner == (Object)null) { return 0; } if (evaluating.Contains(owner)) { return 0; } evaluating.Add(owner); try { if (!(GetPassiveHealthBuffsMethod.Invoke(owner, null) is int result)) { return 0; } return result; } finally { evaluating.Remove(owner); } } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public static class RageTakeDamagePatch { private static readonly Dictionary<PlayableCard, List<IRagePreTakeDamage>> PendingRage = new Dictionary<PlayableCard, List<IRagePreTakeDamage>>(); public static void RegisterRage(PlayableCard target, IRagePreTakeDamage rage) { if (!((Object)(object)target == (Object)null) && rage != null) { if (!PendingRage.TryGetValue(target, out var value)) { value = new List<IRagePreTakeDamage>(); PendingRage.Add(target, value); } if (!value.Contains(rage)) { value.Add(rage); } } } [HarmonyPostfix] [HarmonyPriority(800)] private static void Postfix(PlayableCard __instance, int damage, PlayableCard attacker, ref IEnumerator __result) { List<IRagePreTakeDamage> value = null; if ((Object)(object)__instance != (Object)null) { PendingRage.TryGetValue(__instance, out value); } if (value != null && value.Count != 0) { List<IRagePreTakeDamage> triggers = new List<IRagePreTakeDamage>(value); PendingRage.Remove(__instance); IEnumerator original = __result; __result = RunRageThenDamage(__instance, damage, attacker, triggers, original); } } private static IEnumerator RunRageThenDamage(PlayableCard target, int damage, PlayableCard attacker, List<IRagePreTakeDamage> triggers, IEnumerator original) { for (int i = 0; i < triggers.Count; i++) { IRagePreTakeDamage rage = triggers[i]; if (rage != null && rage.RespondsToRagePreTakeDamage(target, damage, attacker)) { yield return rage.OnRagePreTakeDamage(target, damage, attacker); } } if (original != null) { yield return original; } } } }
Sigil/OldSa_Raid_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Raid_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Raid_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("d27fa05b-0653-4e7d-8248-fc1c010797ee")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Raid; [BepInPlugin("OLD_SA.Raid", "OLD SA Raid", "1.0.0")] public class RaidPlugin : BaseUnityPlugin { private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Raid] Plugin loaded."); Harmony val = new Harmony("OLD_SA.Raid"); val.PatchAll(); RaidAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Raid] Ability initialized."); } } public static class RaidAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Raid"; val.rulebookName = "Raid"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Raid.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] is played, it gains 2 Speed. Then, at the end of each turn, it gains 2 Speed."); } ability = AbilityManager.Add("OLD_SA", val, typeof(RaidBehaviour), imageAsTexture); } } public class RaidBehaviour : AbilityBehaviour { public override Ability Ability => RaidAPI.ability.Id; public override bool RespondsToResolveOnBoard() { return true; } public override IEnumerator OnResolveOnBoard() { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); SmallSigilManager.AddStacks(((AbilityBehaviour)this).Card, (SmallSigilType)5, 2); yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } public override bool RespondsToTurnEnd(bool playerTurnEnd) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || !((AbilityBehaviour)this).Card.OnBoard) { return false; } bool flag = !((AbilityBehaviour)this).Card.OpponentCard; return playerTurnEnd == flag; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard) { SmallSigilManager.AddStacks(((AbilityBehaviour)this).Card, (SmallSigilType)5, 2); } yield break; } }
Sigil/OldSa_Random_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Random_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Random_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("cf3705a4-140c-4f68-8f0c-b63c824f267b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Random; [BepInPlugin("OLD_SA.Random", "OLD SA Random", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RandomAPI.Init(); Harmony val = new Harmony("OLD_SA.Random"); val.PatchAll(); } } public static class RandomAPI { public static FullAbility ability; public static Ability RandomAbility; public static void Init() { //IL_009f: 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) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Random"; val.rulebookName = "Random"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = -1; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Random.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, its target is random."); } ability = AbilityManager.Add("OLD_SA", val, typeof(RandomBehaviour), imageAsTexture); RandomAbility = val.ability; } } public class RandomBehaviour : AbilityBehaviour { public override Ability Ability => RandomAPI.ability.Id; } [HarmonyPatch(typeof(PlayableCard), "GetOpposingSlots")] public static class RandomPatch { private static int randomCounter; [HarmonyPostfix] public static void Postfix(PlayableCard __instance, ref List<CardSlot> __result) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.Slot == (Object)null || __result == null || RandomAPI.ability == null || !__instance.HasAbility(RandomAPI.ability.Id)) { return; } List<CardSlot> list = (__instance.OpponentCard ? Singleton<BoardManager>.Instance.PlayerSlotsCopy : Singleton<BoardManager>.Instance.OpponentSlotsCopy); if (list == null || list.Count == 0) { return; } int count = __result.Count; if (count > 0) { List<CardSlot> list2 = new List<CardSlot>(); for (int i = 0; i < count; i++) { int randomSeed = GetRandomSeed(__instance, i); float num = SeededRandom.Value(randomSeed); int num2 = Mathf.FloorToInt(num * (float)list.Count); num2 = Mathf.Clamp(num2, 0, list.Count - 1); list2.Add(list[num2]); } __result = list2; } } private static int GetRandomSeed(PlayableCard card, int attackIndex) { int currentRandomSeed = SaveManager.SaveFile.GetCurrentRandomSeed(); int num = (((Object)(object)card != (Object)null && (Object)(object)card.Slot != (Object)null) ? card.Slot.Index : 0); int num2 = randomCounter++; int num3 = currentRandomSeed; num3 = num3 * 31 + num; num3 = num3 * 31 + attackIndex; return num3 * 31 + num2; } }
Sigil/OldSa_Redirect_Strikesigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Redirect_Strikesigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Redirect_Strikesigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c07ac79b-0b9b-4a09-8814-20139d4eaeb5")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.RedirectStrike; [BepInPlugin("OLD_SA.RedirectStrike", "OLD SA Redirect Strike", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.RedirectStrike"; public const string NAME = "OLD SA Redirect Strike"; public const string VERSION = "1.0.0"; private void Awake() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"Redirect Strike Plugin loaded"); RedirectStrikeAPI.Init(); Harmony val = new Harmony("OLD_SA.RedirectStrike"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Redirect Strike initialized"); } } public static class RedirectStrikeAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Redirect Strike"; val.rulebookName = "Redirect Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Redirect_Strike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "[creature] excess damage is dealt directly to the player."); } ability = AbilityManager.Add("OLD_SA", val, typeof(RedirectStrikeBehaviour), imageAsTexture); } } public class RedirectStrikeBehaviour : AbilityBehaviour { public override Ability Ability => RedirectStrikeAPI.ability.Id; } [HarmonyPatch(typeof(CombatPhaseManager), "DealOverkillDamage")] public static class RedirectStrikePatch { public static bool Prefix(int damage, CardSlot attackingSlot, CardSlot opposingSlot, ref IEnumerator __result) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (damage <= 0) { return true; } if ((Object)(object)attackingSlot == (Object)null || (Object)(object)attackingSlot.Card == (Object)null) { return true; } PlayableCard card = attackingSlot.Card; if (!card.HasAbility(RedirectStrikeAPI.ability.Id)) { return true; } __result = RedirectOverkillDamage(damage, attackingSlot); return false; } private static IEnumerator RedirectOverkillDamage(int damage, CardSlot attackingSlot) { if (!((Object)(object)Singleton<LifeManager>.Instance == (Object)null)) { bool opponentTakesDamage = !attackingSlot.IsPlayerSlot; yield return Singleton<LifeManager>.Instance.ShowDamageSequence(damage, damage, opponentTakesDamage, 0f, (GameObject)null, 0f, true); } } }
Sigil/OldSa_Retribution_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Dialogue; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Retribution_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Retribution_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("40ac4f68-7b1a-43e3-8dc6-e8c2d15bec1b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Retribution; [BepInPlugin("OLD_SA.Retribution", "OLD SA Retribution", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RetributionAPI.Init(); Harmony val = new Harmony("OLD_SA.Retribution"); val.PatchAll(); Debug.Log((object)"OLD SA Retribution Loaded"); } } public static class RetributionAPI { public static FullAbility ability; public unsafe static void Init() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Retribution"; val.rulebookName = "Retribution"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Retribution.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Retribution_px.png", (FilterMode)0); val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When an enemy creature attacks the player, [creature] causes it to lose Power."); } ability = AbilityManager.Add("OLD_SA", val, typeof(RetributionBehaviour), imageAsTexture); Ability id = ability.Id; Debug.Log((object)("Retribution registered ID=" + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } public class RetributionBehaviour : AbilityBehaviour { public override Ability Ability => RetributionAPI.ability.Id; public IEnumerator Trigger(PlayableCard attacker) { if (!((Object)(object)attacker == (Object)null)) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)((AbilityBehaviour)this).Card != (Object)null && (Object)(object)((AbilityBehaviour)this).Card.Slot != (Object)null && (Object)(object)attacker.Slot != (Object)null) { ((Card)((AbilityBehaviour)this).Card).Anim.PlayAttackAnimation(((AbilityBehaviour)this).Card.IsFlyingAttackingReach(), attacker.Slot, (Action)null); yield return (object)new WaitForSeconds(0f); ((Card)attacker).Anim.PlayHitAnimation(); yield return (object)new WaitForSeconds(0.2f); } CardModificationInfo debuff = new CardModificationInfo(); debuff.attackAdjustment = -1; attacker.AddTemporaryMod(debuff); ((Card)attacker).RenderCard(); yield return SigilDialogueAPI.ShowFirstTime("Retribution", "It makes all who commit violence pay the price."); } } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class RetributionPatch { public static IEnumerator Postfix(IEnumerator result, CardSlot attackingSlot, CardSlot opposingSlot) { int oldDamage = Singleton<CombatPhaseManager>.Instance.DamageDealtThisPhase; while (result.MoveNext()) { yield return result.Current; } if ((Object)(object)attackingSlot == (Object)null || (Object)(object)opposingSlot == (Object)null || (Object)(object)attackingSlot.Card == (Object)null) { yield break; } PlayableCard attacker = attackingSlot.Card; int newDamage = Singleton<CombatPhaseManager>.Instance.DamageDealtThisPhase; if (newDamage <= oldDamage) { yield break; } List<CardSlot> targetSlots = ((!opposingSlot.IsPlayerSlot) ? Singleton<BoardManager>.Instance.OpponentSlotsCopy : Singleton<BoardManager>.Instance.PlayerSlotsCopy); foreach (CardSlot slot in targetSlots) { if (!((Object)(object)slot == (Object)null) && !((Object)(object)slot.Card == (Object)null) && slot.Card.HasAbility(RetributionAPI.ability.Id)) { RetributionBehaviour behaviour = ((Component)slot.Card).GetComponent<RetributionBehaviour>(); if (!((Object)(object)behaviour == (Object)null)) { yield return (object)new WaitForSeconds(0.2f); yield return behaviour.Trigger(attacker); } } } } }
Sigil/OldSa_Ring Fort_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Dialogue; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Ring Fort_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Ring Fort_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("c7d3d1e4-a719-44a4-9bbf-73e52029f5e9")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.RingFort; [BepInPlugin("oldsa.ringfort", "Old SA Ring Fort", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RingFortAPI.Init(); Harmony val = new Harmony("oldsa.ringfort"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Old SA Ring Fort Loaded"); } } public class RingFortBehaviour : AbilityBehaviour { public override Ability Ability => RingFortAPI.ability.Id; public IEnumerator TriggerFirstDialogue() { yield return SigilDialogueAPI.ShowFirstTime("RingFort", "A pitiful creature... yet this time, it managed to protect everything.", ((AbilityBehaviour)this).Card); } } public class RingFortAPI { public static FullAbility ability; public unsafe static void Init() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "RingFort"; val.rulebookName = "Ring Fort"; val.powerLevel = 5; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] takes damage, it intercepts the attack and reduces that damage by 1."); } Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("OldSa_Ring_Fort.png", (FilterMode)0); ability = AbilityManager.Add("OLD_SA", val, typeof(RingFortBehaviour), (Texture)(object)imageAsTexture); Ability id = ability.Id; Debug.Log((object)("Ring Fort registered ID = " + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public class RingFortPatch { public static PlayableCard redirectedCard; public static void Prefix(CardSlot attackingSlot, ref CardSlot opposingSlot, float waitAfter) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) redirectedCard = null; if ((Object)(object)attackingSlot == (Object)null || (Object)(object)opposingSlot == (Object)null || (Object)(object)attackingSlot.Card == (Object)null) { return; } List<CardSlot> list = ((!attackingSlot.IsPlayerSlot) ? Singleton<BoardManager>.Instance.PlayerSlotsCopy : Singleton<BoardManager>.Instance.OpponentSlotsCopy); foreach (CardSlot item in list) { if ((Object)(object)item.Card == (Object)null || !item.Card.HasAbility(RingFortAPI.ability.Id)) { continue; } redirectedCard = item.Card; opposingSlot = item; break; } } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public class RingFortDamagePatch { public static void Prefix(PlayableCard __instance, ref int damage) { if ((Object)(object)__instance == (Object)null || !((Object)(object)__instance == (Object)(object)RingFortPatch.redirectedCard)) { return; } int num = damage; damage = Mathf.Max(0, damage - 1); if (num > damage && !SigilDialogueSaveData.HasTriggered("RingFort")) { RingFortBehaviour component = ((Component)__instance).GetComponent<RingFortBehaviour>(); if ((Object)(object)component != (Object)null) { ((MonoBehaviour)__instance).StartCoroutine(component.TriggerFirstDialogue()); } } } } [HarmonyPatch(typeof(PlayableCard), "CanAttackDirectly")] public class RingFortDirectAttackPatch { public static bool Prefix(PlayableCard __instance, CardSlot opposingSlot, ref bool __result) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)opposingSlot == (Object)null) { return true; } if ((Object)(object)opposingSlot.Card != (Object)null && opposingSlot.Card.HasAbility(RingFortAPI.ability.Id)) { Debug.Log((object)"Ring Fort blocks direct attack"); __result = false; return false; } return true; } }
Sigil/OldSa_Royalty_station.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OLD_SA.Royalty")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OLD_SA.Royalty")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7879e24e-cb30-4fed-833d-51d78ca3f60b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Royalty; [BepInPlugin("OLD_SA.Royalty", "OLD_SA Royalty", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Royalty.Init(); Harmony val = new Harmony("OLD_SA.Royalty"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD_SA Royalty Loaded"); } } public class Royalty : VariableStatBehaviour { public static SpecialStatIcon iconType; protected override SpecialStatIcon IconType => iconType; public static void Init() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) StatIconInfo val = ScriptableObject.CreateInstance<StatIconInfo>(); val.rulebookName = "Royalty"; val.rulebookDescription = "This creature's attack is determined by the number of different tribes present on the board."; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("royalty.png", (FilterMode)0); val.iconGraphic = (Texture)(object)imageAsTexture; Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("royalty_px.png", (FilterMode)0); AbilityExtensions.SetPixelIcon(val, imageAsTexture2, (FilterMode?)null); val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.appliesToAttack = true; val.appliesToHealth = false; FullStatIcon val2 = StatIconManager.Add("OLD_SA", val, typeof(Royalty)); iconType = val2.Id; } protected override int[] GetStatValues() { HashSet<string> hashSet = new HashSet<string>(); foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(true)) { AddTribe(slot, hashSet); } foreach (CardSlot slot2 in Singleton<BoardManager>.Instance.GetSlots(false)) { AddTribe(slot2, hashSet); } int count = hashSet.Count; int num = count; int? extendedPropertyAsInt = CardExtensions.GetExtendedPropertyAsInt(((Card)((SpecialCardBehaviour)this).PlayableCard).Info, "OLD_SA.RoyaltyBonus"); if (extendedPropertyAsInt.HasValue) { num = extendedPropertyAsInt.Value; } return new int[2] { count + num, 0 }; } private void AddTribe(CardSlot slot, HashSet<string> tribes) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slot.Card == (Object)null) { return; } if (((Card)slot.Card).Info.tribes == null || ((Card)slot.Card).Info.tribes.Count == 0) { tribes.Add("NONE"); return; } foreach (Tribe tribe in ((Card)slot.Card).Info.tribes) { tribes.Add(((object)tribe/*cast due to .constrained prefix*/).ToString()); } } }
Sigil/OldSa_Shell_Defense_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using InscryptionAPI.Triggers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Shell_Defense_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Shell_Defense_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("cfb5c90a-c242-4c1c-99c4-5d48da1a63fc")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.ShellDefense; [BepInPlugin("OLD_SA.ShellDefense.New", "OLD SA Shell Defense", "2.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { ShellDefenseAPI.Init(); Debug.Log((object)"[OLD SA] Shell Defense loaded."); } } public static class ShellDefenseAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Shell Defense"; val.rulebookName = "Shell Defense"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 3; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Shell_Defense.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] would take 1 damage, prevent it and deal 1 damage to the attacker."); } ability = AbilityManager.Add("OLD_SA", val, typeof(ShellDefenseBehaviour), imageAsTexture); } } public class ShellDefenseBehaviour : ExtendedAbilityBehaviour, IModifyDamageTaken { private bool shellDefenseReflectedDamage; public override Ability Ability => ShellDefenseAPI.ability.Id; private bool IsValid() { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && ((AbilityBehaviour)this).Card.OnBoard && !((AbilityBehaviour)this).Card.Dead; } public void MarkShellDefenseDamage() { shellDefenseReflectedDamage = true; } private bool IsShellDefenseDamage() { return shellDefenseReflectedDamage; } public bool RespondsToModifyDamageTaken(PlayableCard card, int damage, PlayableCard attacker, int amount) { if (!IsValid()) { return false; } if ((Object)(object)card != (Object)(object)((AbilityBehaviour)this).Card) { return false; } if ((Object)(object)attacker == (Object)null || attacker.Dead) { return false; } if (damage != 1) { return false; } return true; } public int OnModifyDamageTaken(PlayableCard card, int damage, PlayableCard attacker, int amount) { if (!IsValid()) { return damage; } if ((Object)(object)card != (Object)(object)((AbilityBehaviour)this).Card) { return damage; } if (damage != 1) { return damage; } if (IsShellDefenseDamage()) { shellDefenseReflectedDamage = false; return 0; } if ((Object)(object)attacker != (Object)null && !attacker.Dead) { ShellDefenseBehaviour component = ((Component)attacker).GetComponent<ShellDefenseBehaviour>(); if ((Object)(object)component != (Object)null) { component.MarkShellDefenseDamage(); } ((MonoBehaviour)((AbilityBehaviour)this).Card).StartCoroutine(DealShellDefenseDamage(attacker)); } return 0; } private IEnumerator DealShellDefenseDamage(PlayableCard attacker) { if (!((Object)(object)attacker == (Object)null) && !attacker.Dead) { yield return attacker.TakeDamage(1, ((AbilityBehaviour)this).Card); } } public int TriggerPriority(PlayableCard card, int damage, PlayableCard attacker) { return 0; } }
Sigil/OldSa_Sigil_Helper.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using OLD_SA.ArmorStrike; using OLD_SA.CardHelper; using OLD_SA.Patches; using OLD_SA.WolfJackal; using Pixelplacement; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Sigil_Helper")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Sigil_Helper")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("af78b1f3-6044-43f3-95f2-a5438b7b6177")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA { [BepInPlugin("old.sa.plugin", "OLD SA", "1.0.0")] public class OLD_SA_Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("old.sa.plugin"); val.PatchAll(); SniperRulebook.Init(); SentryRulebook.Init(); EnemyDrawSigils.Init(); SquirrelStrafeRulebook.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Loaded"); } } } namespace OLD_SA.CardHelper { public static class EnemyDrawSigils { public static void Init() { EnableEnemy((Ability)9); EnableEnemy((Ability)14); EnableEnemy((Ability)17); EnableEnemy((Ability)2); } private static void EnableEnemy(Ability ability) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) FullAbility val = null; foreach (FullAbility baseGameAbility in AbilityManager.BaseGameAbilities) { if (baseGameAbility == null || (Object)(object)baseGameAbility.Info == (Object)null || baseGameAbility.Info.ability != ability) { continue; } val = baseGameAbility; break; } if (val != null) { AbilityInfo info = val.Info; if (info.metaCategories == null) { info.metaCategories = new List<AbilityMetaCategory>(); } if (!info.metaCategories.Contains((AbilityMetaCategory)1)) { info.metaCategories.Add((AbilityMetaCategory)1); } info.opponentUsable = true; info.canStack = false; } } } public static class SentryRulebook { public static void Init() { FullAbility val = null; foreach (FullAbility baseGameAbility in AbilityManager.BaseGameAbilities) { if (baseGameAbility == null || (Object)(object)baseGameAbility.Info == (Object)null || !(((Object)baseGameAbility.Info).name == "Sentry")) { continue; } val = baseGameAbility; break; } if (val != null) { AbilityInfo info = val.Info; if (info.metaCategories == null) { info.metaCategories = new List<AbilityMetaCategory>(); } if (!info.metaCategories.Contains((AbilityMetaCategory)0)) { info.metaCategories.Add((AbilityMetaCategory)0); } if (!info.metaCategories.Contains((AbilityMetaCategory)1)) { info.metaCategories.Add((AbilityMetaCategory)1); } info.opponentUsable = true; info.canStack = false; } } } public static class SniperRulebook { public static void Init() { FullAbility val = null; foreach (FullAbility baseGameAbility in AbilityManager.BaseGameAbilities) { if (baseGameAbility == null || (Object)(object)baseGameAbility.Info == (Object)null || !(((Object)baseGameAbility.Info).name == "Sniper")) { continue; } val = baseGameAbility; break; } if (val != null) { AbilityInfo info = val.Info; if (info.metaCategories == null) { info.metaCategories = new List<AbilityMetaCategory>(); } if (!info.metaCategories.Contains((AbilityMetaCategory)0)) { info.metaCategories.Add((AbilityMetaCategory)0); } if (!info.metaCategories.Contains((AbilityMetaCategory)1)) { info.metaCategories.Add((AbilityMetaCategory)1); } info.opponentUsable = true; info.canStack = false; } } } public static class SquirrelStrafeRulebook { public static void Init() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 FullAbility val = null; foreach (FullAbility baseGameAbility in AbilityManager.BaseGameAbilities) { if (baseGameAbility == null || (Object)(object)baseGameAbility.Info == (Object)null || (int)baseGameAbility.Info.ability != 46) { continue; } val = baseGameAbility; break; } if (val != null) { AbilityInfo info = val.Info; if (info.metaCategories == null) { info.metaCategories = new List<AbilityMetaCategory>(); } if (!info.metaCategories.Contains((AbilityMetaCategory)0)) { info.metaCategories.Add((AbilityMetaCategory)0); } if (!info.metaCategories.Contains((AbilityMetaCategory)1)) { info.metaCategories.Add((AbilityMetaCategory)1); } info.opponentUsable = false; info.canStack = false; } } } } namespace OLD_SA.Patches { [HarmonyPatch] public static class EnemyDrawCreatedCardPatch { public static HashSet<PlayableCard> PendingOverkillProtection = new HashSet<PlayableCard>(); public static HashSet<string> PendingCreateCards = new HashSet<string>(); public static HashSet<PlayableCard> MergingCards = new HashSet<PlayableCard>(); [HarmonyPatch(typeof(DrawCreatedCard), "CreateDrawnCard")] [HarmonyPrefix] public static bool Prefix(DrawCreatedCard __instance) { PlayableCard ownerCard = GetOwnerCard(__instance); if ((Object)(object)ownerCard == (Object)null) { return true; } if (!ownerCard.OpponentCard) { return true; } CardInfo cardToDraw = GetCardToDraw(__instance); if ((Object)(object)cardToDraw == (Object)null) { return true; } PendingCreateCards.Add(((Object)cardToDraw).name); ((MonoBehaviour)Singleton<TurnManager>.Instance).StartCoroutine(SpawnEnemyCard(cardToDraw, __instance is DrawCopyOnDeath || __instance is BeesOnHit)); return false; } private static PlayableCard GetOwnerCard(DrawCreatedCard drawer) { if ((Object)(object)drawer == (Object)null) { return null; } PropertyInfo propertyInfo = AccessTools.Property(typeof(AbilityBehaviour), "Card"); if (propertyInfo != null) { object? value = propertyInfo.GetValue(drawer); return (PlayableCard)((value is PlayableCard) ? value : null); } return null; } private static CardInfo GetCardToDraw(DrawCreatedCard drawer) { PlayableCard ownerCard = GetOwnerCard(drawer); if ((Object)(object)ownerCard == (Object)null) { return null; } if (drawer is DrawCopy) { object obj = ((Card)ownerCard).Info.Clone(); CardInfo val = (CardInfo)((obj is CardInfo) ? obj : null); RemoveDrawCopyAbility(val); return val; } if (drawer is DrawCopyOnDeath) { object obj2 = ((Card)ownerCard).Info.Clone(); return (CardInfo)((obj2 is CardInfo) ? obj2 : null); } if (drawer is BeesOnHit) { return CardLoader.GetCardByName("Bee"); } if (drawer is DrawAnt) { return CardLoader.GetCardByName("Ant"); } return null; } private static void RemoveDrawCopyAbility(CardInfo info) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown if (!((Object)(object)info == (Object)null)) { if (info.Mods == null) { info.Mods = new List<CardModificationInfo>(); } CardModificationInfo val = new CardModificationInfo(); val.negateAbilities.Add((Ability)9); info.Mods.Add(val); } } private static IEnumerator SpawnEnemyCard(CardInfo info, bool protectOverkill) { yield return null; if ((Object)(object)info == (Object)null) { yield break; } Opponent opponent = Singleton<TurnManager>.Instance.Opponent; if ((Object)(object)opponent == (Object)null) { PendingCreateCards.Remove(((Object)info).name); yield break; } CardSlot freeSlot = FindFreeQueueSlot(opponent); if ((Object)(object)freeSlot != (Object)null) { yield return opponent.QueueCard(info, freeSlot, true, true, true); if (protectOverkill) { PlayableCard created = Singleton<BoardManager>.Instance.GetCardQueuedForSlot(freeSlot); if ((Object)(object)created != (Object)null) { ((MonoBehaviour)Singleton<TurnManager>.Instance).StartCoroutine(AddOverkillProtection(created)); } } PendingCreateCards.Remove(((Object)info).name); yield break; } PlayableCard target = FindSameQueuedCard(opponent, ((Object)info).name); if ((Object)(object)target == (Object)null) { PendingCreateCards.Remove(((Object)info).name); yield break; } if (MergingCards.Contains(target)) { PendingCreateCards.Remove(((Object)info).name); yield break; } MergingCards.Add(target); PlayableCard temp = CardSpawner.SpawnPlayableCard(info); if ((Object)(object)temp == (Object)null) { MergingCards.Remove(target); PendingCreateCards.Remove(((Object)info).name); yield break; } MergeCardStats(target, temp); Object.Destroy((Object)(object)((Component)temp).gameObject); MergingCards.Remove(target); PendingCreateCards.Remove(((Object)info).name); } private static CardSlot FindFreeQueueSlot(Opponent opponent) { foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if (!opponent.Queue.Exists((PlayableCard x) => (Object)(object)x != (Object)null && (Object)(object)x.QueuedSlot == (Object)(object)slot)) { return slot; } } return null; } private static PlayableCard FindSameQueuedCard(Opponent opponent, string name) { List<PlayableCard> list = new List<PlayableCard>(); foreach (PlayableCard item in opponent.Queue) { if (!((Object)(object)item == (Object)null) && ((Object)((Card)item).Info).name == name) { list.Add(item); } } if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } private static void MergeCardStats(PlayableCard target, PlayableCard source) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null || (Object)(object)source == (Object)null) { return; } CardModificationInfo val = new CardModificationInfo(); val.fromCardMerge = true; val.attackAdjustment = source.Attack; val.healthAdjustment = source.Health; val.abilities = new List<Ability>(); foreach (Ability ability in ((Card)source).Info.Abilities) { AddAbility(target, val, ability); } if (val.attackAdjustment != 0 || val.healthAdjustment != 0 || val.abilities.Count != 0) { target.AddTemporaryMod(val); target.OnStatsChanged(); ((Card)target).RenderCard(); } } private static void AddAbility(PlayableCard target, CardModificationInfo mod, Ability ability) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_000d: 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_0033: Unknown result type (might be due to invalid IL or missing references) if ((int)ability != 0 && !target.HasAbility(ability) && !mod.abilities.Contains(ability)) { mod.abilities.Add(ability); } } private static IEnumerator AddOverkillProtection(PlayableCard card) { yield return null; if ((Object)(object)card != (Object)null) { PendingOverkillProtection.Add(card); } } } [HarmonyPatch] public static class SquirrelStrafePatch { private static readonly MethodInfo GetNonDefaultModsMethod = AccessTools.Method(typeof(AbilityBehaviour), "GetNonDefaultModsFromSelf", new Type[1] { typeof(Ability[]) }, (Type[])null); private static MethodBase TargetMethod() { return AccessTools.Method(typeof(SquirrelStrafe), "PostSuccessfulMoveSequence", (Type[])null, (Type[])null); } [HarmonyPostfix] private static void Postfix(SquirrelStrafe __instance, CardSlot cardSlot, ref IEnumerator __result) { __result = CopyModsAfterSpawn(__instance, cardSlot, __result); } private static IEnumerator CopyModsAfterSpawn(SquirrelStrafe source, CardSlot cardSlot, IEnumerator original) { while (original.MoveNext()) { yield return original.Current; } if ((Object)(object)source == (Object)null || (Object)(object)cardSlot == (Object)null) { yield break; } PlayableCard sourceCard = ((Component)source).GetComponent<PlayableCard>(); if ((Object)(object)sourceCard == (Object)null || (Object)(object)cardSlot.Card == (Object)null) { yield break; } if (GetNonDefaultModsMethod == null) { Debug.LogError((object)"[OLD_SA] 找不到 GetNonDefaultModsFromSelf 方法。"); yield break; } List<Ability> originalAbilities = new List<Ability>(((Card)sourceCard).Info.Abilities); List<CardModificationInfo> mods; try { object result = GetNonDefaultModsMethod.Invoke(source, new object[1] { new Ability[1] { (Ability)(int)((AbilityBehaviour)source).Ability } }); mods = result as List<CardModificationInfo>; } finally { ((Card)sourceCard).Info.Abilities.Clear(); ((Card)sourceCard).Info.Abilities.AddRange(originalAbilities); } if (mods == null || mods.Count == 0) { yield break; } PlayableCard squirrel = cardSlot.Card; foreach (CardModificationInfo mod in mods) { squirrel.AddTemporaryMod((CardModificationInfo)mod.Clone()); } squirrel.OnStatsChanged(); } } } namespace OLD_SA.Combat { public static class AttackContext { public static PlayableCard Card; public static PlayableCard OriginalAttacker; public static CardSlot OriginalSlot; public static int Remaining; public static int AttackIndex; public static bool Active; public static void Start(PlayableCard card, int amount) { Card = card; Remaining = amount; AttackIndex = 0; Active = true; OriginalAttacker = card; if ((Object)(object)card != (Object)null) { OriginalSlot = card.Slot; LastAttackState.Start(card, card.Slot); } else { OriginalSlot = null; LastAttackState.Clear(); } } public static bool Is(PlayableCard card) { return Active && (Object)(object)Card == (Object)(object)card; } public static bool HasRemaining() { return Active && Remaining > 0; } public static void Consume() { if (Remaining > 0) { Remaining--; } AttackIndex++; } public static bool TryGetOriginalAttack(out PlayableCard attacker, out CardSlot slot) { attacker = OriginalAttacker; slot = OriginalSlot; return (Object)(object)attacker != (Object)null && (Object)(object)slot != (Object)null; } public static void Clear() { Card = null; OriginalAttacker = null; OriginalSlot = null; Remaining = 0; AttackIndex = 0; Active = false; LastAttackState.Clear(); } } public static class CustomAttackResolver { public static bool IsAdditionalAttack; public static IEnumerator RequestAttack(CardSlot attacker, CardSlot target) { if (!((Object)(object)attacker == (Object)null) && !((Object)(object)target == (Object)null) && !((Object)(object)attacker.Card == (Object)null) && !attacker.Card.Dead) { ExtraAttackQueue.Enqueue(attacker, target); } yield break; } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSequence")] public static class DynamicAttackPatch { [HarmonyPrefix] public static bool Prefix(CombatPhaseManager __instance, CardSlot slot, ref IEnumerator __result) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)slot == (Object)null || (Object)(object)slot.Card == (Object)null) { return true; } PlayableCard card = slot.Card; if (card.HasAbility((Ability)53)) { return true; } if (!AttackContext.Is(card)) { List<CardSlot> opposingSlots = card.GetOpposingSlots(); int num = 0; if (opposingSlots != null) { num = opposingSlots.Count; } int num2 = ExtraAttackState.TakeForAttack(card); if (card.HasAbility(ArmorStrikeAPI.ArmorStrikeAbility)) { int abilityStacks = CardExtensions.GetAbilityStacks(card, (Ability)54); if (abilityStacks > 0) { num2 += abilityStacks; } } int num3 = num + num2; if (num3 <= 1) { return true; } AttackContext.Start(card, num3); } __result = DynamicSequence(__instance, slot); return false; } private static IEnumerator DynamicSequence(CombatPhaseManager manager, CardSlot slot) { PlayableCard card = slot.Card; Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.CombatView, false, false); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1; while (AttackContext.HasRemaining() && !((Object)(object)card == (Object)null) && !card.Dead && !((Object)(object)card.Slot == (Object)null)) { List<CardSlot> targets = card.GetOpposingSlots(); if (targets == null || targets.Count == 0) { break; } int index = Mathf.Min(AttackContext.AttackIndex, targets.Count - 1); CardSlot target = targets[index]; if ((Object)(object)target == (Object)null) { AttackContext.Consume(); continue; } yield return manager.SlotAttackSlot(card.Slot, target, (targets.Count > 1) ? 0.1f : 0f); AttackContext.Consume(); } AttackContext.Clear(); Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1; } } public static class ExtraAttackQueue { private class AttackRequest { public CardSlot attacker; public CardSlot target; } private static Queue<AttackRequest> queue = new Queue<AttackRequest>(); private static bool running = false; public static void Enqueue(CardSlot attacker, CardSlot target) { if (!((Object)(object)attacker == (Object)null) && !((Object)(object)target == (Object)null) && !((Object)(object)attacker.Card == (Object)null) && !attacker.Card.Dead) { queue.Enqueue(new AttackRequest { attacker = attacker, target = target }); if (!running) { ((MonoBehaviour)Singleton<GameFlowManager>.Instance).StartCoroutine(ProcessQueue()); } } } private static IEnumerator ProcessQueue() { running = true; while (queue.Count > 0) { AttackRequest attack = queue.Dequeue(); yield return ExtraCombatBridge.ExecuteAttack(attack.attacker, attack.target); yield return (object)new WaitForSeconds(0.1f); } if (ExtraDamageQueue.HasDamage()) { yield return ExtraDamageQueue.ResolveAll(); } running = false; } } public class CardExtraAttackData { public int Temporary = 0; public int Stored = 0; } public static class ExtraAttackState { private static Dictionary<PlayableCard, CardExtraAttackData> data = new Dictionary<PlayableCard, CardExtraAttackData>(); private static bool wolfProcessing = false; private static CardExtraAttackData Get(PlayableCard card) { if ((Object)(object)card == (Object)null) { return null; } if (!data.ContainsKey(card)) { data[card] = new CardExtraAttackData(); } return data[card]; } public static void AddTemporary(PlayableCard card, int amount) { CardExtraAttackData cardExtraAttackData = Get(card); if (cardExtraAttackData == null || amount <= 0) { return; } cardExtraAttackData.Temporary += amount; if (wolfProcessing || !WolfAndJackalAttackPatch.HasWolf(card)) { return; } wolfProcessing = true; try { cardExtraAttackData.Temporary += amount; } finally { wolfProcessing = false; } } public static void AddStored(PlayableCard card, int amount) { CardExtraAttackData cardExtraAttackData = Get(card); if (cardExtraAttackData == null || amount <= 0) { return; } cardExtraAttackData.Stored += amount; if (wolfProcessing || !WolfAndJackalAttackPatch.HasWolf(card)) { return; } wolfProcessing = true; try { cardExtraAttackData.Stored += amount; } finally { wolfProcessing = false; } } public static int TakeForAttack(PlayableCard card) { CardExtraAttackData cardExtraAttackData = Get(card); if (cardExtraAttackData == null) { return 0; } int result = cardExtraAttackData.Temporary + cardExtraAttackData.Stored; cardExtraAttackData.Temporary = 0; return result; } public static int GetTotal(PlayableCard card) { CardExtraAttackData cardExtraAttackData = Get(card); if (cardExtraAttackData == null) { return 0; } return cardExtraAttackData.Temporary + cardExtraAttackData.Stored; } } public static class ExtraCombatBridge { public static int DamageThisAttack; public static CombatPhaseManager Manager; public static IEnumerator ExecuteAttack(CardSlot attacker, CardSlot target) { Manager = Singleton<CombatPhaseManager>.Instance; if (!((Object)(object)Manager == (Object)null)) { DamageThisAttack = 0; int before = Manager.DamageDealtThisPhase; yield return Manager.SlotAttackSlot(attacker, target, 0f); DamageThisAttack = Manager.DamageDealtThisPhase - before; ExtraDamageQueue.Add(attacker.IsPlayerSlot, DamageThisAttack); } } } public static class ExtraDamageQueue { private class DamageEntry { public bool playerAttack; public int damage; } private static List<DamageEntry> damages = new List<DamageEntry>(); public static void Add(bool playerAttack, int damage) { if (damage > 0) { damages.Add(new DamageEntry { playerAttack = playerAttack, damage = damage }); } } public static bool HasDamage() { return damages.Count > 0; } public static IEnumerator ResolveAll() { foreach (DamageEntry entry in damages) { yield return ExtraDamageResolver.Resolve(entry.playerAttack, entry.damage); yield return (object)new WaitForSeconds(0.1f); } damages.Clear(); } } public static class ExtraDamageResolver { public static IEnumerator Resolve(bool playerAttack, int damage) { if (damage > 0) { yield return (object)new WaitForSeconds(0.4f); yield return SwitchToCombatView(); yield return MoveOriginalWeights(playerAttack); int excessDamage = 0; if (playerAttack) { excessDamage = Singleton<LifeManager>.Instance.Balance + damage - 5; excessDamage = Mathf.Max(0, excessDamage); } int scaleDamage = damage - excessDamage; if (scaleDamage > 0) { yield return Singleton<LifeManager>.Instance.ShowDamageSequence(scaleDamage, scaleDamage, !playerAttack, 0f, (GameObject)null, 0f, true); } if (excessDamage > 0 && playerAttack) { RunState run = RunState.Run; run.currency += excessDamage; yield return ShowCurrencyGain(excessDamage); } } } private static IEnumerator SwitchToCombatView() { if (!((Object)(object)Singleton<ViewManager>.Instance == (Object)null)) { Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.CombatView, false, false); yield return (object)new WaitForSeconds(0.1f); } } private static IEnumerator ShowCurrencyGain(int amount) { if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null && (Object)(object)Singleton<BoardManager>.Instance != (Object)null) { Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.DefaultView, false, false); yield return (object)new WaitForSeconds(0.25f); } if ((Object)(object)Singleton<CurrencyBowl>.Instance != (Object)null) { yield return Singleton<CurrencyBowl>.Instance.ShowGain(Mathf.Min(20, amount), false, false); } } private static IEnumerator MoveOriginalWeights(bool playerAttack) { CombatPhaseManager instance = Singleton<CombatPhaseManager>.Instance; CombatPhaseManager3D manager = (CombatPhaseManager3D)(object)((instance is CombatPhaseManager3D) ? instance : null); if ((Object)(object)manager == (Object)null) { yield break; } FieldInfo field = typeof(CombatPhaseManager3D).GetField("damageWeights", BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { yield break; } List<Transform> weights = field.GetValue(manager) as List<Transform>; if (weights == null || weights.Count == 0 || (Object)(object)Singleton<LifeManager>.Instance.Scales3D == (Object)null) { yield break; } Vector3 scalePos = (playerAttack ? Singleton<LifeManager>.Instance.Scales3D.OpponentSide : Singleton<LifeManager>.Instance.Scales3D.PlayerSide); foreach (Transform weight in weights) { if (!((Object)(object)weight == (Object)null)) { Tween.Position(weight, scalePos, 0.2f, 0f, Tween.EaseOut, (LoopType)0, (Action)null, (Action)null, true); Object.Destroy((Object)(object)((Component)weight).gameObject, 0.2f); yield return (object)new WaitForSeconds(0.02f); } } weights.Clear(); yield return (object)new WaitForSeconds(0.25f); } } public static class LastAttackState { public static PlayableCard Attacker; public static CardSlot AttackSlot; public static void Start(PlayableCard attacker, CardSlot slot) { Attacker = attacker; AttackSlot = slot; } public static void Clear() { Attacker = null; AttackSlot = null; } } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSequence")] public static class OriginalAttackRecordPatch { [HarmonyPrefix] public static void Prefix(CardSlot slot) { if (!((Object)(object)slot == (Object)null) && !((Object)(object)slot.Card == (Object)null)) { LastAttackState.Start(slot.Card, slot); } } } [HarmonyPatch(typeof(CombatPhaseManager), "DealOverkillDamage")] public static class OverkillPatch { [HarmonyPrefix] public static bool Prefix(CombatPhaseManager __instance, int damage, CardSlot attackingSlot, CardSlot opposingSlot, ref IEnumerator __result) { if (damage <= 0 || (Object)(object)opposingSlot == (Object)null) { return true; } PlayableCard cardQueuedForSlot = Singleton<BoardManager>.Instance.GetCardQueuedForSlot(opposingSlot); if ((Object)(object)cardQueuedForSlot == (Object)null) { return true; } if (EnemyDrawCreatedCardPatch.PendingOverkillProtection.Contains(cardQueuedForSlot)) { EnemyDrawCreatedCardPatch.PendingOverkillProtection.Remove(cardQueuedForSlot); __result = EmptyRoutine(); return false; } if (EnemyDrawCreatedCardPatch.MergingCards.Contains(cardQueuedForSlot)) { __result = EmptyRoutine(); return false; } PlayableCard attacker = LastAttackState.Attacker; if ((Object)(object)attacker == (Object)null) { return true; } __result = DealOverkillReplacement(cardQueuedForSlot, attacker, damage); return false; } private static IEnumerator EmptyRoutine() { yield break; } private static IEnumerator DealOverkillReplacement(PlayableCard card, PlayableCard attacker, int damage) { if ((Object)(object)card == (Object)null) { yield break; } yield return (object)new WaitForSeconds(0.1f); Singleton<ViewManager>.Instance.SwitchToView(Singleton<BoardManager>.Instance.QueueView, false, false); try { yield return (object)new WaitForSeconds(0.3f); if (card.HasAbility((Ability)21)) { yield return ShowBlocked(card); yield break; } yield return PreOverkillDamage(card); yield return card.TakeDamage(damage, attacker); yield return PostOverkillDamage(card); } finally { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); } } private static IEnumerator PreOverkillDamage(PlayableCard card) { MethodInfo method = AccessTools.Method(typeof(CombatPhaseManager), "PreOverkillDamage", (Type[])null, (Type[])null); if (!(method == null) && method.Invoke(Singleton<CombatPhaseManager>.Instance, new object[1] { card }) is IEnumerator routine) { yield return routine; } } private static IEnumerator PostOverkillDamage(PlayableCard card) { MethodInfo method = AccessTools.Method(typeof(CombatPhaseManager), "PostOverkillDamage", (Type[])null, (Type[])null); if (!(method == null) && method.Invoke(Singleton<CombatPhaseManager>.Instance, new object[1] { card }) is IEnumerator routine) { yield return routine; } } private static IEnumerator ShowBlocked(PlayableCard card) { MethodInfo method = AccessTools.Method(typeof(CombatPhaseManager), "ShowCardBlocked", (Type[])null, (Type[])null); if (!(method == null) && method.Invoke(Singleton<CombatPhaseManager>.Instance, new object[1] { card }) is IEnumerator routine) { yield return routine; } } } }
Sigil/OldSa_Slow_Strike_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.SmallSigils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Slow_Strike_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Slow_Strike_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("076fd396-a7cb-4f3d-8cd1-87ad2a18dbc6")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.SlowStrike; [BepInPlugin("OLD_SA.SlowStrike", "OLD SA Slow Strike", "1.0.0")] public class SlowStrikePlugin : BaseUnityPlugin { private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Slow Strike] Loading..."); Harmony val = new Harmony("OLD_SA.SlowStrike"); val.PatchAll(); SlowStrikeAPI.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[OLD SA Slow Strike] Loaded!"); } } public static class SlowStrikeAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Slow Strike"; val.rulebookName = "Slow Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 4; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Slow_Strike.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] deals damage, the struck creature gains 2 Slow."); } ability = AbilityManager.Add("OLD_SA", val, typeof(SlowStrikeBehaviour), imageAsTexture); } } public class SlowStrikeBehaviour : AbilityBehaviour { public override Ability Ability => SlowStrikeAPI.ability.Id; public override bool RespondsToDealDamage(int amount, PlayableCard target) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (amount <= 0) { return false; } if ((Object)(object)target == (Object)null) { return false; } return true; } public override IEnumerator OnDealDamage(int amount, PlayableCard target) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((Object)(object)target == (Object)null) && !target.Dead) { SmallSigilManager.AddStacks(target, (SmallSigilType)4, 2); yield return (object)new WaitForSeconds(0.15f); } } }
Sigil/OldSa_SmallSigils.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using InscryptionCommunityPatch.Card; using OLD_SA.Combat; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_SmallSigils")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_SmallSigils")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1cd49d69-dd3b-4c57-b7ac-6ff7e5278d53")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.SmallSigils; public class BloodSigilRule : SmallSigilRuleBase { public override SmallSigilType Type => SmallSigilType.Blood; public override Type BehaviourType => typeof(BloodStatusEffect); public override int Threshold => 0; public override SmallSigilAttribute Attribute => SmallSigilAttribute.None; public override IEnumerator Effect(PlayableCard card) { yield break; } } public class BloodStatusEffect : SmallSigilStatusEffectBehaviour { public override string CardModSingletonName => "OLD_SA_Blood"; } public class BurningSigilRule : SmallSigilRuleBase { public override SmallSigilType Type => SmallSigilType.Burning; public override Type BehaviourType => typeof(BurningStatusEffect); public override int Threshold => 2; public override SmallSigilCategory Category => SmallSigilCategory.Debuff; public override SmallSigilAttribute Attribute => SmallSigilAttribute.Fire; public override IEnumerator Effect(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { yield return card.TakeDamage(1, (PlayableCard)null); } } } public class BurningStatusEffect : SmallSigilStatusEffectBehaviour { public override string CardModSingletonName => "OLD_SA_Burning"; } public class GluttonySigilRule : SmallSigilRuleBase { public override SmallSigilType Type => SmallSigilType.Gluttony; public override Type BehaviourType => typeof(GluttonyStatusEffect); public override int Threshold => 3; public override SmallSigilCategory Category => SmallSigilCategory.Buff; public override SmallSigilAttribute Attribute => SmallSigilAttribute.None; public override IEnumerator Effect(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { int triggerCount = SmallSigilRuleManager.IncrementBattleTriggerCount(card); CardModificationInfo mod = new CardModificationInfo(1, 1); card.AddTemporaryMod(mod); if (triggerCount >= 3) { yield return card.Die(false, (PlayableCard)null, true); } else { yield return null; } } } } public class GluttonyStatusEffect : SmallSigilStatusEffectBehaviour { public override string CardModSingletonName => "OLD_SA_Gluttony"; } [BepInPlugin("OLD_SA.SmallSigils", "OLD SA Small Sigils", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.SmallSigils"; private Harmony harmony; public static Plugin Instance { get; private set; } private void Awake() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown Instance = this; ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Small Sigils Loaded"); SmallSigilStatusEffectManager.Initialize("OLD_SA.SmallSigils"); harmony = new Harmony("OLD_SA.SmallSigils"); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Small Sigils patches applied."); } private void OnDestroy() { if (harmony != null) { harmony.UnpatchSelf(); harmony = null; } Instance = null; } } public class PoisonSigilRule : SmallSigilRuleBase { public override SmallSigilType Type => SmallSigilType.Poison; public override Type BehaviourType => typeof(PoisonStatusEffect); public override int Threshold => 4; public override SmallSigilCategory Category => SmallSigilCategory.Debuff; public override SmallSigilAttribute Attribute => SmallSigilAttribute.Poison; public override IEnumerator Effect(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !card.HasAbility((Ability)105)) { yield return card.Die(false, (PlayableCard)null, true); } } } public class PoisonStatusEffect : SmallSigilStatusEffectBehaviour { public override string CardModSingletonName => "OLD_SA_Poison"; } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSlot")] public static class SlowAttackPatch { [HarmonyPrefix] public static bool Prefix(ref CardSlot attackingSlot) { if ((Object)(object)attackingSlot == (Object)null) { return true; } PlayableCard card = attackingSlot.Card; if ((Object)(object)card == (Object)null) { return true; } int stacks = SmallSigilManager.GetStacks(card, SmallSigilType.Slow); if (stacks < 3) { return true; } SmallSigilManager.RemoveStacks(card, SmallSigilType.Slow, 3); ((Card)card).Anim.StrongNegationEffect(); return false; } } public class SlowSigilRule : SmallSigilRuleBase { public override SmallSigilType Type => SmallSigilType.Slow; public override Type BehaviourType => typeof(SlowStatusEffect); public override int Threshold => 0; public override SmallSigilCategory Category => SmallSigilCategory.Debuff; public override SmallSigilAttribute Attribute => SmallSigilAttribute.None; public override IEnumerator Effect(PlayableCard card) { yield break; } public bool CheckSlow(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } int stacks = SmallSigilManager.GetStacks(card, SmallSigilType.Slow); if (stacks < 3) { return false; } return true; } } public class SlowStatusEffect : SmallSigilStatusEffectBehaviour { public override string CardModSingletonName => "OLD_SA_Slow"; } public class SmallSigilAbilityIcons : ManagedBehaviour { public List<AbilityIconInteractable> part1AbilityIcons = new List<AbilityIconInteractable>(); public List<GameObject> smallSigilIconGroups = new List<GameObject>(); public List<AbilityIconInteractable> abilityIcons = new List<AbilityIconInteractable>(); public Material smallSigilMat; public Color fireColor = new Color(1f, 0.15f, 0.05f, 1f); public Color poisonColor = new Color(0.15f, 1f, 0.15f, 1f); public Color noneColor = new Color(0.45f, 0.22f, 0.08f, 1f); } [HarmonyPatch] internal static class SmallSigilAbilityIconsPatch { private const int MaxSmallSigilIcons = 5; private const float StartX = 0.4f; private const float XSpacing = 0.14f; private const float IconY = 0.75f; private static readonly Vector3 IconScale = new Vector3(0.1f, 0.075f, 1f); [HarmonyPostfix] [HarmonyPatch(typeof(CardAbilityIcons), "UpdateAbilityIcons")] private static void AddSmallSigilIcons(CardAbilityIcons __instance, PlayableCard playableCard) { //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Invalid comparison between Unknown and I4 //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || !SaveManager.SaveFile.IsPart1 || (Object)(object)playableCard == (Object)null) { return; } SmallSigilAbilityIcons smallSigilAbilityIcons = ((Component)__instance).GetComponent<SmallSigilAbilityIcons>(); if ((Object)(object)smallSigilAbilityIcons == (Object)null) { smallSigilAbilityIcons = ((Component)__instance).gameObject.AddComponent<SmallSigilAbilityIcons>(); } if ((Object)(object)smallSigilAbilityIcons == (Object)null || smallSigilAbilityIcons.part1AbilityIcons == null) { return; } if (smallSigilAbilityIcons.part1AbilityIcons.Count < 5) { CreateSmallSigilSlots(__instance, smallSigilAbilityIcons); } if (smallSigilAbilityIcons.part1AbilityIcons.Count == 0) { return; } for (int i = 0; i < smallSigilAbilityIcons.part1AbilityIcons.Count; i++) { AbilityIconInteractable val = smallSigilAbilityIcons.part1AbilityIcons[i]; if ((Object)(object)val != (Object)null) { ((Component)val).gameObject.SetActive(false); } } List<SmallSigilType> list = new List<SmallSigilType>(); if (SmallSigilManager.GetStacks(playableCard, SmallSigilType.Burning) > 0) { list.Add(SmallSigilType.Burning); } if (SmallSigilManager.GetStacks(playableCard, SmallSigilType.Poison) > 0) { list.Add(SmallSigilType.Poison); } if (SmallSigilManager.GetStacks(playableCard, SmallSigilType.Gluttony) > 0) { list.Add(SmallSigilType.Gluttony); } if (SmallSigilManager.GetStacks(playableCard, SmallSigilType.Blood) > 0) { list.Add(SmallSigilType.Blood); } if (SmallSigilManager.GetStacks(playableCard, SmallSigilType.Slow) > 0) { list.Add(SmallSigilType.Slow); } if (SmallSigilManager.GetStacks(playableCard, SmallSigilType.Speed) > 0) { list.Add(SmallSigilType.Speed); } if (list.Count == 0) { return; } int num = Mathf.Min(new int[3] { list.Count, smallSigilAbilityIcons.part1AbilityIcons.Count, 5 }); for (int j = 0; j < num; j++) { SmallSigilType type = list[j]; Ability ability = GetAbility(type); if ((int)ability == 0) { continue; } AbilityIconInteractable val2 = smallSigilAbilityIcons.part1AbilityIcons[j]; if ((Object)(object)val2 == (Object)null) { continue; } int stacks = SmallSigilManager.GetStacks(playableCard, type); if (stacks <= 0) { continue; } ((Component)val2).transform.localPosition = new Vector3(0.4f - 0.14f * (float)j, 0.75f, 0f); ((Component)val2).transform.localScale = IconScale; Texture texture = GetTexture(type); if ((Object)(object)texture == (Object)null) { continue; } val2.AssignAbility(ability, ((Card)playableCard).Info, playableCard); if (stacks > 1) { Texture val3 = InvokePatchTexture(ability, stacks); if ((Object)(object)val3 != (Object)null) { val2.SetIcon(val3); } else { val2.SetIcon(texture); } } else { val2.SetIcon(texture); } Renderer component = ((Component)val2).GetComponent<Renderer>(); if ((Object)(object)component != (Object)null) { component.material.color = GetColor(smallSigilAbilityIcons, type); } ((Component)val2).gameObject.SetActive(true); if (!smallSigilAbilityIcons.abilityIcons.Contains(val2)) { smallSigilAbilityIcons.abilityIcons.Add(val2); } } } [HarmonyPostfix] [HarmonyPatch(typeof(CardAbilityIcons), "UpdateAbilityIcons")] private static void ResetSmallSigilController(CardAbilityIcons __instance) { if ((Object)(object)__instance == (Object)null) { return; } SmallSigilAbilityIcons component = ((Component)__instance).GetComponent<SmallSigilAbilityIcons>(); if (!((Object)(object)component == (Object)null) && component.abilityIcons != null) { component.abilityIcons.RemoveAll((AbilityIconInteractable icon) => (Object)(object)icon == (Object)null || !((Component)icon).gameObject.activeSelf); } } private static Texture InvokePatchTexture(Ability ability, int count) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (count <= 1) { return null; } MethodInfo methodInfo = AccessTools.Method(typeof(StackAbilityIcons), "PatchTexture", (Type[])null, (Type[])null); if (methodInfo == null) { return null; } int num = Mathf.Clamp(count, 2, 99); try { object obj = methodInfo.Invoke(null, new object[2] { ability, num }); return (Texture)((obj is Texture) ? obj : null); } catch { return null; } } private static void CreateSmallSigilSlots(CardAbilityIcons instance, SmallSigilAbilityIcons controller) { //IL_010a: 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) if ((Object)(object)instance == (Object)null || (Object)(object)controller == (Object)null) { return; } AbilityIconInteractable val = null; AbilityIconInteractable[] componentsInChildren = ((Component)instance).GetComponentsInChildren<AbilityIconInteractable>(true); AbilityIconInteractable[] array = componentsInChildren; foreach (AbilityIconInteractable val2 in array) { if (!((Object)(object)val2 == (Object)null) && !((Object)((Component)val2).gameObject).name.StartsWith("SmallSigilIcon_")) { val = val2; break; } } if ((Object)(object)val == (Object)null) { return; } for (int j = controller.part1AbilityIcons.Count; j < 5; j++) { GameObject val3 = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Component)val).transform.parent); if ((Object)(object)val3 == (Object)null) { continue; } ((Object)val3).name = "SmallSigilIcon_" + (j + 1); val3.transform.localPosition = new Vector3(0.4f - 0.14f * (float)j, 0.75f, 0f); val3.transform.localScale = IconScale; AbilityIconInteractable component = val3.GetComponent<AbilityIconInteractable>(); if ((Object)(object)component == (Object)null) { Object.Destroy((Object)(object)val3); continue; } Renderer component2 = ((Component)val).GetComponent<Renderer>(); Renderer component3 = ((Component)component).GetComponent<Renderer>(); if ((Object)(object)component2 != (Object)null && (Object)(object)component3 != (Object)null) { component3.sharedMaterial = component2.sharedMaterial; } controller.part1AbilityIcons.Add(component); val3.SetActive(false); } } private static Ability GetAbility(SmallSigilType type) { //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) return (Ability)(type switch { SmallSigilType.Burning => SmallSigilStatusEffectManager.GetIconAbility(typeof(BurningStatusEffect)), SmallSigilType.Poison => SmallSigilStatusEffectManager.GetIconAbility(typeof(PoisonStatusEffect)), SmallSigilType.Gluttony => SmallSigilStatusEffectManager.GetIconAbility(typeof(GluttonyStatusEffect)), SmallSigilType.Blood => SmallSigilStatusEffectManager.GetIconAbility(typeof(BloodStatusEffect)), SmallSigilType.Slow => SmallSigilStatusEffectManager.GetIconAbility(typeof(SlowStatusEffect)), SmallSigilType.Speed => SmallSigilStatusEffectManager.GetIconAbility(typeof(SpeedStatusEffect)), _ => 0, }); } private static Texture GetTexture(SmallSigilType type) { return (Texture)(type switch { SmallSigilType.Burning => SmallSigilStatusEffectManager.GetIconTexture(typeof(BurningStatusEffect)), SmallSigilType.Poison => SmallSigilStatusEffectManager.GetIconTexture(typeof(PoisonStatusEffect)), SmallSigilType.Gluttony => SmallSigilStatusEffectManager.GetIconTexture(typeof(GluttonyStatusEffect)), SmallSigilType.Blood => SmallSigilStatusEffectManager.GetIconTexture(typeof(BloodStatusEffect)), SmallSigilType.Slow => SmallSigilStatusEffectManager.GetIconTexture(typeof(SlowStatusEffect)), SmallSigilType.Speed => SmallSigilStatusEffectManager.GetIconTexture(typeof(SpeedStatusEffect)), _ => null, }); } private static Color GetColor(SmallSigilAbilityIcons controller, SmallSigilType type) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)controller == (Object)null) { return Color.white; } SmallSigilRuleBase rule = SmallSigilRuleManager.GetRule(type); if (rule == null) { return Color.white; } return (Color)(rule.Attribute switch { SmallSigilAttribute.Fire => controller.fireColor, SmallSigilAttribute.Poison => controller.poisonColor, SmallSigilAttribute.None => controller.noneColor, _ => controller.noneColor, }); } [HarmonyPostfix] [HarmonyPatch(typeof(CardAbilityIcons), "GetDistinctShownAbilities")] private static void HideSmallSigilsFromNormalIcons(ref List<Ability> __result) { if (__result != null && __result.Count != 0) { __result.RemoveAll((Ability ability) => SmallSigilStatusEffectManager.IsSmallSigilAbility(ability)); } } } public class SmallSigilBehaviour : MonoBehaviour { public PlayableCard Card { get; private set; } private void Awake() { Card = ((Component)this).GetComponent<PlayableCard>(); if (!((Object)(object)Card == (Object)null)) { SmallSigilManager.RegisterCard(Card); EnsureTriggerBehaviour(); } } private void EnsureTriggerBehaviour() { if (!((Object)(object)Card == (Object)null) && (Object)(object)((Component)Card).GetComponent<SmallSigilTriggerBehaviour>() == (Object)null) { ((Component)Card).gameObject.AddComponent<SmallSigilTriggerBehaviour>(); } } private void OnDestroy() { if (!((Object)(object)Card == (Object)null)) { SmallSigilRuleManager.ClearCard(Card); SmallSigilManager.ClearCard(Card); Card = null; } } } public class SmallSigilData { private readonly Dictionary<SmallSigilType, int> stacks = new Dictionary<SmallSigilType, int>(); public int GetStacks(SmallSigilType type) { if (stacks.TryGetValue(type, out var value)) { return value; } return 0; } public void AddStacks(SmallSigilType type, int amount) { if (amount > 0) { int num = GetStacks(type); stacks[type] = num + amount; } } public bool RemoveStacks(SmallSigilType type, int amount) { if (amount <= 0) { return false; } int num = GetStacks(type); if (num < amount) { return false; } int num2 = num - amount; if (num2 <= 0) { stacks.Remove(type); } else { stacks[type] = num2; } return true; } public void SetStacks(SmallSigilType type, int amount) { if (amount <= 0) { stacks.Remove(type); } else { stacks[type] = amount; } } public void Clear() { stacks.Clear(); } } public static class SmallSigilManager { private static SmallSigilStatusEffectBehaviour GetBehaviour(PlayableCard card, SmallSigilType type, bool create) { if ((Object)(object)card == (Object)null) { return null; } SmallSigilRuleBase rule = SmallSigilRuleManager.GetRule(type); if (rule == null) { return null; } Type behaviourType = rule.BehaviourType; if (behaviourType == null) { return null; } SmallSigilStatusEffectBehaviour smallSigilStatusEffectBehaviour = ((Component)card).GetComponent(behaviourType) as SmallSigilStatusEffectBehaviour; if ((Object)(object)smallSigilStatusEffectBehaviour == (Object)null && create) { smallSigilStatusEffectBehaviour = ((Component)card).gameObject.AddComponent(behaviourType) as SmallSigilStatusEffectBehaviour; } return smallSigilStatusEffectBehaviour; } public static SmallSigilStatusEffectBehaviour GetBehaviourForRule(PlayableCard card, SmallSigilType type) { return GetBehaviour(card, type, create: false); } public static void RegisterCard(PlayableCard card) { } public static int GetStacks(PlayableCard card, SmallSigilType type) { SmallSigilStatusEffectBehaviour behaviour = GetBehaviour(card, type, create: false); if ((Object)(object)behaviour == (Object)null) { return 0; } return behaviour.EffectSeverity; } public static void AddStacks(PlayableCard card, SmallSigilType type, int amount) { if (!((Object)(object)card == (Object)null) && amount > 0) { SmallSigilStatusEffectBehaviour behaviour = GetBehaviour(card, type, create: true); if (!((Object)(object)behaviour == (Object)null)) { behaviour.AddSeverity(amount); SmallSigilRuleManager.RequestProcess(card); } } } public static bool RemoveStacks(PlayableCard card, SmallSigilType type, int amount) { if ((Object)(object)card == (Object)null || amount <= 0) { return false; } SmallSigilStatusEffectBehaviour behaviour = GetBehaviour(card, type, create: false); if ((Object)(object)behaviour == (Object)null) { return false; } if (behaviour.EffectSeverity < amount) { return false; } behaviour.SetSeverity(behaviour.EffectSeverity - amount); return true; } public static void SetStacks(PlayableCard card, SmallSigilType type, int amount) { if ((Object)(object)card == (Object)null) { return; } SmallSigilStatusEffectBehaviour behaviour = GetBehaviour(card, type, create: true); if (!((Object)(object)behaviour == (Object)null)) { behaviour.SetSeverity(amount); if (amount > 0) { SmallSigilRuleManager.RequestProcess(card); } } } public static void ClearStacks(PlayableCard card, SmallSigilType type) { if (!((Object)(object)card == (Object)null)) { SmallSigilStatusEffectBehaviour behaviour = GetBehaviour(card, type, create: false); if (!((Object)(object)behaviour == (Object)null)) { behaviour.SetSeverity(0); } } } public static void ClearCard(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { SmallSigilRuleManager.ClearCard(card); } } public static void ClearAll() { SmallSigilRuleManager.ClearAll(); } private static string GetCardName(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return "NULL"; } return ((Object)((Card)card).Info).name; } } public abstract class SmallSigilRuleBase { public abstract SmallSigilType Type { get; } public abstract Type BehaviourType { get; } public abstract int Threshold { get; } public virtual bool AutoTrigger => Threshold > 0; public virtual int Consume => Threshold; public virtual SmallSigilCategory Category => SmallSigilCategory.Debuff; public virtual SmallSigilAttribute Attribute => SmallSigilAttribute.None; public virtual bool CanTrigger(int currentStacks) { if (!AutoTrigger) { return false; } return currentStacks >= Threshold; } public abstract IEnumerator Effect(PlayableCard card); } public static class SmallSigilRuleManager { private static readonly Dictionary<SmallSigilType, SmallSigilRuleBase> Rules; private static readonly HashSet<PlayableCard> ProcessingCards; private static readonly Dictionary<PlayableCard, int> BattleTriggerCounts; private const float TriggerDelay = 0.4f; static SmallSigilRuleManager() { Rules = new Dictionary<SmallSigilType, SmallSigilRuleBase>(); ProcessingCards = new HashSet<PlayableCard>(); BattleTriggerCounts = new Dictionary<PlayableCard, int>(); RegisterRules(); } private static void RegisterRules() { Register(new BurningSigilRule()); Register(new PoisonSigilRule()); Register(new GluttonySigilRule()); Register(new BloodSigilRule()); Register(new SlowSigilRule()); Register(new SpeedSigilRule()); } private static void Register(SmallSigilRuleBase rule) { if (rule != null) { Rules[rule.Type] = rule; } } public static void RequestProcess(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !ProcessingCards.Contains(card) && HasTriggeredEffect(card)) { ProcessingCards.Add(card); SmallSigilStatusEffectBehaviour component = ((Component)card).GetComponent<SmallSigilStatusEffectBehaviour>(); if ((Object)(object)component == (Object)null) { ProcessingCards.Remove(card); } else { ((MonoBehaviour)component).StartCoroutine(Process(card)); } } } public static bool HasTriggeredEffect(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } foreach (KeyValuePair<SmallSigilType, SmallSigilRuleBase> rule in Rules) { SmallSigilRuleBase value = rule.Value; int stacks = SmallSigilManager.GetStacks(card, value.Type); if (value.Threshold > 0 && stacks >= value.Threshold) { return true; } } return false; } public static IEnumerator Process(PlayableCard card) { if ((Object)(object)card == (Object)null) { yield break; } if (!ProcessingCards.Contains(card)) { ProcessingCards.Add(card); } try { bool needsAnotherCheck = true; while ((Object)(object)card != (Object)null && needsAnotherCheck) { needsAnotherCheck = false; foreach (KeyValuePair<SmallSigilType, SmallSigilRuleBase> pair in Rules) { if ((Object)(object)card == (Object)null) { yield break; } SmallSigilRuleBase rule = pair.Value; int stacks = SmallSigilManager.GetStacks(card, rule.Type); if (rule.Threshold <= 0 || stacks < rule.Threshold) { continue; } int triggerCount = stacks / rule.Threshold; for (int i = 0; i < triggerCount; i++) { if ((Object)(object)card == (Object)null) { yield break; } int currentStacks = SmallSigilManager.GetStacks(card, rule.Type); if (currentStacks < rule.Threshold) { break; } SmallSigilStatusEffectBehaviour behaviour = SmallSigilManager.GetBehaviourForRule(card, rule.Type); if ((Object)(object)behaviour == (Object)null) { break; } yield return RunSmallSigilTriggerSequence(card, behaviour.IconAbilityInfo.ability); if ((Object)(object)card == (Object)null) { yield break; } yield return (object)new WaitForSeconds(0.4f); currentStacks = SmallSigilManager.GetStacks(card, rule.Type); if (currentStacks < rule.Threshold || !SmallSigilManager.RemoveStacks(card, rule.Type, rule.Consume)) { break; } yield return rule.Effect(card); if ((Object)(object)card == (Object)null) { yield break; } yield return null; } if ((Object)(object)card != (Object)null && rule.Threshold > 0 && SmallSigilManager.GetStacks(card, rule.Type) >= rule.Threshold) { needsAnotherCheck = true; } } if ((Object)(object)card != (Object)null && HasTriggeredEffect(card)) { needsAnotherCheck = true; } } } finally { ProcessingCards.Remove(card); } } public static IEnumerator ProcessAndWait(PlayableCard card) { if ((Object)(object)card == (Object)null) { yield break; } while ((Object)(object)card != (Object)null && ProcessingCards.Contains(card)) { yield return null; } if ((Object)(object)card == (Object)null) { yield break; } while ((Object)(object)card != (Object)null && HasTriggeredEffect(card)) { SmallSigilStatusEffectBehaviour behaviour = ((Component)card).GetComponent<SmallSigilStatusEffectBehaviour>(); if ((Object)(object)behaviour == (Object)null) { break; } yield return ((MonoBehaviour)behaviour).StartCoroutine(Process(card)); yield return null; } } private static IEnumerator RunSmallSigilTriggerSequence(PlayableCard card, Ability ability) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)card == (Object)null)) { if ((Object)(object)Singleton<GlobalTriggerHandler>.Instance != (Object)null) { Singleton<GlobalTriggerHandler>.Instance.AbilitiesTriggeredThisTurn.Add(ability); } yield return card.OnAbilityTriggered(ability); } } public static SmallSigilCategory GetCategory(SmallSigilType type) { if (Rules.TryGetValue(type, out var value)) { return value.Category; } return SmallSigilCategory.Debuff; } public static SmallSigilAttribute GetAttribute(SmallSigilType type) { if (Rules.TryGetValue(type, out var value)) { return value.Attribute; } return SmallSigilAttribute.None; } public static SmallSigilRuleBase GetRule(SmallSigilType type) { if (Rules.TryGetValue(type, out var value)) { return value; } return null; } public static int GetBattleTriggerCount(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } if (BattleTriggerCounts.TryGetValue(card, out var value)) { return value; } return 0; } public static int IncrementBattleTriggerCount(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } int battleTriggerCount = GetBattleTriggerCount(card); battleTriggerCount++; BattleTriggerCounts[card] = battleTriggerCount; return battleTriggerCount; } public static void ResetBattleTriggerCount(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { BattleTriggerCounts.Remove(card); } } public static void ClearCard(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { BattleTriggerCounts.Remove(card); ProcessingCards.Remove(card); } } public static void ClearAll() { BattleTriggerCounts.Clear(); ProcessingCards.Clear(); } } public abstract class SmallSigilStatusEffectBehaviour : SpecialCardBehaviour { public abstract string CardModSingletonName { get; } protected string DisplayModSingletonName => CardModSingletonName + "_DISPLAY"; public virtual bool EffectCanBeInherited => false; public AbilityInfo IconAbilityInfo => SmallSigilStatusEffectManager.GetIconAbilityInfo(((object)this).GetType()); public int EffectSeverity { get; protected set; } protected virtual void Start() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null)) { AbilityInfo iconAbilityInfo = IconAbilityInfo; if (!((Object)(object)iconAbilityInfo == (Object)null)) { EffectSeverity = GetExistingSeverity(iconAbilityInfo.ability); SyncEffectMods(); } } } private int GetExistingSeverity(Ability ability) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null || (Object)(object)((Card)((SpecialCardBehaviour)this).PlayableCard).Info == (Object)null || (int)ability == 0) { return 0; } int num = 0; foreach (CardModificationInfo temporaryMod in ((SpecialCardBehaviour)this).PlayableCard.TemporaryMods) { if (temporaryMod == null || temporaryMod.singletonId != CardModSingletonName || temporaryMod.abilities == null) { continue; } foreach (Ability ability2 in temporaryMod.abilities) { if (ability2 == ability) { num++; } } } if (num > 0) { return num; } int num2 = 0; foreach (CardModificationInfo mod in ((Card)((SpecialCardBehaviour)this).PlayableCard).Info.Mods) { if (mod == null || mod.singletonId != DisplayModSingletonName || mod.abilities == null) { continue; } foreach (Ability ability3 in mod.abilities) { if (ability3 == ability) { num2++; } } } return num2; } public void AddSeverity(int amount) { if (!((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null) && amount > 0) { EffectSeverity += amount; SyncEffectMods(); } } public void SetSeverity(int amount) { if (!((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null)) { EffectSeverity = ((amount >= 0) ? amount : 0); SyncEffectMods(); } } private void SyncEffectMods() { if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null || (Object)(object)((Card)((SpecialCardBehaviour)this).PlayableCard).Info == (Object)null) { return; } RemoveTemporaryEffectMod(); RemoveDisplayEffectMod(); if (EffectSeverity <= 0) { ((SpecialCardBehaviour)this).PlayableCard.OnStatsChanged(); ((Card)((SpecialCardBehaviour)this).PlayableCard).RenderCard(); return; } CardModificationInfo val = CreateEffectMod(); if (val != null && val.abilities != null && val.abilities.Count > 0) { ((SpecialCardBehaviour)this).PlayableCard.AddTemporaryMod(val); } CardModificationInfo val2 = CreateDisplayMod(); if (val2 != null && val2.abilities != null && val2.abilities.Count > 0) { ((Card)((SpecialCardBehaviour)this).PlayableCard).Info.Mods.Add(val2); } ((SpecialCardBehaviour)this).PlayableCard.OnStatsChanged(); ((Card)((SpecialCardBehaviour)this).PlayableCard).RenderCard(); } private void RemoveTemporaryEffectMod() { if (!((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null)) { CardModificationInfo val = ((SpecialCardBehaviour)this).PlayableCard.TemporaryMods.Find((CardModificationInfo x) => x != null && x.singletonId == CardModSingletonName); if (val != null) { ((SpecialCardBehaviour)this).PlayableCard.RemoveTemporaryMod(val, true); } } } private void RemoveDisplayEffectMod() { if ((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null || (Object)(object)((Card)((SpecialCardBehaviour)this).PlayableCard).Info == (Object)null) { return; } List<CardModificationInfo> list = ((Card)((SpecialCardBehaviour)this).PlayableCard).Info.Mods.FindAll((CardModificationInfo x) => x != null && x.singletonId == DisplayModSingletonName); if (list.Count == 0) { return; } foreach (CardModificationInfo item in list) { ((Card)((SpecialCardBehaviour)this).PlayableCard).Info.Mods.Remove(item); } } private CardModificationInfo CreateEffectMod() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected I4, but got Unknown CardModificationInfo val = new CardModificationInfo(); val.singletonId = CardModSingletonName; val.nonCopyable = true; AbilityInfo iconAbilityInfo = IconAbilityInfo; if ((Object)(object)iconAbilityInfo == (Object)null) { return val; } for (int i = 0; i < EffectSeverity; i++) { CardModificationInfoExtensions.AddAbilities(val, (Ability[])(object)new Ability[1] { (Ability)(int)iconAbilityInfo.ability }); } return val; } private CardModificationInfo CreateDisplayMod() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected I4, but got Unknown CardModificationInfo val = new CardModificationInfo(); val.singletonId = DisplayModSingletonName; val.nonCopyable = true; AbilityInfo iconAbilityInfo = IconAbilityInfo; if ((Object)(object)iconAbilityInfo == (Object)null) { return val; } for (int i = 0; i < EffectSeverity; i++) { CardModificationInfoExtensions.AddAbilities(val, (Ability[])(object)new Ability[1] { (Ability)(int)iconAbilityInfo.ability }); } return val; } public void ClearDisplayMod() { if (!((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null) && !((Object)(object)((Card)((SpecialCardBehaviour)this).PlayableCard).Info == (Object)null)) { RemoveDisplayEffectMod(); ((SpecialCardBehaviour)this).PlayableCard.OnStatsChanged(); ((Card)((SpecialCardBehaviour)this).PlayableCard).RenderCard(); } } public void ClearAllEffectMods() { if (!((Object)(object)((SpecialCardBehaviour)this).PlayableCard == (Object)null) && !((Object)(object)((Card)((SpecialCardBehaviour)this).PlayableCard).Info == (Object)null)) { RemoveTemporaryEffectMod(); RemoveDisplayEffectMod(); EffectSeverity = 0; ((SpecialCardBehaviour)this).PlayableCard.OnStatsChanged(); ((Card)((SpecialCardBehaviour)this).PlayableCard).RenderCard(); } } } public static class SmallSigilStatusEffectManager { public const string SmallSigilProperty = "OLD_SA_SmallSigil"; private static readonly Dictionary<Type, AbilityInfo> Effects = new Dictionary<Type, AbilityInfo>(); private static readonly Dictionary<Type, Texture> IconTextures = new Dictionary<Type, Texture>(); public static void Initialize(string pluginGuid) { if (Effects.Count <= 0) { Register<BurningStatusEffect>(pluginGuid, "Blaze", "Every 2 Blaze, the bearer takes 1 damage.", "OldSa_Blaze.png"); Register<PoisonStatusEffect>(pluginGuid, "Poison", "Every 4 Poison, the bearer dies.", "OldSa_Poison.png"); Register<GluttonyStatusEffect>(pluginGuid, "Gluttony", "Every 3 Gluttony, the bearer gains 1 Power and 1 Health. After triggering 3 times in a battle, the bearer dies.", "OldSa_Gluttony.png"); Register<BloodStatusEffect>(pluginGuid, "Blood", "Crimson everywhere, flesh growing wild.", "OldSa_Blood.png"); Register<SlowStatusEffect>(pluginGuid, "Slow", "Every 3 Slow, the bearer loses its attack this turn.", "OldSa_Slow.png"); Register<SpeedStatusEffect>(pluginGuid, "Speed", "For every 3 Speed, attacks once.", "OldSa_Speed.png"); } } private static void Register<T>(string pluginGuid, string rulebookName, string rulebookDescription, string iconFile) where T : SmallSigilStatusEffectBehaviour { Texture2D imageAsTexture = TextureHelper.GetImageAsTexture(iconFile, (FilterMode)0); if (!((Object)(object)imageAsTexture == (Object)null)) { IconTextures[typeof(T)] = (Texture)(object)imageAsTexture; AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = rulebookName; val.rulebookName = rulebookName; FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, rulebookDescription); } val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; AbilityExtensions.SetCanStack(val, true, false); AbilityExtensions.SetPassive(val, true); AbilityExtensions.SetExtendedProperty(val, "OLD_SA_SmallSigil", (object)true); FullAbility val2 = AbilityManager.Add(pluginGuid, val, typeof(T), (Texture)(object)imageAsTexture); if (val2 != null) { Effects[typeof(T)] = val2.Info; } } } public static AbilityInfo GetIconAbilityInfo(Type behaviourType) { if (behaviourType == null) { return null; } if (Effects.TryGetValue(behaviourType, out var value)) { return value; } return null; } public static Ability GetIconAbility(Type behaviourType) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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) AbilityInfo iconAbilityInfo = GetIconAbilityInfo(behaviourType); if ((Object)(object)iconAbilityInfo == (Object)null) { return (Ability)0; } return iconAbilityInfo.ability; } public static Texture GetIconTexture(Type behaviourType) { if (behaviourType == null) { return null; } if (IconTextures.TryGetValue(behaviourType, out var value)) { return value; } return null; } public static bool IsSmallSigilAbility(Ability ability) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) if ((int)ability == 0) { return false; } AbilityInfo info = AbilitiesUtil.GetInfo(ability); if ((Object)(object)info == (Object)null) { return false; } return AbilityExtensions.GetExtendedPropertyAsBool(info, "OLD_SA_SmallSigil") == true; } } public enum SmallSigilCategory { Buff, Debuff } public enum SmallSigilAttribute { None, Fire, Poison } public class SmallSigilTriggerBehaviour : TriggerReceiver { private PlayableCard Card => ((Component)this).GetComponent<PlayableCard>(); public override bool RespondsToTakeDamage(PlayableCard source) { return (Object)(object)Card != (Object)null && SmallSigilRuleManager.HasTriggeredEffect(Card); } public override IEnumerator OnTakeDamage(PlayableCard source) { if (!((Object)(object)Card == (Object)null)) { yield return SmallSigilRuleManager.Process(Card); } } public override bool RespondsToCardGettingAttacked(PlayableCard source) { return false; } public override IEnumerator OnCardGettingAttacked(PlayableCard card) { yield break; } public override bool RespondsToTurnEnd(bool playerTurnEnd) { return false; } public override IEnumerator OnTurnEnd(bool playerTurnEnd) { yield break; } public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { return false; } public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { yield break; } } public enum SmallSigilType { Burning, Poison, Gluttony, Blood, Slow, Speed } [HarmonyPatch(typeof(CombatPhaseManager), "SlotAttackSequence")] public static class SpeedAttackPatch { [HarmonyPrefix] [HarmonyPriority(800)] public static void Prefix(CardSlot slot) { if (!((Object)(object)slot == (Object)null) && !((Object)(object)slot.Card == (Object)null)) { PlayableCard card = slot.Card; int stacks = SmallSigilManager.GetStacks(card, SmallSigilType.Speed); int num = stacks / 3; if (num > 0) { SmallSigilManager.RemoveStacks(card, SmallSigilType.Speed, num * 3); ExtraAttackState.AddTemporary(card, num); } } } } public class SpeedSigilRule : SmallSigilRuleBase { public override SmallSigilType Type => SmallSigilType.Speed; public override Type BehaviourType => typeof(SpeedStatusEffect); public override int Threshold => 0; public override SmallSigilCategory Category => SmallSigilCategory.Buff; public override SmallSigilAttribute Attribute => SmallSigilAttribute.None; public override IEnumerator Effect(PlayableCard card) { yield break; } } public class SpeedStatusEffect : SmallSigilStatusEffectBehaviour { public override string CardModSingletonName => "OLD_SA_Speed"; }
Sigil/OldSa_Split_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Split_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Split_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7f10d55c-8f75-49ca-b611-866a7b867b52")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Split; [BepInPlugin("OLD_SA.Split", "OLD SA Split", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.Split"; public const string NAME = "OLD SA Split"; public const string VERSION = "1.0.0"; private void Awake() { SplitAPI.Init(); } } public static class SplitAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Split"; val.rulebookName = "Split"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Split.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] dies, place a Split card on its left and right. The Split card's stats are half of this card's."); } ability = AbilityManager.Add("OLD_SA", val, typeof(SplitBehaviour), imageAsTexture); } } public class SplitBehaviour : ExtendedAbilityBehaviour { private const string LEFT_PROPERTY = "Split_0"; private const string RIGHT_PROPERTY = "Split_1"; private const string DEFAULT_LEFT_CARD = "Skeleton"; private const string DEFAULT_RIGHT_CARD = "Skeleton"; public override Ability Ability => SplitAPI.ability.Id; public override bool RespondsToOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if ((Object)(object)card == (Object)null) { return false; } if (!fromCombat) { return false; } return (Object)(object)card == (Object)(object)((AbilityBehaviour)this).Card; } public override IEnumerator OnOtherCardDie(PlayableCard card, CardSlot deathSlot, bool fromCombat, PlayableCard killer) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)card == (Object)null || (Object)(object)card != (Object)(object)((AbilityBehaviour)this).Card || !fromCombat) { yield break; } int originalAttack = card.Attack; int originalMaxHealth = ((Card)card).Info.Health; int splitAttack = Mathf.Max(0, Mathf.FloorToInt((float)originalAttack / 2f)); int splitHealth = Mathf.Max(1, Mathf.FloorToInt((float)originalMaxHealth / 2f)); string leftCardName = CardExtensions.GetExtendedProperty(((Card)card).Info, "Split_0"); if (string.IsNullOrEmpty(leftCardName)) { leftCardName = "Skeleton"; } string rightCardName = CardExtensions.GetExtendedProperty(((Card)card).Info, "Split_1"); if (string.IsNullOrEmpty(rightCardName)) { rightCardName = "Skeleton"; } BoardManager board = Singleton<BoardManager>.Instance; if (!((Object)(object)board == (Object)null)) { CardSlot leftSlot = GetLeftSplitSlot(board, deathSlot, card.OpponentCard); CardSlot rightSlot = GetRightSplitSlot(board, deathSlot, card.OpponentCard); yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)leftSlot != (Object)null && (Object)(object)leftSlot.Card == (Object)null) { yield return SpawnSplitCard(leftCardName, leftSlot, splitAttack, splitHealth); } if ((Object)(object)rightSlot != (Object)null && (Object)(object)rightSlot.Card == (Object)null) { yield return SpawnSplitCard(rightCardName, rightSlot, splitAttack, splitHealth); } yield return ((AbilityBehaviour)this).LearnAbility(0.5f); } } private CardSlot GetLeftSplitSlot(BoardManager board, CardSlot deathSlot, bool opponentCard) { if ((Object)(object)board == (Object)null || (Object)(object)deathSlot == (Object)null) { return null; } CardSlot adjacent = board.GetAdjacent(deathSlot, true); if ((Object)(object)adjacent != (Object)null) { return adjacent; } List<CardSlot> list = (opponentCard ? board.OpponentSlotsCopy : board.PlayerSlotsCopy); if (list == null || list.Count == 0) { return null; } return list[list.Count - 1]; } private CardSlot GetRightSplitSlot(BoardManager board, CardSlot deathSlot, bool opponentCard) { if ((Object)(object)board == (Object)null || (Object)(object)deathSlot == (Object)null) { return null; } CardSlot adjacent = board.GetAdjacent(deathSlot, false); if ((Object)(object)adjacent != (Object)null) { return adjacent; } List<CardSlot> list = (opponentCard ? board.OpponentSlotsCopy : board.PlayerSlotsCopy); if (list == null || list.Count == 0) { return null; } return list[0]; } private IEnumerator SpawnSplitCard(string cardName, CardSlot targetSlot, int attack, int health) { if (string.IsNullOrEmpty(cardName) || (Object)(object)targetSlot == (Object)null || (Object)(object)targetSlot.Card != (Object)null) { yield break; } CardInfo splitInfo = CardLoader.GetCardByName(cardName); if ((Object)(object)splitInfo == (Object)null) { yield break; } object obj = splitInfo.Clone(); splitInfo = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)splitInfo == (Object)null) { yield break; } PlayableCard splitCard = CardSpawner.SpawnPlayableCardWithCopiedMods(splitInfo, ((AbilityBehaviour)this).Card, SplitAPI.ability.Id); if ((Object)(object)splitCard == (Object)null) { yield break; } CardModificationInfo splitStatMod = new CardModificationInfo(); splitStatMod.attackAdjustment = attack - splitCard.Attack; splitStatMod.healthAdjustment = health - ((Card)splitCard).Info.Health; splitCard.AddTemporaryMod(splitStatMod); ((Card)splitCard).RenderCard(); ((Component)splitCard).transform.position = ((Component)targetSlot).transform.position + Vector3.back * 2f + Vector3.up * 2f; ((Component)splitCard).transform.rotation = Quaternion.Euler(110f, 90f, 90f); BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } if ((Object)(object)targetSlot.Card != (Object)null) { if ((Object)(object)splitCard != (Object)null) { Object.Destroy((Object)(object)((Component)splitCard).gameObject); } yield break; } yield return board.ResolveCardOnBoard(splitCard, targetSlot, 0.1f, (Action)null, true); if ((Object)(object)splitCard != (Object)null && (Object)(object)splitCard.Slot != (Object)null && (Object)(object)((Card)splitCard).Anim != (Object)null) { ((Card)splitCard).Anim.StrongNegationEffect(); } } }
Sigil/OldSa_Strafe Strike_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Combat; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Strafe Strike_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Strafe Strike_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a396b6fd-2b3b-4ced-aca0-69ad30118ef9")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.StrafeStrike; [BepInPlugin("OLD_SA.StrafeStrike", "OLD SA Strafe Strike", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.StrafeStrike"); StrafeStrikeAPI.Init(); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Strafe Strike Loaded"); } } public static class StrafeStrikeAPI { public static FullAbility ability; public static void Init() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Strafe Strike"; val.rulebookName = "Strafe Strike"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 4; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Strafe_Strike.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Strafe_Strike_px.png", (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); } FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "After [creature] moves, it attacks."); } ability = AbilityManager.Add("OLD_SA", val, typeof(StrafeStrikeBehaviour), imageAsTexture); } } public class StrafeStrikeBehaviour : AbilityBehaviour { private CardSlot lastSlot; public override Ability Ability => StrafeStrikeAPI.ability.Id; public override bool RespondsToResolveOnBoard() { return (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead && (Object)(object)((AbilityBehaviour)this).Card.Slot != (Object)null; } public override IEnumerator OnResolveOnBoard() { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null)) { lastSlot = ((AbilityBehaviour)this).Card.Slot; } yield break; } public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead) { return false; } if ((Object)(object)otherCard == (Object)null || otherCard.Dead) { return false; } if ((Object)(object)otherCard != (Object)(object)((AbilityBehaviour)this).Card) { return false; } if ((Object)(object)lastSlot == (Object)null) { return false; } if ((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)(object)lastSlot) { return false; } return true; } public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null || (Object)(object)otherCard == (Object)null || (Object)(object)otherCard != (Object)(object)((AbilityBehaviour)this).Card || otherCard.Dead) { yield break; } CardSlot attackingSlot = ((AbilityBehaviour)this).Card.Slot; if ((Object)(object)lastSlot == (Object)null || (Object)(object)attackingSlot == (Object)(object)lastSlot) { yield break; } lastSlot = attackingSlot; yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead && !((Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null)) { attackingSlot = ((AbilityBehaviour)this).Card.Slot; if ((Object)(object)attackingSlot.opposingSlot != (Object)null) { yield return CustomAttackResolver.RequestAttack(attackingSlot, attackingSlot.opposingSlot); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } }
Sigil/OldSa_Sweep_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Sweep; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Sweep_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Sweep_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("03d52a77-6a08-49a6-b9f9-13e4baedbd73")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Sweep { public static class SweepAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Sweep"; val.rulebookName = "Sweep"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Sweep.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] attacks, it deals 1 damage to all enemy creatures."); } ability = AbilityManager.Add("OLD_SA", val, typeof(SweepBehaviour), imageAsTexture); } } public class SweepBehaviour : AbilityBehaviour { public override Ability Ability => SweepAPI.ability.Id; } [HarmonyPatch(typeof(PlayableCard), "GetOpposingSlots")] public static class SweepTargetPatch { public static void Postfix(PlayableCard __instance, ref List<CardSlot> __result) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || !__instance.HasAbility(SweepAPI.ability.Id)) { return; } BoardManager instance = Singleton<BoardManager>.Instance; if ((Object)(object)instance == (Object)null) { return; } List<CardSlot> list = (__instance.OpponentCard ? instance.PlayerSlotsCopy : instance.OpponentSlotsCopy); List<CardSlot> list2 = new List<CardSlot>(); foreach (CardSlot item in list) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Card == (Object)null) && !item.Card.Dead) { list2.Add(item); } } if (list2.Count > 0) { __result = list2; } } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public static class SweepDamagePatch { public static void Prefix(PlayableCard __instance, ref int damage, PlayableCard attacker) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)attacker == (Object)null) && attacker.HasAbility(SweepAPI.ability.Id)) { damage = 1; } } } } namespace OLD_SA_Sweep { [BepInPlugin("OLD_SA.Sweep", "OLD SA Sweep", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.Sweep"; public const string NAME = "OLD SA Sweep"; public const string VERSION = "1.0.0"; private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SweepAPI.Init(); Harmony val = new Harmony("OLD_SA.Sweep"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Sweep loaded."); } } }
Sigil/OldSa_Tempest_sigil.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Tempest_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Tempest_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("209b2d3a-a1fc-4e1d-8a4e-a627b05cec58")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Tempest; [BepInPlugin("OLD_SA.Tempest", "OLD SA Tempest", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown TempestAPI.Init(); Harmony val = new Harmony("OLD_SA.Tempest"); val.PatchAll(); } } public class TempestAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Tempest"; val.rulebookName = "Tempest"; val.powerLevel = 4; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("OldSa_Tempest.png", (FilterMode)0); ability = AbilityManager.Add("OLD_SA", val, typeof(TempestBehaviour), (Texture)(object)imageAsTexture); val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)7 }; FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "For each flying ally, [creature] attacks an additional time."); } } } public class TempestBehaviour : ExtendedAbilityBehaviour { public static Ability ability; public override Ability Ability => ability; public override bool RespondsToGetOpposingSlots() { return true; } public override List<CardSlot> GetOpposingSlots(List<CardSlot> originalSlots, List<CardSlot> otherAddedSlots) { List<CardSlot> list = new List<CardSlot>(); int num = CountFriendlyAirborne(); for (int i = 0; i < num; i++) { CardSlot val = CardExtensions.OpposingSlot(((AbilityBehaviour)this).Card); if ((Object)(object)val != (Object)null) { list.Add(val); } } return list; } private int CountFriendlyAirborne() { int num = 0; foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(((AbilityBehaviour)this).Card.Slot.IsPlayerSlot)) { if ((Object)(object)slot.Card != (Object)null && HasAirborne(slot.Card)) { num++; } } return num; } private bool HasAirborne(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } return card.HasAbility((Ability)19); } }
Sigil/OldSa_Vampire_sigil.dll
Decompiled 20 hours agousing System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Vampire; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Vampire_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Vampire_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e01b4fe2-5b05-4f2d-a419-dadef7ab74f6")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Vampire { public static class VampireAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Vampire"; val.rulebookName = "Vampire"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Vampire.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] deals damage, it heals 1 damage."); } ability = AbilityManager.Add("OLD_SA", val, typeof(VampireBehaviour), imageAsTexture); } } public class VampireBehaviour : AbilityBehaviour { public override Ability Ability => VampireAPI.ability.Id; public override bool RespondsToDealDamage(int amount, PlayableCard target) { return amount >= 1 && (Object)(object)((AbilityBehaviour)this).Card != (Object)null && !((AbilityBehaviour)this).Card.Dead && ((AbilityBehaviour)this).Card.OnBoard; } public override IEnumerator OnDealDamage(int amount, PlayableCard target) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.Dead) { int missingHealth = ((AbilityBehaviour)this).Card.MaxHealth - ((AbilityBehaviour)this).Card.Health; if (missingHealth > 0) { ((AbilityBehaviour)this).Card.HealDamage(1); ((Card)((AbilityBehaviour)this).Card).RenderCard(); } yield return ((AbilityBehaviour)this).LearnAbility(0.25f); } } } } namespace OLD_SA_Vampire { [BepInPlugin("OLD_SA.Vampire", "OLD SA Vampire", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string GUID = "OLD_SA.Vampire"; public const string NAME = "OLD SA Vampire"; public const string VERSION = "1.0.0"; private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown VampireAPI.Init(); Harmony val = new Harmony("OLD_SA.Vampire"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Vampire loaded."); } } }
Sigil/OldSa_Wind's Blessing_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Blessing; using OLD_SA.Dialogue; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Wind's Blessing_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Wind's Blessing_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3c5c93e4-53b2-4569-b21f-e6bb56856b02")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.WindsBlessing; [BepInPlugin("OLD_SA.WindsBlessing", "OLD SA Wind's Blessing", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Wind's Blessing Loaded"); WindBlessingAPI.Init(); WindBlessingAudio.Init(); Harmony val = new Harmony("OLD_SA.WindsBlessing"); val.PatchAll(); } } public class WindBlessingAPI { public static FullAbility ability; public static void Init() { AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "WindsBlessing"; val.rulebookName = "Wind's Blessing"; val.powerLevel = 5; Texture2D imageAsTexture = TextureHelper.GetImageAsTexture("OldSa_Winds_Blessing.png", (FilterMode)0); ability = AbilityManager.Add("OLD_SA", val, typeof(WindBlessingBehaviour), (Texture)(object)imageAsTexture); val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "At the start of the turn, [creature] grants Wind Blessing to itself and adjacent creatures."); } } } public static class WindBlessingAssets { public static Sprite LoadSprite(string name) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Texture2D imageAsTexture = TextureHelper.GetImageAsTexture(name, (FilterMode)0); if ((Object)(object)imageAsTexture == (Object)null) { Debug.Log((object)("Missing artwork: " + name)); return null; } return Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); } } public static class WindBlessingAudio { private static AudioClip windSound; private static AudioClip pterosaurRoar; public static void Init() { Debug.Log((object)"Loading Wind Blessing Audio..."); windSound = LoadAudio("old_sa_wind.wav"); pterosaurRoar = LoadAudio("old_sa_pterosaur_roar.wav"); Debug.Log((object)("Wind sound = " + (object)windSound)); Debug.Log((object)("Pterosaur roar = " + (object)pterosaurRoar)); } public static void PlayWind(Vector3 position) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Playing wind sound"); if ((Object)(object)windSound == (Object)null) { Debug.Log((object)"Wind sound missing"); } else { PlayClip(windSound, position); } } public static void PlayPterosaurRoar(Vector3 position) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Playing pterosaur roar"); if ((Object)(object)pterosaurRoar == (Object)null) { Debug.Log((object)"Pterosaur roar missing"); } else { PlayClip(pterosaurRoar, position); } } private static void PlayClip(AudioClip clip, Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("WindBlessingAudio"); val.transform.position = position; AudioSource val2 = val.AddComponent<AudioSource>(); val2.clip = clip; val2.volume = 1f; Debug.Log((object)("Audio length:" + clip.length)); val2.spatialBlend = 0f; val2.Play(); Object.Destroy((Object)(object)val, clip.length + 0.2f); } private static AudioClip LoadAudio(string fileName) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown Debug.Log((object)("LoadAudio called: " + fileName)); string text = Path.Combine(Path.GetDirectoryName(typeof(WindBlessingAudio).Assembly.Location), "Audio", fileName); if (!File.Exists(text)) { Debug.Log((object)("Missing audio: " + text)); return null; } WWW val = new WWW("file:///" + text); while (!val.isDone) { } if (!string.IsNullOrEmpty(val.error)) { Debug.Log((object)("Audio load error: " + val.error)); return null; } AudioClip audioClip = val.GetAudioClip(false, false); if ((Object)(object)audioClip == (Object)null) { Debug.Log((object)("AudioClip creation failed: " + fileName)); return null; } Debug.Log((object)("Loaded audio " + fileName + " length=" + audioClip.length)); return audioClip; } } public class WindBlessingBehaviour : AbilityBehaviour { private bool windBlessingTriggered; public override Ability Ability => WindBlessingAPI.ability.Id; public override bool RespondsToUpkeep(bool playerUpkeep) { return playerUpkeep; } public override IEnumerator OnUpkeep(bool playerUpkeep) { windBlessingTriggered = true; yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); if (ShouldUseWindPortrait()) { yield return WindBlessingPterosaurPortraitSwitch.SwitchToStage1(((AbilityBehaviour)this).Card); } CardSlot leftSlot = GetAdjacentSlot(-1); if ((Object)(object)leftSlot != (Object)null && (Object)(object)leftSlot.Card != (Object)null) { yield return TriggerWindBlessing(leftSlot.Card); } yield return (object)new WaitForSeconds(0.15f); if (ShouldUseWindPortrait()) { yield return WindBlessingPterosaurPortraitSwitch.SwitchToStage2(((AbilityBehaviour)this).Card); } CardSlot rightSlot = GetAdjacentSlot(1); if ((Object)(object)rightSlot != (Object)null && (Object)(object)rightSlot.Card != (Object)null) { yield return TriggerWindBlessing(rightSlot.Card); } yield return (object)new WaitForSeconds(0.25f); yield return TriggerSelfWindBlessing(); yield return SigilDialogueAPI.ShowFirstTime("WindBlessing", "It spreads its wings, sending creatures soaring into the sky.", ((AbilityBehaviour)this).Card); while (WindBlessingEffect.ActiveWindIcons > 0) { yield return null; } Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false); } private IEnumerator TriggerWindBlessing(PlayableCard target) { if (!((Object)(object)target == (Object)null) && !target.HasAbility((Ability)19)) { yield return WindBlessingEffect.Play(target); yield return GiveWindBlessing(target); } } private IEnumerator TriggerSelfWindBlessing() { if (!((Object)(object)((AbilityBehaviour)this).Card == (Object)null) && !((AbilityBehaviour)this).Card.HasAbility((Ability)19)) { if (ShouldUseWindPortrait()) { yield return WindBlessingPterosaurPortraitSwitch.SwitchToStage3(((AbilityBehaviour)this).Card); } yield return WindBlessingEffect.Play(((AbilityBehaviour)this).Card, selfCast: true); yield return GiveWindBlessing(((AbilityBehaviour)this).Card); } } private bool ShouldUseWindPortrait() { return windBlessingTriggered && (Object)(object)((AbilityBehaviour)this).Card != (Object)null && (Object)(object)((Card)((AbilityBehaviour)this).Card).Info != (Object)null && ((Object)((Card)((AbilityBehaviour)this).Card).Info).name == "OLD_SA_WIND_PTEROSAUR"; } private CardSlot GetAdjacentSlot(int offset) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || (Object)(object)((AbilityBehaviour)this).Card.Slot == (Object)null) { return null; } CardSlot slot = ((AbilityBehaviour)this).Card.Slot; int num = slot.Index + offset; List<CardSlot> slots = Singleton<BoardManager>.Instance.GetSlots(slot.IsPlayerSlot); if (num < 0 || num >= slots.Count) { return null; } return slots[num]; } private IEnumerator GiveWindBlessing(PlayableCard target) { if (!((Object)(object)target == (Object)null) && !target.HasAbility((Ability)19) && !WindBlessingRuntime.HasWind(target)) { WindBlessingRuntime.Add(target); target.UpdateFaceUpOnBoardEffects(); ((Card)target).RenderCard(); } yield break; } } public static class WindBlessingEffect { private const string PTEROSAUR_CARD = "OLD_SA_WIND_PTEROSAUR"; public static int ActiveWindIcons; public static IEnumerator Play(PlayableCard card, bool selfCast = false) { if (!((Object)(object)card == (Object)null)) { Debug.Log((object)("Wind Blessing effect on " + ((Object)((Card)card).Info).name)); ((Card)card).Anim.PlayTransformAnimation(); WindBlessingWindIcon.Spawn(card); if (selfCast && ((Object)((Card)card).Info).name == "OLD_SA_WIND_PTEROSAUR") { WindBlessingAudio.PlayPterosaurRoar(((Component)card).transform.position); } else { WindBlessingAudio.PlayWind(((Component)card).transform.position); } } yield break; } } public static class WindBlessingFlyingManager { public static HashSet<PlayableCard> AddingWindFlying = new HashSet<PlayableCard>(); public static bool IsAddingWindFlying(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } return AddingWindFlying.Contains(card); } public static void ClearAdding() { AddingWindFlying.Clear(); } } public static class WindBlessingPterosaurPortraitSwitch { private const string PTEROSAUR_CARD = "OLD_SA_WIND_PTEROSAUR"; public static IEnumerator SwitchToStage1(PlayableCard card, bool allowEmission = false) { yield return SwitchPortrait(card, 1, allowEmission); } public static IEnumerator SwitchToStage2(PlayableCard card, bool allowEmission = false) { yield return SwitchPortrait(card, 2, allowEmission); } public static IEnumerator SwitchToStage3(PlayableCard card, bool allowEmission = false) { yield return SwitchPortrait(card, 3, allowEmission); } private static IEnumerator SwitchPortrait(PlayableCard card, int stage, bool allowEmission) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null || ((Object)((Card)card).Info).name != "OLD_SA_WIND_PTEROSAUR") { yield break; } string portraitName = null; switch (stage) { case 1: portraitName = "OLD_SA_WIND_PTEROSAUR_1"; break; case 2: portraitName = "OLD_SA_WIND_PTEROSAUR_2"; break; case 3: portraitName = "OLD_SA_WIND_PTEROSAUR_3"; break; } if (portraitName != null) { Sprite portrait = LoadPortrait(portraitName); if ((Object)(object)portrait != (Object)null) { card.SwitchToPortrait(portrait); ((Card)card).RenderInfo.forceEmissivePortrait = allowEmission && HasEmission(portraitName); ((Card)card).RenderCard(); } } } public static IEnumerator ResetPortrait(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null) && !(((Object)((Card)card).Info).name != "OLD_SA_WIND_PTEROSAUR")) { Sprite normalPortrait = LoadPortrait("OLD_SA_WIND_PTEROSAUR"); if ((Object)(object)normalPortrait != (Object)null) { ((Card)card).RenderInfo.forceEmissivePortrait = false; ((Card)card).RenderInfo.portraitOverride = null; card.SwitchToPortrait(normalPortrait); ((Card)card).RenderCard(); } } yield break; } private static Sprite LoadPortrait(string name) { //IL_0051: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Texture2D imageAsTexture = TextureHelper.GetImageAsTexture(name + ".png", (FilterMode)0); if ((Object)(object)imageAsTexture == (Object)null) { Debug.Log((object)("Missing portrait: " + name)); return null; } Sprite val = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); ((Object)val).name = name; Texture2D val2 = null; try { val2 = TextureHelper.GetImageAsTexture(name + "_emission.png", (FilterMode)0); } catch { } if ((Object)(object)val2 != (Object)null) { Sprite val3 = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); ((Object)val3).name = name + "_emission"; TextureHelper.RegisterEmissionForSprite(val, val3); } return val; } private static bool HasEmission(string name) { Texture2D val = null; try { val = TextureHelper.GetImageAsTexture(name + "_emission.png", (FilterMode)0); } catch { } return (Object)(object)val != (Object)null; } } public static class WindBlessingWindIcon { public static void Spawn(PlayableCard card) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)card == (Object)null)) { Sprite val = WindBlessingAssets.LoadSprite("WindIcon.png"); if ((Object)(object)val == (Object)null) { Debug.Log((object)"Missing WindIcon"); return; } GameObject val2 = new GameObject("WindBlessingIcon"); val2.transform.position = ((Component)card).transform.position + new Vector3(0f, 0.8f, 0f); val2.transform.rotation = Quaternion.Euler(90f, 0f, 0f); SpriteRenderer val3 = val2.AddComponent<SpriteRenderer>(); val3.sprite = val; ((Renderer)val3).sortingOrder = 999; WindBlessingEffect.ActiveWindIcons++; WindIconRotation windIconRotation = val2.AddComponent<WindIconRotation>(); windIconRotation.StartAnimation(); } } } public class WindIconRotation : MonoBehaviour { private float duration = 1.2f; private float timer = 0f; private float startSpeed = 720f; private SpriteRenderer renderer; private Vector3 startScale = new Vector3(0.2f, 0.2f, 0.2f); private Vector3 normalScale = Vector3.one; public void StartAnimation() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) timer = 0f; renderer = ((Component)this).GetComponent<SpriteRenderer>(); ((Component)this).transform.localScale = startScale; } private void Update() { //IL_008d: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) timer += Time.deltaTime; float num = Mathf.Clamp01(timer / duration); if (num < 0.15f) { float num2 = num / 0.15f; ((Component)this).transform.localScale = Vector3.Lerp(startScale, normalScale, Mathf.Sin(num2 * (float)Math.PI * 0.5f)); } float num3 = Mathf.Lerp(startSpeed, 0f, Mathf.Pow(num, 2.5f)); ((Component)this).transform.Rotate(Vector3.forward, num3 * Time.deltaTime); if (num > 0.8f) { float num4 = (num - 0.8f) / 0.2f; float num5 = Mathf.Lerp(1f, 0f, num4); ((Component)this).transform.localScale = new Vector3(num5, num5, num5); if ((Object)(object)renderer != (Object)null) { Color color = renderer.color; color.a = Mathf.Lerp(1f, 0f, num4); renderer.color = color; } } if (timer >= duration) { WindBlessingEffect.ActiveWindIcons--; Object.Destroy((Object)(object)((Component)this).gameObject); } } }
Sigil/OldSa_WolfAndJackal_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.WolfJackal; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_WolfAndJackal_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_WolfAndJackal_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("52f11cb7-74f6-4ad0-8434-d2213aa3d57a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] public static class WolfAndJackalActivatedAPI { public static bool HasWolfAndWarg(PlayableCard card) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)card == (Object)null) { return false; } foreach (Ability ability in ((Card)card).Info.Abilities) { if (ability == WolfAndJackalAPI.ability.Id) { return true; } } return false; } } namespace OLD_SA.WolfJackal; [BepInPlugin("OLD_SA.WolfJackal", "OLD SA WolfJackal", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown WolfAndJackalAPI.Init(); Harmony val = new Harmony("OLD_SA.WolfJackal"); val.PatchAll(); Debug.Log((object)"OLD SA WolfJackal Loaded"); } } [HarmonyPatch] public static class WolfAndJackalActivatedEffectPatch { private static bool Copying; private static IEnumerable<MethodBase> TargetMethods() { Type[] types = typeof(ActivatedAbilityBehaviour).Assembly.GetTypes(); foreach (Type type in types) { if (type.IsSubclassOf(typeof(ActivatedAbilityBehaviour))) { MethodInfo method = type.GetMethod("Activate", BindingFlags.Instance | BindingFlags.NonPublic); if (method != null) { yield return method; } } } } [HarmonyPostfix] public static IEnumerator Postfix(IEnumerator result, ActivatedAbilityBehaviour __instance) { yield return result; if (Copying || (Object)(object)__instance == (Object)null) { yield break; } PlayableCard card = ((Component)__instance).GetComponent<PlayableCard>(); if (!((Object)(object)card == (Object)null) && WolfAndJackalTriggerAPI.HasWolfAndWarg(card)) { Copying = true; MethodInfo activate = ((object)__instance).GetType().GetMethod("Activate", BindingFlags.Instance | BindingFlags.NonPublic); if (activate != null && activate.Invoke(__instance, null) is IEnumerator second) { yield return second; } Copying = false; } } } public static class WolfAndJackalAPI { public static FullAbility ability; public unsafe static void Init() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "WolfAndWarg"; val.rulebookName = "Wolf and Warg"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0 }; val.powerLevel = 5; val.opponentUsable = false; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_WolfAndWarg.png", (FilterMode)0); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When another sigil on [creature] triggers, it triggers an additional time."); } ability = AbilityManager.Add("OLD_SA", val, typeof(WolfAndJackalBehaviour), imageAsTexture); Ability id = ability.Id; Debug.Log((object)("WolfAndWarg registered ID=" + ((object)(*(Ability*)(&id))/*cast due to .constrained prefix*/).ToString())); } } [HarmonyPatch(typeof(PlayableCard), "GetOpposingSlots")] public static class WolfAndJackalAttackPatch { private static Dictionary<PlayableCard, bool> Processing = new Dictionary<PlayableCard, bool>(); [HarmonyPostfix] public static void Postfix(PlayableCard __instance, ref List<CardSlot> __result) { if ((Object)(object)__instance == (Object)null || __result == null || !__instance.OnBoard || !HasWolf(__instance) || (Processing.ContainsKey(__instance) && Processing[__instance])) { return; } Processing[__instance] = true; try { if (__instance.HasAbility((Ability)100)) { CardSlot opposingSlot = __instance.Slot.opposingSlot; if ((Object)(object)opposingSlot != (Object)null) { __result.Add(opposingSlot); } } if (__instance.HasAbility((Ability)24)) { List<CardSlot> adjacentSlots = Singleton<BoardManager>.Instance.GetAdjacentSlots(__instance.Slot.opposingSlot); if (adjacentSlots != null) { foreach (CardSlot item in adjacentSlots) { if (!((Object)(object)item == (Object)null)) { __result.Add(item); } } } } if (!__instance.HasTriStrike()) { return; } List<CardSlot> list = new List<CardSlot>(); CardSlot opposingSlot2 = __instance.Slot.opposingSlot; if ((Object)(object)opposingSlot2 != (Object)null) { list.Add(opposingSlot2); } List<CardSlot> adjacentSlots2 = Singleton<BoardManager>.Instance.GetAdjacentSlots(opposingSlot2); if (adjacentSlots2 != null) { foreach (CardSlot item2 in adjacentSlots2) { if (!((Object)(object)item2 == (Object)null)) { list.Add(item2); } } } list.Sort((CardSlot a, CardSlot b) => a.Index - b.Index); foreach (CardSlot item3 in list) { __result.Add(item3); } } finally { Processing.Remove(__instance); } } public static bool HasWolf(PlayableCard card) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return false; } foreach (Ability ability in ((Card)card).Info.Abilities) { if (ability == WolfAndJackalAPI.ability.Id) { return true; } } return false; } } public class WolfAndJackalBehaviour : AbilityBehaviour { public override Ability Ability => WolfAndJackalAPI.ability.Id; } [HarmonyPatch(typeof(PlayableCard), "GetPassiveAttackBuffs")] public static class WolfAndJackalPassiveBuffPatch { [HarmonyPostfix] public static void Postfix(PlayableCard __instance, ref int __result) { if ((Object)(object)__instance == (Object)null || !__instance.OnBoard) { return; } int num = 0; foreach (CardSlot adjacentSlot in Singleton<BoardManager>.Instance.GetAdjacentSlots(__instance.Slot)) { if (!((Object)(object)adjacentSlot.Card == (Object)null) && adjacentSlot.Card.HasAbility((Ability)34) && WolfAndJackalTriggerAPI.HasWolfAndWarg(adjacentSlot.Card)) { num++; } } CardSlot opposingSlot = __instance.Slot.opposingSlot; if ((Object)(object)opposingSlot != (Object)null && (Object)(object)opposingSlot.Card != (Object)null) { PlayableCard card = opposingSlot.Card; if (card.HasAbility((Ability)76) && WolfAndJackalTriggerAPI.HasWolfAndWarg(card)) { num++; } if (card.HasAbility((Ability)83) && WolfAndJackalTriggerAPI.HasWolfAndWarg(card) && !__instance.HasAbility((Ability)105)) { num--; } } if (num != 0) { __result += num; } } } [HarmonyPatch(typeof(CardTriggerHandler), "OnTrigger")] public static class WolfAndJackalPatch { private static bool repeating; [HarmonyPostfix] public static IEnumerator Postfix(IEnumerator result, CardTriggerHandler __instance, Trigger trigger, object[] otherArgs) { //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 result; if (repeating) { yield break; } PlayableCard card = ((Component)__instance).GetComponent<PlayableCard>(); if ((Object)(object)card == (Object)null || WolfAndJackalAPI.ability == null) { yield break; } AbilityBehaviour[] realAbilities = ((Component)card).GetComponents<AbilityBehaviour>(); AbilityBehaviour[] array = realAbilities; for (int i = 0; i < array.Length; i++) { _ = array[i]; } bool hasWolfAndWarg = false; AbilityBehaviour[] array2 = realAbilities; foreach (AbilityBehaviour realAbility in array2) { if (realAbility.Ability == WolfAndJackalAPI.ability.Id) { hasWolfAndWarg = true; break; } } if (!hasWolfAndWarg || (int)trigger == 18) { yield break; } List<TriggerReceiver> receivers = GetReceivers(__instance); if (receivers == null) { yield break; } repeating = true; foreach (TriggerReceiver receiver in receivers) { if (!((Object)(object)receiver == (Object)null)) { AbilityBehaviour ability = (AbilityBehaviour)(object)((receiver is AbilityBehaviour) ? receiver : null); if (!((Object)(object)ability == (Object)null) && ability.Ability != WolfAndJackalAPI.ability.Id && GlobalTriggerHandler.ReceiverRespondsToTrigger(trigger, receiver, otherArgs)) { yield return Singleton<GlobalTriggerHandler>.Instance.TriggerSequence(trigger, receiver, otherArgs); } } } repeating = false; } private static List<TriggerReceiver> GetReceivers(CardTriggerHandler handler) { MethodInfo method = typeof(CardTriggerHandler).GetMethod("GetAllReceivers", BindingFlags.Instance | BindingFlags.NonPublic); if (method == null) { return null; } return method.Invoke(handler, null) as List<TriggerReceiver>; } } public static class WolfAndJackalTriggerAPI { public static bool HasWolfAndWarg(PlayableCard card) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)card == (Object)null) { return false; } if (WolfAndJackalAPI.ability == null) { return false; } foreach (Ability ability in ((Card)card).Info.Abilities) { if (ability == WolfAndJackalAPI.ability.Id) { return true; } } return false; } public static int GetPassiveMultiplier(PlayableCard card) { return (!HasWolfAndWarg(card)) ? 1 : 2; } }
Sigil/OldSa_Writhe_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Writhe_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Writhe_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3560dc46-299b-4da7-9e0a-7b7619f5384f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Writhe; [BepInPlugin("OLD_SA.Writhe", "OLD SA Writhe", "1.0.0")] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"OLD SA Writhe loading..."); WritheAPI.Init(); Harmony val = new Harmony("OLD_SA.Writhe"); val.PatchAll(); Log.LogInfo((object)"OLD SA Writhe loaded."); } } public static class WritheAPI { public static FullAbility ability; public static void Init() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Writhe"; val.rulebookName = "Writhe"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 3; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Writhe.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Writhe_px.png", (FilterMode)0); val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] would take lethal damage, it survives with 1 health and loses attack equal to the excess damage. If its attack is 0, it dies."); } ability = AbilityManager.Add("OLD_SA", val, typeof(WritheBehaviour), imageAsTexture); } } public class WritheBehaviour : AbilityBehaviour { public override Ability Ability => WritheAPI.ability.Id; } [HarmonyPatch] public static class WrithePatch { private static MethodBase TargetMethod() { return AccessTools.Method(typeof(PlayableCard), "TakeDamage", new Type[2] { typeof(int), typeof(PlayableCard) }, (Type[])null); } [HarmonyPrefix] public static bool Prefix(PlayableCard __instance, int damage, PlayableCard attacker, ref IEnumerator __result) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return true; } if (!__instance.HasAbility(WritheAPI.ability.Id) || __instance.Dead || damage <= 0) { return true; } int health = __instance.Health; int num = Mathf.Max(0, __instance.Attack); if (damage < health) { return true; } int num2 = Mathf.Max(0, health - 1); int num3 = damage - num2; if (num3 > num) { return true; } __result = WritheTakeDamageSequence(__instance, num2, num3, damage, attacker); return false; } private static IEnumerator WritheTakeDamageSequence(PlayableCard card, int healthDamage, int overflow, int originalDamage, PlayableCard attacker) { if ((Object)(object)card == (Object)null || card.Dead) { yield break; } AbilityBehaviour writhe = (AbilityBehaviour)(object)((Component)card).GetComponent<WritheBehaviour>(); MethodInfo preTriggerMethod = AccessTools.Method(typeof(AbilityBehaviour), "PreSuccessfulTriggerSequence", (Type[])null, (Type[])null); if ((Object)(object)writhe != (Object)null && preTriggerMethod != null && preTriggerMethod.Invoke(writhe, null) is IEnumerator sequence) { yield return sequence; } if ((Object)(object)card == (Object)null || card.Dead) { yield break; } if (healthDamage > 0) { PlayableCardStatus status = card.Status; status.damageTaken += healthDamage; } if ((Object)(object)((Card)card).Anim != (Object)null && card.Health > 0) { ((Card)card).Anim.PlayHitAnimation(); } if (overflow > 0) { CardModificationInfo attackLoss = new CardModificationInfo { attackAdjustment = -overflow }; card.AddTemporaryMod(attackLoss); } card.OnStatsChanged(); ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); if ((Object)(object)attacker != (Object)null) { if (attacker.TriggerHandler.RespondsToTrigger((Trigger)9, new object[2] { originalDamage, card })) { yield return attacker.TriggerHandler.OnTrigger((Trigger)9, new object[2] { originalDamage, card }); } yield return Singleton<GlobalTriggerHandler>.Instance.TriggerCardsOnBoard((Trigger)19, false, new object[3] { attacker, attacker.Attack, card }); } } }
Sigil/Old_Sa_Proliferation_sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Old_Sa_Proliferation_sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Old_Sa_Proliferation_sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f19e4650-e4a0-498d-b995-1a4fc3ab031c")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Proliferation; [BepInPlugin("OLD_SA.Proliferation", "OLD SA Proliferation", "1.0.0")] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"OLD SA Proliferation loading..."); ProliferationAPI.Init(); Harmony val = new Harmony("OLD_SA.Proliferation"); val.PatchAll(); Log.LogInfo((object)"OLD SA Proliferation loaded."); } } public static class ProliferationAPI { public static FullAbility ability; public static void Init() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) AbilityInfo val = ScriptableObject.CreateInstance<AbilityInfo>(); ((Object)val).name = "Proliferation"; val.rulebookName = "Proliferation"; val.metaCategories = new List<AbilityMetaCategory> { (AbilityMetaCategory)0, (AbilityMetaCategory)1 }; val.powerLevel = 5; val.opponentUsable = true; val.canStack = false; Texture imageAsTexture = (Texture)(object)TextureHelper.GetImageAsTexture("OldSa_Proliferation.png", (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture("OldSa_Proliferation_px.png", (FilterMode)0); val.pixelIcon = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); FieldInfo field = typeof(AbilityInfo).GetField("rulebookDescription", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { field.SetValue(val, "When [creature] takes damage, a 1/1 copy of it is created in the owner's hand for 2 Bone."); } ability = AbilityManager.Add("OLD_SA", val, typeof(ProliferationBehaviour), imageAsTexture); } } public class ProliferationBehaviour : AbilityBehaviour { public override Ability Ability => ProliferationAPI.ability.Id; public override bool RespondsToTakeDamage(PlayableCard source) { if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null) { return false; } if (((AbilityBehaviour)this).Card.Dead) { return false; } return true; } public override IEnumerator OnTakeDamage(PlayableCard source) { yield return ((AbilityBehaviour)this).PreSuccessfulTriggerSequence(); if ((Object)(object)((AbilityBehaviour)this).Card == (Object)null || ((AbilityBehaviour)this).Card.Dead || (Object)(object)((Card)((AbilityBehaviour)this).Card).Info == (Object)null) { yield break; } object obj = ((Card)((AbilityBehaviour)this).Card).Info.Clone(); CardInfo clone = (CardInfo)((obj is CardInfo) ? obj : null); if ((Object)(object)clone == (Object)null) { yield break; } CardModificationInfo statMod = new CardModificationInfo(); statMod.attackAdjustment = 1 - clone.Attack; statMod.healthAdjustment = 1 - clone.Health; statMod.bonesCostAdjustment = 2 - clone.BonesCost; statMod.bloodCostAdjustment = -clone.BloodCost; statMod.energyCostAdjustment = -clone.EnergyCost; if (clone.Mods == null) { clone.Mods = new List<CardModificationInfo>(); } clone.Mods.Add(statMod); if (!((AbilityBehaviour)this).Card.OpponentCard) { if ((int)Singleton<ViewManager>.Instance.CurrentView > 0) { yield return (object)new WaitForSeconds(0.2f); Singleton<ViewManager>.Instance.SwitchToView((View)0, false, false); yield return (object)new WaitForSeconds(0.2f); } yield return Singleton<CardSpawner>.Instance.SpawnCardToHand(clone, (List<CardModificationInfo>)null, 0.25f, (Action<PlayableCard>)null); } else { yield return SpawnEnemyCopy(clone); yield return ((AbilityBehaviour)this).LearnAbility(0.1f); } } private IEnumerator SpawnEnemyCopy(CardInfo info) { if ((Object)(object)info == (Object)null) { yield break; } Opponent opponent = Singleton<TurnManager>.Instance.Opponent; if ((Object)(object)opponent == (Object)null) { yield break; } CardSlot freeSlot = FindFreeQueueSlot(opponent); if ((Object)(object)freeSlot != (Object)null) { yield return opponent.QueueCard(info, freeSlot, true, true, true); PlayableCard created = Singleton<BoardManager>.Instance.GetCardQueuedForSlot(freeSlot); if ((Object)(object)created != (Object)null) { EnemyDrawCreatedCardPatch.PendingOverkillProtection.Add(created); } yield break; } PlayableCard same = FindSameQueuedCard(opponent, ((Object)info).name); if (!((Object)(object)same == (Object)null) && !EnemyDrawCreatedCardPatch.MergingCards.Contains(same)) { EnemyDrawCreatedCardPatch.MergingCards.Add(same); PlayableCard temp = CardSpawner.SpawnPlayableCard(info); if ((Object)(object)temp == (Object)null) { EnemyDrawCreatedCardPatch.MergingCards.Remove(same); yield break; } MergeCardStats(same, temp); Object.Destroy((Object)(object)((Component)temp).gameObject); EnemyDrawCreatedCardPatch.MergingCards.Remove(same); } } private CardSlot FindFreeQueueSlot(Opponent opponent) { foreach (CardSlot slot in Singleton<BoardManager>.Instance.OpponentSlotsCopy) { if (!opponent.Queue.Exists((PlayableCard x) => (Object)(object)x != (Object)null && (Object)(object)x.QueuedSlot == (Object)(object)slot)) { return slot; } } return null; } private PlayableCard FindSameQueuedCard(Opponent opponent, string name) { List<PlayableCard> list = new List<PlayableCard>(); foreach (PlayableCard item in opponent.Queue) { if (!((Object)(object)item == (Object)null) && ((Object)((Card)item).Info).name == name) { list.Add(item); } } if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } private void MergeCardStats(PlayableCard target, PlayableCard source) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null || (Object)(object)source == (Object)null) { return; } CardModificationInfo val = new CardModificationInfo(); val.fromCardMerge = true; val.attackAdjustment = source.Attack; val.healthAdjustment = source.Health; val.abilities = new List<Ability>(); foreach (Ability ability in ((Card)source).Info.Abilities) { if ((int)ability != 0 && !target.HasAbility(ability) && !val.abilities.Contains(ability)) { val.abilities.Add(ability); } } if (val.attackAdjustment != 0 || val.healthAdjustment != 0 || val.abilities.Count != 0) { target.AddTemporaryMod(val); target.OnStatsChanged(); ((Card)target).RenderCard(); } } }
Xenowood_Law_Card/OLD_SA_Evolution.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using OLD_SA.Dialogue; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OLD_SA_Evolution")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OLD_SA_Evolution")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5b768fcb-7685-41db-8b51-6ca3e88435e4")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Evolution; public static class EvolutionAPI { public static Dictionary<string, string> Evolutions = new Dictionary<string, string>(); public static Dictionary<string, int> Turns = new Dictionary<string, int>(); public static Dictionary<string, string> EvolutionDialogues = new Dictionary<string, string>(); public static HashSet<string> TriggeredEvolutionDialogues = new HashSet<string>(); public static void AddEvolution(string from, string to, int turns, string dialogue = null) { Evolutions[from] = to; Turns[from] = turns; if (!string.IsNullOrEmpty(dialogue)) { EvolutionDialogues[from] = dialogue; } } public static bool ShouldTriggerEvolutionDialogue(string cardName) { if (TriggeredEvolutionDialogues.Contains(cardName)) { return false; } TriggeredEvolutionDialogues.Add(cardName); OLD_SA_SaveManager.Save(); return true; } public static List<string> GetTriggeredDialogues() { return new List<string>(TriggeredEvolutionDialogues); } public static void LoadTriggeredDialogues(List<string> data) { TriggeredEvolutionDialogues.Clear(); if (data == null) { return; } foreach (string datum in data) { if (!string.IsNullOrEmpty(datum)) { TriggeredEvolutionDialogues.Add(datum); } } } public static void ClearTriggeredDialogues() { TriggeredEvolutionDialogues.Clear(); } } public class EvolutionData { public string target; public int turns; public string dialogue; } [HarmonyPatch(typeof(PlayableCard))] public static class EvolutionDialoguePatch { private static Dictionary<PlayableCard, string> BeforeEvolutionTarget = new Dictionary<PlayableCard, string>(); [HarmonyPatch("TransformIntoCard")] [HarmonyPrefix] public static void Prefix(PlayableCard __instance, CardInfo evolvedInfo) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)((Card)__instance).Info == (Object)null) && !((Object)(object)evolvedInfo == (Object)null)) { string extendedProperty = CardExtensions.GetExtendedProperty(evolvedInfo, "OLD_SA_EvolveFrom"); if (!string.IsNullOrEmpty(extendedProperty) && !(((Object)((Card)__instance).Info).name != extendedProperty)) { BeforeEvolutionTarget[__instance] = ((Object)evolvedInfo).name; } } } [HarmonyPatch("TransformIntoCard")] [HarmonyPostfix] public static IEnumerator Postfix(IEnumerator result, PlayableCard __instance, CardInfo evolvedInfo) { while (result.MoveNext()) { yield return result.Current; } if ((Object)(object)__instance == (Object)null || (Object)(object)evolvedInfo == (Object)null || !BeforeEvolutionTarget.TryGetValue(__instance, out var targetName)) { yield break; } BeforeEvolutionTarget.Remove(__instance); if (!(((Object)evolvedInfo).name != targetName)) { string dialogue = CardExtensions.GetExtendedProperty(evolvedInfo, "OLD_SA_EvolveDialogue"); if (!string.IsNullOrEmpty(dialogue)) { yield return ShowEvolutionDialogue(dialogue, evolvedInfo); } } } private static IEnumerator ShowEvolutionDialogue(string dialogue, CardInfo evolvedInfo) { DialogueColorAPI.CurrentColor = null; if ((Object)(object)evolvedInfo != (Object)null && ((Object)evolvedInfo).name == "OLD_SA_ABERRATION_FLESH") { DialogueColorAPI.CurrentColor = new Color(0.65f, 0.05f, 0.05f); } yield return (object)new WaitForEndOfFrame(); try { if ((Object)(object)Singleton<TextDisplayer>.Instance != (Object)null) { yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(dialogue, -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } finally { DialogueColorAPI.CurrentColor = null; } } } public static class EvolutionManager { public static void RegisterAll() { foreach (CardInfo item in CardManager.AllCardsCopy) { string evolveFrom = CardExtensions.GetExtendedProperty(item, "OLD_SA_EvolveFrom"); if (string.IsNullOrEmpty(evolveFrom)) { continue; } CardInfo val = CardManager.AllCardsCopy.Find((CardInfo x) => ((Object)x).name == evolveFrom); if (!((Object)(object)val == (Object)null)) { int num = 1; string extendedProperty = CardExtensions.GetExtendedProperty(item, "OLD_SA_EvolveTurns"); if (int.TryParse(extendedProperty, out var result)) { num = result; } if (val.evolveParams == null || (Object)(object)val.evolveParams.evolution != (Object)(object)item) { CardExtensions.SetEvolve(val, item, num, (IEnumerable<CardModificationInfo>)null); } if (val.evolveParams != null) { val.evolveParams.turnsToEvolve = num; } string extendedProperty2 = CardExtensions.GetExtendedProperty(item, "OLD_SA_EvolveDialogue"); EvolutionAPI.AddEvolution(((Object)val).name, ((Object)item).name, num, extendedProperty2); } } } } [BepInPlugin("OLD_SA.Evolution", "OLD SA Evolution", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.Evolution"); val.PatchAll(); SceneManager.sceneLoaded += OnSceneLoaded; ((MonoBehaviour)this).StartCoroutine(InitialRegister()); Debug.Log((object)"OLD SA Evolution Loaded"); } private IEnumerator InitialRegister() { yield return (object)new WaitUntil((Func<bool>)(() => CardManager.AllCardsCopy != null && CardManager.AllCardsCopy.Count > 0)); yield return (object)new WaitForSeconds(1f); EvolutionManager.RegisterAll(); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { ((MonoBehaviour)this).StartCoroutine(DelayedSceneRegister()); } private IEnumerator DelayedSceneRegister() { yield return (object)new WaitForSeconds(1f); EvolutionManager.RegisterAll(); } }
Xenowood_Law_Card/OLD_SA_Sigil.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using OLD_SA.CardTraits; using OLD_SA.Evolution; using OldSa_Challenge; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OLD_SA_Sigil")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OLD_SA_Sigil")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("59150cfa-2a48-413c-bd72-7da85784e761")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Dialogue; public static class DialogueColorAPI { public static Color? CurrentColor; } public static class OLD_SA_SaveManager { [Serializable] private class DialogueSaveData { public List<string> SigilDialogues = new List<string>(); public List<string> EvolutionDialogues = new List<string>(); public List<string> TraitDialogues = new List<string>(); public List<string> ChallengeDialogues = new List<string>(); } private static string PathFile => Path.Combine(Application.persistentDataPath, "OLD_SA_Save.json"); public static void Save() { DialogueSaveData dialogueSaveData = new DialogueSaveData(); dialogueSaveData.SigilDialogues = SigilDialogueSaveData.GetSaveList(); dialogueSaveData.EvolutionDialogues = EvolutionAPI.GetTriggeredDialogues(); dialogueSaveData.TraitDialogues = CardTraitDialogueSaveData.GetSaveList(); dialogueSaveData.ChallengeDialogues = ChallengeDialogueSaveData.GetSaveList(); string contents = JsonUtility.ToJson((object)dialogueSaveData, true); try { File.WriteAllText(PathFile, contents); } catch (Exception ex) { Debug.LogError((object)("OLD SA Save Failed: " + ex.Message)); } } public static void Load() { if (!File.Exists(PathFile)) { return; } try { string text = File.ReadAllText(PathFile); DialogueSaveData dialogueSaveData = JsonUtility.FromJson<DialogueSaveData>(text); if (dialogueSaveData != null) { SigilDialogueSaveData.LoadFromList(dialogueSaveData.SigilDialogues); EvolutionAPI.LoadTriggeredDialogues(dialogueSaveData.EvolutionDialogues); CardTraitDialogueSaveData.LoadFromList(dialogueSaveData.TraitDialogues); ChallengeDialogueSaveData.LoadFromList(dialogueSaveData.ChallengeDialogues); } } catch (Exception ex) { Debug.LogError((object)("OLD SA Load Failed: " + ex.Message)); } } } [BepInPlugin("OLD_SA.Dialogue", "OLD SA Dialogue", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown OLD_SA_SaveManager.Load(); Harmony val = new Harmony("OLD_SA.Dialogue"); val.PatchAll(); Debug.Log((object)"OLD SA Dialogue Loaded"); } } public static class SigilDialogueAPI { public static bool ShowingDialogue; public static IEnumerator ShowFirstTime(string sigilID, string dialogue) { return ShowFirstTime(sigilID, dialogue, null); } public static IEnumerator ShowFirstTime(string sigilID, string dialogue, PlayableCard triggerCard = null) { if (SigilDialogueSaveData.HasTriggered(sigilID)) { yield break; } SigilDialogueSaveData.AddTriggered(sigilID); OLD_SA_SaveManager.Save(); DialogueColorAPI.CurrentColor = null; if ((Object)(object)triggerCard != (Object)null && (Object)(object)((Card)triggerCard).Info != (Object)null) { string cardName = ((Object)((Card)triggerCard).Info).name; if (cardName == "OLD_SA_WIND_PTEROSAUR") { DialogueColorAPI.CurrentColor = Color.cyan; } if (cardName == "OLD_SA_BEE_QUEEN") { DialogueColorAPI.CurrentColor = Color.yellow; } } ShowingDialogue = true; if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null) { Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)1; } if ((Object)(object)Singleton<PlayerHand>.Instance != (Object)null) { Singleton<PlayerHand>.Instance.PlayingLocked = true; } try { if ((Object)(object)Singleton<TextDisplayer>.Instance != (Object)null) { yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(dialogue, -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } } finally { if ((Object)(object)Singleton<PlayerHand>.Instance != (Object)null) { Singleton<PlayerHand>.Instance.PlayingLocked = false; } if ((Object)(object)Singleton<ViewManager>.Instance != (Object)null) { Singleton<ViewManager>.Instance.Controller.LockState = (ViewLockState)0; } DialogueColorAPI.CurrentColor = null; ShowingDialogue = false; } } } public static class SigilDialogueSaveData { private static HashSet<string> Triggered = new HashSet<string>(); public static int Count => Triggered.Count; public static bool HasTriggered(string id) { if (string.IsNullOrEmpty(id)) { return false; } return Triggered.Contains(id); } public static void AddTriggered(string id) { if (!string.IsNullOrEmpty(id) && !Triggered.Contains(id)) { Triggered.Add(id); } } public static void Remove(string id) { if (!string.IsNullOrEmpty(id)) { Triggered.Remove(id); } } public static void Clear() { Triggered.Clear(); } public static List<string> GetSaveList() { return new List<string>(Triggered); } public static void LoadFromList(List<string> data) { Triggered.Clear(); if (data == null) { return; } foreach (string datum in data) { if (!string.IsNullOrEmpty(datum)) { Triggered.Add(datum); } } } } [HarmonyPatch] public static class SigilDialogueSavePatch { [HarmonyPatch(typeof(SaveFile), "Initialize")] [HarmonyPostfix] public static void InitializePostfix() { OLD_SA_SaveManager.Load(); } [HarmonyPatch(typeof(SaveManager), "SaveToFile")] [HarmonyPostfix] public static void SaveToFilePostfix(bool saveActiveScene) { OLD_SA_SaveManager.Save(); } } [HarmonyPatch(typeof(TextDisplayer), "ShowMessage")] public static class TextDisplayerColorPatch { [HarmonyPostfix] public static void Postfix(TextDisplayer __instance) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!DialogueColorAPI.CurrentColor.HasValue) { return; } FieldInfo fieldInfo = AccessTools.Field(typeof(TextDisplayer), "textMesh"); if (fieldInfo == null) { return; } object value = fieldInfo.GetValue(__instance); if (value != null) { PropertyInfo property = value.GetType().GetProperty("color"); if (property != null && property.CanWrite) { property.SetValue(value, DialogueColorAPI.CurrentColor.Value); } } } }
Xenowood_Law_Card/OldSa_CardTraits.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using OLD_SA.Dialogue; using OLD_SA.Puppet; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_CardTraits")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_CardTraits")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("4ebfbc44-c273-4a7d-92ed-5b86f52380fa")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.CardTraits; public static class CardTrait { public const string Featherless = "OLD_SA_Featherless"; public const string Jackal = "OLD_SA_Jackal"; public const string WeakHatchling = "OLD_SA_WeakHatchling"; public const string Infinite = "OLD_SA_Infinite"; public const string CarnivalMaster = "OLD_SA_CarnivalMaster"; public const string PuppetMaster = "OLD_SA_PuppetMaster"; } public static class CardTraitAPI { public static HashSet<string> TriggeredTraitDialogues = new HashSet<string>(); public static bool ShouldTriggerDialogue(string dialogueID) { if (string.IsNullOrEmpty(dialogueID)) { return false; } if (TriggeredTraitDialogues.Contains(dialogueID)) { return false; } TriggeredTraitDialogues.Add(dialogueID); OLD_SA_SaveManager.Save(); return true; } public static List<string> GetTriggeredDialogues() { return new List<string>(TriggeredTraitDialogues); } public static void LoadTriggeredDialogues(List<string> data) { TriggeredTraitDialogues.Clear(); if (data == null) { return; } foreach (string datum in data) { if (!string.IsNullOrEmpty(datum)) { TriggeredTraitDialogues.Add(datum); } } } public static void ClearTriggeredDialogues() { TriggeredTraitDialogues.Clear(); } } public static class CardTraitConditionAPI { private static Dictionary<string, string> RequiredAdjacent = new Dictionary<string, string>(); public static void RegisterAdjacentRequirement(string trait, string cardName) { RequiredAdjacent[trait] = cardName; } public static bool CheckAdjacentRequirement(PlayableCard card, string trait) { if (!RequiredAdjacent.ContainsKey(trait)) { return true; } string text = RequiredAdjacent[trait]; foreach (CardSlot adjacentSlot in Singleton<BoardManager>.Instance.GetAdjacentSlots(card.Slot)) { if ((Object)(object)adjacentSlot.Card != (Object)null && ((Object)((Card)adjacentSlot.Card).Info).name == text) { return true; } } return false; } } public static class CardTraitDialogueManager { public static IEnumerator TryTrigger(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null)) { string dialogueID = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogueID"); string dialogue = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogue"); yield return TryTrigger(dialogueID, dialogue); } } public static IEnumerator TryTrigger(string dialogueID, string dialogue) { if (!string.IsNullOrEmpty(dialogueID) && !string.IsNullOrEmpty(dialogue) && !CardTraitDialogueSaveData.HasTriggered(dialogueID)) { yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(dialogue, -0.65f, 0.4f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); CardTraitDialogueSaveData.AddTriggered(dialogueID); } } public static IEnumerator PlayTraitDialogue(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { yield break; } string dialogue = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogue"); if (!string.IsNullOrEmpty(dialogue)) { DialogueColorAPI.CurrentColor = null; string cardName = ((Object)((Card)card).Info).name; if (cardName == "OLD_SA_GIANT_BEAR") { DialogueColorAPI.CurrentColor = new Color(0.45f, 0.25f, 0.1f); } try { yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(dialogue, -0.65f, 0.4f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); } finally { DialogueColorAPI.CurrentColor = null; } } } public static IEnumerator TryTrigger(PlayableCard card, string trait) { if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null)) { string dialogueID = ((Object)((Card)card).Info).name + "_" + trait; string dialogue = CardExtensions.GetExtendedProperty(((Card)card).Info, trait + "_Dialogue"); yield return TryTrigger(dialogueID, dialogue); } } } public static class CardTraitDialogueQueue { private static string id; private static string text; public static void Add(string dialogueID, string dialogue) { if (!string.IsNullOrEmpty(dialogueID) && !string.IsNullOrEmpty(dialogue)) { id = dialogueID; text = dialogue; } } public static bool HasDialogue() { return !string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(text); } public static IEnumerator Play() { if (HasDialogue()) { string currentID = id; string currentText = text; id = null; text = null; yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(currentText, -0.65f, 0.4f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); CardTraitDialogueSaveData.AddTriggered(currentID); } } } public class CardTraitDialogueRunner : MonoBehaviour { private static CardTraitDialogueRunner instance; private bool playing; public static CardTraitDialogueRunner Instance { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)instance == (Object)null) { GameObject val = new GameObject("CardTraitDialogueRunner"); Object.DontDestroyOnLoad((Object)(object)val); instance = val.AddComponent<CardTraitDialogueRunner>(); } return instance; } } public void Queue(string dialogueID, string dialogue) { CardTraitDialogueQueue.Add(dialogueID, dialogue); } private void Update() { if (!playing && CardTraitDialogueQueue.HasDialogue()) { ((MonoBehaviour)this).StartCoroutine(PlayQueue()); } } private IEnumerator PlayQueue() { playing = true; yield return CardTraitDialogueQueue.Play(); playing = false; } } public static class CardTraitDialogueSaveData { private static HashSet<string> Triggered = new HashSet<string>(); public static bool HasTriggered(string id) { if (string.IsNullOrEmpty(id)) { return false; } return Triggered.Contains(id); } public static void AddTriggered(string id) { if (!string.IsNullOrEmpty(id) && !Triggered.Contains(id)) { Triggered.Add(id); } } public static void Remove(string id) { if (!string.IsNullOrEmpty(id)) { Triggered.Remove(id); } } public static void Clear() { Triggered.Clear(); } public static List<string> GetSaveList() { return new List<string>(Triggered); } public static void LoadFromList(List<string> data) { Triggered.Clear(); if (data == null) { return; } foreach (string datum in data) { if (!string.IsNullOrEmpty(datum)) { Triggered.Add(datum); } } } } [HarmonyPatch(typeof(PlayableCard), "AddTemporaryMod")] public static class CardTraitFlyingPatch { [HarmonyPrefix] public static bool Prefix(PlayableCard __instance, CardModificationInfo mod) { if ((Object)(object)__instance == (Object)null || (Object)(object)((Card)__instance).Info == (Object)null || mod == null || mod.abilities == null) { return true; } if (!mod.abilities.Contains((Ability)19)) { return true; } if (mod.singletonId == "wind_blessing_flying") { return true; } if (!CardTraitHelper.HasTrait(__instance, "OLD_SA_Featherless")) { return true; } ((MonoBehaviour)__instance).StartCoroutine(CardTraitDialogueManager.TryTrigger(__instance)); mod.abilities.Remove((Ability)19); if (mod.abilities.Count == 0 && mod.attackAdjustment == 0 && mod.healthAdjustment == 0 && (mod.negateAbilities == null || mod.negateAbilities.Count == 0)) { return false; } return true; } } public static class CardTraitHelper { public static bool HasTrait(PlayableCard card, string trait) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return false; } if (CardExtensions.GetExtendedProperty(((Card)card).Info, trait) == "true") { return true; } foreach (CardModificationInfo mod in ((Card)card).Info.Mods) { if (mod.singletonId == trait) { return true; } } foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod.singletonId == trait) { return true; } } return false; } } public static class CarnivalMasterFusionManager { public static void AddCard(CardInfo card) { if (!((Object)(object)card == (Object)null) && RunState.Run != null) { DeckInfo playerDeck = RunState.Run.playerDeck; if (playerDeck != null) { ((CardCollectionInfo)playerDeck).AddCard(card); } } } } public static class CarnivalTraitAPI { public const string Trait = "OLD_SA_CarnivalMaster"; public const string NeedCards = "OLD_SA_TraitNeedCards"; public const string TransformCard = "OLD_SA_TraitTransformCard"; public const string DialogueID = "OLD_SA_TraitDialogueID"; public const string Dialogue = "OLD_SA_TraitDialogue"; public static string GetNeedCards(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_CarnivalMaster")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitNeedCards"); } public static string GetTransformCard(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_CarnivalMaster")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitTransformCard"); } public static string GetDialogueID(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_CarnivalMaster")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogueID"); } public static string GetDialogue(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_CarnivalMaster")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogue"); } } public static class CarnivalMasterTraitPatch { private static bool transforming; public static IEnumerator CheckCarnivalFusion() { if (transforming) { yield break; } BoardManager board = Singleton<BoardManager>.Instance; if ((Object)(object)board == (Object)null) { yield break; } foreach (CardSlot slot in board.GetSlots(true)) { if ((Object)(object)slot.Card == (Object)null) { continue; } PlayableCard master = slot.Card; if (CardTraitHelper.HasTrait(master, "OLD_SA_CarnivalMaster")) { PlayableCard[] cards = FindCards(master); if (cards != null) { yield return Fusion(master, cards); yield break; } } } } private static PlayableCard[] FindCards(PlayableCard master) { string needCards = CarnivalTraitAPI.GetNeedCards(master); if (string.IsNullOrEmpty(needCards)) { return null; } string[] array = needCards.Split(new char[1] { ',' }); List<PlayableCard> list = new List<PlayableCard>(); string[] array2 = array; foreach (string text in array2) { foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(!master.OpponentCard)) { if ((Object)(object)slot.Card == (Object)null || (Object)(object)slot.Card == (Object)(object)master || !(((Object)((Card)slot.Card).Info).name == text.Trim())) { continue; } list.Add(slot.Card); break; } } if (list.Count != array.Length) { return null; } return list.ToArray(); } private static IEnumerator Fusion(PlayableCard master, PlayableCard[] materials) { transforming = true; CardInfo result = CardLoader.GetCardByName(CarnivalTraitAPI.GetTransformCard(master)); if ((Object)(object)result == (Object)null) { transforming = false; yield break; } CardSlot spawnSlot = master.Slot; yield return CardTraitDialogueManager.TryTrigger(master); ((Card)master).Anim.ExitBoard(0.5f, Vector3.zero); foreach (PlayableCard card in materials) { ((Card)card).Anim.ExitBoard(0.5f, Vector3.zero); } yield return (object)new WaitForSeconds(0.6f); Object.Destroy((Object)(object)((Component)master).gameObject); foreach (PlayableCard card2 in materials) { Object.Destroy((Object)(object)((Component)card2).gameObject); } yield return (object)new WaitForSeconds(0.2f); yield return Singleton<BoardManager>.Instance.CreateCardInSlot(result, spawnSlot, 0.1f, true); CarnivalMasterFusionManager.AddCard(result); transforming = false; } } [HarmonyPatch(typeof(BoardManager), "AssignCardToSlot")] public static class CarnivalMasterTriggerPatch { public static IEnumerator Postfix(IEnumerator __result) { while (__result.MoveNext()) { yield return __result.Current; } yield return (object)new WaitForSeconds(0.05f); yield return CarnivalMasterTraitPatch.CheckCarnivalFusion(); } } [HarmonyPatch(typeof(DeckInfo), "ModifyCard")] public static class FeatherlessDeckModifyPatch { [HarmonyPrefix] public static bool Prefix(CardInfo card, CardModificationInfo mod) { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 if ((Object)(object)card == (Object)null || mod == null || mod.abilities == null) { return true; } if (!mod.abilities.Contains((Ability)19)) { return true; } if (CardExtensions.GetExtendedProperty(card, "OLD_SA_Featherless") != "true") { return true; } mod.abilities.Remove((Ability)19); string extendedProperty = CardExtensions.GetExtendedProperty(card, "OLD_SA_TraitDialogueID"); string extendedProperty2 = CardExtensions.GetExtendedProperty(card, "OLD_SA_TraitDialogue"); CardTraitDialogueQueue.Add(extendedProperty, extendedProperty2); if (mod.abilities.Count == 0 && mod.attackAdjustment == 0 && mod.healthAdjustment == 0 && (mod.negateAbilities == null || mod.negateAbilities.Count == 0) && (mod.addGemCost == null || mod.addGemCost.Count == 0) && (mod.specialAbilities == null || mod.specialAbilities.Count == 0) && (int)mod.statIcon == 0) { return false; } return true; } } [HarmonyPatch(typeof(RandomAbility), "ChooseAbility")] public static class FeatherlessRandomAbilityPatch { [HarmonyPostfix] public static void Postfix(RandomAbility __instance, ref Ability __result) { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected I4, but got Unknown if ((Object)(object)__instance == (Object)null) { return; } PlayableCard card = Traverse.Create((object)__instance).Field("Card").GetValue<PlayableCard>(); if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null) && CardTraitHelper.HasTrait(card, "OLD_SA_Featherless") && (int)__result == 19) { List<Ability> learnedAbilities = AbilitiesUtil.GetLearnedAbilities(false, 0, 5, (AbilityMetaCategory)1); learnedAbilities.Remove((Ability)19); learnedAbilities.RemoveAll((Ability x) => card.HasAbility(x)); if (learnedAbilities.Count > 0) { __result = (Ability)(int)learnedAbilities[SeededRandom.Range(0, learnedAbilities.Count, SaveManager.SaveFile.GetCurrentRandomSeed())]; } else { __result = (Ability)15; } } } } [HarmonyPatch(typeof(PlayableCard), "AddTemporaryMod")] public static class InfinitePermanentStatsPatch { [HarmonyPrefix] public static bool Prefix(PlayableCard __instance, CardModificationInfo mod) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown if ((Object)(object)__instance == (Object)null || (Object)(object)((Card)__instance).Info == (Object)null || mod == null) { return true; } if (!CardTraitHelper.HasTrait(__instance, "OLD_SA_Infinite")) { return true; } int num = ((mod.attackAdjustment > 0) ? mod.attackAdjustment : 0); int num2 = ((mod.healthAdjustment > 0) ? mod.healthAdjustment : 0); if (num == 0 && num2 == 0) { return true; } CardModificationInfo val = new CardModificationInfo(); val.attackAdjustment = num; val.healthAdjustment = num2; ((Card)__instance).Info.Mods.Add(val); mod.attackAdjustment -= num; mod.healthAdjustment -= num2; if (mod.attackAdjustment != 0 || mod.healthAdjustment != 0 || mod.bloodCostAdjustment != 0 || mod.bonesCostAdjustment != 0 || mod.energyCostAdjustment != 0 || mod.gemify || mod.fromOverclock || (mod.abilities != null && mod.abilities.Count > 0) || (mod.negateAbilities != null && mod.negateAbilities.Count > 0)) { return true; } return false; } } public static class JackalFusionManager { public static void ReplaceDeckCards(CardInfo jackal, CardInfo wolf, CardInfo result) { if (RunState.Run == null) { return; } DeckInfo playerDeck = RunState.Run.playerDeck; if (playerDeck == null) { return; } if ((Object)(object)jackal != (Object)null) { ((CardCollectionInfo)playerDeck).RemoveCardByName(((Object)jackal).name); } if ((Object)(object)wolf != (Object)null) { ((CardCollectionInfo)playerDeck).RemoveCardByName(((Object)wolf).name); } if ((Object)(object)result != (Object)null) { ((CardCollectionInfo)playerDeck).AddCard(result); } foreach (CardInfo card in ((CardCollectionInfo)playerDeck).Cards) { } } } public static class JackalTraitAPI { public const string Trait = "OLD_SA_Jackal"; public const string ConditionCard = "OLD_SA_TraitConditionCard"; public const string TransformCard = "OLD_SA_TraitTransformCard"; public const string DialogueID = "OLD_SA_TraitDialogueID"; public const string Dialogue = "OLD_SA_TraitDialogue"; public static string GetConditionCard(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_Jackal")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitConditionCard"); } public static string GetTransformCard(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_Jackal")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitTransformCard"); } public static string GetDialogueID(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_Jackal")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogueID"); } public static string GetDialogue(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_Jackal")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogue"); } } public static class JackalTraitPatch { private static bool transforming; public static IEnumerator CheckJackalFusion() { if (transforming || (Object)(object)Singleton<BoardManager>.Instance == (Object)null) { yield break; } foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(true)) { if ((Object)(object)slot.Card == (Object)null) { continue; } PlayableCard jackal = slot.Card; if (CardTraitHelper.HasTrait(jackal, "OLD_SA_Jackal")) { PlayableCard wolf = FindWolf(jackal); if ((Object)(object)wolf != (Object)null) { yield return Fusion(jackal, wolf); yield break; } } } } private static PlayableCard FindWolf(PlayableCard jackal) { foreach (CardSlot adjacentSlot in Singleton<BoardManager>.Instance.GetAdjacentSlots(jackal.Slot)) { if ((Object)(object)adjacentSlot.Card == (Object)null || !(((Object)((Card)adjacentSlot.Card).Info).name == JackalTraitAPI.GetConditionCard(jackal))) { continue; } return adjacentSlot.Card; } return null; } private static IEnumerator Fusion(PlayableCard jackal, PlayableCard wolf) { transforming = true; CardInfo result = CardLoader.GetCardByName(JackalTraitAPI.GetTransformCard(jackal)); if ((Object)(object)result == (Object)null) { transforming = false; yield break; } CardSlot spawnSlot = jackal.Slot; CardInfo jackalInfo = ((Card)jackal).Info; CardInfo wolfInfo = ((Card)wolf).Info; yield return CardTraitDialogueManager.TryTrigger(jackal); if ((Object)(object)jackal != (Object)null) { ((Card)jackal).Anim.ExitBoard(0.5f, Vector3.zero); } if ((Object)(object)wolf != (Object)null) { ((Card)wolf).Anim.ExitBoard(0.5f, Vector3.zero); } yield return (object)new WaitForSeconds(0.6f); if ((Object)(object)jackal != (Object)null) { Object.Destroy((Object)(object)((Component)jackal).gameObject); } if ((Object)(object)wolf != (Object)null) { Object.Destroy((Object)(object)((Component)wolf).gameObject); } yield return (object)new WaitForSeconds(0.2f); yield return Singleton<BoardManager>.Instance.CreateCardInSlot(result, spawnSlot, 0.1f, true); JackalFusionManager.ReplaceDeckCards(jackalInfo, wolfInfo, result); transforming = false; } } [HarmonyPatch(typeof(BoardManager), "AssignCardToSlot")] public static class JackalFusionTriggerPatch { public static IEnumerator Postfix(IEnumerator __result) { while (__result.MoveNext()) { yield return __result.Current; } yield return (object)new WaitForSeconds(0.05f); if (HasJackalOnBoard()) { yield return JackalTraitPatch.CheckJackalFusion(); } } private static bool HasJackalOnBoard() { if ((Object)(object)Singleton<BoardManager>.Instance == (Object)null) { return false; } foreach (CardSlot slot in Singleton<BoardManager>.Instance.GetSlots(true)) { if ((Object)(object)slot.Card == (Object)null || !CardTraitHelper.HasTrait(slot.Card, "OLD_SA_Jackal")) { continue; } return true; } return false; } } [BepInPlugin("OLD_SA.CardTraits", "OLD SA CardTraits", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.CardTraits"); val.PatchAll(); _ = CardTraitDialogueRunner.Instance; ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA CardTraits Loaded"); } } public static class PuppetMasterTraitAPI { public const string Trait = "OLD_SA_PuppetMaster"; public static string GetDialogueID(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_PuppetMaster")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogueID"); } public static string GetDialogue(PlayableCard card) { if (!CardTraitHelper.HasTrait(card, "OLD_SA_PuppetMaster")) { return null; } return CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_TraitDialogue"); } } [HarmonyPatch(typeof(PlayableCard), "Die")] public static class PuppetMasterTraitPatch { private static bool killingPuppets; public static void Prefix(PlayableCard __instance) { if (!killingPuppets && !((Object)(object)__instance == (Object)null) && CardTraitHelper.HasTrait(__instance, "OLD_SA_PuppetMaster") && PuppetHelper.GetPuppets(__instance).Count != 0) { ((MonoBehaviour)__instance).StartCoroutine(KillPuppets(__instance)); } } private static IEnumerator KillPuppets(PlayableCard master) { if ((Object)(object)master == (Object)null) { yield break; } List<PlayableCard> puppets = new List<PlayableCard>(PuppetHelper.GetPuppets(master)); if (puppets.Count == 0) { yield break; } yield return CardTraitDialogueManager.TryTrigger(master); killingPuppets = true; try { foreach (PlayableCard puppet in puppets) { if (!((Object)(object)puppet == (Object)null) && !puppet.Dead) { puppet.Die(false, master, true); yield return (object)new WaitForSeconds(0.1f); } } } finally { killingPuppets = false; } } } [HarmonyPatch(typeof(Evolve), "OnUpkeep")] public static class WeakHatchlingPatch { private static readonly FieldRef<Evolve, int> NumTurnsInPlay = AccessTools.FieldRefAccess<Evolve, int>("numTurnsInPlay"); private static readonly MethodInfo PreSuccessfulTriggerSequenceMethod = AccessTools.Method(typeof(AbilityBehaviour), "PreSuccessfulTriggerSequence", (Type[])null, (Type[])null); [HarmonyPrefix] public static bool Prefix(Evolve __instance, bool playerUpkeep, ref IEnumerator __result) { if ((Object)(object)__instance == (Object)null) { return true; } PlayableCard card = GetCard(__instance); if ((Object)(object)card == (Object)null || !CardTraitHelper.HasTrait(card, "OLD_SA_WeakHatchling")) { return true; } __result = WeakHatchlingOnUpkeep(__instance, card, playerUpkeep); return false; } private static PlayableCard GetCard(Evolve evolve) { if ((Object)(object)evolve == (Object)null) { return null; } PropertyInfo propertyInfo = AccessTools.Property(typeof(AbilityBehaviour), "Card"); if (propertyInfo == null) { return null; } object? value = propertyInfo.GetValue(evolve, null); return (PlayableCard)((value is PlayableCard) ? value : null); } private static IEnumerator WeakHatchlingOnUpkeep(Evolve evolve, PlayableCard card, bool playerUpkeep) { if ((Object)(object)evolve == (Object)null || (Object)(object)card == (Object)null || card.Dead || card.OpponentCard == playerUpkeep) { yield break; } int turnsToEvolve = ((!((Object)(object)((Card)card).Info != (Object)null) || ((Card)card).Info.evolveParams == null) ? 1 : ((Card)card).Info.evolveParams.turnsToEvolve); int numTurnsInPlay = NumTurnsInPlay.Invoke(evolve); numTurnsInPlay++; NumTurnsInPlay.Invoke(evolve) = numTurnsInPlay; int remaining = Mathf.Max(1, turnsToEvolve - numTurnsInPlay); ((Card)card).RenderInfo.OverrideAbilityIcon((Ability)5, ResourceBank.Get<Texture>("Art/Cards/AbilityIcons/ability_evolve_" + remaining)); ((Card)card).RenderCard(); if (numTurnsInPlay >= turnsToEvolve) { yield return InvokePreSuccessfulTriggerSequence(evolve); if (!((Object)(object)card == (Object)null) && !card.Dead) { Singleton<ViewManager>.Instance.SwitchToView((View)4, false, false); yield return (object)new WaitForSeconds(0.15f); ((Card)card).Anim.PlayTransformAnimation(); yield return (object)new WaitForSeconds(0.15f); CardModificationInfo growth = new CardModificationInfo { attackAdjustment = 1, healthAdjustment = 1, singletonId = "OLD_SA_WeakHatchling_Growth" }; card.AddTemporaryMod(growth); RemoveEvolve(card); ((Card)card).RenderCard(); card.OnStatsChanged(); card.UpdateFaceUpOnBoardEffects(); yield return CardTraitDialogueManager.TryTrigger(card); } } } private static IEnumerator InvokePreSuccessfulTriggerSequence(Evolve evolve) { if ((Object)(object)evolve == (Object)null || PreSuccessfulTriggerSequenceMethod == null) { yield break; } object result = PreSuccessfulTriggerSequenceMethod.Invoke(evolve, null); if (result is IEnumerator sequence) { while (sequence.MoveNext()) { yield return sequence.Current; } } } private static void RemoveEvolve(PlayableCard card) { if ((Object)(object)card == (Object)null) { return; } if ((Object)(object)card.TriggerHandler != (Object)null) { card.TriggerHandler.RemoveAbility((Ability)5); } while (true) { CardModificationInfo val = null; foreach (CardModificationInfo temporaryMod in card.TemporaryMods) { if (temporaryMod == null || temporaryMod.abilities == null || !temporaryMod.abilities.Contains((Ability)5)) { continue; } val = temporaryMod; break; } if (val == null) { break; } card.RemoveTemporaryMod(val, true); } if (card.Status != null) { if (card.Status.hiddenAbilities == null) { card.Status.hiddenAbilities = new List<Ability>(); } if (!card.Status.hiddenAbilities.Contains((Ability)5)) { card.Status.hiddenAbilities.Add((Ability)5); } } ((Card)card).RenderInfo.OverrideAbilityIcon((Ability)5, (Texture)null); ((Card)card).RenderCard(); } }
Xenowood_Law_Card/OldSa_Card_Helper.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.CardTraits; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Card_Helper")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Card_Helper")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1f970448-c0fe-40dc-8c38-0f94e5a5ea4e")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA { public static class ShieldTransform { private const string NormalKey = "OLD_SA.ShieldTransform.Normal"; private const string OneShieldKey = "OLD_SA.ShieldTransform.OneShield"; private const string MultiShieldKey = "OLD_SA.ShieldTransform.MultiShield"; public static int GetForm(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return 0; } int lifeShieldStacks = GetLifeShieldStacks(card); if (lifeShieldStacks <= 0) { return 0; } if (lifeShieldStacks == 1) { return 1; } return 2; } private static int GetLifeShieldStacks(PlayableCard card) { if ((Object)(object)card == (Object)null) { return 0; } OLD_SA_LifeShield component = ((Component)card).GetComponent<OLD_SA_LifeShield>(); if ((Object)(object)component == (Object)null) { return 0; } return component.GetStacks(); } public static CardInfo GetTargetCard(PlayableCard card, int form) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return null; } string text; switch (form) { case 0: text = "OLD_SA.ShieldTransform.Normal"; break; case 1: text = "OLD_SA.ShieldTransform.OneShield"; break; case 2: text = "OLD_SA.ShieldTransform.MultiShield"; break; default: return null; } string extendedProperty = CardExtensions.GetExtendedProperty(((Card)card).Info, text); if (string.IsNullOrEmpty(extendedProperty)) { return null; } return CardLoader.GetCardByName(extendedProperty); } public static IEnumerator Transform(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null || card.Dead) { yield break; } string oldTraits = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_Traits"); string normal = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ShieldTransform.Normal"); string oneShield = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ShieldTransform.OneShield"); string multiShield = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ShieldTransform.MultiShield"); List<Ability> hiddenAbilities = new List<Ability>(); if (card.Status != null && card.Status.hiddenAbilities != null) { hiddenAbilities.AddRange(card.Status.hiddenAbilities); } List<CardModificationInfo> mods = new List<CardModificationInfo>(); foreach (CardModificationInfo mod in CardExtensions.AllCardModificationInfos(card)) { if (mod != null && !mod.nonCopyable) { object obj = mod.Clone(); CardModificationInfo cloneMod = (CardModificationInfo)((obj is CardModificationInfo) ? obj : null); if (cloneMod != null) { mods.Add(cloneMod); } } } int form = GetForm(card); CardInfo target = GetTargetCard(card, form); if ((Object)(object)target == (Object)null || ((Object)((Card)card).Info).name == ((Object)target).name) { yield break; } object obj2 = target.Clone(); CardInfo clone = (CardInfo)((obj2 is CardInfo) ? obj2 : null); if ((Object)(object)clone == (Object)null) { yield break; } if (clone.Mods == null) { clone.Mods = new List<CardModificationInfo>(); } foreach (CardModificationInfo mod2 in mods) { clone.Mods.Add(mod2); } yield return card.TransformIntoCard(clone, (Action)null, (Action)null); yield return (object)new WaitForSeconds(0.2f); if ((Object)(object)card == (Object)null || card.Dead || (Object)(object)((Card)card).Info == (Object)null) { yield break; } RestoreProperty(((Card)card).Info, "OLD_SA_Traits", oldTraits); RestoreProperty(((Card)card).Info, "OLD_SA.ShieldTransform.Normal", normal); RestoreProperty(((Card)card).Info, "OLD_SA.ShieldTransform.OneShield", oneShield); RestoreProperty(((Card)card).Info, "OLD_SA.ShieldTransform.MultiShield", multiShield); if (card.Status != null) { foreach (Ability ability in hiddenAbilities) { if (!card.Status.hiddenAbilities.Contains(ability)) { card.Status.hiddenAbilities.Add(ability); } } } OLD_SA_TraitInjector.AddTraitBehaviours(card); card.OnStatsChanged(); ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); yield return (object)new WaitForSeconds(0.1f); } private static void RestoreProperty(CardInfo info, string key, string value) { if (!((Object)(object)info == (Object)null) && !string.IsNullOrEmpty(value)) { CardExtensions.SetExtendedProperty(info, key, (object)value); } } } [HarmonyPatch(typeof(PlayableCard), "UpdateFaceUpOnBoardEffects")] public static class ShieldTransformPatch { private static readonly Dictionary<PlayableCard, int> LastForm = new Dictionary<PlayableCard, int>(); private static readonly HashSet<PlayableCard> Transforming = new HashSet<PlayableCard>(); [HarmonyPostfix] public static void Postfix(PlayableCard __instance) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)((Card)__instance).Info == (Object)null) && !__instance.Dead && !Transforming.Contains(__instance) && HasTransformConfiguration(__instance)) { int form = ShieldTransform.GetForm(__instance); if (!LastForm.ContainsKey(__instance)) { LastForm[__instance] = form; } else if (LastForm[__instance] != form) { Transforming.Add(__instance); ((MonoBehaviour)__instance).StartCoroutine(TransformAndRelease(__instance)); } } } private static IEnumerator TransformAndRelease(PlayableCard card) { try { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null || card.Dead) { yield break; } bool wasSubmerged = ((Card)card).FaceDown; if (wasSubmerged) { ((Card)card).SetFaceDown(false, false); card.UpdateFaceUpOnBoardEffects(); yield return (object)new WaitForSeconds(0.5f); if ((Object)(object)card == (Object)null || card.Dead) { yield break; } } if (((Card)card).FaceDown) { ((Card)card).SetFaceDown(false, false); card.UpdateFaceUpOnBoardEffects(); yield return (object)new WaitForSeconds(0.3f); } yield return ShieldTransform.Transform(card); if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null || card.Dead) { yield break; } yield return (object)new WaitForSeconds(0.5f); bool targetHasSubmerge = CardExtensions.GetAbilityStacks(card, (Ability)13) > 0; if (wasSubmerged && targetHasSubmerge) { ((Card)card).SetCardbackSubmerged(); if (!((Card)card).FaceDown) { ((Card)card).SetFaceDown(true, false); } yield return (object)new WaitForSeconds(0.3f); } else if (((Card)card).FaceDown) { ((Card)card).SetFaceDown(false, false); card.UpdateFaceUpOnBoardEffects(); yield return (object)new WaitForSeconds(0.3f); } LastForm[card] = ShieldTransform.GetForm(card); } finally { if ((Object)(object)card != (Object)null) { Transforming.Remove(card); } } } private static bool HasTransformConfiguration(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return false; } return !string.IsNullOrWhiteSpace(CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ShieldTransform.Normal")) || !string.IsNullOrWhiteSpace(CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ShieldTransform.OneShield")) || !string.IsNullOrWhiteSpace(CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ShieldTransform.MultiShield")); } } } namespace OLD_SA.CardHelper { public static class OriginalCardPortraits { private class PortraitConfig { public string CardName; public string TextureName; public string EmissionTextureName; public PortraitConfig(string cardName, string textureName, string emissionTextureName) { CardName = cardName; TextureName = textureName; EmissionTextureName = emissionTextureName; } } private static readonly PortraitConfig[] PortraitConfigs = new PortraitConfig[1] { new PortraitConfig("SquirrelBall", "SquirrelBall.png", "SquirrelBall_em.png") }; private static bool initialized; public static void Init() { if (!initialized) { initialized = true; CardManager.ModifyCardList += ModifyCards; } } private static List<CardInfo> ModifyCards(List<CardInfo> cards) { PortraitConfig[] portraitConfigs = PortraitConfigs; foreach (PortraitConfig config in portraitConfigs) { CardInfo val = cards.Find((CardInfo x) => (Object)(object)x != (Object)null && ((Object)x).name == config.CardName); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)("[OLD_SA] 找不到原版卡牌:" + config.CardName)); continue; } Texture2D imageAsTexture = TextureHelper.GetImageAsTexture(config.TextureName, (FilterMode)0); Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture(config.EmissionTextureName, (FilterMode)0); if ((Object)(object)imageAsTexture == (Object)null || (Object)(object)imageAsTexture2 == (Object)null) { Debug.LogError((object)("[OLD_SA] 卡图加载失败:" + config.CardName)); } else { CardExtensions.SetPortrait(val, imageAsTexture, imageAsTexture2, (FilterMode?)null); } } return cards; } } [BepInPlugin("OLD_SA.CardHelper", "OLD SA Card Helper", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("OLD_SA.CardHelper"); OriginalCardPortraits.Init(); val.PatchAll(); } } } namespace OLD_SA.CardHelper.Portrait { public static class HermitCrabPortraitSwitch { private const string NORMAL_PORTRAIT = "OLD_SA.NormalPortrait"; private const string NORMAL_EMISSION = "OLD_SA.NormalEmission"; private const string ARMORED_PORTRAIT = "OLD_SA.ArmoredPortrait"; private const string ARMORED_EMISSION = "OLD_SA.ArmoredEmission"; public static IEnumerator SwitchToArmored(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { yield break; } string portraitName = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ArmoredPortrait"); string emissionName = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.ArmoredEmission"); if (!string.IsNullOrWhiteSpace(portraitName)) { Sprite portrait = LoadPortrait(portraitName, emissionName); if (!((Object)(object)portrait == (Object)null)) { card.SwitchToPortrait(portrait); ((Card)card).RenderCard(); } } } public static IEnumerator ResetPortrait(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { yield break; } string portraitName = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.NormalPortrait"); string emissionName = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA.NormalEmission"); if (!string.IsNullOrWhiteSpace(portraitName)) { Sprite portrait = LoadPortrait(portraitName, emissionName); if (!((Object)(object)portrait == (Object)null)) { card.SwitchToPortrait(portrait); ((Card)card).RenderCard(); } } } private static Sprite LoadPortrait(string portraitName, string emissionName) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) portraitName = NormalizeTextureName(portraitName); Texture2D val = null; try { val = TextureHelper.GetImageAsTexture(portraitName, (FilterMode)0); } catch { } if ((Object)(object)val == (Object)null) { Debug.Log((object)("[OLD SA] Missing portrait: " + portraitName)); return null; } Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); ((Object)val2).name = portraitName; if (string.IsNullOrWhiteSpace(emissionName)) { return val2; } emissionName = NormalizeTextureName(emissionName); Texture2D val3 = null; try { val3 = TextureHelper.GetImageAsTexture(emissionName, (FilterMode)0); } catch { } if ((Object)(object)val3 == (Object)null) { Debug.Log((object)("[OLD SA] Missing emission: " + emissionName)); return val2; } Sprite val4 = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f)); ((Object)val4).name = emissionName; TextureHelper.RegisterEmissionForSprite(val2, val4); return val2; } private static string NormalizeTextureName(string name) { if (string.IsNullOrWhiteSpace(name)) { return name; } name = name.Trim(); if (name.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) { return name; } return name + ".png"; } } [HarmonyPatch(typeof(PlayableCard), "UpdateFaceUpOnBoardEffects")] public static class HermitCrabShieldPortraitPatch { private static readonly Dictionary<PlayableCard, bool> ShieldState = new Dictionary<PlayableCard, bool>(); private static readonly Dictionary<PlayableCard, Coroutine> PortraitCoroutines = new Dictionary<PlayableCard, Coroutine>(); [HarmonyPostfix] public static void Postfix(PlayableCard __instance) { if ((Object)(object)__instance == (Object)null || (Object)(object)((Card)__instance).Info == (Object)null) { return; } string extendedProperty = CardExtensions.GetExtendedProperty(((Card)__instance).Info, "OLD_SA.NormalPortrait"); string extendedProperty2 = CardExtensions.GetExtendedProperty(((Card)__instance).Info, "OLD_SA.ArmoredPortrait"); if (!string.IsNullOrWhiteSpace(extendedProperty) && !string.IsNullOrWhiteSpace(extendedProperty2)) { bool flag = __instance.HasShield(); if ((!ShieldState.TryGetValue(__instance, out var value) || value != flag || !PortraitCoroutines.ContainsKey(__instance)) && (!ShieldState.TryGetValue(__instance, out value) || value != flag)) { ShieldState[__instance] = flag; StartPortraitUpdate(__instance, flag); } } } private static void StartPortraitUpdate(PlayableCard card, bool armored) { if ((Object)(object)card == (Object)null) { return; } if (PortraitCoroutines.TryGetValue(card, out var value)) { if (value != null) { ((MonoBehaviour)card).StopCoroutine(value); } PortraitCoroutines.Remove(card); } Coroutine value2 = ((MonoBehaviour)card).StartCoroutine(UpdatePortrait(card, armored)); PortraitCoroutines[card] = value2; } private static IEnumerator UpdatePortrait(PlayableCard card, bool expectedShield) { yield return null; if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { yield break; } bool currentShield = card.HasShield(); if (currentShield != expectedShield) { ShieldState[card] = currentShield; PortraitCoroutines.Remove(card); StartPortraitUpdate(card, currentShield); yield break; } if (expectedShield) { yield return HermitCrabPortraitSwitch.SwitchToArmored(card); } else { yield return HermitCrabPortraitSwitch.ResetPortrait(card); } if ((Object)(object)card != (Object)null) { bool finalShield = card.HasShield(); PortraitCoroutines.Remove(card); if (finalShield != expectedShield) { ShieldState[card] = finalShield; StartPortraitUpdate(card, finalShield); } } } } public static class PortraitRefresh { public static IEnumerator Refresh(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null)) { yield return HermitCrabPortraitSwitch.ResetPortrait(card); TailPortraitSwitch.Reset(card); ((Card)card).RenderCard(); } } } [HarmonyPatch(typeof(TailOnHit), "SetTailLost")] public static class TailPortraitPatch { public static void Postfix(TailOnHit __instance, bool lost) { if ((Object)(object)__instance == (Object)null) { return; } PlayableCard card = GetCard(__instance); if (!((Object)(object)card == (Object)null) && !((Object)(object)((Card)card).Info == (Object)null)) { if (lost) { TailPortraitSwitch.SwitchToLostTail(card); } else { TailPortraitSwitch.Reset(card); } } } private static PlayableCard GetCard(TailOnHit behaviour) { if ((Object)(object)behaviour == (Object)null) { return null; } PropertyInfo propertyInfo = AccessTools.Property(((object)behaviour).GetType(), "Card"); if (propertyInfo != null && typeof(PlayableCard).IsAssignableFrom(propertyInfo.PropertyType)) { try { object? value = propertyInfo.GetValue(behaviour, null); PlayableCard val = (PlayableCard)((value is PlayableCard) ? value : null); if ((Object)(object)val != (Object)null) { return val; } } catch (Exception) { } } Type type = ((object)behaviour).GetType(); while (type != null) { FieldInfo fieldInfo = AccessTools.Field(type, "Card"); if (fieldInfo != null && typeof(PlayableCard).IsAssignableFrom(fieldInfo.FieldType)) { try { object? value2 = fieldInfo.GetValue(behaviour); PlayableCard val2 = (PlayableCard)((value2 is PlayableCard) ? value2 : null); if ((Object)(object)val2 != (Object)null) { return val2; } } catch (Exception) { } } type = type.BaseType; } return null; } } public static class TailPortraitSwitch { private const string NORMAL = "OLD_SA.TailNormalPortrait"; private const string NORMAL_EM = "OLD_SA.TailNormalEmission"; private const string LOST = "OLD_SA.TailLostPortrait"; private const string LOST_EM = "OLD_SA.TailLostEmission"; public static void SwitchToLostTail(PlayableCard card) { SwitchPortrait(card, "OLD_SA.TailLostPortrait", "OLD_SA.TailLostEmission", "断尾"); } public static void Reset(PlayableCard card) { SwitchPortrait(card, "OLD_SA.TailNormalPortrait", "OLD_SA.TailNormalEmission", "普通"); } private static void SwitchPortrait(PlayableCard card, string portraitKey, string emissionKey, string stateName) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return; } string extendedProperty = CardExtensions.GetExtendedProperty(((Card)card).Info, portraitKey); if (!string.IsNullOrWhiteSpace(extendedProperty)) { string extendedProperty2 = CardExtensions.GetExtendedProperty(((Card)card).Info, emissionKey); Sprite val = LoadPortrait(extendedProperty, extendedProperty2); if (!((Object)(object)val == (Object)null)) { card.SwitchToPortrait(val); ((Card)card).RenderCard(); } } } private static Sprite LoadPortrait(string portraitName, string emissionName) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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) portraitName = Normalize(portraitName); Texture2D imageAsTexture; try { imageAsTexture = TextureHelper.GetImageAsTexture(portraitName, (FilterMode)0); } catch (Exception) { return null; } if ((Object)(object)imageAsTexture == (Object)null) { return null; } Sprite val = Sprite.Create(imageAsTexture, new Rect(0f, 0f, (float)((Texture)imageAsTexture).width, (float)((Texture)imageAsTexture).height), new Vector2(0.5f, 0.5f)); ((Object)val).name = portraitName; if (!string.IsNullOrWhiteSpace(emissionName)) { emissionName = Normalize(emissionName); try { Texture2D imageAsTexture2 = TextureHelper.GetImageAsTexture(emissionName, (FilterMode)0); if ((Object)(object)imageAsTexture2 != (Object)null) { Sprite val2 = Sprite.Create(imageAsTexture2, new Rect(0f, 0f, (float)((Texture)imageAsTexture2).width, (float)((Texture)imageAsTexture2).height), new Vector2(0.5f, 0.5f)); ((Object)val2).name = emissionName; TextureHelper.RegisterEmissionForSprite(val, val2); } } catch (Exception) { } } return val; } private static string Normalize(string name) { if (string.IsNullOrWhiteSpace(name)) { return name; } if (!name.EndsWith(".png", StringComparison.OrdinalIgnoreCase)) { return name + ".png"; } return name; } } }
Xenowood_Law_Card/OldSa_Node.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Helpers; using InscryptionAPI.Nodes; using Pixelplacement; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Node")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Node")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("65a5c92a-0050-4a49-8f5b-67eb4bac819a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Node; public static class FungalStitchSpawnState { public static int SpawnedCount; } [HarmonyPatch(typeof(MapGenerator), "GenerateNodes")] public static class FungalStitchMapResetPatch { [HarmonyPrefix] public static void Prefix() { FungalStitchSpawnState.SpawnedCount = 0; } } [HarmonyPatch(typeof(MapGenerator), "CreateNode")] public static class FungalStitchCreateNodePatch { [HarmonyPostfix] public static void Postfix(int x, int y, List<NodeData> nodesInRow, List<NodeData> previousNodes, int mapLength, ref NodeData __result) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown if (FungalStitchNode.Node != null && RunState.Run != null && RunState.Run.regionTier >= 1 && RunState.Run.regionTier <= 3 && y > 4 && y < mapLength - 1 && FungalStitchSpawnState.SpawnedCount < 3 && __result != null && CanReplaceNode(__result) && !(Random.value >= 0.05f)) { CustomSpecialNodeData val = new CustomSpecialNodeData(FungalStitchNode.Node); ((NodeData)val).gridX = x; ((NodeData)val).gridY = y; ((MapElementData)val).id = ((MapElementData)__result).id; __result = (NodeData)(object)val; FungalStitchSpawnState.SpawnedCount++; } } private static bool CanReplaceNode(NodeData node) { if (node is CardBattleNodeData) { return false; } if (node is TotemBattleNodeData) { return false; } if (node is BossBattleNodeData) { return false; } return node is CardChoicesNodeData || node is CardMergeNodeData || node is GainConsumablesNodeData || node is BuildTotemNodeData || node is DuplicateMergeNodeData || node is CardRemoveNodeData || node is CardStatBoostNodeData || node is CopyCardNodeData || node is BuyPeltsNodeData || node is TradePeltsNodeData || node is DeckTrialNodeData || node is BoulderChoiceNodeData; } } public static class FungalStitchNode { public static FullNode Node; public static void Register() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown Assembly assembly = typeof(FungalStitchNode).Assembly; Node = NewNodeManager.New("OLD_SA_FUNGAL_STITCH", "Fungal Stitch", (GenerationType)2, typeof(FungalStitchNodeSequencer), new List<Texture2D> { TextureHelper.GetImageAsTexture("FungalStitch_1.png", assembly, (FilterMode)0), TextureHelper.GetImageAsTexture("FungalStitch_2.png", assembly, (FilterMode)0), TextureHelper.GetImageAsTexture("FungalStitch_3.png", assembly, (FilterMode)0), TextureHelper.GetImageAsTexture("FungalStitch_4.png", assembly, (FilterMode)0) }, new List<SelectionCondition> { (SelectionCondition)new WithinRegionIndexRange(3, 3) }, (List<SelectionCondition>)null, (Action<CustomSpecialNodeData>)null, (Action<CustomSpecialNodeData, MapNode2D>)null, (GameObject)null, (GameObject)null); } } public class FungalStitchNodeSequencer : CustomCardChoiceNodeSequencer { private CardInfo selectedStatsCard; private CardInfo selectedCostCard; private CardInfo selectedAbilitiesCard; private Random stitchRandom; private readonly List<CardInfo> usedCards = new List<CardInfo>(); private CardInfo currentSelectedCard; private CardInfo finalCard; private bool finalCardSelected; private static readonly BindingFlags PrivateInstance = BindingFlags.Instance | BindingFlags.NonPublic; public override bool ShouldDestroyOnEnd(CustomSpecialNodeData node) { return true; } public override bool ShouldNotReturnToMapOnEnd(CustomSpecialNodeData node) { return false; } public override IEnumerator DoCustomSequence(CustomSpecialNodeData node) { ((CustomCardChoiceNodeSequencer)this).Inherit(node); usedCards.Clear(); selectedStatsCard = null; selectedCostCard = null; selectedAbilitiesCard = null; currentSelectedCard = null; finalCard = null; finalCardSelected = false; int seed = SaveManager.SaveFile.GetCurrentRandomSeed(); stitchRandom = new Random(seed); Singleton<TableRuleBook>.Instance.SetOnBoard(true); Singleton<ViewManager>.Instance.SwitchToView((View)1, false, true); yield return (object)new WaitForSeconds(0.1f); LeshyAnimationController.Instance.PutOnMask((Mask)5, true); yield return (object)new WaitForSeconds(1f); Singleton<ViewManager>.Instance.SwitchToView((View)29, false, true); yield return (object)new WaitForSeconds(0.1f); Singleton<OpponentAnimationController>.Instance.SetHeadTrigger("doctor_idle"); SetSideHeadTalking(sideHeadTalking: false); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("You pick!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); SetSideHeadTalking(sideHeadTalking: true); yield return (object)new WaitForSeconds(0.15f); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("We stitch!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); SetSideHeadTalking(sideHeadTalking: false); yield return (object)new WaitForSeconds(0.1f); Singleton<ViewManager>.Instance.SwitchToView((View)3, false, true); yield return (object)new WaitForSeconds(0.15f); List<CardInfo> availableCards = GetUnusedCards(); if (availableCards.Count < 6) { Singleton<ViewManager>.Instance.SwitchToView((View)29, false, true); yield return (object)new WaitForSeconds(0.1f); Singleton<OpponentAnimationController>.Instance.SetHeadTrigger("doctor_idle"); SetSideHeadTalking(sideHeadTalking: false); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("Not enough! We need more!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); SetSideHeadTalking(sideHeadTalking: true); yield return (object)new WaitForSeconds(0.15f); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput("Come back next time!", -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); SetSideHeadTalking(sideHeadTalking: false); yield return (object)new WaitForSeconds(0.1f); Singleton<TextDisplayer>.Instance.Clear(); Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.1f); yield return LeshyAnimationController.Instance.TakeOffMask(); yield break; } int totalCards = Mathf.Min(availableCards.Count, 9); int cardsPerRound = totalCards / 3; int remainder = totalCards % 3; int firstRoundCount = cardsPerRound + ((remainder > 0) ? 1 : 0); int secondRoundCount = cardsPerRound + ((remainder > 1) ? 1 : 0); int thirdRoundCount = cardsPerRound; yield return ShowRoundDialogue("Choose your stats."); yield return SelectCardRound(firstRoundCount, delegate(CardInfo card) { selectedStatsCard = card; }); yield return ShowRoundDialogue("Choose your cost."); yield return SelectCardRound(secondRoundCount, delegate(CardInfo card) { selectedCostCard = card; }); yield return ShowRoundDialogue("Choose your sigils."); yield return SelectCardRound(thirdRoundCount, delegate(CardInfo card) { selectedAbilitiesCard = card; }); RemoveSelectedCardsFromDeck(); finalCard = CreateFungalStitchedCard(); if ((Object)(object)finalCard == (Object)null) { Debug.LogError((object)"[OLD SA Node] Fungal Stitch failed to create the final card."); Singleton<TextDisplayer>.Instance.Clear(); Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false); yield return LeshyAnimationController.Instance.TakeOffMask(); } else { yield return ShowFinalCard(finalCard); SetSideHeadTalking(sideHeadTalking: false); Singleton<TextDisplayer>.Instance.Clear(); Singleton<ViewManager>.Instance.SwitchToView((View)1, false, false); yield return (object)new WaitForSeconds(0.1f); yield return LeshyAnimationController.Instance.TakeOffMask(); } } private IEnumerator ShowRoundDialogue(string message) { SetSideHeadTalking(sideHeadTalking: false); yield return Singleton<TextDisplayer>.Instance.ShowUntilInput(message, -2.5f, 0.5f, (Emotion)0, (LetterAnimation)0, (Speaker)0, (string[])null, true); SetSideHeadTalking(sideHeadTalking: false); yield return (object)new WaitForSeconds(0.15f); } private void SetSideHeadTalking(bool sideHeadTalking) { if ((Object)(object)Singleton<OpponentAnimationController>.Instance != (Object)null) { Singleton<OpponentAnimationController>.Instance.SetHeadBool("doctor_sidehead", sideHeadTalking); } if ((Object)(object)LeshyAnimationController.Instance.CurrentMask != (Object)null) { DoctorMask component = LeshyAnimationController.Instance.CurrentMask.GetComponent<DoctorMask>(); if ((Object)(object)component != (Object)null) { component.SetEyesActive(sideHeadTalking); } } LeshyAnimationController.Instance.EyeAnimationsDisabled = sideHeadTalking; } private IEnumerator SelectCardRound(int numberOfChoices, Action<CardInfo> onSelected) { Singleton<ViewManager>.Instance.SwitchToView((View)3, false, true); yield return (object)new WaitForSeconds(0.1f); List<CardInfo> candidates = GetUnusedRandomCards(numberOfChoices); if (candidates.Count == 0) { Debug.LogError((object)"[OLD SA Node] Fungal Stitch could not find any unused cards."); yield break; } foreach (CardInfo candidate in candidates) { if ((Object)(object)candidate != (Object)null && !usedCards.Contains(candidate)) { usedCards.Add(candidate); } } currentSelectedCard = null; ((CardChoicesSequencer)this).selectableCards = ((CardChoicesSequencer)this).SpawnCards(candidates.Count, ((Component)this).transform, new Vector3(0f, 5.01f, 0f), 1.5f); for (int i = 0; i < candidates.Count; i++) { SelectableCard selectableCard = ((CardChoicesSequencer)this).selectableCards[i]; CardInfo candidate2 = candidates[i]; float centerOffset = (float)(candidates.Count - 1) * 0.75f; ((Component)selectableCard).transform.localPosition = new Vector3(0f - centerOffset + 1.5f * (float)i, 5.01f, 0f); selectableCard.Initialize(candidate2, (Action<SelectableCard>)delegate(SelectableCard card) { if (!((Object)(object)currentSelectedCard != (Object)null)) { currentSelectedCard = ((Card)card).Info; } }, (Action<SelectableCard>)null, false, (Action<SelectableCard>)((CardChoicesSequencer)this).OnCardInspected); ((Card)selectableCard).SetFaceDown(false, false); selectableCard.SetParticlesEnabled(false); ((InteractableBase)selectableCard).SetEnabled(false); ((Card)selectableCard).SetInteractionEnabled(false); ((Component)selectableCard).gameObject.SetActive(true); ((Component)selectableCard).transform.localEulerAngles = new Vector3(90f, 0f, 0f); Vector3 position = ((Component)selectableCard).transform.position; ((Component)selectableCard).transform.position = position + Vector3.forward * 5f + new Vector3(-0.5f + Random.value, 0f, 0f); Tween.Position(((Component)selectableCard).transform, position, 0.3f, 0f, Tween.EaseInOut, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.1f); } yield return (object)new WaitForSeconds(0.25f); ((CardChoicesSequencer)this).SetCollidersEnabled(true); foreach (SelectableCard selectableCard2 in ((CardChoicesSequencer)this).selectableCards) { if (!((Object)(object)selectableCard2 == (Object)null)) { selectableCard2.SetParticlesEnabled(false); ((InteractableBase)selectableCard2).SetEnabled(true); ((Card)selectableCard2).SetInteractionEnabled(true); } } yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)currentSelectedCard != (Object)null)); CardInfo result = currentSelectedCard; ((CardChoicesSequencer)this).SetCollidersEnabled(false); foreach (SelectableCard selectableCard3 in ((CardChoicesSequencer)this).selectableCards) { if (!((Object)(object)selectableCard3 == (Object)null)) { ((InteractableBase)selectableCard3).SetEnabled(false); ((Card)selectableCard3).SetInteractionEnabled(false); } } yield return (object)new WaitForSeconds(0.15f); foreach (SelectableCard selectableCard4 in ((CardChoicesSequencer)this).selectableCards) { if (!((Object)(object)selectableCard4 == (Object)null)) { Tween.Position(((Component)selectableCard4).transform, ((Component)selectableCard4).transform.position + Vector3.forward * 20f, 0.3f, 0f, Tween.EaseInOut, (LoopType)0, (Action)null, (Action)null, true); Object.Destroy((Object)(object)((Component)selectableCard4).gameObject, 0.3f); } } ((CardChoicesSequencer)this).selectableCards.Clear(); onSelected?.Invoke(result); currentSelectedCard = null; yield return (object)new WaitForSeconds(0.3f); } private List<CardInfo> GetUnusedCards() { List<CardInfo> cards = ((CardCollectionInfo)SaveManager.SaveFile.CurrentDeck).Cards; List<CardInfo> list = new List<CardInfo>(); HashSet<string> hashSet = new HashSet<string>(); foreach (CardInfo usedCard in usedCards) { if (!((Object)(object)usedCard == (Object)null) && !string.IsNullOrEmpty(((Object)usedCard).name)) { hashSet.Add(((Object)usedCard).name); } } foreach (CardInfo card in cards) { if (!((Object)(object)card == (Object)null) && !string.IsNullOrEmpty(((Object)card).name) && !hashSet.Contains(((Object)card).name) && !list.Any((CardInfo x) => (Object)(object)x != (Object)null && ((Object)x).name == ((Object)card).name)) { list.Add(card); } } return list; } private List<CardInfo> GetUnusedRandomCards(int count) { List<CardInfo> list = GetUnusedCards(); for (int num = list.Count - 1; num > 0; num--) { int index = stitchRandom.Next(0, num + 1); CardInfo value = list[num]; list[num] = list[index]; list[index] = value; } if (list.Count > count) { list = list.Take(count).ToList(); } return list; } private void RemoveSelectedCardsFromDeck() { if ((Object)(object)selectedStatsCard != (Object)null) { ((CardCollectionInfo)RunState.Run.playerDeck).RemoveCard(selectedStatsCard); } if ((Object)(object)selectedCostCard != (Object)null) { ((CardCollectionInfo)RunState.Run.playerDeck).RemoveCard(selectedCostCard); } if ((Object)(object)selectedAbilitiesCard != (Object)null) { ((CardCollectionInfo)RunState.Run.playerDeck).RemoveCard(selectedAbilitiesCard); } Debug.Log((object)"[OLD SA Node] Fungal Stitch removed the three selected cards from the deck."); } private void ResetFungalStitchTemplateTribes() { CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_STITCHED_SPORES"); if (!((Object)(object)cardByName == (Object)null)) { } } private CardInfo CreateFungalStitchedCard() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_STITCHED_SPORES"); if ((Object)(object)cardByName == (Object)null) { Debug.LogError((object)"[OLD SA Node] Missing OLD_SA_STITCHED_SPORES"); return null; } cardByName.Mods.Clear(); CardModificationInfo val = new CardModificationInfo(); val.attackAdjustment = selectedStatsCard.Attack - cardByName.Attack; val.healthAdjustment = selectedStatsCard.Health - cardByName.Health; val.statIcon = selectedStatsCard.SpecialStatIcon; if (selectedStatsCard.SpecialAbilities != null) { val.specialAbilities = new List<SpecialTriggeredAbility>(selectedStatsCard.SpecialAbilities); } val.bloodCostAdjustment = selectedCostCard.BloodCost - cardByName.BloodCost; val.bonesCostAdjustment = selectedCostCard.BonesCost - cardByName.BonesCost; val.energyCostAdjustment = selectedCostCard.EnergyCost - cardByName.EnergyCost; if (selectedCostCard.GemsCost != null && selectedCostCard.GemsCost.Count > 0) { val.addGemCost = new List<GemType>(selectedCostCard.GemsCost); } if (selectedAbilitiesCard.Abilities != null) { foreach (Ability ability in selectedAbilitiesCard.Abilities) { if (!val.abilities.Contains(ability)) { val.abilities.Add(ability); } } } if (selectedAbilitiesCard.Mods != null) { foreach (CardModificationInfo mod in selectedAbilitiesCard.Mods) { if (mod.abilities != null) { foreach (Ability ability2 in mod.abilities) { if (!val.abilities.Contains(ability2)) { val.abilities.Add(ability2); } } } if (mod.negateAbilities == null) { continue; } foreach (Ability negateAbility in mod.negateAbilities) { if (!val.negateAbilities.Contains(negateAbility)) { val.negateAbilities.Add(negateAbility); } } } } cardByName.Mods.Add(val); return cardByName; } private T GetPrivateField<T>(object obj, string fieldName) { FieldInfo field = obj.GetType().GetField(fieldName, BindingFlags.Instance | BindingFlags.NonPublic); if (field == null) { Debug.LogError((object)("Could not find field: " + fieldName)); return default(T); } return (T)field.GetValue(obj); } private IEnumerator ShowFinalCard(CardInfo info) { Singleton<ViewManager>.Instance.SwitchToView((View)3, false, true); yield return (object)new WaitForSeconds(0.15f); ((CardChoicesSequencer)this).selectableCards = ((CardChoicesSequencer)this).SpawnCards(1, ((Component)this).transform, new Vector3(0f, 5.01f, 0f), 1.5f); if (((CardChoicesSequencer)this).selectableCards.Count == 0) { Debug.LogError((object)"[OLD SA Node] Failed to spawn the final Fungal Stitch card."); yield break; } SelectableCard resultCard = ((CardChoicesSequencer)this).selectableCards[0]; finalCardSelected = false; resultCard.Initialize(info, (Action<SelectableCard>)delegate { if (!finalCardSelected) { finalCardSelected = true; } }, (Action<SelectableCard>)null, false, (Action<SelectableCard>)((CardChoicesSequencer)this).OnCardInspected); ((Card)resultCard).SetFaceDown(false, false); resultCard.SetParticlesEnabled(false); ((InteractableBase)resultCard).SetEnabled(false); ((Card)resultCard).SetInteractionEnabled(false); ((Component)resultCard).gameObject.SetActive(true); ((Component)resultCard).transform.localPosition = new Vector3(0f, 5.01f, 0f); ((Component)resultCard).transform.localEulerAngles = new Vector3(90f, 0f, 0f); Vector3 position = ((Component)resultCard).transform.position; ((Component)resultCard).transform.position = position + Vector3.forward * 5f; Tween.Position(((Component)resultCard).transform, position, 0.3f, 0f, Tween.EaseInOut, (LoopType)0, (Action)null, (Action)null, true); yield return (object)new WaitForSeconds(0.3f); resultCard.SetParticlesEnabled(false); ((CardChoicesSequencer)this).SetCollidersEnabled(true); ((InteractableBase)resultCard).SetEnabled(true); ((Card)resultCard).SetInteractionEnabled(true); yield return (object)new WaitUntil((Func<bool>)(() => finalCardSelected)); ((CardChoicesSequencer)this).SetCollidersEnabled(false); ((InteractableBase)resultCard).SetEnabled(false); ((Card)resultCard).SetInteractionEnabled(false); ((CardCollectionInfo)RunState.Run.playerDeck).AddCard(info); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)resultCard != (Object)null) { Tween.Position(((Component)resultCard).transform, ((Component)resultCard).transform.position + Vector3.forward * 20f, 0.4f, 0f, Tween.EaseInOut, (LoopType)0, (Action)null, (Action)null, true); Object.Destroy((Object)(object)((Component)resultCard).gameObject, 0.4f); } ((CardChoicesSequencer)this).selectableCards.Clear(); yield return (object)new WaitForSeconds(0.4f); } private static void SetPrivateField(object target, string fieldName, object value) { FieldInfo field = target.GetType().GetField(fieldName, PrivateInstance); if (field == null) { Debug.LogError((object)("[OLD SA Node] Could not find private CardInfo field: " + fieldName)); } else { field.SetValue(target, value); } } } [BepInPlugin("OLD_SA.Node", "OLD SA Node", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown Debug.Log((object)"[OLD SA Node] Initializing..."); FungalStitchNode.Register(); Harmony val = new Harmony("oldsa.test"); val.PatchAll(); Debug.Log((object)"[OLD SA Node] All nodes registered."); } }
Xenowood_Law_Card/OldSa_Pelt.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Dialogue; using InscryptionAPI.Helpers; using InscryptionAPI.Pelts; using InscryptionAPI.Pelts.Extensions; using OLD_SA.Pelt; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Pelt")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Pelt")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("b8818afc-f159-4d5d-a320-9616352cd5db")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Incorporal { [HarmonyPatch(typeof(RenderStatsLayer), "AssignCopiedRenderTexture")] public static class GhostCardRenderTexturePatch { [HarmonyPostfix] private static void Postfix(RenderStatsLayer __instance, Texture tex, bool emission) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)tex == (Object)null)) { object? obj = AccessTools.Property(typeof(RenderStatsLayer), "PlayableCard")?.GetValue(__instance, null); PlayableCard val = (PlayableCard)((obj is PlayableCard) ? obj : null); if (!((Object)(object)val == (Object)null) && GhostCard.IsApplied(val)) { GhostCard.SyncRenderTexture(val, tex, emission); } } } } } namespace OLD_SA.Pelt { public static class GhostCard { private static AssetBundle ghostBundle; private static Material ghostBaseMaterial; private static readonly Dictionary<PlayableCard, Material> originalMaterials = new Dictionary<PlayableCard, Material>(); private static readonly Dictionary<PlayableCard, Material> ghostMaterials = new Dictionary<PlayableCard, Material>(); private static string BundlePath => Path.Combine(Paths.PluginPath, "OLD_SA_DLC", "OLD_SA_Card", "old_sa_ghost"); private static bool LoadGhostBundle() { if ((Object)(object)ghostBaseMaterial != (Object)null) { return true; } if ((Object)(object)ghostBundle == (Object)null) { if (!File.Exists(BundlePath)) { return false; } ghostBundle = AssetBundle.LoadFromFile(BundlePath); if ((Object)(object)ghostBundle == (Object)null) { return false; } } ghostBaseMaterial = ghostBundle.LoadAsset<Material>("assets/ghostcard_material.mat"); if ((Object)(object)ghostBaseMaterial == (Object)null) { return false; } return true; } public static void SyncRenderTexture(PlayableCard card, Texture tex, bool emission) { if ((Object)(object)card == (Object)null || (Object)(object)tex == (Object)null) { return; } Material value = null; if (!ghostMaterials.TryGetValue(card, out value) || (Object)(object)value == (Object)null) { return; } if (emission) { if (value.HasProperty("_EmissionMap")) { value.SetTexture("_EmissionMap", tex); } } else if (value.HasProperty("_MainTex")) { value.SetTexture("_MainTex", tex); } Material value2 = null; if (!originalMaterials.TryGetValue(card, out value2) || !((Object)(object)value2 != (Object)null)) { return; } if (emission) { if (value2.HasProperty("_EmissionMap")) { value2.SetTexture("_EmissionMap", tex); } } else if (value2.HasProperty("_MainTex")) { value2.SetTexture("_MainTex", tex); } } public static void Apply(PlayableCard card) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).StatsLayer == (Object)null) { return; } Material value = null; if (ghostMaterials.TryGetValue(card, out value)) { if (!((Object)(object)value == (Object)null)) { if ((Object)(object)((Card)card).StatsLayer.Material != (Object)(object)value) { ((Card)card).StatsLayer.Material = value; } return; } ghostMaterials.Remove(card); } if ((Object)(object)((Card)card).StatsLayer.Material == (Object)null || !LoadGhostBundle()) { return; } Material material = ((Card)card).StatsLayer.Material; if ((Object)(object)material == (Object)null) { return; } Material val = new Material(ghostBaseMaterial); if (material.HasProperty("_MainTex") && val.HasProperty("_MainTex")) { Texture texture = material.GetTexture("_MainTex"); if ((Object)(object)texture != (Object)null) { val.SetTexture("_MainTex", texture); } } if (material.HasProperty("_EmissionMap") && val.HasProperty("_EmissionMap")) { Texture texture2 = material.GetTexture("_EmissionMap"); if ((Object)(object)texture2 != (Object)null) { val.SetTexture("_EmissionMap", texture2); } } originalMaterials[card] = material; ghostMaterials[card] = val; ((Card)card).StatsLayer.Material = val; } public static void Refresh(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Material value = null; if (ghostMaterials.TryGetValue(card, out value) && !((Object)(object)value == (Object)null) && !((Object)(object)((Card)card).StatsLayer == (Object)null) && (Object)(object)((Card)card).StatsLayer.Material != (Object)(object)value) { ((Card)card).StatsLayer.Material = value; } } } public static void Remove(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Material value = null; originalMaterials.TryGetValue(card, out value); Material value2 = null; ghostMaterials.TryGetValue(card, out value2); if ((Object)(object)((Card)card).StatsLayer != (Object)null && (Object)(object)value != (Object)null) { ((Card)card).StatsLayer.Material = value; } if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)value2); } originalMaterials.Remove(card); ghostMaterials.Remove(card); } } public static bool IsApplied(PlayableCard card) { if ((Object)(object)card == (Object)null) { return false; } Material value = null; if (!ghostMaterials.TryGetValue(card, out value)) { return false; } if ((Object)(object)value == (Object)null) { return false; } if ((Object)(object)((Card)card).StatsLayer == (Object)null) { return false; } return (Object)(object)((Card)card).StatsLayer.Material == (Object)(object)value; } public static Material GetGhostMaterial(PlayableCard card) { if ((Object)(object)card == (Object)null) { return null; } Material value = null; if (ghostMaterials.TryGetValue(card, out value)) { return value; } return null; } public static void Forget(PlayableCard card) { if (!((Object)(object)card == (Object)null)) { Material value = null; if (ghostMaterials.TryGetValue(card, out value) && (Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } originalMaterials.Remove(card); ghostMaterials.Remove(card); } } } public static class HolyPelt { private const string HolyPeltName = "OLD_SA_HOLY_PELT"; public static void Initialize() { RegisterHolyPelt(); } private static void RegisterHolyPelt() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_HOLY_PELT"); Func<List<CardInfo>> func = () => CardLoader.GetUnlockedCards((CardMetaCategory)3, (CardTemple)0); PeltData val = PeltManager.New("OLD_SA.Pelt", cardByName, func, 11, 1, 4); val.peltTierName = "Holy"; val.isSoldByTrapper = true; DialogueManager.GenerateTraderPeltsEvent("OLD_SA.Pelt", val, new List<CustomLine> { CustomLine.op_Implicit("Your creatures have all been driven wild by this.") }, (List<List<CustomLine>>)null); } private static int GetHolyPeltPrice(SelectableCard card) { PeltData val = PeltManager.AllPeltsAvailableAtTrader().Find((PeltData x) => x != null && x.peltCardName == "OLD_SA_HOLY_PELT"); if (val != null) { return val.BuyPrice; } return 11; } } public class OldSaEerieForestBackground : CardAppearanceBehaviour { public static Appearance ID; private static Texture2D BackgroundTexture; public override void ApplyAppearance() { if ((Object)(object)BackgroundTexture == (Object)null) { BackgroundTexture = TextureHelper.GetImageAsTexture("OldSa_Eerie_Forest_Background.png", (FilterMode)0); } ((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)BackgroundTexture; } } public class OldSaMythBackground : CardAppearanceBehaviour { public static Appearance ID; private static Texture2D BackgroundTexture; public override void ApplyAppearance() { if ((Object)(object)BackgroundTexture == (Object)null) { BackgroundTexture = TextureHelper.GetImageAsTexture("OldSa_Myth_Background.png", (FilterMode)0); } ((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)BackgroundTexture; } } public class OldSaPlantBackground : CardAppearanceBehaviour { public static Appearance ID; private static Texture2D BackgroundTexture; public override void ApplyAppearance() { if ((Object)(object)BackgroundTexture == (Object)null) { BackgroundTexture = TextureHelper.GetImageAsTexture("OldSa_Plant_Background.png", (FilterMode)0); } ((CardAppearanceBehaviour)this).Card.RenderInfo.baseTextureOverride = (Texture)(object)BackgroundTexture; } } [BepInPlugin("OLD_SA.Pelt", "OLD SA Pelt", "1.0.0")] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "OLD_SA.Pelt"; public const string PluginName = "OLD SA Pelt"; public const string PluginVersion = "1.0.0"; internal static Plugin Instance; internal static ManualLogSource Log; private const string BrokenPeltName = "OLD_SA_BROKEN_PELT"; private const string HolyPeltName = "OLD_SA_HOLY_PELT"; private const string BrokenModificationId = "OLD_SA_BROKEN_PELT_MOD"; private void Awake() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00ed: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; try { FullCardAppearanceBehaviour val = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "RainbowEmission", typeof(RainbowEmission)); RainbowEmission.ID = val.Id; FullCardAppearanceBehaviour val2 = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "SacredSilver", typeof(SacredSilver)); SacredSilver.ID = val2.Id; FullCardAppearanceBehaviour val3 = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "OldSa_Eerie_Forest_Background", typeof(OldSaEerieForestBackground)); OldSaEerieForestBackground.ID = val3.Id; FullCardAppearanceBehaviour val4 = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "OldSa_Plant_Background", typeof(OldSaPlantBackground)); OldSaPlantBackground.ID = val4.Id; FullCardAppearanceBehaviour val5 = CardAppearanceBehaviourManager.Add("OLD_SA.Pelt", "OldSa_Myth_Background", typeof(OldSaMythBackground)); OldSaMythBackground.ID = val5.Id; RegisterBrokenPelt(); HolyPelt.Initialize(); PurePelt.Initialize(); Harmony val6 = new Harmony("OLD_SA.Pelt"); val6.PatchAll(); } catch (Exception ex) { Log.LogError((object)("[OLD SA Pelt] Initialization failed: " + ex)); } } private void RegisterBrokenPelt() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_BROKEN_PELT"); if ((Object)(object)cardByName == (Object)null) { Log.LogError((object)"[OLD SA Pelt] Could not find card: OLD_SA_BROKEN_PELT"); return; } Func<List<CardInfo>> func = delegate { List<CardInfo> unlockedCards = CardLoader.GetUnlockedCards((CardMetaCategory)1, (CardTemple)0); unlockedCards.RemoveAll((CardInfo card) => !CanBeBroken(card)); return unlockedCards; }; PeltData val = PeltManager.New("OLD_SA.Pelt", cardByName, func, 1, 0, 8); val.isSoldByTrapper = false; val.peltTierName = "Broken"; DialogueManager.GenerateTraderPeltsEvent("OLD_SA.Pelt", val, new List<CustomLine> { CustomLine.op_Implicit("What good do you think I have to offer you?") }, (List<List<CustomLine>>)null); PeltExtensions.SetModifyCardChoiceAtTrader(val, (Action<CardInfo>)ModifyBrokenCard); PeltExtensions.SetModifyCardChoiceAtTrader(val, (Action<CardInfo>)ModifyBrokenCard); Log.LogInfo((object)"[OLD SA Pelt] Registered OLD_SA_BROKEN_PELT."); } private static bool CanBeBroken(CardInfo cardInfo) { if ((Object)(object)cardInfo == (Object)null) { return false; } if (cardInfo.Attack > 0) { return true; } if (cardInfo.Health > 2) { return true; } if (cardInfo.Abilities != null && cardInfo.Abilities.Count > 0) { return true; } return false; } private static void ModifyBrokenCard(CardInfo cardInfo) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown if ((Object)(object)cardInfo == (Object)null) { return; } if (cardInfo.Mods != null) { foreach (CardModificationInfo mod in cardInfo.Mods) { if (mod == null || !(mod.singletonId == "OLD_SA_BROKEN_PELT_MOD")) { continue; } return; } } int attack = cardInfo.Attack; int health = cardInfo.Health; bool flag = attack > 0; bool flag2 = health > 2; CardModificationInfo val = new CardModificationInfo(); if (flag && flag2) { if (Random.Range(0, 2) == 0) { val.attackAdjustment = -1; } else { val.healthAdjustment = -2; } } else if (flag) { val.attackAdjustment = -1; } else if (flag2) { val.healthAdjustment = -2; } else { RemoveRandomAbility(cardInfo, val); } string text = cardInfo.DisplayedNameLocalized; if (string.IsNullOrEmpty(text)) { text = ((Object)cardInfo).name; } val.nameReplacement = string.Format(Localization.Translate("Broken {0}"), text); val.singletonId = "OLD_SA_BROKEN_PELT_MOD"; if (cardInfo.Mods == null) { cardInfo.Mods = new List<CardModificationInfo>(); } cardInfo.Mods.Add(val); } private static void RemoveRandomAbility(CardInfo cardInfo, CardModificationInfo brokenMod) { //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_0061: Unknown result type (might be due to invalid IL or missing references) if (cardInfo.Abilities != null && cardInfo.Abilities.Count != 0) { List<Ability> list = new List<Ability>(cardInfo.Abilities); if (list.Count != 0) { Ability item = list[Random.Range(0, list.Count)]; brokenMod.negateAbilities = new List<Ability>(); brokenMod.negateAbilities.Add(item); } } } internal static bool HasBrokenPeltInHand() { if ((Object)(object)Singleton<PlayerHand>.Instance == (Object)null) { return false; } foreach (PlayableCard item in Singleton<PlayerHand>.Instance.CardsInHand) { if ((Object)(object)item == (Object)null || (Object)(object)((Card)item).Info == (Object)null || !(((Object)((Card)item).Info).name == "OLD_SA_BROKEN_PELT")) { continue; } return true; } return false; } internal static bool HasHolyPeltInHand() { if ((Object)(object)Singleton<PlayerHand>.Instance == (Object)null) { return false; } foreach (PlayableCard item in Singleton<PlayerHand>.Instance.CardsInHand) { if ((Object)(object)item == (Object)null || (Object)(object)((Card)item).Info == (Object)null || !(((Object)((Card)item).Info).name == "OLD_SA_HOLY_PELT")) { continue; } return true; } return false; } } public static class PurePelt { private const string PurePeltName = "OLD_SA_PURE_PELT"; private const string PureModificationId = "OLD_SA_PURE_PELT_MOD"; public static void Initialize() { RegisterPurePelt(); } private static void RegisterPurePelt() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) CardInfo cardByName = CardLoader.GetCardByName("OLD_SA_PURE_PELT"); if ((Object)(object)cardByName == (Object)null) { Debug.LogError((object)"[OLD SA Pelt] Could not find card: OLD_SA_PURE_PELT"); return; } Func<List<CardInfo>> func = delegate { List<CardInfo> unlockedCards = CardLoader.GetUnlockedCards((CardMetaCategory)3, (CardTemple)0); unlockedCards.RemoveAll((CardInfo card) => !CanReceivePure(card)); return unlockedCards; }; PeltData val = PeltManager.New("OLD_SA.Pelt", cardByName, func, 11, 0, 4); val.peltTierName = "Pure"; val.isSoldByTrapper = true; DialogueManager.GenerateTraderPeltsEvent("OLD_SA.Pelt", val, new List<CustomLine> { CustomLine.op_Implicit("Your creatures are purged of impurity and grow stronger.") }, (List<List<CustomLine>>)null); PeltExtensions.SetModifyCardChoiceAtTrader(val, (Action<CardInfo>)ModifyPureCard); } private static bool CanReceivePure(CardInfo cardInfo) { if ((Object)(object)cardInfo == (Object)null) { return false; } bool flag = HasAttackParameter(cardInfo); bool flag2 = HasHealthParameter(cardInfo); if (flag && flag2) { return false; } return true; } private static bool HasAttackParameter(CardInfo cardInfo) { if ((Object)(object)cardInfo == (Object)null) { return false; } if (HasSpecialStatIconAttack(cardInfo)) { return true; } if (cardInfo.Mods != null) { foreach (CardModificationInfo mod in cardInfo.Mods) { if (mod == null || mod.attackAdjustment <= 0) { continue; } return true; } } return false; } private static bool HasHealthParameter(CardInfo cardInfo) { if ((Object)(object)cardInfo == (Object)null) { return false; } if (HasSpecialStatIconHealth(cardInfo)) { return true; } if (cardInfo.Mods != null) { foreach (CardModificationInfo mod in cardInfo.Mods) { if (mod == null || mod.healthAdjustment <= 0) { continue; } return true; } } return false; } private static bool HasSpecialStatIconAttack(CardInfo cardInfo) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cardInfo == (Object)null) { return false; } List<SpecialTriggeredAbility> specialTriggeredAbilities = GetSpecialTriggeredAbilities(cardInfo); if (specialTriggeredAbilities == null || specialTriggeredAbilities.Count == 0) { return false; } foreach (FullStatIcon allStatIcon in StatIconManager.AllStatIcons) { if (allStatIcon == null || (Object)(object)allStatIcon.Info == (Object)null || !allStatIcon.Info.appliesToAttack || !specialTriggeredAbilities.Contains(allStatIcon.AbilityId)) { continue; } return true; } return false; } private static bool HasSpecialStatIconHealth(CardInfo cardInfo) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cardInfo == (Object)null) { return false; } List<SpecialTriggeredAbility> specialTriggeredAbilities = GetSpecialTriggeredAbilities(cardInfo); if (specialTriggeredAbilities == null || specialTriggeredAbilities.Count == 0) { return false; } foreach (FullStatIcon allStatIcon in StatIconManager.AllStatIcons) { if (allStatIcon == null || (Object)(object)allStatIcon.Info == (Object)null || !allStatIcon.Info.appliesToHealth || !specialTriggeredAbilities.Contains(allStatIcon.AbilityId)) { continue; } return true; } return false; } private static List<SpecialTriggeredAbility> GetSpecialTriggeredAbilities(CardInfo cardInfo) { List<SpecialTriggeredAbility> list = new List<SpecialTriggeredAbility>(); if ((Object)(object)cardInfo == (Object)null) { return list; } Type type = ((object)cardInfo).GetType(); while (type != null) { FieldInfo[] fields = type.GetFields(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo[] array = fields; foreach (FieldInfo fieldInfo in array) { if (!(fieldInfo == null)) { object value; try { value = fieldInfo.GetValue(cardInfo); } catch { continue; } if (value != null) { AddSpecialTriggeredAbilities(value, list); } } } PropertyInfo[] properties = type.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); PropertyInfo[] array2 = properties; foreach (PropertyInfo propertyInfo in array2) { if (!(propertyInfo == null) && propertyInfo.CanRead && propertyInfo.GetIndexParameters().Length == 0) { object value2; try { value2 = propertyInfo.GetValue(cardInfo, null); } catch { continue; } if (value2 != null) { AddSpecialTriggeredAbilities(value2, list); } } } type = type.BaseType; } return list.Distinct().ToList(); } private static void AddSpecialTriggeredAbilities(object value, List<SpecialTriggeredAbility> result) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Invalid comparison between Unknown and I4 //IL_008a: Unknown result type (might be due to invalid IL or missing references) if (value == null) { return; } if (value is SpecialTriggeredAbility val) { if ((int)val > 0) { result.Add(val); } } else { if (!(value is IEnumerable enumerable)) { return; } foreach (object item in enumerable) { if (item is SpecialTriggeredAbility val2 && (int)val2 > 0) { result.Add(val2); } } } } private static void ModifyPureCard(CardInfo cardInfo) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown if ((Object)(object)cardInfo == (Object)null) { return; } if (cardInfo.Mods != null) { foreach (CardModificationInfo mod in cardInfo.Mods) { if (mod == null || !(mod.singletonId == "OLD_SA_PURE_PELT_MOD")) { continue; } return; } } bool flag = HasAttackParameter(cardInfo); bool flag2 = HasHealthParameter(cardInfo); if (!(flag && flag2)) { CardModificationInfo val = new CardModificationInfo(); if (flag) { val.healthAdjustment = 2; } else if (flag2) { val.attackAdjustment = 1; } else if (Random.Range(0, 2) == 0) { val.attackAdjustment = 1; } else { val.healthAdjustment = 2; } string text = cardInfo.DisplayedNameLocalized; if (string.IsNullOrEmpty(text)) { text = ((Object)cardInfo).name; } val.nameReplacement = string.Format(Localization.Translate("Pure {0}"), text); val.singletonId = "OLD_SA_PURE_PELT_MOD"; if (cardInfo.Mods == null) { cardInfo.Mods = new List<CardModificationInfo>(); } cardInfo.Mods.Add(val); } } } public class RainbowEmission : CardAppearanceBehaviour { public static Appearance ID; private static AssetBundle rainbowBundle; private static Material rainbowBaseMaterial; private Material originalMaterial; private Material rainbowMaterial; private static string GetBundlePath() { string location = Assembly.GetExecutingAssembly().Location; string directoryName = Path.GetDirectoryName(location); if (string.IsNullOrEmpty(directoryName)) { Debug.LogError((object)"[OLD SA Pelt] Failed to locate DLL directory."); return null; } return Path.Combine(directoryName, "old_sa_rainbow"); } private static bool LoadRainbowBundle() { if ((Object)(object)rainbowBaseMaterial != (Object)null) { return true; } if ((Object)(object)rainbowBundle == (Object)null) { string bundlePath = GetBundlePath(); if (string.IsNullOrEmpty(bundlePath)) { return false; } if (!File.Exists(bundlePath)) { Debug.LogError((object)("[OLD SA Pelt] Rainbow AssetBundle not found: " + bundlePath)); return false; } rainbowBundle = AssetBundle.LoadFromFile(bundlePath); if ((Object)(object)rainbowBundle == (Object)null) { Debug.LogError((object)("[OLD SA Pelt] Failed to load Rainbow AssetBundle: " + bundlePath)); return false; } } rainbowBaseMaterial = rainbowBundle.LoadAsset<Material>("assets/rainbowoilfilm_material.mat"); if ((Object)(object)rainbowBaseMaterial == (Object)null) { Debug.LogError((object)"[OLD SA Pelt] RainbowOilFilm_Material not found in AssetBundle."); return false; } return true; } public override void ApplyAppearance() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown if (!((Object)(object)((CardAppearanceBehaviour)this).Card == (Object)null) && !((Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer == (Object)null) && !((Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer.Material == (Object)null) && LoadRainbowBundle()) { originalMaterial = ((CardAppearanceBehaviour)this).Card.StatsLayer.Material; rainbowMaterial = new Material(rainbowBaseMaterial); ((CardAppearanceBehaviour)this).Card.StatsLayer.Material = rainbowMaterial; } } public override void ManagedUpdate() { if (!((Object)(object)rainbowMaterial == (Object)null)) { } } public override void ResetAppearance() { if ((Object)(object)((CardAppearanceBehaviour)this).Card != (Object)null && (Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer != (Object)null && (Object)(object)originalMaterial != (Object)null) { ((CardAppearanceBehaviour)this).Card.StatsLayer.Material = originalMaterial; } if ((Object)(object)rainbowMaterial != (Object)null) { Object.Destroy((Object)(object)rainbowMaterial); rainbowMaterial = null; } originalMaterial = null; } } public class SacredSilver : CardAppearanceBehaviour { public static Appearance ID; private static AssetBundle sacredSilverBundle; private static Material sacredSilverBaseMaterial; private Material originalMaterial; private Material sacredSilverMaterial; private static string GetBundlePath() { string location = Assembly.GetExecutingAssembly().Location; string directoryName = Path.GetDirectoryName(location); if (string.IsNullOrEmpty(directoryName)) { Debug.LogError((object)"[OLD SA Pelt] Failed to locate DLL directory."); return null; } return Path.Combine(directoryName, "oldsa_sacred_silver"); } private static bool LoadSacredSilverBundle() { if ((Object)(object)sacredSilverBaseMaterial != (Object)null) { return true; } if ((Object)(object)sacredSilverBundle == (Object)null) { string bundlePath = GetBundlePath(); if (string.IsNullOrEmpty(bundlePath)) { return false; } if (!File.Exists(bundlePath)) { Debug.LogError((object)("[OLD SA Pelt] Sacred Silver AssetBundle not found: " + bundlePath)); return false; } sacredSilverBundle = AssetBundle.LoadFromFile(bundlePath); if ((Object)(object)sacredSilverBundle == (Object)null) { Debug.LogError((object)("[OLD SA Pelt] Failed to load Sacred Silver AssetBundle: " + bundlePath)); return false; } } sacredSilverBaseMaterial = sacredSilverBundle.LoadAsset<Material>("assets/sacredsilver.mat"); if ((Object)(object)sacredSilverBaseMaterial == (Object)null) { Debug.LogError((object)"[OLD SA Pelt] SacredSilver Material not found in AssetBundle."); return false; } return true; } public override void ApplyAppearance() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown if (!((Object)(object)((CardAppearanceBehaviour)this).Card == (Object)null) && !((Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer == (Object)null) && !((Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer.Material == (Object)null) && LoadSacredSilverBundle()) { originalMaterial = ((CardAppearanceBehaviour)this).Card.StatsLayer.Material; sacredSilverMaterial = new Material(sacredSilverBaseMaterial); ((CardAppearanceBehaviour)this).Card.StatsLayer.Material = sacredSilverMaterial; } } public override void ManagedUpdate() { if (!((Object)(object)sacredSilverMaterial == (Object)null)) { } } public override void ResetAppearance() { if ((Object)(object)((CardAppearanceBehaviour)this).Card != (Object)null && (Object)(object)((CardAppearanceBehaviour)this).Card.StatsLayer != (Object)null && (Object)(object)originalMaterial != (Object)null) { ((CardAppearanceBehaviour)this).Card.StatsLayer.Material = originalMaterial; } if ((Object)(object)sacredSilverMaterial != (Object)null) { Object.Destroy((Object)(object)sacredSilverMaterial); sacredSilverMaterial = null; } originalMaterial = null; } } }
Xenowood_Law_Card/OldSa_Trait.dll
Decompiled 20 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Trait")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Trait")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("628debee-9b42-44ac-b32a-51f8ddb48f10")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA { public class OLD_SA_LifeShield : MonoBehaviour { public int stacks; public int GetStacks() { return stacks; } public void AddShield(int amount) { if (amount > 0) { stacks += amount; PlayableCard component = ((Component)this).GetComponent<PlayableCard>(); if ((Object)(object)component != (Object)null) { ((Card)component).RenderCard(); ((MonoBehaviour)component).StartCoroutine(ShieldTransform.Transform(component)); } } } public bool ConsumeShield() { if (stacks <= 0) { return false; } stacks--; PlayableCard component = ((Component)this).GetComponent<PlayableCard>(); if ((Object)(object)component != (Object)null) { ((Card)component).RenderCard(); component.UpdateFaceUpOnBoardEffects(); } return true; } } [HarmonyPatch(typeof(PlayableCard), "TakeDamage")] public static class LifeShieldPatch { [HarmonyPrefix] public static bool Prefix(PlayableCard __instance, int damage, PlayableCard attacker, ref IEnumerator __result) { if ((Object)(object)__instance == (Object)null) { return true; } OLD_SA_LifeShield component = ((Component)__instance).GetComponent<OLD_SA_LifeShield>(); if ((Object)(object)component == (Object)null || component.stacks <= 0) { return true; } if (damage < __instance.Health) { return true; } component.ConsumeShield(); __result = SaveByLifeShield(__instance, damage, attacker); return false; } private static IEnumerator SaveByLifeShield(PlayableCard card, int damage, PlayableCard attacker) { if (!((Object)(object)card == (Object)null) && !card.Dead) { card.Status.damageTaken = card.Health - 1; card.OnStatsChanged(); ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); yield return null; } } } [BepInPlugin("oldsa.inscryption", "OLD SA", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Plugin 正在加载"); Harmony val = new Harmony("oldsa.inscryption"); val.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Harmony 补丁安装完成"); } } } namespace OLD_SA.CardTraits { [HarmonyPatch(typeof(PlayableCard), "Die")] public static class BloodArmorKillPatch { [HarmonyPostfix] public static void Postfix(PlayableCard __instance, PlayableCard killer) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)killer == (Object)null) && !killer.Dead && killer.OnBoard && killer.HasOldSaTrait("OLD_SA_BLOOD_ARMOR")) { BloodArmorTrait bloodArmorTrait = ((Component)killer).GetComponent<BloodArmorTrait>(); if ((Object)(object)bloodArmorTrait == (Object)null) { bloodArmorTrait = ((Component)killer).gameObject.AddComponent<BloodArmorTrait>(); } bloodArmorTrait.RegisterKill(); } } } public class BloodArmorTrait : MonoBehaviour { private const int KillRequired = 2; private int killCount; public void RegisterKill() { PlayableCard component = ((Component)this).GetComponent<PlayableCard>(); if (!((Object)(object)component == (Object)null) && !component.Dead && component.OnBoard && component.HasOldSaTrait("OLD_SA_BLOOD_ARMOR")) { killCount++; while (killCount >= 2) { killCount -= 2; AddArmor(component); } } } private void AddArmor(PlayableCard card) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown if (!((Object)(object)card == (Object)null) && !card.Dead) { CardModificationInfo val = new CardModificationInfo((Ability)54); card.AddTemporaryMod(val); if ((Object)(object)((Card)card).Anim != (Object)null) { ((Card)card).Anim.LightNegationEffect(); } ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); } } } public class BloodDevourerTrait : OLD_SA_TraitBehaviour { public const string Trait = "OLD_SA_BLOOD_DEVOURER"; } public class BoleteGrowthState : MonoBehaviour { public int Form = 0; public int HealingProgress = 0; public PlayableCard Card => ((Component)this).GetComponent<PlayableCard>(); public void SetForm(int value) { Form = Mathf.Clamp(value, 0, 2); } public void AddHealing(int amount) { HealingProgress += amount; } public bool CanEvolveByHealing() { return Form == 1 && HealingProgress >= 2; } public void ResetHealing() { HealingProgress = 0; } } [HarmonyPatch(typeof(CardMergeSequencer), "GetValidCardsForSacrifice")] internal static class CardMergeSequencer_SpecialPeltSacrificePatch { [HarmonyPostfix] private static void Postfix(ref List<CardInfo> __result) { if (__result != null && __result.Count != 0) { __result.RemoveAll((CardInfo card) => (Object)(object)card != (Object)null && card.HasOldSaTrait("OLD_SA_PITIFUL_SACRIFICE")); } } } public static class GreedyCardManager { public static GreedyCardTrait GetActiveGreedyCard() { if ((Object)(object)Singleton<BoardManager>.Instance == (Object)null) { return null; } foreach (CardSlot item in Singleton<BoardManager>.Instance.PlayerSlotsCopy) { if (!((Object)(object)item.Card == (Object)null)) { GreedyCardTrait component = ((Component)item.Card).GetComponent<GreedyCardTrait>(); if ((Object)(object)component != (Object)null) { return component; } } } return null; } } [HarmonyPatch(typeof(CardDrawPiles3D), "DrawFromSidePile")] public static class GreedyCardPatch { [HarmonyPrefix] public static bool Prefix(CardDrawPiles3D __instance) { GreedyCardTrait activeGreedyCard = GreedyCardManager.GetActiveGreedyCard(); if ((Object)(object)activeGreedyCard == (Object)null) { return true; } if (activeGreedyCard.ShouldBlock()) { ((MonoBehaviour)__instance).StartCoroutine(activeGreedyCard.PlayDialogue()); return false; } activeGreedyCard.AddDrawCount(); return true; } } [HarmonyPatch(typeof(PlayableCard), "HealDamage")] internal static class HealingArmorHealPatch { private static void Prefix(PlayableCard __instance, out int __state) { __state = (((Object)(object)__instance != (Object)null) ? __instance.Health : 0); } private static void Postfix(PlayableCard __instance, int __state) { if (!((Object)(object)__instance != (Object)null) || (Object)(object)((Card)__instance).Info != (Object)null) { } if ((Object)(object)__instance == (Object)null || (Object)(object)((Card)__instance).Info == (Object)null || __instance.Dead || !__instance.OnBoard || (Object)(object)__instance == (Object)null || (Object)(object)((Card)__instance).Info == (Object)null || __instance.Dead || !__instance.OnBoard) { return; } int num = __instance.Health - __state; if (num > 0 && __instance.HasOldSaTrait("OLD_SA_HEALING_ARMOR")) { HealingArmorTrait healingArmorTrait = ((Component)__instance).GetComponent<HealingArmorTrait>(); if ((Object)(object)healingArmorTrait == (Object)null) { healingArmorTrait = ((Component)__instance).gameObject.AddComponent<HealingArmorTrait>(); } healingArmorTrait.RegisterHealing(num); } } } public class HealingArmorTrait : MonoBehaviour { private const int HealRequired = 2; private int accumulatedHealing; public void RegisterHealing(int amount) { if (amount <= 0) { return; } PlayableCard component = ((Component)this).GetComponent<PlayableCard>(); if (!((Object)(object)component == (Object)null) && !component.Dead && component.OnBoard && component.HasOldSaTrait("OLD_SA_HEALING_ARMOR")) { accumulatedHealing += amount; while (accumulatedHealing >= 2) { accumulatedHealing -= 2; AddLifeShield(component); } } } private void AddLifeShield(PlayableCard card) { if (!((Object)(object)card == (Object)null) && !card.Dead) { OLD_SA_LifeShield oLD_SA_LifeShield = ((Component)card).GetComponent<OLD_SA_LifeShield>(); if ((Object)(object)oLD_SA_LifeShield == (Object)null) { oLD_SA_LifeShield = ((Component)card).gameObject.AddComponent<OLD_SA_LifeShield>(); } oLD_SA_LifeShield.AddShield(1); if ((Object)(object)((Card)card).Anim != (Object)null) { ((Card)card).Anim.LightNegationEffect(); } ((Card)card).RenderCard(); card.UpdateFaceUpOnBoardEffects(); } } } public class BeeHunterTrait : OLD_SA_TraitBehaviour { public override bool RespondsToOtherCardResolve(PlayableCard otherCard) { return (Object)(object)otherCard != (Object)null && otherCard.OpponentCard && otherCard.HasOldSaTrait("OLD_SA_BEE"); } public override IEnumerator OnOtherCardResolve(PlayableCard otherCard) { yield return CardTraitDialogueManager.TryTrigger(((SpecialCardBehaviour)this).PlayableCard, "OLD_SA_BEE_HUNTER"); otherCard.TakeDamage(((SpecialCardBehaviour)this).PlayableCard.Attack, ((SpecialCardBehaviour)this).PlayableCard); } } public class GreedyCardTrait : OLD_SA_TraitBehaviour { private int sideDeckDrawCount; public PlayableCard OwnerCard => ((SpecialCardBehaviour)this).PlayableCard; public void AddDrawCount() { sideDeckDrawCount++; } public bool ShouldBlock() { return sideDeckDrawCount >= 5; } public override void OnCleanUp() { sideDeckDrawCount = 0; } public IEnumerator PlayDialogue() { yield return CardTraitDialogueManager.TryTrigger(OwnerCard, "OLD_SA_GREEDY_CARD"); } } public static class OLD_SA_Traits { public const string Bee = "OLD_SA_BEE"; public const string BeeHunter = "OLD_SA_BEE_HUNTER"; public const string GreedyCard = "OLD_SA_GREEDY_CARD"; public const string BloodDevourer = "OLD_SA_BLOOD_DEVOURER"; public const string PitifulSacrifice = "OLD_SA_PITIFUL_SACRIFICE"; public const string BloodBoleteArmor = "OLD_SA_BLOOD_BOLETE_ARMOR"; public const string HealingArmor = "OLD_SA_HEALING_ARMOR"; public const string BloodArmor = "OLD_SA_BLOOD_ARMOR"; } public static class OLD_SA_TraitAPI { private const string TraitProperty = "OLD_SA_Traits"; public static bool HasOldSaTrait(this CardInfo info, string trait) { if ((Object)(object)info == (Object)null || string.IsNullOrWhiteSpace(trait)) { return false; } string extendedProperty = CardExtensions.GetExtendedProperty(info, "OLD_SA_Traits"); if (string.IsNullOrWhiteSpace(extendedProperty)) { return false; } return (from x in extendedProperty.Split(new char[1] { ',' }) select x.Trim()).Any((string x) => string.Equals(x, trait, StringComparison.Ordinal)); } public static bool HasOldSaTrait(this PlayableCard card, string trait) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return false; } return ((Card)card).Info.HasOldSaTrait(trait); } public static string GetTraitDialogueID(this CardInfo info) { if ((Object)(object)info == (Object)null) { return null; } return CardExtensions.GetExtendedProperty(info, "OLD_SA_TraitDialogueID"); } public static string GetTraitDialogue(this CardInfo info) { if ((Object)(object)info == (Object)null) { return null; } return CardExtensions.GetExtendedProperty(info, "OLD_SA_TraitDialogue"); } } public class OLD_SA_TraitBehaviour : SpecialCardBehaviour { protected bool HasTrait(string trait) { return ((SpecialCardBehaviour)this).PlayableCard.HasOldSaTrait(trait); } protected void TriggerTraitDialogue() { ((MonoBehaviour)this).StartCoroutine(CardTraitDialogueManager.TryTrigger(((SpecialCardBehaviour)this).PlayableCard)); } } public static class OLD_SA_TraitInjector { public static void AddTraitBehaviours(PlayableCard card) { if ((Object)(object)card == (Object)null || (Object)(object)((Card)card).Info == (Object)null) { return; } string extendedProperty = CardExtensions.GetExtendedProperty(((Card)card).Info, "OLD_SA_Traits"); if (string.IsNullOrWhiteSpace(extendedProperty)) { return; } string[] array = extendedProperty.Split(new char[1] { ',' }); string[] array2 = array; foreach (string text in array2) { string text2 = text.Trim(); if (text2 == "OLD_SA_BEE_HUNTER" && (Object)(object)((Component)card).GetComponent<BeeHunterTrait>() == (Object)null) { ((Component)card).gameObject.AddComponent<BeeHunterTrait>(); } if (text2 == "OLD_SA_GREEDY_CARD" && (Object)(object)((Component)card).GetComponent<GreedyCardTrait>() == (Object)null) { ((Component)card).gameObject.AddComponent<GreedyCardTrait>(); } if (text2 == "OLD_SA_BLOOD_DEVOURER" && (Object)(object)((Component)card).GetComponent<BloodDevourerTrait>() == (Object)null) { ((Component)card).gameObject.AddComponent<BloodDevourerTrait>(); } if (text2 == "OLD_SA_BLOOD_ARMOR" && (Object)(object)((Component)card).GetComponent<BloodArmorTrait>() == (Object)null) { ((Component)card).gameObject.AddComponent<BloodArmorTrait>(); } if (text2 == "OLD_SA_HEALING_ARMOR" && (Object)(object)((Component)card).GetComponent<HealingArmorTrait>() == (Object)null) { ((Component)card).gameObject.AddComponent<HealingArmorTrait>(); } } } } public static class OLD_SA_TraitManager { public static Dictionary<string, Type> Traits = new Dictionary<string, Type> { { "OLD_SA_BEE_HUNTER", typeof(BeeHunterTrait) }, { "OLD_SA_GREEDY_CARD", typeof(GreedyCardTrait) } }; } [HarmonyPatch(typeof(PlayableCard), "SetInfo")] public static class OLD_SA_TraitPatch { [HarmonyPostfix] public static void Postfix(PlayableCard __instance, CardInfo info) { OLD_SA_TraitInjector.AddTraitBehaviours(__instance); } } public static class VanillaBeeTagPatch { public static void AddBeeTags() { AddTag("Bee"); AddTag("Beehive"); } private static void AddTag(string cardName) { CardInfo cardByName = CardLoader.GetCardByName(cardName); if (!((Object)(object)cardByName == (Object)null)) { string extendedProperty = CardExtensions.GetExtendedProperty(cardByName, "OLD_SA_Traits"); if (string.IsNullOrWhiteSpace(extendedProperty)) { CardExtensions.SetExtendedProperty(cardByName, "OLD_SA_Traits", (object)"OLD_SA_BEE"); } else if (!Array.Exists(extendedProperty.Split(new char[1] { ',' }), (string trait) => trait.Trim() == "OLD_SA_BEE")) { CardExtensions.SetExtendedProperty(cardByName, "OLD_SA_Traits", (object)(extendedProperty + ",OLD_SA_BEE")); } } } } }
Xenowood_Law_Card/OldSa_Tribes.dll
Decompiled 20 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DiskCardGame; using HarmonyLib; using InscryptionAPI.Card; using InscryptionAPI.Helpers; using OLD_SA.Pelt; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OldSa_Tribes")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OldSa_Tribes")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("408b1661-bdcd-4b4d-85b7-bcdbe1090f1a")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace OLD_SA.Tribes { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("OLD_SA.Tribes", "OLD SA Tribes", "1.0.0")] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; public const string GUID = "OLD_SA.Tribes"; private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"OLD SA Tribes loading..."); TribesAPI.Init(); Harmony val = new Harmony("OLD_SA.Tribes"); val.PatchAll(); CardBackgroundPatch.Initialize(new Harmony("OLD_SA.Tribes")); Log.LogInfo((object)"OLD SA Tribes loaded."); } } public static class TribesAPI { public static Tribe Feline; public static Tribe Plant; public static Tribe Crustacean; public static Tribe Magic; public static Tribe Water; public static Tribe Mollusca; public static void Init() { //IL_0018: 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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00c2: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) Feline = TribeManager.Add("OLD_SA", "Feline", TextureHelper.GetImageAsTexture("OldSa_Feline.png", (FilterMode)0), true, (Texture2D)null); Plant = TribeManager.Add("OLD_SA", "Plant", TextureHelper.GetImageAsTexture("OldSa_Plant.png", (FilterMode)0), true, (Texture2D)null); Crustacean = TribeManager.Add("OLD_SA", "Crustacean", TextureHelper.GetImageAsTexture("OldSa_Crustacean.png", (FilterMode)0), true, (Texture2D)null); Magic = TribeManager.Add("OLD_SA", "Magic", TextureHelper.GetImageAsTexture("OldSa_Magic.png", (FilterMode)0), true, (Texture2D)null); Water = TribeManager.Add("OLD_SA", "Water", TextureHelper.GetImageAsTexture("OldSa_Water.png", (FilterMode)0), true, (Texture2D)null); Mollusca = TribeManager.Add("OLD_SA", "Mollusca", TextureHelper.GetImageAsTexture("OldSa_Mollusca.png", (FilterMode)0), true, (Texture2D)null); CardInfo cardByName = CardLoader.GetCardByName("Cat"); if ((Object)(object)cardByName != (Object)null && !cardByName.tribes.Contains(Feline)) { cardByName.tribes.Add(Feline); } CardInfo cardByName2 = CardLoader.GetCardByName("DeadTree"); if ((Object)(object)cardByName2 != (Object)null && !cardByName2.tribes.Contains(Plant)) { cardByName2.tribes.Add(Plant); } CardInfo cardByName3 = CardLoader.GetCardByName("Stump"); if ((Object)(object)cardByName3 != (Object)null && !cardByName3.tribes.Contains(Plant)) { cardByName3.tribes.Add(Plant); } CardInfo cardByName4 = CardLoader.GetCardByName("Tree"); if ((Object)(object)cardByName4 != (Object)null && !cardByName4.tribes.Contains(Plant)) { cardByName4.tribes.Add(Plant); } CardInfo cardByName5 = CardLoader.GetCardByName("Tree_Hologram"); if ((Object)(object)cardByName5 != (Object)null && !cardByName5.tribes.Contains(Plant)) { cardByName5.tribes.Add(Plant); } CardInfo cardByName6 = CardLoader.GetCardByName("Tree_SnowCovered"); if ((Object)(object)cardByName6 != (Object)null && !cardByName6.tribes.Contains(Plant)) { cardByName6.tribes.Add(Plant); } CardInfo cardByName7 = CardLoader.GetCardByName("BaitBucket"); if ((Object)(object)cardByName7 != (Object)null && !cardByName7.tribes.Contains(Water)) { cardByName7.tribes.Add(Water); } CardInfo cardByName8 = CardLoader.GetCardByName("Bullfrog"); if ((Object)(object)cardByName8 != (Object)null && !cardByName8.tribes.Contains(Water)) { cardByName8.tribes.Add(Water); } CardInfo cardByName9 = CardLoader.GetCardByName("Otter"); if ((Object)(object)cardByName9 != (Object)null && !cardByName9.tribes.Contains(Water)) { cardByName9.tribes.Add(Water); } CardInfo cardByName10 = CardLoader.GetCardByName("SquidBell"); if ((Object)(object)cardByName10 != (Object)null) { if (!cardByName10.tribes.Contains(Water)) { cardByName10.tribes.Add(Water); } if (!cardByName10.tribes.Contains(Mollusca)) { cardByName10.tribes.Add(Mollusca); } } CardInfo cardByName11 = CardLoader.GetCardByName("SquidCards"); if ((Object)(object)cardByName11 != (Object)null) { if (!cardByName11.tribes.Contains(Water)) { cardByName11.tribes.Add(Water); } if (!cardByName11.tribes.Contains(Mollusca)) { cardByName11.tribes.Add(Mollusca); } } CardInfo cardByName12 = CardLoader.GetCardByName("SquidBell"); if ((Object)(object)cardByName12 != (Object)null) { if (!cardByName12.tribes.Contains(Water)) { cardByName12.tribes.Add(Water); } if (!cardByName12.tribes.Contains(Mollusca)) { cardByName12.tribes.Add(Mollusca); } } CardInfo cardByName13 = CardLoader.GetCardByName("Tadpole"); if ((Object)(object)cardByName13 != (Object)null && !cardByName13.tribes.Contains(Water)) { cardByName13.tribes.Add(Water); } CardInfo cardByName14 = CardLoader.GetCardByName("Kraken"); if ((Object)(object)cardByName12 != (Object)null) { if (!cardByName12.tribes.Contains(Water)) { cardByName12.tribes.Add(Water); } if (!cardByName12.tribes.Contains(Mollusca)) { cardByName12.tribes.Add(Mollusca); } } CardInfo cardByName15 = CardLoader.GetCardByName("Shark"); if ((Object)(object)cardByName15 != (Object)null && !cardByName15.tribes.Contains(Water)) { cardByName15.tribes.Add(Water); } CardInfo cardByName16 = CardLoader.GetCardByName("Hodag"); if ((Object)(object)cardByName16 != (Object)null && !cardByName16.tribes.Contains((Tribe)4)) { cardByName16.tribes.Add((Tribe)4); } } } } namespace OLD_SA.Pelt { internal static class CardBackgroundPatch { private static readonly Dictionary<string, Appearance> CardBackgrounds = new Dictionary<string, Appearance> { { "OLD_SA_NEPENTHES", OldSaPlantBackground.ID }, { "OLD_SA_STRANGLEVIEN", OldSaPlantBackground.ID }, { "OLD_SA_GEARGRASS", OldSaPlantBackground.ID }, { "OLD_SA_RATATOSK", OldSaMythBackground.ID }, { "OLD_SA_NIDHOGG", OldSaMythBackground.ID }, { "OLD_SA_VEDRFOLNIR", OldSaMythBackground.ID }, { "OLD_SA_HOLLOWGAZE", OldSaEerieForestBackground.ID }, { "OLD_SA_SIREN", OldSaMythBackground.ID } }; public static void Initialize(Harmony harmony) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown harmony.Patch((MethodBase)AccessTools.Method(typeof(Card), "ApplyAppearanceBehaviours", new Type[1] { typeof(List<Appearance>) }, (Type[])null), new HarmonyMethod(AccessTools.Method(typeof(CardBackgroundPatch), "Prefix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } private static void Prefix(Card __instance, List<Appearance> appearances) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.Info == (Object)null) && appearances != null && CardBackgrounds.TryGetValue(((Object)__instance.Info).name, out var value) && !appearances.Contains(value)) { appearances.Add(value); } } } }
Xenowood_Law_Card/Xenowood_Law_Decks/OLD_SA_Decks.dll
Decompiled 20 hours agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using InscryptionAPI.Ascension; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OLD_SA_Decks")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OLD_SA_Decks")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("006f57b1-dcb0-4c34-9083-035a71c7be95")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] public static class StarterDeck { public static void Init() { StarterDeckManager.New("com.oldsa.hive", "Hive Will", "OLD_SA_HiveDeck.png", new string[3] { "Beehive", "OLD_SA_BEE_WORKER", "OLD_SA_BEE_QUEEN" }, 0); StarterDeckManager.New("com.oldsa.poison", "Poison", "OLD_SA_Poison.png", new string[3] { "Skink", "OLD_SA_DART_FROG", "Adder" }, 0); StarterDeckManager.New("com.oldsa.strafe", "Strafe", "OLD_SA_Strafe.png", new string[3] { "ElkCub", "OLD_SA_ANTELOPE", "Bull" }, 0); StarterDeckManager.New("com.oldsa.cat", "Cat", "OLD_SA_Cat.png", new string[3] { "Cat", "OLD_SA_LYNX", "OLD_SA_CAT_OF_ULTHAR" }, 0); StarterDeckManager.New("com.oldsa.bones", "Bones", "OLD_SA_Bones.png", new string[3] { "OLD_SA_FILES", "OLD_SA_BONEGULL", "Lammergeier" }, 0); StarterDeckManager.New("com.oldsa.attack", "Attack", "OLD_SA_Attack.png", new string[3] { "Mantis", "OLD_SA_STAG_BEETLE", "OLD_SA_MANTIS_SHRIMP" }, 0); StarterDeckManager.New("com.oldsa.shield", "Shield", "OLD_SA_Shield.png", new string[3] { "OLD_SA_HONEY_BADGER", "OLD_SA_SNAIL", "OLD_SA_TRICERATOPS" }, 0); StarterDeckManager.New("com.oldsa.pure", "Pure", "OLD_SA_Pure.png", new string[3] { "OLD_SA_PURE_PELT", "OLD_SA_PURE_PELT", "OLD_SA_PURE_PELT" }, 0); StarterDeckManager.New("com.oldsa.running", "Running", "OLD_SA_Running.png", new string[3] { "SquirrelBall", "OLD_SA_OSTRICH", "OLD_SA_CHEETAH" }, 0); } } namespace OLD_SA.Decks; [BepInPlugin("OLD_SA.Decks", "OLD SA Decks", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { StarterDeck.Init(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"OLD SA Decks Loaded"); } }