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_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(); ((Object)val).name = "Greed's Sin"; val.rulebookName = "Greed's Sin"; val.metaCategories = new List { (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 allies = new List(); if ((Object)(object)Singleton.Instance != (Object)null) { List slots = Singleton.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 (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(); } }