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.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(); ((Object)val).name = "Fileswarm"; val.rulebookName = "Fileswarm"; val.metaCategories = new List { (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(); 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.Instance.CreateCardInSlot(spawnedCard, deathSlot, 0.15f, true); if (!((Object)(object)deathSlot.Card == (Object)null)) { FileswarmSpawnMarker marker = ((Component)deathSlot.Card).gameObject.GetComponent(); if ((Object)(object)marker == (Object)null) { marker = ((Component)deathSlot.Card).gameObject.AddComponent(); } 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."); } }