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_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(); ((Object)val).name = "Entangle"; val.rulebookName = "Entangle"; val.metaCategories = new List { (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."); } }