using 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("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(); ((Object)val).name = "Proliferation"; val.rulebookName = "Proliferation"; val.metaCategories = new List { (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 || ((AbilityBehaviour)this).Card.OpponentCard) { yield break; } object obj = ((Card)((AbilityBehaviour)this).Card).Info.Clone(); CardInfo clone = (CardInfo)((obj is CardInfo) ? obj : null); if (!((Object)(object)clone == (Object)null)) { 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; clone.Mods.Add(statMod); if ((int)Singleton.Instance.CurrentView > 0) { yield return (object)new WaitForSeconds(0.2f); Singleton.Instance.SwitchToView((View)0, false, false); yield return (object)new WaitForSeconds(0.2f); } yield return Singleton.Instance.SpawnCardToHand(clone, (List)null, 0.25f, (Action)null); yield return (object)new WaitForSeconds(0.45f); yield return ((AbilityBehaviour)this).LearnAbility(0.1f); } } }