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.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(); ((Object)val).name = "Death Spray"; val.rulebookName = "Death Spray"; val.metaCategories = new List { (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 targets = new List(); if (!((AbilityBehaviour)this).Card.OpponentCard) { foreach (CardSlot slot in Singleton.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.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)]; SmallSigilManager.AddStacks(target, (SmallSigilType)1, 4); yield return null; } } } [BepInPlugin("OLD_SA.DeathSpray", "OLD SA Death Spray", "1.0.0")] public class Plugin : BaseUnityPlugin { private void Awake() { DeathSprayAPI.Init(); } }