From 6caad7624b4dddfcdc5ff3d76a9058b1b66ab5c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Aug 2026 22:36:17 +0100 Subject: [PATCH 1/2] fixed setting the emission for sacrificable portraits, which erroneusly refered to the SteelTrap portrait. --- InscryptionAPI/Card/CardExtensionsPortraits.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensionsPortraits.cs b/InscryptionAPI/Card/CardExtensionsPortraits.cs index f7fd9a69..428b2532 100644 --- a/InscryptionAPI/Card/CardExtensionsPortraits.cs +++ b/InscryptionAPI/Card/CardExtensionsPortraits.cs @@ -635,13 +635,13 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Textu } public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprite portrait) { - if (info.SteelTrapPortrait() == null) + if (info.SacrificablePortrait() == null) throw new InvalidOperationException($"Cannot set emissive portrait before setting the default sacrifice portrait!"); - info.SteelTrapPortrait().RegisterEmissionForSprite(portrait); + info.SacrificablePortrait().RegisterEmissionForSprite(portrait); return info; } - public static Sprite GetEmissiveSacrificablePortrait(this CardInfo info) => info.SteelTrapPortrait().GetEmissionSprite(); + public static Sprite GetEmissiveSacrificablePortrait(this CardInfo info) => info.SacrificablePortrait().GetEmissionSprite(); #endregion /// From 0c75f9e7f92e57a7ceb5193054e753562e4c6f5a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Aug 2026 13:42:40 +0100 Subject: [PATCH 2/2] added functions for setting emission sprites for TailLostPortrait, and added missing functions for setting TailLostPortrait from Sprite --- .../Card/CardExtensionsPortraits.cs | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/InscryptionAPI/Card/CardExtensionsPortraits.cs b/InscryptionAPI/Card/CardExtensionsPortraits.cs index 428b2532..706353f3 100644 --- a/InscryptionAPI/Card/CardExtensionsPortraits.cs +++ b/InscryptionAPI/Card/CardExtensionsPortraits.cs @@ -328,6 +328,71 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, Texture2D portrai return info; } + /// + /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// + /// CardInfo to access. + /// The sprite containing the card portrait. + /// The same CardInfo so a chain can continue. + public static CardInfo SetLostTailPortrait(this CardInfo info, Sprite portrait) + { + if (info.tailParams == null) + throw new InvalidOperationException("Cannot set lost tail portrait without tail params being set first"); + + info.tailParams.SetLostTailPortrait(portrait, info); + + return info; + } + + /// + /// Sets the emissive lost tail portrait for the card. This can only be done after the default lost tail portrait has been set (SetLostTailPortrait). + /// + /// CardInfo to access. + /// The path to the .png file containing the portrait artwork (relative to the Plugins directory). + /// The same CardInfo so a chain can continue. + public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, string pathToArt) + { + if (info.tailParams == null) + throw new InvalidOperationException("Cannot set emissive lost tail portrait without tail params being set first"); + + info.tailParams.SetEmissiveLostTailPortrait(pathToArt); + + return info; + } + + /// + /// Sets the emissive lost tail portrait for the card. This can only be done after the default lost tail portrait has been set (SetLostTailPortrait). + /// + /// CardInfo to access. + /// The texture containing the card portrait. + /// The filter mode for the texture, or null if no change. + /// The same CardInfo so a chain can continue. + public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) + { + if (info.tailParams == null) + throw new InvalidOperationException("Cannot set emissive lost tail portrait without tail params being set first"); + + info.tailParams.SetEmissiveLostTailPortrait(portrait, filterMode); + + return info; + } + + /// + /// Sets the emissive lost tail portrait for the card. This can only be done after the default lost tail portrait has been set (SetLostTailPortrait). + /// + /// CardInfo to access. + /// The sprite containing the card portrait. + /// The same CardInfo so a chain can continue. + public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Sprite portrait) + { + if (info.tailParams == null) + throw new InvalidOperationException("Cannot set emissive lost tail portrait without tail params being set first"); + + info.tailParams.SetEmissiveLostTailPortrait(portrait); + + return info; + } + /// /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. /// @@ -377,6 +442,46 @@ public static TailParams SetLostTailPortrait(this TailParams info, Sprite portra return info; } + /// + /// Sets the emissive lost tail portrait for the card. This can only be done after the default lost tail portrait has been set (SetLostTailPortrait). + /// + /// Tail to access. + /// The path to the .png file containing the artwork (relative to the Plugins directory). + /// The same TailParams so a chain can continue. + public static TailParams SetEmissiveLostTailPortrait(this TailParams info, string pathToArt) + { + return info.SetEmissiveLostTailPortrait(TextureHelper.GetImageAsTexture(pathToArt)); + } + + /// + /// Sets the emissive lost tail portrait for the card. This can only be done after the default lost tail portrait has been set (SetLostTailPortrait). + /// + /// Tail to access. + /// The texture containing the card portrait. + /// The filter mode for the texture, or null if no change. + /// The same TailParams so a chain can continue. + public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Texture2D portrait, FilterMode? filterMode = null) + { + return info.SetEmissiveLostTailPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); + } + + /// + /// Sets the emissive lost tail portrait for the card. This can only be done after the default lost tail portrait has been set (SetLostTailPortrait). + /// + /// Tail to access. + /// The sprite containing the card portrait. + /// The filter mode for the texture, or null if no change. + /// The same TailParams so a chain can continue. + public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprite portrait) + { + if (info.tailLostPortrait == null) + throw new InvalidOperationException($"Cannot set the emissive portrait before setting the default lost tail portrait!"); + + info.tailLostPortrait.RegisterEmissionForSprite(portrait); + return info; + } + public static Sprite GetEmissiveTailLostPortrait(this TailParams info) => info.tailLostPortrait?.GetEmissionSprite(); + #endregion #region Pixel Alt