From 76aad2bc91a8cdd3fe52f168596bcf488ff3c791 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 18:57:34 -0800 Subject: [PATCH 01/74] Add XML for CardAppearanceBehaviourManager --- .../Card/CardAppearanceBehaviourManager.cs | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs b/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs index 638b54bb3..8212e1b9a 100644 --- a/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs +++ b/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs @@ -5,13 +5,29 @@ namespace InscryptionAPI.Card; -public static class CardAppearanceBehaviourManager -{ +/// +/// Class for managing custom CardAppearanceBehaviours. +/// +public static class CardAppearanceBehaviourManager { + /// + /// A utility class that holds all of the required information about an appearance behaviour + /// in order to be able to use it in-game. + /// public class FullCardAppearanceBehaviour { + /// + /// Appearance enum id for the appearance behaviour. + /// public readonly CardAppearanceBehaviour.Appearance Id; + /// + /// Type of the appearance behaviour. + /// public readonly Type AppearanceBehaviour; - + /// + /// Creates a new instance of FullCardAppearanceBehaviour and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// + /// Appearance enum id. + /// Type of the custom CardAppearanceBehaviour class. public FullCardAppearanceBehaviour(CardAppearanceBehaviour.Appearance id, Type appearanceBehaviour) { Id = id; @@ -21,9 +37,15 @@ public FullCardAppearanceBehaviour(CardAppearanceBehaviour.Appearance id, Type a } } + /// + /// A collection of all CardAppearanceBehaviours from the base game. + /// public readonly static ReadOnlyCollection BaseGameAppearances = new(GenBaseGameAppearanceList()); private readonly static ObservableCollection NewAppearances = new(); + /// + /// All of CardAppearanceBehaviours, including vanilla and custom. + /// public static List AllAppearances { get; private set; } = BaseGameAppearances.ToList(); static CardAppearanceBehaviourManager() @@ -45,7 +67,13 @@ private static List GenBaseGameAppearanceList() } return baseGame; } - + /// + /// Registers a custom CardAppearanceBehaviour with the API. + /// + /// The GUID of the mod adding the behaviour. + /// The internal name identifier for the behaviour. + /// The Type of the custom CardAppearanceBehaviour class. + /// A FullCardAppearanceBehaviour object containing all the custom CardAppearanceBehaviour's data. public static FullCardAppearanceBehaviour Add(string guid, string abilityName, Type behavior) { FullCardAppearanceBehaviour full = new(GuidManager.GetEnumValue(guid, abilityName), behavior); @@ -53,6 +81,14 @@ public static FullCardAppearanceBehaviour Add(string guid, string abilityName, T return full; } + /// + /// Unregisters a CardAppearanceBehaviour from the API. + /// + /// The Appearance enum of the behaviour to remove. public static void Remove(CardAppearanceBehaviour.Appearance id) => NewAppearances.Remove(NewAppearances.FirstOrDefault(x => x.Id == id)); + /// + /// Unregisters a CardAppearanceBehaviour from the API. + /// + /// The FullCardAppearanceBehaviour object of the behaviour to remove. public static void Remove(FullCardAppearanceBehaviour ability) => NewAppearances.Remove(ability); } From 27c218e88bb6253da08fd1ff6569e6175cef3146 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:05:32 -0800 Subject: [PATCH 02/74] Add XML for AbilityManager --- InscryptionAPI/Card/AbilityManager.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index b8f858252..658219cb5 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -204,6 +204,9 @@ public FullAbility Clone() /// public static event Func, List> ModifyAbilityList; + /// + /// Custom AbilityMetaCategory enum for marking an ability as modular in Part 2. + /// public static AbilityMetaCategory Part2Modular => GuidManager.GetEnumValue(InscryptionAPIPlugin.ModGUID, "Part2Modular"); /// /// Resynchronizes the ablity list. @@ -362,6 +365,9 @@ internal static Dictionary GetAbilityExtensionTable(this Ability } #region LoadAbilityIcon + /// + /// Reverse patch that provides access to the original, unmodified LoadAbilityIcon method. + /// [HarmonyReversePatch(HarmonyReversePatchType.Original)] [HarmonyPatch(typeof(AbilitiesUtil), nameof(AbilitiesUtil.LoadAbilityIcon))] [MethodImpl(MethodImplOptions.NoInlining)] @@ -420,6 +426,10 @@ private static bool GetLearnedAbilitesReplacement(bool opponentUsable, int minPo } #region Rulebook Description + /// + /// Prefix string for activated sigils with dynamic activation costs. + /// Used by the API to determine what part of a sigil's description should be updated. + /// public const string SIGILCOST = "[sigilcost:"; [HarmonyPostfix, HarmonyPatch(typeof(AbilityInfo), nameof(AbilityInfo.ParseAndTranslateDescription))] private static void CleanUpParsedDescription(ref string __result) @@ -652,7 +662,7 @@ IEnumerator OnTrigger(CardTriggerHandler r, Trigger trigger, params object[] oth } [HarmonyTranspiler, HarmonyPatch(typeof(AbilityIconInteractable), nameof(AbilityIconInteractable.AssignAbility))] - public static IEnumerable AbilityIconInteractable_AssignAbility(IEnumerable instructions) + private static IEnumerable AbilityIconInteractable_AssignAbility(IEnumerable instructions) { // === We want to turn this: // AbilityInfo info2 = AbilitiesUtil.GetInfo(ability); From 1e4915a7fc310cfe89f5fba4dae10c440b6e253e Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:12:51 -0800 Subject: [PATCH 03/74] Add XML to CostProperties **Comment out unusued duplicate field** --- InscryptionAPI/Card/CostProperties.cs | 29 +++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/InscryptionAPI/Card/CostProperties.cs b/InscryptionAPI/Card/CostProperties.cs index 877d85e49..ac1b5d2dd 100644 --- a/InscryptionAPI/Card/CostProperties.cs +++ b/InscryptionAPI/Card/CostProperties.cs @@ -7,11 +7,18 @@ namespace InscryptionAPI.Card.CostProperties; +/// +/// Class that handles dynamic costs on PlayableCards. +/// [HarmonyPatch] -public static class CostProperties -{ - public class RefreshCostMonoBehaviour : MonoBehaviour - { +public static class CostProperties { + /// + /// Class that's attached to PlayableCard objects to ensure their costs are updated appropriately. + /// + public class RefreshCostMonoBehaviour : MonoBehaviour { + /// + /// PlayableCard instance this behaviour is attached to. + /// public PlayableCard playableCard; private int cachedBloodCost = -1, cachedBoneCost = -1; private readonly List cachedGemsCost = new(); @@ -52,6 +59,13 @@ private bool DidCostsChangeThisFrame() return refreshCost; } + /// + /// Determines if a card's list of Gem costs has been updated. + /// + /// + /// + /// + /// public bool GemsChanged(List a, List b) { if (a.Count != b.Count) @@ -67,11 +81,14 @@ public bool GemsChanged(List a, List b) } } + /// + /// A table that maps a CardInfo object to a list of weak references to every PlayableCard that uses that same CardInfo + /// public static ConditionalWeakTable>> CardInfoToCard = new(); - // a table that maps a CardInfo object to a list of weak references to every PlayableCard that uses that same CardInfo - public static ConditionalWeakTable>> CardInfoToPlayableCardReferences = new(); + + //public static ConditionalWeakTable>> CardInfoToPlayableCardReferences = new(); /// From 90a6226f1fdafd3c9097d030499028aab1a50ac4 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:20:39 -0800 Subject: [PATCH 04/74] Add/fix XML for CardExtensionsHelpers --- InscryptionAPI/Card/CardExtensionsHelpers.cs | 43 ++++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensionsHelpers.cs b/InscryptionAPI/Card/CardExtensionsHelpers.cs index d953c7710..537e785ef 100644 --- a/InscryptionAPI/Card/CardExtensionsHelpers.cs +++ b/InscryptionAPI/Card/CardExtensionsHelpers.cs @@ -214,7 +214,15 @@ public static bool HasAnyOfTraits(this CardInfo cardInfo, params Trait[] traits) return false; } + /// + /// Returns whether or not the given CardInfo has the Pelt Trait. + /// public static bool IsPelt(this CardInfo cardInfo) => cardInfo.HasTrait(Trait.Pelt); + /// + /// Returns whether or not the given CardInfo has the Terrain Trait. + /// + /// + /// public static bool IsTerrain(this CardInfo cardInfo) => cardInfo.HasTrait(Trait.Terrain); #endregion @@ -223,7 +231,7 @@ public static bool HasAnyOfTraits(this CardInfo cardInfo, params Trait[] traits) /// Checks if the CardInfo has a specific CardMetaCategory. /// /// CardInfo to access. - /// The CardMetaCategory to check for. + /// The CardMetaCategory to check for. /// Returns true if the card is does not have the specified CardMetaCategory. public static bool HasCardMetaCategory(this CardInfo cardInfo, CardMetaCategory metaCategory) => cardInfo.metaCategories.Contains(metaCategory); @@ -307,7 +315,7 @@ public static int GetAbilityStacks(this PlayableCard card, Ability ability) /// /// Gets the number of Ability stacks a card has. /// - /// The PlayableCard to access. + /// The CardInfo to access. /// The Ability to check for. /// The number of Ability stacks the card has. public static int GetAbilityStacks(this CardInfo info, Ability ability) @@ -666,11 +674,22 @@ public static bool HasAnyOfSpecialAbilities(this PlayableCard playableCard, para /// The card in the opposing slot, otherwise return null. public static PlayableCard OpposingCard(this PlayableCard playableCard) => playableCard.OpposingSlot()?.Card; + /// + /// Adds all given CardModificationInfos to a PlayableCard as temporary mods. + /// + /// The PlayableCard to access. + /// The collection of CardModificationInfos to add as temporary mods to the card. public static void AddTemporaryMods(this PlayableCard card, params CardModificationInfo[] mods) { foreach (CardModificationInfo mod in mods) card.AddTemporaryMod(mod); } + + /// + /// Removes all given CardModificationInfos from a PlayableCard's list of temporary mods. + /// + /// The PlayableCard to access. + /// The collection of CardModificationInfos to remove from the card's temporary mods. public static void RemoveTemporaryMods(this PlayableCard card, params CardModificationInfo[] mods) { foreach (CardModificationInfo mod in mods) @@ -750,11 +769,10 @@ public static void AddShieldCount(this PlayableCard card, int amount, bool up } /// - /// Reduces the amount of shields a specific ability is currently giving. + /// Removes shields from the given PlayableCard. /// /// The PlayableCard to access. /// How many shields to add. - /// The shield-giving ability to add more shields to. /// Whether to update the card's display, meaning sigil stack numbers and any shield effects. public static void RemoveShieldCount(this PlayableCard card, int amount, bool updateDisplay = true) { @@ -777,6 +795,13 @@ public static void RemoveShieldCount(this PlayableCard card, int amount, Ability } component.RemoveShields(amount, updateDisplay); } + /// + /// Reduces a card's shield count from a specific shield-giving ability. + /// + /// The class of the ability to remove shield count from. + /// PlayableCard instance to remove shield from. + /// How many shields to remove. + /// Whether or not to update the card's rendering. public static void RemoveShieldCount(this PlayableCard card, int amount, bool updateDisplay = true) where T : DamageShieldBehaviour { card.GetComponent()?.RemoveShields(amount, updateDisplay); @@ -856,10 +881,20 @@ public static void ResetShield(this PlayableCard card, Ability ability) card.Status.lostShield = false; } + /// + /// Determines whether the given Ability enum id corresponds to a shield-giving ability. + /// + /// The enum for the ability to check. + /// True if the id is for an ability that gives sigils using the API's features. public static bool IsShieldAbility(this Ability ability) { return ShieldManager.AllShieldInfos.AbilityByID(ability) != null; } + /// + /// Determines whether the given AbilityInfo corresponds to a shield-giving ability. + /// + /// The AbilityInfo for the ability to check. + /// True if the AbilityInfo is for an ability that gives sigils using the API's features. public static bool IsShieldAbility(this AbilityInfo abilityInfo) { return ShieldManager.AllShieldInfos.Contains(abilityInfo); From 47e775ac4899f4cd283a448db9b5fcbb6c385621 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:06:30 -0800 Subject: [PATCH 05/74] Add/fix XML for CardExtensionsPortraits --- .../Card/CardExtensionsPortraits.cs | 209 +++++++++++++++++- 1 file changed, 205 insertions(+), 4 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensionsPortraits.cs b/InscryptionAPI/Card/CardExtensionsPortraits.cs index 706353f39..0c2386387 100644 --- a/InscryptionAPI/Card/CardExtensionsPortraits.cs +++ b/InscryptionAPI/Card/CardExtensionsPortraits.cs @@ -40,6 +40,7 @@ public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, Filte /// /// Sets the cards portrait and emission at the same time. /// + /// The CardInfon to access. /// The texture containing the card portrait. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. @@ -202,6 +203,11 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, Sprite sprite) return info; } + /// + /// Retrieves the given CardInfo's emissive portrait. + /// + /// The CardInfo to access. + /// Null if there is no emissive portrait. public static Sprite GetEmissivePortrait(this CardInfo info) => info.portraitTex.GetEmissionSprite(); /// @@ -243,6 +249,11 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrai return info; } + /// + /// Retrives the given CardInfo's emissive alternate portrait. + /// + /// The CardInfo to access. + /// Null if there is no emissive alternate portrait. public static Sprite GetEmissiveAltPortrait(this CardInfo info) => info.alternatePortrait.GetEmissionSprite(); #endregion @@ -287,6 +298,11 @@ public static CardInfo SetPixelPortrait(this CardInfo info, Sprite portrait) return info; } + /// + /// Retrieves the given CardInfo's pixel portrait. + /// + /// The CardInfo to access. + /// Null if there is no pixel portrait. public static Sprite GetPixelPortrait(this CardInfo info) { return info.pixelPortrait; @@ -469,8 +485,7 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Textu /// 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 Sprite containing the card portrait. /// The same TailParams so a chain can continue. public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprite portrait) { @@ -480,6 +495,12 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprit info.tailLostPortrait.RegisterEmissionForSprite(portrait); return info; } + + /// + /// Retrieves the given CardInfo's emissive tail lost portrait. + /// + /// The CardInfo to access. + /// Null if there is no emissive tail lost portrait. public static Sprite GetEmissiveTailLostPortrait(this TailParams info) => info.tailLostPortrait?.GetEmissionSprite(); #endregion @@ -521,6 +542,11 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Sprite port return info; } + /// + /// Retrieves the given CardInfo's alternate Act 2 portrait. + /// + /// The CardInfo to access. + /// Null if there is no alternate pixel portrait. public static Sprite GetPixelAlternatePortrait(this CardInfo info) => info.PixelAlternatePortrait(); #endregion @@ -536,11 +562,24 @@ public static CardInfo SetSteelTrapPortrait(this CardInfo info, string pathToArt return info.SetSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + /// + /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// + /// 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 SetSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetSteelTrapPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); } + /// + /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// + /// CardInfo to access. + /// The Sprite containing the card portrait. + /// The same CardInfo so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -571,6 +610,13 @@ public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Texture2D p { return info.SetPixelSteelTrapPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); } + + /// + /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// + /// CardInfo to access. + /// The Sprite containing the card portrait. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -590,10 +636,25 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, string p { return info.SetEmissiveSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + + /// + /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// + /// 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 SetEmissiveSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveSteelTrapPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); } + + /// + /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// + /// CardInfo to access. + /// The Sprite containing the card portrait. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (info.SteelTrapPortrait() == null) @@ -602,12 +663,18 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite p info.SteelTrapPortrait().RegisterEmissionForSprite(portrait); return info; } + + /// + /// Retrieves the given CardInfo's emissive steel trap portrait. + /// + /// + /// Null if there is no emissive steel trap portrait. public static Sprite GetEmissiveSteelTrapPortrait(this CardInfo info) => info.SteelTrapPortrait()?.GetEmissionSprite(); #endregion #region Shield Alt /// - /// Sets the card's alternate broken shield portrait. This portrait is only used when a card with a shield-giving sigil loses all its shields. + /// Sets the card's alternate broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. /// /// CardInfo to access. /// The path to the .png file containing the portrait artwork (relative to the Plugins directory). @@ -616,10 +683,25 @@ public static CardInfo SetBrokenShieldPortrait(this CardInfo info, string pathTo { return info.SetBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + + /// + /// Sets the card's broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. + /// + /// CardInfo to access. + /// The sacrificable portrait's Texture. + /// Filter mode to apply to the texture in-game. Defaults to Point. + /// The same CardInfo so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetBrokenShieldPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); } + + /// + /// Sets the card's broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. + /// + /// CardInfo to access. + /// The sacrificable portrait's Portrait. + /// The same CardInfo so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -639,10 +721,25 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, string p { return info.SetPixelBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + + /// + /// Sets the card's broken shield portrait. This portrait is only used in Act 2. + /// + /// CardInfo to access. + /// The sacrificable portrait's Texture. + /// Filter mode to apply to the texture in-game. Defaults to Point. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelBrokenShieldPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); } + + /// + /// Sets the card's broken shield portrait. This portrait is only used in Act 2. + /// + /// CardInfo to access. + /// The sacrificable portrait's Sprite. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -662,10 +759,25 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, strin { return info.SetEmissiveBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + + /// + /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). + /// + /// CardInfo to access. + /// The sacrificable portrait's Texture. + /// Filter mode to apply to the texture in-game. Defaults to Point. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveBrokenShieldPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); } + + /// + /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). + /// + /// CardInfo to access. + /// The sacrificable portrait's Sprite. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (info.BrokenShieldPortrait() == null) @@ -674,6 +786,12 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprit info.BrokenShieldPortrait().RegisterEmissionForSprite(portrait); return info; } + + /// + /// Retrieves the given CardInfo's emissive broken shield portrait. + /// + /// The CardInfo to access. + /// Null if there is no emissive broken shield portrait. public static Sprite GetEmissiveBrokenShieldPortrait(this CardInfo info) => info.BrokenShieldPortrait()?.GetEmissionSprite(); #endregion @@ -688,10 +806,23 @@ public static CardInfo SetSacrificablePortrait(this CardInfo info, string pathTo { return info.SetSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + /// + /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. + /// + /// CardInfo to access. + /// The sacrificable portrait's Texture. + /// Filter mode to apply to the texture in-game. Defaults to Point. + /// The same CardInfo so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetSacrificablePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); } + /// + /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. + /// + /// CardInfo to access. + /// The sacrificable portrait's Sprite. + /// The same CardInfo so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -711,10 +842,25 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, string p { return info.SetPixelSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + + /// + /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. + /// + /// CardInfo to access. + /// The card portrait's Texture. + /// The filter mode applied to the portrait in-game (defaults to Point). + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelSacrificablePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); } + + /// + /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. + /// + /// CardInfo to access. + /// The card portrait's Sprite. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -725,7 +871,7 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Sprite p } /// - /// Sets the emissive sacrifcable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). + /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). @@ -734,10 +880,25 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, strin { return info.SetEmissiveSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); } + + /// + /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). + /// + /// CardInfo to access. + /// The card portrait's Texture. + /// The filter mode applied to the portrait in-game (defaults to Point). + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveSacrificablePortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); } + + /// + /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). + /// + /// CardInfo to access. + /// The card portrait's Sprite. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprite portrait) { if (info.SacrificablePortrait() == null) @@ -746,6 +907,11 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprit info.SacrificablePortrait().RegisterEmissionForSprite(portrait); return info; } + /// + /// Retrieves the given CardInfo's sacrificable portrait's emission. + /// + /// + /// The CardInfo's emissive sacrificable portrait, or null if one doesn't exist. public static Sprite GetEmissiveSacrificablePortrait(this CardInfo info) => info.SacrificablePortrait().GetEmissionSprite(); #endregion @@ -761,13 +927,48 @@ public static CardInfo SetAnimatedPortrait(this CardInfo info, GameObject portra return info; } + /// + /// Returns whether or not the given PlayableCard's CardInfo has an alternate card portrait. + /// public static bool HasAlternatePortrait(this PlayableCard card) => card.Info.HasAlternatePortrait(); + + /// + /// Returns whether or not the given CardInfo has an alternate card portrait. + /// public static bool HasAlternatePortrait(this CardInfo info) => info.alternatePortrait != null; + + /// + /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait. + /// public static bool HasPixelAlternatePortrait(this CardInfo info) => info.PixelAlternatePortrait() != null; + + /// + /// Returns whether or not the given CardInfo has an alternate Steel Trap card portrait for when Steel Trap triggers on a card. + /// public static bool HasSteelTrapPortrait(this CardInfo info) => info.SteelTrapPortrait() != null; + + /// + /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when Steel Trap triggers on a card. + /// public static bool HasPixelSteelTrapPortrait(this CardInfo info) => info.PixelSteelTrapPortrait() != null; + + /// + /// Returns whether or not the given CardInfo has an alternate card portrait for when a card's shield is broken. + /// public static bool HasBrokenShieldPortrait(this CardInfo info) => info.BrokenShieldPortrait() != null; + + /// + /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when a card's shield is broken. + /// public static bool HasPixelBrokenShieldPortrait(this CardInfo info) => info.PixelBrokenShieldPortrait() != null; + + /// + /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when a card can be sacrificed. + /// public static bool HasSacrificablePortrait(this CardInfo info) => info.SacrificablePortrait() != null; + + /// + /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when a card can be sacrificed. + /// public static bool HasPixelSacrificablePortrait(this CardInfo info) => info.PixelSacrificablePortrait() != null; } \ No newline at end of file From a94ba78441ca1e8a1d7506ae1fd3ccd7a8a3879a Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:10:51 -0800 Subject: [PATCH 06/74] Add XML for CardExtensions class --- InscryptionAPI/Card/CardExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/InscryptionAPI/Card/CardExtensions.cs b/InscryptionAPI/Card/CardExtensions.cs index dd8dcebf6..52355ee33 100644 --- a/InscryptionAPI/Card/CardExtensions.cs +++ b/InscryptionAPI/Card/CardExtensions.cs @@ -4,6 +4,9 @@ namespace InscryptionAPI.Card; +/// +/// Class containing a large number of helper extension methods for PlayableCard and CardInfo objects. +/// public static partial class CardExtensions { /// From 7f546d13ab16899a047f7c95ff04cfe0eb538dac Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:34:38 -0800 Subject: [PATCH 07/74] Add XML for CardExtensionsProperties --- .../Card/CardExtensionsProperties.cs | 99 +++++++++++++++++-- 1 file changed, 92 insertions(+), 7 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensionsProperties.cs b/InscryptionAPI/Card/CardExtensionsProperties.cs index 678902698..e4b14332e 100644 --- a/InscryptionAPI/Card/CardExtensionsProperties.cs +++ b/InscryptionAPI/Card/CardExtensionsProperties.cs @@ -5,8 +5,7 @@ namespace InscryptionAPI.Card; -public static partial class CardExtensions -{ +public static partial class CardExtensions { /// /// Adds a custom property value to the card. /// @@ -86,6 +85,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// Sets whether the card should be killed by Tidal Lock's effect. /// /// CardInfo to access. + /// Whether or not this card should be affected by Tidal Lock. /// The same CardInfo so a chain can continue. public static CardInfo SetAffectedByTidalLock(this CardInfo info, bool affectedByTidalLock = true) { @@ -112,6 +112,7 @@ public static CardInfo SetAffectedByTidalLock(this CardInfo info, bool affectedB /// Sets whether the card should be killed by Tidal Lock's effect. /// /// CardInfo to access. + /// The internal name of the card this card should transform into. /// The same CardInfo so a chain can continue. public static CardInfo SetTransformerCardId(this CardInfo info, string transformerCardId) { @@ -122,6 +123,12 @@ public static CardInfo SetTransformerCardId(this CardInfo info, string transform #endregion #region Custom Costs + /// + /// Determines if the given CardInfo has the given custom card cost. + /// + /// The CardInfo to access. + /// The custom card cost to check for. + /// True if the CardInfo needs the given custom cost to be played. public static bool HasCustomCost(this CardInfo info, FullCardCost customCost) => info.GetCustomCost(customCost) != 0; @@ -142,6 +149,13 @@ public static CardInfo SetTransformerCardId(this CardInfo info, string transform /// How much of the custom cost the CardInfo should need to be played. /// The same CardInfo so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, string costName, int amount) => info.SetExtendedProperty(costName, amount); + /// + /// A variant of SetExtendedProperty intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. + /// + /// The CardInfo to modify. + /// The class of the cost we want to set. + /// How much of the custom cost the CardInfo should need to be played. + /// The same CardInfo so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, int amount) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); @@ -149,15 +163,37 @@ public static CardInfo SetCustomCost(this CardInfo info, int amount) where T } /// - /// Variant of GetCustomCost that automatically retrieves the given cost's canBeNegative value. + /// Variant of GetCustomCost that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. /// - /// - /// - /// + /// The PlayableCard to access. + /// The name of the custom card cost. + /// How much of the given cost is needed for the given card to be played. public static int GetCustomCostAmount(this PlayableCard card, string costName) => card.Info.GetCustomCostAmount(costName); + + /// + /// Variant of GetCustomCost that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. + /// + /// The CardInfo to access. + /// The name of the custom card cost. + /// How much of the given cost is needed for the given card to be played. public static int GetCustomCostAmount(this CardInfo cardInfo, string costName) => cardInfo.GetCustomCost(costName, AllCustomCosts.Find(x => x.CostName == costName).CanBeNegative); + /// + /// Retrieves the given PlayableCard's custom card cost amount. + /// + /// The PlayableCard to access. + /// The name of the custom card cost. + /// Whether the card cost amount can be negative. If false, returns 0 for negative cost values. + /// How much of the given cost is needed for the given card to be played. public static int GetCustomCost(this PlayableCard card, string costName, bool canBeNegative = false) => card.Info.GetCustomCost(costName, canBeNegative); + + /// + /// Retrieves the given CardInfo's custom card cost amount. + /// + /// The CardInfo to access. + /// The name of the custom card cost. + /// Whether the card cost amount can be negative. If false, returns 0 for negative cost values. + /// How much of the given cost is needed for the given card to be played. public static int GetCustomCost(this CardInfo cardInfo, string costName, bool canBeNegative = false) { int retval = cardInfo.GetExtendedPropertyAsInt(costName) ?? 0; @@ -171,39 +207,83 @@ public static int GetCustomCost(this CardInfo cardInfo, string costName, bool ca return retval; } + /// + /// Retrieves the custom card cost amount of the given class Type from the given PlayableCard. + /// + /// The class of the card cost to check. + /// The PlayableCard to access. + /// If the returned value can be negative. If false, returns 0 instead. + /// The card cost amount this card costs. public static int GetCustomCost(this PlayableCard card, bool canBeNegative = false) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); return card.Info.GetCustomCost(cost.CostName, canBeNegative); } + /// + /// Retrieves the custom card cost amount of the given class Type from the given CardInfo. + /// + /// The class of the card cost to check. + /// The CardInfo to access. + /// If the returned value can be negative. If false, returns 0 instead. + /// The card cost amount this card costs. public static int GetCustomCost(this CardInfo cardInfo, bool canBeNegative = false) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); return cardInfo.GetCustomCost(cost.CostName, canBeNegative); } + /// + /// Retrieves the custom card cost amount of the given class Type from the given PlayableCard. + /// + /// The class of the card cost to check. + /// The PlayableCard to access. + /// The card cost amount this card costs. public static int GetCustomCostAmount(this PlayableCard card) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); return card.GetCustomCost(cost); } + /// + /// Retrieves the custom card cost amount of the given class Type from the given CardInfo. + /// + /// The class of the card cost to check. + /// The CardInfo to access. + /// The card cost amount this card costs. public static int GetCustomCostAmount(this CardInfo cardInfo) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); return cardInfo.GetCustomCost(cost); } + /// + /// Retrieves the given custom card cost amount from the given PlayableCard. + /// Only returns negative values if the custom cost allows it. + /// + /// The PlayableCard to access. + /// The custom card cost to check for. + /// The card cost amount this card costs. public static int GetCustomCost(this PlayableCard card, FullCardCost fullCardCost) { return card.GetCustomCostAmount(fullCardCost.CostName); } + /// + /// Retrieves the given custom card cost amount from the given CardInfo. + /// Only returns negative values if the custom cost allows it. + /// + /// The CardInfo to access. + /// The custom card cost to check for. + /// The card cost amount this card costs. public static int GetCustomCost(this CardInfo cardInfo, FullCardCost fullCardCost) { return cardInfo.GetCustomCostAmount(fullCardCost.CostName); } - + /// + /// Retrieves all custom card costs from the given Card. + /// + /// The Card to access. + /// A List of CustomCardCost objects for each custom cost the Card needs to be played. public static List GetCustomCardCosts(this DiskCardGame.Card card) { try @@ -227,6 +307,11 @@ public static List GetCustomCardCosts(this DiskCardGame.Card car return new(); } + /// + /// Retrieves all custom card costs from the given CardInfo. + /// + /// The CardInfo to access. + /// A List of CustomCardCost objects for each custom cost the CardInfo needs to be played. public static List GetCustomCosts(this CardInfo info) { List costs = new(); From 992689606a87ac51e4a52e3c28d71ed0bd2311db Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:37:46 -0800 Subject: [PATCH 08/74] Add missing XML for CardExtensionsSetters --- InscryptionAPI/Card/CardExtensionsSetters.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensionsSetters.cs b/InscryptionAPI/Card/CardExtensionsSetters.cs index 7df54ab39..104ee2295 100644 --- a/InscryptionAPI/Card/CardExtensionsSetters.cs +++ b/InscryptionAPI/Card/CardExtensionsSetters.cs @@ -261,6 +261,7 @@ public static CardInfo SetTerrain(this CardInfo info) /// Adds the Terrain trait and background to this card, with the option to not use TerrainLayout. /// /// CardInfo to access. + /// Whether or not the CardInfo should be given the TerrainLayout appearance behaviour. /// The same CardInfo so a chain can continue. public static CardInfo SetTerrain(this CardInfo info, bool useTerrainLayout) { @@ -275,6 +276,7 @@ public static CardInfo SetTerrain(this CardInfo info, bool useTerrainLayout) /// Adds the Pelt trait and background to this card, and optionally adds the SpawnLice special ability. /// /// CardInfo to access. + /// Whether or not the given CardInfo should also spawn lice. /// The same CardInfo so a chain can continue. public static CardInfo SetPelt(this CardInfo info, bool spawnLice = true) { @@ -453,8 +455,6 @@ public static CardInfo SetTail(this CardInfo info, string tailName, IEnumerable< /// /// CardInfo to access. /// The card that will be generated as the "tail" when the first hit is dodged. - /// The texture containing the card portrait. - /// The filter mode for the texture, or null if no change. /// A set of card mods to be applied to the tail. /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, IEnumerable mods = null) From c9061a462e68a1421590039ee6f63060d542d403 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 20:40:15 -0800 Subject: [PATCH 09/74] Add missing XML to CardManager --- InscryptionAPI/Card/CardManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/InscryptionAPI/Card/CardManager.cs b/InscryptionAPI/Card/CardManager.cs index cad99a63f..4a9bb9c7d 100644 --- a/InscryptionAPI/Card/CardManager.cs +++ b/InscryptionAPI/Card/CardManager.cs @@ -608,6 +608,12 @@ private static IEnumerable Transpiler(IEnumerable + /// Adds a null check when calling GetCardByName. If the returned CardInfo is null, outputs a console log error. + /// + /// The CardInfo being returned by GetCardByName. + /// The internal name of the CardInfo attempting to be retrieved. + /// The return value of GetCardByName. public static CardInfo LogCardInfo(CardInfo info, string cardInfoName) { if (info == null) From d961848e15eb373d2a6b55560687bd1c9d4ecc40 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 23:14:54 -0800 Subject: [PATCH 10/74] Add missing XML to CardCostManager --- InscryptionAPI/Costs/CardCostManager.cs | 83 ++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 7 deletions(-) diff --git a/InscryptionAPI/Costs/CardCostManager.cs b/InscryptionAPI/Costs/CardCostManager.cs index 901ccf4b1..5beab1464 100644 --- a/InscryptionAPI/Costs/CardCostManager.cs +++ b/InscryptionAPI/Costs/CardCostManager.cs @@ -2,10 +2,8 @@ using GBC; using HarmonyLib; using InscryptionAPI.Card; -using InscryptionAPI.Card.CostProperties; using InscryptionAPI.Dialogue; using InscryptionAPI.Guid; -using InscryptionAPI.Helpers; using Sirenix.Utilities; using System.Collections; using System.Collections.ObjectModel; @@ -19,8 +17,10 @@ namespace InscryptionAPI.CardCosts; /// Class for managing custom card costs. /// [HarmonyPatch] -public static class CardCostManager -{ +public static class CardCostManager { + /// + /// A utility class that holds all of the required information about a card cost in order to be able to use it in-game. + /// public class FullCardCost { /// @@ -151,6 +151,20 @@ public bool CanBePlayedByTurn2WithHand(int amount, CardInfo card, List return GetCanBePlayedByTurn2WithHand(amount, card, hand); } + /// + /// Creates a new instance of FullCardCost and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// + /// The GUID of the mod that added this. + /// The unique id/name for this cost. + /// A subclass of CustomCardCost that implements the logic for the cost. + /// The method used to retrieve a card's cost texture based on its cost value. + /// The method used to retrieve a card's pixel cost texture based on its cost value. + /// The method used to determine this cost's tier. + /// The method used to determine if cards with this cost can be drawn in the opening hand. + /// The method used to determine what texture this cost's reward card should use when choosing it in a card cost choice node. + /// Whether or not this cost can have a valid negative value (if false, negative values default to 0). + /// The ResourceType id for this cost. Used in card cost choice nodes. + /// What amounts of this cost card cost choice nodes can offer the player as an option (think how the nodes let you choose from cards with 1, 2, or 3 Blood). public FullCardCost(string modGUID, string costName, Type costBehaviour, Func getCostTexture, Func getPixelCostTexture, @@ -174,6 +188,15 @@ public FullCardCost(string modGUID, string costName, Type costBehaviour, TypeManager.Add(costName, costBehaviour); } + /// + /// Creates a new instance of FullCardCost and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Simplified version of the full constructor. + /// + /// The GUID of the mod that added this. + /// The unique id/name for this cost. + /// A subclass of CustomCardCost that implements the logic for the cost. + /// The method used to retrieve a card's cost texture based on its cost value. + /// The method used to retrieve a card's pixel cost texture based on its cost value. public FullCardCost(string modGUID, string costName, Type costBehaviour, Func getCostTexture, Func getPixelCostTexture) @@ -344,8 +367,6 @@ public static FullCardCost SetCanBeNegative(this FullCardCost fullCardCost, bool /// Sets the ResourceType and RewardBackTexture for this cost, allowing it to be selected at cost choice nodes in Act 1. /// /// The FullCardCost object to modify. - /// The GUID of the mod adding the cost. - /// The internal name of the cost. /// Whether this card cost should appear at cost choice nodes. Sets the ResourceType to a unique value if true. Sets the ResourceType to None if false. /// The texture to use at the cost choice node. /// The same FullCardCost so a chain can continue. @@ -354,6 +375,15 @@ public static FullCardCost SetFoundAtChoiceNodes(this FullCardCost fullCardCost, return fullCardCost.SetFoundAtChoiceNodes(isChoice, (int i) => rewardBack, null); } + /// + /// Sets the ResourceType and RewardBackTexture for this cost, allowing it to be selected at cost choice nodes in Act 1. + /// This version of the method is intended for when custom costs may be offered in different amounts (like Blood and Bones) at the cost choice node. + /// + /// The FullCardCost object to modify. + /// Whether this card cost should appear at cost choice nodes. Sets the ResourceType to a unique value if true. Sets the ResourceType to None if false. + /// The method for determining the texture to use at the cost choice node. + /// The cost amounts the cost choice node may offer to the player. + /// The same FullCardCost so a chain can continue. public static FullCardCost SetFoundAtChoiceNodes(this FullCardCost fullCardCost, bool isChoice, Func rewardBackFunc, params int[] choiceAmounts) { if (isChoice) @@ -771,18 +801,37 @@ private static IEnumerator CustomCostChoiceChosen(IEnumerator enumerator, CardSi yield break; } + /// + /// Gets a random choosable Nature card that costs Energy. + /// For use in the Act 1 card cost choice node. + /// + /// The random seed for the current run. + /// The CardInfo of a valid Energy card, or null if none exists. public static CardInfo GetRandomChoosableEnergyCard(int randomSeed) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll(x => x.energyCost > 0); return list.Count == 0 ? null : CardLoader.Clone(list[SeededRandom.Range(0, list.Count, randomSeed)]); } + /// + /// Gets a random choosable Nature card that costs Gems. + /// For use in the Act 1 card cost choice node. + /// + /// The random seed for the current run. + /// The gem colour valid cards must have to be valid. + /// The CardInfo of a valid Gems card, or null if none exists. public static CardInfo GetRandomChoosableMoxCard(int randomSeed, GemType gem) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll(x => x.gemsCost.Count > 0 && x.gemsCost.Contains(gem)); return list.Count == 0 ? null : CardLoader.Clone(list[SeededRandom.Range(0, list.Count, randomSeed)]); } - // chooses a random card that has at least 1 of the provided custom costs + /// + /// Gets a random choosable Nature card that costs at least one of the given custom costs. + /// For use in the Act 1 card cost choice node. + /// + /// The random seed for the current run. + /// The List of custom costs to check for a random card for. + /// The CardInfo of a valid custom cost card, or null if none exists. public static CardInfo GetRandomChoosableCustomCostCard(int randomSeed, List customCosts) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature) @@ -793,6 +842,14 @@ public static CardInfo GetRandomChoosableCustomCostCard(int randomSeed, List + /// Gets a random choosable Nature card with the given custom play cost that requires an owned amount within the given collection of integers. + /// For use in the Act 1 card cost choice node. + /// + /// The random seed for the current run. + /// The custom cost valid cards will have. + /// The collection of cost amounts to search for. + /// The CardInfo of a valid card, or null if none exists. public static CardInfo GetRandomChoosableCustomCostCardWithAmounts(int randomSeed, FullCardCost customCost, params int[] costAmounts) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature) @@ -801,6 +858,12 @@ public static CardInfo GetRandomChoosableCustomCostCardWithAmounts(int randomSee InscryptionAPIPlugin.Logger.LogDebug($"Choice amounts for {customCost.CostName}: {costAmounts.Length}. Found {list.Count} card(s)."); return list.Count == 0 ? null : CardLoader.Clone(list[SeededRandom.Range(0, list.Count, randomSeed)]); } + /// + /// Determines what gem colour to offer in a card cost choice node if one can be offered. + /// Only one gem colour can be offered at a time, for use with the Act 1 card cost choice node. + /// + /// The random seed of the current run. + /// A number between 1-3 corresponding to Green, Orange, and Blue respectively; or 0 if no valid gem cards exist. public static int GetRandomMoxIndex(int randomSeed) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll((CardInfo x) => x.gemsCost.Count > 0); @@ -832,7 +895,13 @@ public abstract class CustomCardCost : ManagedBehaviour /// The internal name of the cost. Used to check for the cost's extended property by the API. /// public abstract string CostName { get; } + /// + /// How many attempts must be made before the play hint can be shown again. + /// public virtual int PlayHintFrequency { get; } = 1; + /// + /// How many times the game has tried to show this cost's play hint. + /// public int playHintAttempts = 0; /// From 4619e29d07e4c754d446537a8adf56b6cbdada6d Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 23:35:59 -0800 Subject: [PATCH 11/74] Add XML for CardModificationInfoExtensions Considering if the custom costs ID system can be deprecated, but it may have a use as a way of providing custom cost adjustments on CardModInfos --- .../Card/CardModificationInfoExtensions.cs | 325 +++++++++++++++++- 1 file changed, 322 insertions(+), 3 deletions(-) diff --git a/InscryptionAPI/Card/CardModificationInfoExtensions.cs b/InscryptionAPI/Card/CardModificationInfoExtensions.cs index f299b4254..e06a3b806 100644 --- a/InscryptionAPI/Card/CardModificationInfoExtensions.cs +++ b/InscryptionAPI/Card/CardModificationInfoExtensions.cs @@ -4,11 +4,25 @@ using static InscryptionAPI.Card.CardModificationInfoManager; namespace InscryptionAPI.Card; +/// +/// Class of helper extensions for CardModificationInfo objects. +/// public static class CardModificationInfoExtensions { + /// + /// Determines if the given CardModificationInfo contains info for a death card. + /// + /// The CardModificationInfo to access. + /// True if the CardModificationInfo has death card info. public static bool HasDeathCardInfo(this CardModificationInfo mod) => mod.deathCardInfo != null; #region Adders + /// + /// Adds decal ID strings to the given CardModificationInfo. + /// + /// The CardModificationInfo to access. + /// The decal IDs to add. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo AddDecalIds(this CardModificationInfo mod, params string[] decalIds) { foreach (string decalId in decalIds) @@ -18,6 +32,13 @@ public static CardModificationInfo AddDecalIds(this CardModificationInfo mod, pa } return mod; } + /// + /// Adds the given abilities to the given CardModificationInfos list of negated abilities. + /// THIS WILL NOT NEGATE THE GIVEN ABILITIES ON ITS OWN. + /// + /// The CardModificationInfo to access. + /// The list of abilities to negate. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo AddNegateAbilities(this CardModificationInfo mod, params Ability[] negateAbilities) { mod.negateAbilities ??= new(); @@ -27,59 +48,132 @@ public static CardModificationInfo AddNegateAbilities(this CardModificationInfo #endregion #region Setters + /// + /// Sets the name replacement field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// The name replacement. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetNameReplacement(this CardModificationInfo mod, string name = null) { mod.nameReplacement = name; return mod; } + /// + /// Sets the singleton ID field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// The singleton ID. If null, does not set it. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetSingletonId(this CardModificationInfo mod, string id = null) { if (id != null) mod.singletonId = id; return mod; } + /// + /// Sets the attack and health adjustment fields for the given CardModificationInfo. + /// + /// The CardModification to access. + /// How much attack this mod should give. Can be negative. + /// How much health this mod should give. Can be negative. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetAttackAndHealth(this CardModificationInfo mod, int attack = 0, int health = 0) { mod.attackAdjustment = attack; mod.healthAdjustment = health; return mod; } + /// + /// Sets the cost adjustment fields for the given CardModificationInfo. + /// + /// The CardModification to access. + /// The amount the mod should modify a card's blood cost. Can be negative. + /// The amount the mod should modify a card's bones cost. Can be negative. + /// The amount the mod should modify a card's energy cost. Can be negative. + /// The amount the mod should modify a card's gems cost. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetCosts(this CardModificationInfo mod, int blood = 0, int bones = 0, int energy = 0, List gems = null) { return mod.SetBloodCost(blood).SetBonesCost(bones).SetEnergyCost(energy).SetGemsCost(gems); } + /// + /// Sets the blood cost adjustment field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// The amount the mod should modify a card's blood cost. Can be negative. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetBloodCost(this CardModificationInfo mod, int cost = 0) { mod.bloodCostAdjustment = cost; return mod; } + /// + /// Sets the bones cost adjustment field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// The amount the mod should modify a card's bones cost. Can be negative. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetBonesCost(this CardModificationInfo mod, int cost = 0) { mod.bonesCostAdjustment = cost; return mod; } + /// + /// Sets the energy cost adjustment field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// The amount the mod should modify a card's energy cost. Can be negative. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetEnergyCost(this CardModificationInfo mod, int cost = 0) { mod.energyCostAdjustment = cost; return mod; } + /// + /// Sets the addGemsCost field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// List of gems cost this mod should add to a card. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetGemsCost(this CardModificationInfo mod, List cost = null) { if (cost != null) mod.addGemCost = cost; return mod; } + /// + /// Sets the addGemsCost field for the given CardModificationInfo. + /// + /// The CardModification to access. + /// Collection of gems cost this mod should add to a card. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetGemsCost(this CardModificationInfo mod, params GemType[] cost) { if (cost.Length > 0) mod.addGemCost = cost.ToList(); return mod; } + /// + /// Adds the given abilities to the given CardModificationInfo. + /// + /// The CardModificationInfo to access. + /// + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo AddAbilities(this CardModificationInfo mod, params Ability[] abilities) { mod.abilities.AddRange(abilities); return mod; } + /// + /// Sets the given CardModificationInfo's deathCardInfo field with a new death card portrait. + /// + /// The CardModificationInfo to access. + /// What head the portrait should use. + /// What mouth the portrait should use. + /// What eyes the portrait should use. + /// If the portrait should be missing an eye. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetDeathCardPortrait(this CardModificationInfo mod, CompositeFigurine.FigurineType headType = CompositeFigurine.FigurineType.SettlerMan, int mouthIndex = 0, int eyesIndex = 0, bool lostEye = false) @@ -91,9 +185,12 @@ public static CardModificationInfo SetDeathCardPortrait(this CardModificationInf #endregion /// - /// Used by the API to remove temporary decal mods, since it's not done automatically. + /// Used by the API to set and remove temporary decal mods, since it's not done automatically. /// public static void SetTemporaryDecal(this CardModificationInfo mod) => mod.SetExtendedProperty("API:TemporaryDecal", true); + /// + /// Determines if the given CardModificationInfo is an API temporary decal. + /// public static bool IsTemporaryDecal(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("API:TemporaryDecal") ?? false; #region Singleton ID @@ -111,6 +208,11 @@ public static CardModificationInfo ClearCustomPropertiesId(this CardModification return mod; } + /// + /// Removes the custom costs ID field from a CardModificationInfo's singletonId. + /// + /// The CardModificationInfo object whose custom costs ID we want to clear. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo mod) { string costs = GetCustomCostsIdString(mod); @@ -121,10 +223,39 @@ public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo } #region Properties + /// + /// Determines if the given CardModificationInfo has a singleton ID containing an API custom (extended) property. + /// + /// The CardModificationInfo to access. + /// What custom property to look for. + /// True if the given property is present, false if it isn't present or there is no custom property section. public static bool HasCustomPropertyId(this CardModificationInfo mod, string propertyName) => HasCustomPropertiesId(mod.singletonId) && mod.singletonId.Contains(propertyName); + /// + /// Determines if the given string is a custom (extended) properties string ID. + /// + /// The string to access. + /// What custom property to look for. + /// True if the given property is present, false if it isn't present or there is no custom property section. public static bool HasCustomPropertyId(this string singletonId, string propertyName) => HasCustomPropertiesId(singletonId) && singletonId.Contains(propertyName); + /// + /// Determines if the given CardModificationInfo has any custom (extended) properties in its singleton ID. + /// + /// The CardModificationInfo to access. + /// True if there are any custom properties, false otherwise. public static bool HasCustomPropertiesId(this CardModificationInfo mod) => !mod.singletonId.IsNullOrWhitespace() && mod.singletonId.Contains(PROPERTIES); + /// + /// Determines if the given string has any custom (extended) properties in it. + /// + /// The string to access. + /// True if there are any custom properties, false otherwise. public static bool HasCustomPropertiesId(this string singletonId) => !singletonId.IsNullOrWhitespace() && singletonId.Contains(PROPERTIES); + /// + /// Creates and/or modifies the custom properties section inside the given CardModificationInfo's singleton ID. + /// + /// The CardModificationInfo to access. + /// The name of the property to add. + /// What value to set for the property. Will be converted to a string. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo SetPropertiesId(this CardModificationInfo mod, string propertyName, object value) { string valuePair = $"{propertyName},{value}"; @@ -159,11 +290,29 @@ public static CardModificationInfo SetPropertiesId(this CardModificationInfo mod return mod; } + /// + /// Determines if the given CardModificationInfo has a custom property with the given name. Checks extended properties before checking the singleton ID. + /// + /// The CardModificationInfo + /// The custom property to search for. + /// True if the CardModificationInfo has an extended property or custom property ID with the given name. False otherwise. public static bool HasCustomProperty(this CardModificationInfo mod, string propertyName) => mod.GetCustomProperty(propertyName) != null; + /// + /// Gets the custom property value from the given CardModificationInfo using the given property name. Checks extended properties before checking the singleton ID. + /// + /// The CardModificationInfo to access. + /// The custom property's name. + /// The value of the custom property, or null. public static string GetCustomProperty(this CardModificationInfo mod, string propertyName) { return mod.GetExtendedProperty(propertyName) ?? mod.GetCustomPropertyId(propertyName); } + /// + /// Retrieves the value of the given custom property ID in the given CardModificationInfo. + /// + /// The CardModificationInfo to access. + /// The custom property whose value we want. + /// The value of the custom property, or null if there is none. public static string GetCustomPropertyId(this CardModificationInfo mod, string propertyName) { if (!mod.HasCustomPropertyId(propertyName)) @@ -185,11 +334,48 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p #endregion #region CustomCosts + /// + /// Determines if the given CardModificationInfo adds the given custom cost. + /// + /// The CardModificationInfo to access. + /// The name of the custom cost to search for. + /// True if the CardModification adds the given card cost. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostId(this CardModificationInfo mod, string costName) => HasCustomCostsId(mod.singletonId) && mod.singletonId.Contains(costName); + + /// + /// Determines if the given singleton ID string has the given custom cost in its custom costs substring. + /// + /// The CardModificationInfo to access. + /// The name of the custom cost to search for. + /// True if the string has the given card cost in its custom costs substring. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostId(this string singletonId, string costName) => HasCustomCostsId(singletonId) && singletonId.Contains(costName); + + /// + /// Determines if the given CardModificationInfo adds any custom costs. + /// + /// The CardModificationInfo to access. + /// True if the CardModification adds any card costs. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostsId(this CardModificationInfo mod) => !mod.singletonId.IsNullOrWhitespace() && mod.singletonId.Contains(CUSTOM_COSTS); + + /// + /// Determines if the given singleton ID string has the custom costs substring. + /// + /// The CardModificationInfo to access. + /// True if the string has the custom costs substring. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostsId(this string singletonId) => !singletonId.IsNullOrWhitespace() && singletonId.Contains(CUSTOM_COSTS); + /// + /// Sets the custom cost ID and play amount to the given CardModificationInfo's singleton ID. + /// + /// The CardModificationInfo to access. + /// + /// + /// + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod, string costName, object value) { string valuePair = $"{costName},{value}"; @@ -222,11 +408,33 @@ public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod return mod; } + /// + /// Whetehr or not the given CardModificationInfo has the given custom cost. + /// + /// The CardModificationInfo to access. + /// The name of the custom cost to find. + /// True if the CardModificationInfo uses the given custom cost. False otherwise; + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCost(this CardModificationInfo mod, string costName) => (mod.GetExtendedProperty(costName) ?? mod.GetCustomCostId(costName)) != null; + /// + /// Retrieves the play amount of the given custom cost on the given CardModificationInfo. + /// Checks extended properties before checking custom cost IDs. + /// + /// The CardModificationinfo to access. + /// The name of the custom cost to find. + /// The custom cost's play amount as an int. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static int GetCustomCost(this CardModificationInfo mod, string costName) { return mod.GetExtendedPropertyAsInt(costName) ?? mod.GetCustomCostIdValue(costName); } + /// + /// Retrieves the amount of the given custom cost the given CardModificationInfo costs as a string. + /// + /// The CardModificationInfo to access. + /// The name of the custom cost to find. + /// The string representation of the custom cost's play amount, or null if the custom cost ID is not present. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static string GetCustomCostId(this CardModificationInfo mod, string costName) { if (!mod.HasCustomCostId(costName)) @@ -245,6 +453,13 @@ public static string GetCustomCostId(this CardModificationInfo mod, string costN return pairString.Substring(0, valueIdx).Replace(costName + ",", ""); } + /// + /// Retrieves the cost amount of the given custom cost on the given CardModificationInfo. + /// + /// The CardModificationInfo to access. + /// Name of the custom cost to check for. + /// How much of the custom cost this CardModificationInfo needs, or 0 if the cost is not present. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static int GetCustomCostIdValue(this CardModificationInfo mod, string costName) { string valueStr = mod.GetCustomCostId(costName); @@ -253,6 +468,12 @@ public static int GetCustomCostIdValue(this CardModificationInfo mod, string cos return int.TryParse(valueStr, out int result) ? result : 0; } + /// + /// Retrieves a list of all custom costs that the given CardModificationInfo adds. + /// + /// The CardModificationInfo to access. + /// A List of all FullCardCosts the given CardModificationInfo adds to the attached card. + // [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static List GetCustomCostsFromMod(this CardModificationInfo mod) { List costs = new(); @@ -273,8 +494,23 @@ public static int GetCustomCostIdValue(this CardModificationInfo mod, string cos #endregion #region ID Getters + /// + /// Creates a copy of the given CardModificationInfo's singleton ID without any of the API's custom property or cost substrings. + /// + /// The CardModificationInfo to access. + /// A new string that is a copy of the CardModificationInfo's singleton ID but without any API-added substrings. public static string CleanId(this CardModificationInfo mod) => mod.IdWithoutCosts().IdWithoutProperties(); + /// + /// Creates a new string that is a copy of the given CardModificationInfo's singleton ID string without the custom properties ID substring. + /// + /// The CardModificationInfo to access. + /// A clean copy of the CardModificationInfo's singleton ID without the custom properties ID substring. public static string IdWithoutProperties(this CardModificationInfo mod) => mod.singletonId.IdWithoutProperties(); + /// + /// Creates a new string that is a copy of the given string without the custom properties ID substring. + /// + /// The string to access. + /// A clean copy of the singleton ID without the custom properties ID substring. public static string IdWithoutProperties(this string singletonId) { if (!singletonId.HasCustomPropertiesId()) @@ -283,7 +519,17 @@ public static string IdWithoutProperties(this string singletonId) string properties = GetCustomPropertiesIdString(singletonId); return singletonId.Replace(properties, ""); } + /// + /// Creates a new string that is a copy of the given CardModificationInfo's singleton ID string without the custom costs ID substring. + /// + /// The CardModificationInfo to access. + /// A clean copy of the CardModificationInfo's singleton ID without the custom costs substring. public static string IdWithoutCosts(this CardModificationInfo mod) => mod.singletonId.IdWithoutCosts(); + /// + /// Creates a new string that is a copy of the given string without the custom costs substring. + /// + /// The string to access. + /// A clean copy of the singleton ID without the custom costs substring. public static string IdWithoutCosts(this string singletonId) { if (!singletonId.HasCustomCostsId()) @@ -366,6 +612,11 @@ public static string GetExtendedProperty(this CardModificationInfo mod, string p #endregion #region RemoveGems + /// + /// Removes all gem cost negations on the CardModificationInfo. + /// Only considers extended properties. + /// + /// The CardModificationInfo to access. public static void ClearAllRemovedGemsCosts(this CardModificationInfo mod) { if (mod.HasRemovedGreenGemCost()) @@ -377,9 +628,14 @@ public static void ClearAllRemovedGemsCosts(this CardModificationInfo mod) if (mod.HasRemoveBlueGemCost()) mod.RemoveBlueGemCost(false); } + /// + /// Determines which gem costs have been removed/negated by the given CardModificationInfo using extended properties. + /// + /// The CardModificationInfo to access. + /// A List of all removed gem cost colours. public static List RemovedGemsCosts(this CardModificationInfo mod) { - List gems = new(); + List gems = new(3); if (mod.HasRemovedGreenGemCost()) gems.Add(GemType.Green); @@ -391,6 +647,12 @@ public static List RemovedGemsCosts(this CardModificationInfo mod) return gems; } + /// + /// Clears extended properties on the given CardModificationInfo that remove single gem costs with the given types. + /// + /// The CardModificationInfo to access. + /// A collection of all gem colours that should be re-added/stop being negated. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo RemoveGemsCost(this CardModificationInfo mod, params GemType[] gemTypes) { if (gemTypes.Contains(GemType.Green)) @@ -404,6 +666,12 @@ public static CardModificationInfo RemoveGemsCost(this CardModificationInfo mod, return mod; } + /// + /// Clears all extended properties on the given CardModificationInfo that remove single gem costs. + /// + /// The CardModificationInfo to access. + /// A collection of all gem colours that should be re-added/stop being negated. + /// The same CardModificationInfo so a chain can continue. public static CardModificationInfo ClearRemovedGemsCost(this CardModificationInfo mod, params GemType[] gemTypes) { if (gemTypes.Contains(GemType.Green)) @@ -417,14 +685,65 @@ public static CardModificationInfo ClearRemovedGemsCost(this CardModificationInf return mod; } + /// + /// Uses extended properties to make the given CardModificationInfo negate a single green gem cost. + /// + /// The CardModificationInfo to access. + /// Whether the given CardModificationInfo should remove a single green gem from the play cost. + /// The same CardModificationInfo so a chain can continue. + /// If you want to negate multiple gems of the same colour, you'll need to create multiple CardModificationInfos. public static CardModificationInfo RemoveGreenGemCost(this CardModificationInfo mod, bool remove) => mod.SetExtendedProperty("RemoveGreenGem", remove, true); + /// + /// Uses extended properties to make the given CardModificationInfo negate a single orange gem cost. + /// + /// The CardModificationInfo to access. + /// Whether the given CardModificationInfo should remove a single orange gem from the play cost. + /// The same CardModificationInfo so a chain can continue. + /// If you want to negate multiple gems of the same colour, you'll need to create multiple CardModificationInfos. public static CardModificationInfo RemoveOrangeGemCost(this CardModificationInfo mod, bool remove) => mod.SetExtendedProperty("RemoveOrangeGem", remove, true); + /// + /// Uses extended properties to make the given CardModificationInfo negate a single blue gem cost. + /// + /// The CardModificationInfo to access. + /// Whether the given CardModificationInfo should remove a single blue gem from the play cost. + /// The same CardModificationInfo so a chain can continue. + /// If you want to negate multiple gems of the same colour, you'll need to create multiple CardModificationInfos. public static CardModificationInfo RemoveBlueGemCost(this CardModificationInfo mod, bool remove) => mod.SetExtendedProperty("RemoveBlueGem", remove, true); + /// + /// Determines if the given CardModificationInfo removes a green gems cost. + /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. + /// + /// The CardModificationInfo to access. + /// True if the CardModificationInfo negates a green gem. public static bool HasRemovedGreenGemCost(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("RemoveGreenGem") ?? false; + /// + /// Determines if the given CardModificationInfo removes a orange gems cost. + /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. + /// + /// The CardModificationInfo to access. + /// True if the CardModificationInfo negates a orange gem. public static bool HasRemovedOrangeGemCost(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("RemoveOrangeGem") ?? false; + /// + /// Determines if the given CardModificationInfo removes a blue gems cost. + /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. + /// + /// The CardModificationInfo to access. + /// True if the CardModificationInfo negates a blue gem. public static bool HasRemoveBlueGemCost(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("RemoveBlueGem") ?? false; - + /// + /// Determines if the given CardModificationInfo removes any gem costs using the API's extended properties. + /// Does not check nullifyGemsCost. + /// + /// The CardModificationInfo to access. + /// True if the CardModificationInfo negates any single gem. public static bool HasRemovedAnyGemCost(this CardModificationInfo mod) => mod.HasRemovedGreenGemCost() || mod.HasRemovedOrangeGemCost() || mod.HasRemoveBlueGemCost(); + /// + /// Determines if the given CardModificationInfo removes a gems cost of the given colour. + /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. + /// + /// The CardModificationInfo to access. + /// The colour gem to search for. + /// True if the CardModificationInfo negates a gem with the given colour. public static bool HasRemovedGemCost(this CardModificationInfo mod, GemType gemType) { return gemType switch From 2a9b9ad39ea511f932c96fd784aaab430c1ce511 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 23:52:52 -0800 Subject: [PATCH 12/74] Add missing XML, remarks on the custom costs ID system that recommend not using it except in very specific cases --- .../Card/CardModificationInfoExtensions.cs | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/CardModificationInfoExtensions.cs b/InscryptionAPI/Card/CardModificationInfoExtensions.cs index e06a3b806..bff055811 100644 --- a/InscryptionAPI/Card/CardModificationInfoExtensions.cs +++ b/InscryptionAPI/Card/CardModificationInfoExtensions.cs @@ -213,6 +213,13 @@ public static CardModificationInfo ClearCustomPropertiesId(this CardModification /// /// The CardModificationInfo object whose custom costs ID we want to clear. /// The same CardModificationInfo so a chain can continue. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo mod) { string costs = GetCustomCostsIdString(mod); @@ -340,6 +347,13 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// The CardModificationInfo to access. /// The name of the custom cost to search for. /// True if the CardModification adds the given card cost. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostId(this CardModificationInfo mod, string costName) => HasCustomCostsId(mod.singletonId) && mod.singletonId.Contains(costName); @@ -349,6 +363,13 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// The CardModificationInfo to access. /// The name of the custom cost to search for. /// True if the string has the given card cost in its custom costs substring. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostId(this string singletonId, string costName) => HasCustomCostsId(singletonId) && singletonId.Contains(costName); @@ -357,6 +378,13 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// /// The CardModificationInfo to access. /// True if the CardModification adds any card costs. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostsId(this CardModificationInfo mod) => !mod.singletonId.IsNullOrWhitespace() && mod.singletonId.Contains(CUSTOM_COSTS); @@ -365,6 +393,13 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// /// The CardModificationInfo to access. /// True if the string has the custom costs substring. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostsId(this string singletonId) => !singletonId.IsNullOrWhitespace() && singletonId.Contains(CUSTOM_COSTS); @@ -374,7 +409,14 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// The CardModificationInfo to access. /// /// - /// + /// The same CardModificationInfo so a chain can continue. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod, string costName, object value) { @@ -414,6 +456,13 @@ public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod /// The CardModificationInfo to access. /// The name of the custom cost to find. /// True if the CardModificationInfo uses the given custom cost. False otherwise; + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCost(this CardModificationInfo mod, string costName) => (mod.GetExtendedProperty(costName) ?? mod.GetCustomCostId(costName)) != null; /// @@ -423,6 +472,13 @@ public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod /// The CardModificationinfo to access. /// The name of the custom cost to find. /// The custom cost's play amount as an int. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static int GetCustomCost(this CardModificationInfo mod, string costName) { @@ -434,6 +490,13 @@ public static int GetCustomCost(this CardModificationInfo mod, string costName) /// The CardModificationInfo to access. /// The name of the custom cost to find. /// The string representation of the custom cost's play amount, or null if the custom cost ID is not present. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static string GetCustomCostId(this CardModificationInfo mod, string costName) { @@ -459,6 +522,13 @@ public static string GetCustomCostId(this CardModificationInfo mod, string costN /// The CardModificationInfo to access. /// Name of the custom cost to check for. /// How much of the custom cost this CardModificationInfo needs, or 0 if the cost is not present. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static int GetCustomCostIdValue(this CardModificationInfo mod, string costName) { @@ -473,6 +543,13 @@ public static int GetCustomCostIdValue(this CardModificationInfo mod, string cos ///
/// The CardModificationInfo to access. /// A List of all FullCardCosts the given CardModificationInfo adds to the attached card. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static List GetCustomCostsFromMod(this CardModificationInfo mod) { From 4f927aa40e9c162df4a3a95f6e9d9c4f024e15ac Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Thu, 12 Nov 2026 23:53:07 -0800 Subject: [PATCH 13/74] Add XML to CardModificationInfoManager --- .../Card/CardModificationInfoManager.cs | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/InscryptionAPI/Card/CardModificationInfoManager.cs b/InscryptionAPI/Card/CardModificationInfoManager.cs index abcf06414..1a93c812f 100644 --- a/InscryptionAPI/Card/CardModificationInfoManager.cs +++ b/InscryptionAPI/Card/CardModificationInfoManager.cs @@ -99,6 +99,11 @@ public static void SyncCardMods() } } } + /// + /// Retrieves all custom properties stored in the given singleton ID string. + /// + /// The singleton ID string to retrieve custom properties from. + /// A List of all custom properties stored by the singleton ID. public static List GetCustomPropertiesFromId(string singletonId) { List propertiesList = new(); @@ -114,6 +119,15 @@ public static List GetCustomPropertiesFromId(string singletonId) } return propertiesList; } + /// + /// Retrieves all custom costs stored in the given singleton ID string. + /// + /// The singleton ID string to retrieve custom costs from. + /// A List of all custom costs stored by the singleton ID. + /// + /// With the improved system of adding custom costs using the [CardCostManager](InscryptionAPI.CardCosts.CardCostManager), + /// it's recommended to avoid using the custom costs ID system unless you want to do something akin to the vanilla CardModInfo cost adjustments. + /// public static List GetCustomCostsFromId(string singletonId) { List costList = new(); @@ -131,7 +145,17 @@ public static List GetCustomCostsFromId(string singletonId) return costList; } + /// + /// Retrieves the custom properties substring from the given CardModificationInfo's singleton ID. + /// + /// The CardModificationInfo to access. + /// The custom properties substring or null if one doesn't exist. public static string GetCustomPropertiesIdString(CardModificationInfo mod) => mod.HasCustomPropertiesId() ? GetCustomPropertiesIdString(mod.singletonId) : null; + /// + /// Retrieves the custom properties substring from the given singleton ID string. + /// + /// The singleton ID string to access. + /// The custom properties substring or null if one doesn't exist. public static string GetCustomPropertiesIdString(string singletonId) { if (!singletonId.HasCustomPropertiesId()) @@ -144,7 +168,31 @@ public static string GetCustomPropertiesIdString(string singletonId) return propertiesString.Substring(0, endOf + 1); } + /// + /// Retrieves the custom costs substring from the given CardModificationInfo's singleton ID. + /// + /// The CardModificationInfo to access. + /// The custom costs substring or null if one doesn't exist. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
public static string GetCustomCostsIdString(CardModificationInfo mod) => mod.HasCustomCostsId() ? GetCustomCostsIdString(mod.singletonId) : null; + /// + /// Retrieves the custom costs substring from the given singleton ID string. + /// + /// The singleton ID string to access. + /// The custom costs substring or null if one doesn't exist. + /// + /// + /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + ///
+ ///
public static string GetCustomCostsIdString(string singletonId) { if (!singletonId.HasCustomCostsId()) From 870dd8fe948eafa3097646ca427d061157b9bd61 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:17:06 -0800 Subject: [PATCH 14/74] Fix dynamic gem costs not removing from the initial starting cost, reverse key-value pair of currentSacrificedCardInfos, add XML --- .../Card/ExtendedActivatedAbilityBehaviour.cs | 125 +++++++++++++++++- 1 file changed, 118 insertions(+), 7 deletions(-) diff --git a/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs b/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs index bee1226cb..2fd2bfcf2 100644 --- a/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs +++ b/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs @@ -7,29 +7,96 @@ using UnityEngine; namespace InscryptionAPI.Card; +/// +/// A version of ActivatedAbilityBehaviour that allows for the creation of activated abilities that cost Blood, Gems, or Health. Also supports dynamic activation costs. +/// public abstract class ExtendedActivatedAbilityBehaviour : AbilityBehaviour { + /// + /// Stores the total Blood activation cost modifier. + /// public int bloodCostMod; + /// + /// Stores the total Bones activation cost modifier. + /// public int bonesCostMod; + /// + /// Stores the total Energy activation cost modifier. + /// public int energyCostMod; + /// + /// Stores the total added Gems activation requirement modifier. + /// public List gemsCostMod = new(); + /// + /// Stores the total removed Gems activation requirement modifier. + /// + public List gemsCostRemovedMod = new(); + /// + /// Stores the total Blood activation cost modifier. + /// public int healthCostMod; - public virtual int StartingBloodCost { get; } - public virtual int StartingBonesCost { get; } - public virtual int StartingEnergyCost { get; } - public virtual List StartingGemsCost { get; } + /// + /// Initial amount of Blood needed to activate this ability. + /// + public virtual int StartingBloodCost { get; } = 0; + /// + /// Initial amount of Bones needed to activate this ability. + /// + public virtual int StartingBonesCost { get; } = 0; + /// + /// Initial amount of Energy needed to activate this ability. + /// + public virtual int StartingEnergyCost { get; } = 0; + /// + /// Initial types of Gems needed to activate this ability. + /// + public virtual List StartingGemsCost { get; } = null; + /// + /// Initial amount of Health needed to activate this ability. + /// public virtual int StartingHealthCost { get; } + /// + /// Amount the Blood activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateBloodCostMod { get; set; } + /// + /// Amount the Bones activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateBonesCostMod { get; set; } + /// + /// Amount the Energy activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateEnergyCostMod { get; set; } + /// + /// What Gems are added to the activation requirement whenever this ability is activated. + /// public virtual List OnActivateGemsCostMod { get; set; } + /// + /// What Gems are removed from the activation requirement whenever this ability is activated. + /// public virtual bool OnActivateGemsCostModRemovesGems { get; set; } + /// + /// Amount the Health activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateHealthCostMod { get; set; } + /// + /// How much Blood this ability currently costs to activate. + /// public int BloodCost => Mathf.Max(0, StartingBloodCost + bloodCostMod); + /// + /// How much Bones this ability currently costs to activate. + /// public int BonesCost => Mathf.Max(0, StartingBonesCost + bonesCostMod); + /// + /// How much Energy this ability currently costs to activate. + /// public int EnergyCost => Mathf.Max(0, StartingEnergyCost + energyCostMod); + /// + /// What Gems this ability currently requires to activate. + /// public List GemsCost { get { List retval = new(); @@ -37,22 +104,46 @@ public List GemsCost { retval.AddRange(StartingGemsCost); } retval.AddRange(gemsCostMod); + foreach (GemType gem in gemsCostRemovedMod) { + retval.Remove(gem); + } return retval; } } + /// + /// How much Health this ability currently costs to activate. + /// public int HealthCost => Mathf.Max(0, StartingHealthCost + healthCostMod); - public Dictionary currentSacrificedCardInfos = new(); + /// + /// Dictionary of CardSlots that have been selected for sacrifices and the associated CardInfo. + /// + public Dictionary currentSacrificedCardInfos = new(); + /// + /// Determines if the PostResolveOnBoard trigger should activate. + /// + /// True if PostResolveOnBoard should activate. public virtual bool RespondsToPostResolveOnBoard() { return false; } + /// + /// Trigger that's called after card's with this ability resolve on the board. + /// Used since ResolveOnBoard is sealed to prevent the ability breaking. + /// public virtual IEnumerator OnPostResolveOnBoard() { yield break; } + /// + /// If the ResolveOnBoard trigger should be called. + /// + /// True if it should be activated. public sealed override bool RespondsToResolveOnBoard() => RespondsToPostResolveOnBoard() || LearnMechanic(); + /// + /// Runs the logic that teaches the player how activated abilities work in Act 2, plus any PostResolveOnBoard logic. + /// public sealed override IEnumerator OnResolveOnBoard() { if (LearnMechanic()) // Act 2 tutorial dialogue @@ -74,8 +165,16 @@ public sealed override IEnumerator OnResolveOnBoard() if (RespondsToPostResolveOnBoard()) yield return OnPostResolveOnBoard(); } - + /// + /// Whetehr this ability should be triggered. + /// + /// The ability being checked for activation. + /// True if this ability is being checked for activation. public sealed override bool RespondsToActivatedAbility(Ability ability) => this.Ability == ability; + /// + /// The logic sequence for when this ability is activated. + /// Contains logic for paying activation costs. + /// public sealed override IEnumerator OnActivatedAbility() { if (CanAfford() && CanActivate()) @@ -160,11 +259,23 @@ public sealed override IEnumerator OnActivatedAbility() yield return new WaitForSeconds(0.25f); } } + /// + /// Sequence called after the ability finishes activation. + /// + /// public virtual IEnumerator PostActivate() { yield break; } + /// + /// Whether or not this ability can be activated. + /// + /// true if this ability can be activated. public virtual bool CanActivate() => true; + /// + /// Player-implemented sequence for what this ability will actually do when activated. + /// + /// public abstract IEnumerator Activate(); private IEnumerator ChooseSacrifices() @@ -236,7 +347,7 @@ private IEnumerator ChooseSacrifices() if (currentSacrifice2.Card != null && !currentSacrifice2.Card.Dead) { manager.SacrificesMadeThisTurn++; - currentSacrificedCardInfos.Add(currentSacrifice2.Card.Info, currentSacrifice2); + currentSacrificedCardInfos.Add(currentSacrifice2, currentSacrifice2.Card.Info); yield return currentSacrifice2.Card.Sacrifice(); Singleton.Instance.SwitchToView(manager.BoardView); } From 8107a0850f783272fd0bad1b16342f2aa88cdf29 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:23:59 -0800 Subject: [PATCH 15/74] Add XML for classes in DamageShieldBehaviour file --- InscryptionAPI/Card/DamageShieldBehaviour.cs | 266 ++++++++++++++----- 1 file changed, 193 insertions(+), 73 deletions(-) diff --git a/InscryptionAPI/Card/DamageShieldBehaviour.cs b/InscryptionAPI/Card/DamageShieldBehaviour.cs index 458d7c5c7..31b20de4e 100644 --- a/InscryptionAPI/Card/DamageShieldBehaviour.cs +++ b/InscryptionAPI/Card/DamageShieldBehaviour.cs @@ -11,27 +11,53 @@ namespace InscryptionAPI.Card; /// A custom class implementing shield-giving behaviour. /// With the most recent API versions, shield-giving sigils like DeathShield/Nano Armour/ Armoured can now stack and instead use a counter rather than a simple boolean. /// -public abstract class DamageShieldBehaviour : AbilityBehaviour -{ +public abstract class DamageShieldBehaviour : AbilityBehaviour { + /// + /// Field for modifying the number of shields this ability provides. + /// public int numShields; // modifiable version of NumShields + /// + /// Getter that returns the actual number of remaining shields this ability provides (no negative shields). + /// public int NumShields => Mathf.Max(0, numShields); - public abstract int StartingNumShields { get; } // how many shields this sigil will provide initially + /// + /// How many shields this sigil will provide when first added to a card. + /// + public abstract int StartingNumShields { get; } + /// + /// If this ability is providing any shields. + /// + /// True if this ability has at least one remaining shield. public bool HasShields() => NumShields > 0; + /// + /// For internal use: determines when the ability has called Awake and had its starting shields initialised. + /// public bool initialised = false; + /// + /// The base Awake method but made overrideable to avoid issues with setting the initial number of shields. + /// public virtual void Awake() { - if (base.Card != null) - numShields = StartingNumShields; + if (base.Card != null) { + ResetShields(true); + } initialised = true; } + /// + /// The base Start method but made overrideable. + /// public virtual void Start() { } - + /// + /// Method for adding more shield count to this ability. Resets the loseShields Status boolean if the net shields are > 0. + /// + /// How many more shields this ability should give. + /// Whether or not to update the card's render. public virtual void AddShields(int amount, bool updateDisplay = true) { numShields += amount; @@ -43,6 +69,11 @@ public virtual void AddShields(int amount, bool updateDisplay = true) base.Card.OnStatsChanged(); } } + /// + /// Method for removing shield count from this ability. + /// + /// How many shields to remove from this ability. + /// Whether or not to update the card's render. public virtual void RemoveShields(int amount, bool updateDisplay = true) { numShields -= amount; @@ -62,6 +93,10 @@ public virtual void RemoveShields(int amount, bool updateDisplay = true) base.Card.OnStatsChanged(); } } + /// + /// Sets the current number of shields back to its starting value. + /// + /// public virtual void ResetShields(bool updateDisplay) { int currentShields = NumShields; @@ -83,29 +118,92 @@ public virtual void ResetShields(bool updateDisplay) /// /// A custom class combining [DamageShieldBehaviour](InscryptionAPI.Card.DamageShieldBehaviour) and [ExtendedActivatedBehaviour](InscryptionAPI.Card.ExtendedActivatedBehaviour). /// -public abstract class ActivatedDamageShieldBehaviour : DamageShieldBehaviour -{ +public abstract class ActivatedDamageShieldBehaviour : DamageShieldBehaviour { + /// + /// Stores the total Blood activation cost modifier. + /// public int bloodCostMod; + /// + /// Stores the total Bones activation cost modifier. + /// public int bonesCostMod; + /// + /// Stores the total Energy activation cost modifier. + /// public int energyCostMod; - public List gemsCostMod; + /// + /// Stores the total added Gems activation requirement modifier. + /// + public List gemsCostMod = new(); + /// + /// Stores the total removed Gems activation requirement modifier. + /// + public List gemsCostRemovedMod = new(); + /// + /// Stores the total Blood activation cost modifier. + /// public int healthCostMod; - public virtual int StartingBloodCost { get; } - public virtual int StartingBonesCost { get; } - public virtual int StartingEnergyCost { get; } - public virtual List StartingGemsCost { get; } + /// + /// Initial amount of Blood needed to activate this ability. + /// + public virtual int StartingBloodCost { get; } = 0; + /// + /// Initial amount of Bones needed to activate this ability. + /// + public virtual int StartingBonesCost { get; } = 0; + /// + /// Initial amount of Energy needed to activate this ability. + /// + public virtual int StartingEnergyCost { get; } = 0; + /// + /// Initial types of Gems needed to activate this ability. + /// + public virtual List StartingGemsCost { get; } = null; + /// + /// Initial amount of Health needed to activate this ability. + /// public virtual int StartingHealthCost { get; } + /// + /// Amount the Blood activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateBloodCostMod { get; set; } + /// + /// Amount the Bones activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateBonesCostMod { get; set; } + /// + /// Amount the Energy activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateEnergyCostMod { get; set; } + /// + /// What Gems are added to the activation requirement whenever this ability is activated. + /// public virtual List OnActivateGemsCostMod { get; set; } + /// + /// What Gems are removed from the activation requirement whenever this ability is activated. + /// public virtual bool OnActivateGemsCostModRemovesGems { get; set; } + /// + /// Amount the Health activation cost is modified whenever this ability is activated. + /// public virtual int OnActivateHealthCostMod { get; set; } + /// + /// How much Blood this ability currently costs to activate. + /// public int BloodCost => Mathf.Max(0, StartingBloodCost + bloodCostMod); + /// + /// How much Bones this ability currently costs to activate. + /// public int BonesCost => Mathf.Max(0, StartingBonesCost + bonesCostMod); + /// + /// How much Energy this ability currently costs to activate. + /// public int EnergyCost => Mathf.Max(0, StartingEnergyCost + energyCostMod); + /// + /// What Gems this ability currently requires to activate. + /// public List GemsCost { get { List retval = new(); @@ -113,24 +211,45 @@ public List GemsCost { retval.AddRange(StartingGemsCost); } retval.AddRange(gemsCostMod); + foreach (GemType gem in gemsCostRemovedMod) { + retval.Remove(gem); + } return retval; } } + /// + /// How much Health this ability currently costs to activate. + /// public int HealthCost => Mathf.Max(0, StartingHealthCost + healthCostMod); - public Dictionary currentSacrificedCardInfos = new(); + /// + /// Dictionary of CardSlots that have been selected for sacrifices and the associated CardInfo. + /// + public Dictionary currentSacrificedCardInfos = new(); - public virtual bool RespondsToPostResolveOnBoard() - { + /// + /// Determines if the PostResolveOnBoard trigger should activate. + /// + /// True if PostResolveOnBoard should activate. + public virtual bool RespondsToPostResolveOnBoard() { return false; } - public virtual IEnumerator OnPostResolveOnBoard() - { + /// + /// Trigger that's called after card's with this ability resolve on the board. + /// Used since ResolveOnBoard is sealed to prevent the ability breaking. + /// + public virtual IEnumerator OnPostResolveOnBoard() { yield break; } + /// + /// If the ResolveOnBoard trigger should be called. + /// + /// True if it should be activated. public sealed override bool RespondsToResolveOnBoard() => RespondsToPostResolveOnBoard() || LearnMechanic(); - public sealed override IEnumerator OnResolveOnBoard() - { + /// + /// Runs the logic that teaches the player how activated abilities work in Act 2, plus any PostResolveOnBoard logic. + /// + public sealed override IEnumerator OnResolveOnBoard() { if (LearnMechanic()) // Act 2 tutorial dialogue { yield return new WaitForSeconds(0.15f); @@ -150,42 +269,44 @@ public sealed override IEnumerator OnResolveOnBoard() if (RespondsToPostResolveOnBoard()) yield return OnPostResolveOnBoard(); } - + /// + /// Whetehr this ability should be triggered. + /// + /// The ability being checked for activation. + /// True if this ability is being checked for activation. public sealed override bool RespondsToActivatedAbility(Ability ability) => this.Ability == ability; - public sealed override IEnumerator OnActivatedAbility() - { - if (CanAfford() && CanActivate()) - { - if (BloodCost > 0) - { + /// + /// The logic sequence for when this ability is activated. + /// Contains logic for paying activation costs. + /// + public sealed override IEnumerator OnActivatedAbility() { + if (CanAfford() && CanActivate()) { + if (BloodCost > 0) { yield return ChooseSacrifices(); if (Singleton.Instance.CancelledSacrifice) yield break; } - if (HealthCost > 0) - { + if (HealthCost > 0) { base.Card.Anim.LightNegationEffect(); base.Card.Status.damageTaken += HealthCost; } - if (EnergyCost > 0) - { + if (EnergyCost > 0) { yield return Singleton.Instance.SpendEnergy(EnergyCost); - if (Singleton.Instance != null) - { + if (Singleton.Instance != null) { CardSlot cardSlot = Singleton.Instance.GetSlots(getPlayerSlots: true).Find((CardSlot x) => x.Card != null && x.Card.HasAbility(Ability.ConduitEnergy)); - if (cardSlot != null) - { + if (cardSlot != null) { ConduitEnergy component = cardSlot.Card.GetComponent(); if (component != null && component.CompletesCircuit()) yield return Singleton.Instance.AddEnergy(EnergyCost); } } } - if (BonesCost > 0) + if (BonesCost > 0) { yield return Singleton.Instance.SpendBones(BonesCost); + } yield return new WaitForSeconds(0.1f); yield return base.PreSuccessfulTriggerSequence(); @@ -194,15 +315,13 @@ public sealed override IEnumerator OnActivatedAbility() if (HealthCost > 0) // card still exists and has 0 Health { - if (base.Card && base.Card.Health <= 0 && !base.Card.Dead) - { + if (base.Card && base.Card.Health <= 0 && !base.Card.Dead) { yield return base.Card.Die(true); yield return PostActivate(); currentSacrificedCardInfos.Clear(); yield break; } } - int energyMod = OnActivateEnergyCostMod; int bonesMod = OnActivateBonesCostMod; List gemsMod = OnActivateGemsCostMod; @@ -229,22 +348,31 @@ public sealed override IEnumerator OnActivatedAbility() yield return PostActivate(); currentSacrificedCardInfos.Clear(); } - else - { + else { base.Card.Anim.LightNegationEffect(); AudioController.Instance.PlaySound2D("toneless_negate", MixerGroup.GBCSFX, 0.2f); yield return new WaitForSeconds(0.25f); } } - public virtual IEnumerator PostActivate() - { + /// + /// Sequence called after the ability finishes activation. + /// + /// + public virtual IEnumerator PostActivate() { yield break; } + /// + /// Whether or not this ability can be activated. + /// + /// true if this ability can be activated. public virtual bool CanActivate() => true; + /// + /// Player-implemented sequence for what this ability will actually do when activated. + /// + /// public abstract IEnumerator Activate(); - private IEnumerator ChooseSacrifices() - { + private IEnumerator ChooseSacrifices() { BoardManager manager = Singleton.Instance; List validSlots = manager.GetCardSlots( !base.Card.OpponentCard, x => x.Card != null & x.Card != base.Card); @@ -258,10 +386,8 @@ private IEnumerator ChooseSacrifices() manager.CancelledSacrifice = false; manager.LastSacrificesInfo.Clear(); manager.SetQueueSlotsEnabled(false); - foreach (CardSlot allSlot in manager.AllSlots.Where(x => x.Card != base.Card)) - { - if (!allSlot.IsPlayerSlot || allSlot.Card == null) - { + foreach (CardSlot allSlot in manager.AllSlots.Where(x => x.Card != base.Card)) { + if (!allSlot.IsPlayerSlot || allSlot.Card == null) { allSlot.SetEnabled(enabled: false); allSlot.ShowState(HighlightedInteractable.State.NonInteractable); } @@ -269,14 +395,12 @@ private IEnumerator ChooseSacrifices() allSlot.Card.Anim.SetShaking(true); } yield return manager.SetSacrificeMarkersShown(BloodCost); - while (manager.GetValueOfSacrifices(manager.currentSacrifices) < BloodCost && !manager.cancelledPlacementWithInput) - { + while (manager.GetValueOfSacrifices(manager.currentSacrifices) < BloodCost && !manager.cancelledPlacementWithInput) { manager.SetSacrificeMarkersValue(manager.currentSacrifices.Count); yield return new WaitForEndOfFrame(); } - foreach (CardSlot allSlot2 in manager.AllSlots) - { + foreach (CardSlot allSlot2 in manager.AllSlots) { allSlot2.SetEnabled(false); if (allSlot2.IsPlayerSlot && allSlot2.Card != null) allSlot2.Card.Anim.SetShaking(shaking: false); @@ -285,14 +409,11 @@ private IEnumerator ChooseSacrifices() foreach (CardSlot currentSacrifice in manager.currentSacrifices) manager.LastSacrificesInfo.Add(currentSacrifice.Card.Info); - if (manager.cancelledPlacementWithInput) - { + if (manager.cancelledPlacementWithInput) { manager.HideSacrificeMarkers(); - foreach (CardSlot slot in manager.GetSlots(getPlayerSlots: true)) - { - if (slot.Card != null) - { + foreach (CardSlot slot in manager.GetSlots(getPlayerSlots: true)) { + if (slot.Card != null) { slot.Card.Anim.SetSacrificeHoverMarkerShown(false); if (manager.currentSacrifices.Contains(slot)) slot.Card.Anim.SetMarkedForSacrifice(false); @@ -302,25 +423,21 @@ private IEnumerator ChooseSacrifices() Singleton.Instance.ClearForcedCursorType(); manager.CancelledSacrifice = true; } - else - { + else { manager.SetSacrificeMarkersValue(manager.GetValueOfSacrifices(manager.currentSacrifices)); yield return new WaitForSeconds(0.2f); manager.HideSacrificeMarkers(); - foreach (CardSlot currentSacrifice2 in manager.currentSacrifices) - { - if (currentSacrifice2.Card != null && !currentSacrifice2.Card.Dead) - { + foreach (CardSlot currentSacrifice2 in manager.currentSacrifices) { + if (currentSacrifice2.Card != null && !currentSacrifice2.Card.Dead) { manager.SacrificesMadeThisTurn++; - currentSacrificedCardInfos.Add(currentSacrifice2.Card.Info, currentSacrifice2); + currentSacrificedCardInfos.Add(currentSacrifice2, currentSacrifice2.Card.Info); yield return currentSacrifice2.Card.Sacrifice(); Singleton.Instance.SwitchToView(manager.BoardView); } } } manager.SetQueueSlotsEnabled(slotsEnabled: true); - foreach (CardSlot allSlot3 in manager.AllSlots) - { + foreach (CardSlot allSlot3 in manager.AllSlots) { allSlot3.SetEnabled(enabled: true); allSlot3.ShowState(HighlightedInteractable.State.Interactable); } @@ -343,10 +460,8 @@ private bool CanAfford() { } return false; } - private bool LearnMechanic() => SaveManager.SaveFile.IsPart2 && !ProgressionData.LearnedMechanic(MechanicsConcept.GBCActivatedAbilities); - private int SacrificeValue() - { + private int SacrificeValue() { return Singleton.Instance.GetValueOfSacrifices( Singleton.Instance.GetCardSlots(!base.Card.OpponentCard, x => x.Card != null && x.Card != base.Card)); } @@ -355,8 +470,13 @@ private int SacrificeValue() /// /// A custom AbilityBehaviour that's attached to the DeathShield ability so it functions with the API's shield logic changes. /// -public class APIDeathShield : DamageShieldBehaviour -{ +public class APIDeathShield : DamageShieldBehaviour { + /// + /// This subclass's provided ability. + /// public override Ability Ability => Ability.DeathShield; + /// + /// Starting shields is equal to the number of stacks of Nano Armour/Armoured + /// public override int StartingNumShields => base.Card.GetAbilityStacks(Ability); // look ma, I stack! } \ No newline at end of file From f6d6c2b7046fe0a6c5c206d05b9225fcb59cd860 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:25:01 -0800 Subject: [PATCH 16/74] Add missing XML in ShieldManager --- InscryptionAPI/Card/ShieldManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/ShieldManager.cs b/InscryptionAPI/Card/ShieldManager.cs index 8720d92fd..76d39b498 100644 --- a/InscryptionAPI/Card/ShieldManager.cs +++ b/InscryptionAPI/Card/ShieldManager.cs @@ -18,9 +18,12 @@ namespace InscryptionAPI.Card; public static class ShieldManager { /// - /// A list of FullAbilities whose AbilityBehaviour overrides DamageShieldBehaviour. + /// A list of FullAbilities whose AbilityBehaviour inherits from DamageShieldBehaviour. /// public static List AllShieldAbilities { get; internal set; } = new(AllAbilities); + /// + /// The current processed list of all AbilityInfos in the game that inherit from DamageShieldBehaviour. + /// public static List AllShieldInfos { get; internal set; } = AllShieldAbilities.Select(x => x.Info).ToList(); /// From 2ca5907b852f28a20f579cd95e6264d6543434d3 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:29:47 -0800 Subject: [PATCH 17/74] Add XML to DeathCardManager --- InscryptionAPI/Card/DeathCardManager.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/InscryptionAPI/Card/DeathCardManager.cs b/InscryptionAPI/Card/DeathCardManager.cs index 7b75cb89a..169f77c68 100644 --- a/InscryptionAPI/Card/DeathCardManager.cs +++ b/InscryptionAPI/Card/DeathCardManager.cs @@ -4,14 +4,28 @@ namespace InscryptionAPI.Card; +/// +/// Class for handling custom death cards. +/// [HarmonyPatch] public static class DeathCardManager { + /// + /// The prefix used by the API to demark custom death cards added through the DeathCardManager. + /// public const string CardPrefix = "apiDeathCard"; + /// + /// A list of all API-added death cards + /// public static List APIDeathCards => CardManager.AllCardsCopy.FindAll(x => x.ModPrefixIs(CardPrefix)); private static readonly List NewDefaultDeathCards = new(); private static readonly List NewAscensionDeathMods = new(); + /// + /// Adds a death card to the list of default death cards available at the start of each run. + /// + /// The CardModificationInfo containing the death card data. + /// If true, will add deathCardMod to the list of ascension death cards rather than the default (Part 1) pool. public static void AddDefaultDeathCard(CardModificationInfo deathCardMod, bool addToAscension = false) { if (addToAscension) @@ -27,6 +41,12 @@ private static bool MatchingDeathCardInfo(DeathCardInfo info, DeathCardInfo comp info.lostEye == compareAgainst.lostEye && info.mouthIndex == compareAgainst.mouthIndex; } + /// + /// Gets the name of an API-added death card from the given CardModificationInfo. Can also create a new death card using the given CardModificationInfo. + /// + /// The CardModificationInfo to access. + /// Whether or not to create a new death card with the given name. Appends a number for duplicate card names. + /// The internal name of the death card associated with the given CardModificationInfo. public static string GetAPIDeathCardName(CardModificationInfo mod, bool createNewCard = false) { string cleanId = mod.CleanId(); // use the clean singleton id to reduce chance of duplicate name From 6e56340aa9f8151d8353237acce3f3968650bcb1 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:38:56 -0800 Subject: [PATCH 18/74] Add XML to ExtendedAbilityBehaviour --- .../Card/ExtendedAbilityBehaviour.cs | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs b/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs index c597b0046..89273f681 100644 --- a/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs +++ b/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs @@ -5,18 +5,49 @@ namespace InscryptionAPI.Card; +/// +/// Extended subclass of AbilityBehaviour that implements several custom API triggers. +/// [HarmonyPatch] public abstract class ExtendedAbilityBehaviour : AbilityBehaviour, IGetOpposingSlots, IActivateWhenFacedown, IPassiveAttackBuff, IPassiveHealthBuff { // This section handles attack slot management + /// + /// Whether or not this ability should activate certain triggers while facedown. + /// public virtual bool TriggerWhenFacedown => false; + /// + /// Whether or not the given trigger should be called on this ability when its card is face down. + /// + /// The trigger being checked. + /// Array of objects relating to the trigger being checked. + /// True if the given trigger should be activated while this ability's card is face down. public virtual bool ShouldTriggerWhenFaceDown(Trigger trigger, object[] otherArgs) => TriggerWhenFacedown; + /// + /// Whether or not the given trigger should be called on this ability when its card is face down. + /// + /// The Type of the custom API trigger being checked. + /// True if the given trigger should be activated while this ability's card is face down. public virtual bool ShouldTriggerCustomWhenFaceDown(Type customTrigger) => TriggerWhenFacedown; - public virtual bool RespondsToGetOpposingSlots() => false; + /// + /// Whether or not this ability should modify what CardSlots cards with this ability will target when attacking. + /// + /// True if this ability should modify the list of cards being added. + public virtual bool RespondsToGetOpposingSlots() => false; + /// + /// Gets an additional list of CardSlots that cards with this ability should target when attacking. + /// + /// List of CardSlots that were originally being targeted before custom abilities were applied. + /// Other CardSlots added by other abilities to the list of targeted slots. + /// List of CardSlots that should be added to the list of targeted slots. public virtual List GetOpposingSlots(List originalSlots, List otherAddedSlots) => new(); + /// + /// Whether or not the default attack slot should be removed (eg., Bifurcated Strike). + /// + /// True if cards with this ability should not strike the opposing slot by default. public virtual bool RemoveDefaultAttackSlot() => false; // This section handles passive attack/health buffs @@ -46,18 +77,35 @@ private static List GetHealthBuffs(PlayableCard card) return retval; } + /// + /// If this ability provides a passive attack buff. + /// [Obsolete("Use IPassiveAttackBuff instead")] public virtual bool ProvidesPassiveAttackBuff => false; + /// + /// If this ability provides a passive health buff. + /// [Obsolete("Use IPassiveHealthBuff instead")] public virtual bool ProvidesPassiveHealthBuff => false; + /// + /// Array representing the attack buff given by this ability. + /// [Obsolete("Use IPassiveAttackBuff instead")] public virtual int[] GetPassiveAttackBuffs() => null; + /// + /// Array representing the health buff given by this ability. + /// [Obsolete("Use IPassiveHealthBuff instead")] public virtual int[] GetPassiveHealthBuffs() => null; + /// + /// Determines the passive attack buff given by this ability if one is given. + /// + /// The PlayableCard current being checked. + /// The attack buff to give to the target card. public virtual int GetPassiveAttackBuff(PlayableCard target) { if (ProvidesPassiveAttackBuff) @@ -74,6 +122,11 @@ public virtual int GetPassiveAttackBuff(PlayableCard target) return 0; } + /// + /// Determines the passive health buff given by this ability if one is given. + /// + /// The PlayableCard current being checked. + /// The health buff to give to the target card. public virtual int GetPassiveHealthBuff(PlayableCard target) { if (ProvidesPassiveHealthBuff) From 824760b8594f0b442a4d2437d4a6e2a18668f1f0 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:40:05 -0800 Subject: [PATCH 19/74] Add XML to IActivateWhenFacedown --- InscryptionAPI/Card/IActivateWhenFacedown.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/InscryptionAPI/Card/IActivateWhenFacedown.cs b/InscryptionAPI/Card/IActivateWhenFacedown.cs index f4c9cc3d9..09341c188 100644 --- a/InscryptionAPI/Card/IActivateWhenFacedown.cs +++ b/InscryptionAPI/Card/IActivateWhenFacedown.cs @@ -2,8 +2,22 @@ namespace InscryptionAPI.Card; +/// +/// Custom trigger for determining if an ability trigger should activate when a card is face down. +/// public interface IActivateWhenFacedown { + /// + /// Whether or not the given trigger should be called on this ability when its card is face down. + /// + /// The trigger being checked. + /// Array of objects relating to the trigger being checked. + /// True if the given trigger should be activated while this ability's card is face down. public bool ShouldTriggerWhenFaceDown(Trigger trigger, object[] otherArgs); + /// + /// Whether or not the given trigger should be called on this ability when its card is face down. + /// + /// The Type of the custom API trigger being checked. + /// True if the given trigger should be activated while this ability's card is face down. public bool ShouldTriggerCustomWhenFaceDown(Type customTrigger); } \ No newline at end of file From 25ae80207badbdd453548c1f2b1f9d4baade3687 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 00:44:30 -0800 Subject: [PATCH 20/74] Add XML to OpponentGemsManager --- InscryptionAPI/Card/OpponentGemsManager.cs | 39 ++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/InscryptionAPI/Card/OpponentGemsManager.cs b/InscryptionAPI/Card/OpponentGemsManager.cs index 1f03747e3..69e971e7d 100644 --- a/InscryptionAPI/Card/OpponentGemsManager.cs +++ b/InscryptionAPI/Card/OpponentGemsManager.cs @@ -1,25 +1,60 @@ using DiskCardGame; namespace InscryptionAPI.Card; -public class OpponentGemsManager : Singleton -{ +/// +/// Class for handling gems currently possessed by the opponent. +/// Allows for abilities and other behaviours that rely on owned gems to correctly work on both sides of the board. +/// +public class OpponentGemsManager : Singleton { + /// + /// List of gems currently owned by the opponent. + /// public List opponentGems = new(); + /// + /// How many of a certain gem type the opponent possesses. + /// + /// The gem type to search for. + /// How many of the given gem type are owned by the opponent public int GemsOfType(GemType gem) => opponentGems.Count(x => x == gem); + /// + /// Determines if the opponent owns a given gem. + /// + /// The gem type to look for. + /// True if the opponent owns at least one gem of the given type. False otherwise. public bool HasGem(GemType gem) => opponentGems.Contains(gem); + /// + /// Adds a gem of the given type to the List of opponent-owned gems. + /// + /// Type of gem to add to the opponent's possession. public void AddGem(GemType gem) => opponentGems.Add(gem); + /// + /// Removes a gem of the given type from the List of opponent-owned gems. + /// + /// Type of gem to remove from the opponent's possession. public void LoseGem(GemType gem) => opponentGems.Remove(gem); + /// + /// Adds gems of the given types to the List of opponent-owned gems. + /// + /// Types of gems to add to the opponent's possession. public void AddGems(params GemType[] gems) { foreach (GemType gem in gems) opponentGems.Add(gem); } + /// + /// Removes gems of the given types from the List of opponent-owned gems. + /// + /// Types of gems to remove from the opponent's possession. public void LoseGems(params GemType[] gems) { foreach (GemType gem in gems) opponentGems.Remove(gem); } + /// + /// Forcefully updates the list of opponent-owned gems based on gems owned on the opponent's side of the board. + /// public void ForceGemsUpdate() { opponentGems.Clear(); From f09c51e11f7107e5a7d7a5768346c19f665ff3d9 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:01:32 -0800 Subject: [PATCH 21/74] Fix minor error in XML --- InscryptionAPI/Card/AbilityManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 658219cb5..1a57bbb26 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -354,7 +354,7 @@ public static AbilityInfo New(string guid, string rulebookName, string rulebookD public static void Remove(Ability id) => NewAbilities.Remove(NewAbilities.FirstOrDefault(x => x.Id == id)); /// - /// Removes an ability from the game based on ability ID. Can only remove mod-added abilities, not vanilla abilities. + /// Removes an ability from the game based on its FullAbility. Can only remove mod-added abilities, not vanilla abilities. /// /// The instance of the ability to remove. public static void Remove(FullAbility ability) => NewAbilities.Remove(ability); From ac22a3334f1cea093fa41e7027e5850f7e52cf34 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:02:40 -0800 Subject: [PATCH 22/74] Add XML for SpecialStatIconManager --- InscryptionAPI/Card/SpecialStatIconManager.cs | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/InscryptionAPI/Card/SpecialStatIconManager.cs b/InscryptionAPI/Card/SpecialStatIconManager.cs index 7804a124d..67353e691 100644 --- a/InscryptionAPI/Card/SpecialStatIconManager.cs +++ b/InscryptionAPI/Card/SpecialStatIconManager.cs @@ -8,6 +8,9 @@ namespace InscryptionAPI.Card; +/// +/// Manager class for handling stat icons. +/// [HarmonyPatch] public static class StatIconManager { @@ -22,11 +25,26 @@ public static class StatIconManager { SpecialStatIcon.SacrificesThisTurn, SpecialTriggeredAbility.SacrificesThisTurn } }; + /// + /// A utility class that holds all of the required information about a stat icon in order to be able to use it in-game. + /// public class FullStatIcon { + /// + /// Enum ID for this stat icon. + /// public readonly SpecialStatIcon Id; + /// + /// Special ability enum ID for this stat icon. + /// public readonly SpecialTriggeredAbility AbilityId; + /// + /// The description object for this stat icon. + /// public readonly StatIconInfo Info; + /// + /// A subclass of VariableStatBehaviour that implements the logic for this stat icon. + /// public readonly Type VariableStatBehavior; /// @@ -38,6 +56,13 @@ public class FullStatIcon /// public Dictionary RulebookDescriptionRedirects = new(); + /// + /// Creates a new instance of FullStatIcon and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// + /// The unique ID for this stat icon. + /// The unique ID for this stat icon's associated special ability. + /// The description object for this ability. + /// A subclass of VariableStatBehaviour that implements the logic for the ability. public FullStatIcon(SpecialStatIcon id, SpecialTriggeredAbility abilityId, StatIconInfo info, Type variableStatBehavior) { Id = id; @@ -49,10 +74,19 @@ public FullStatIcon(SpecialStatIcon id, SpecialTriggeredAbility abilityId, StatI } } + /// + /// All of the vanilla game's stat icons. + /// public readonly static ReadOnlyCollection BaseGameStatIcons = new(GenBaseGameStatIconList()); private readonly static ObservableCollection NewStatIcons = new(); + /// + /// The current processed list of all stat icons in the game, including vanilla and mod-added abilities. + /// public static List AllStatIcons { get; private set; } = BaseGameStatIcons.ToList(); + /// + /// The current processed list of all StatIconInfos in the game, including vanilla and mod-added abilities. + /// public static List AllStatIconInfos { get; private set; } = BaseGameStatIcons.Select(x => x.Info).ToList(); static StatIconManager() @@ -95,6 +129,13 @@ private static List GenBaseGameStatIconList() return baseGame; } + /// + /// Creates a new stat icon and registers it to be able to be added to cards + /// + /// The guid of the mod adding the ability. + /// An instance of StatIconInfo describing the ability. + /// A subclass of VariableStatBehaviour that implements the logic for the stat icon. + /// An instance of FullStatIcon containing all necessary data for the stat icon to work.. public static FullStatIcon Add(string guid, StatIconInfo info, Type behavior) { // Register the special ability at the same time @@ -107,6 +148,14 @@ public static FullStatIcon Add(string guid, StatIconInfo info, Type behavior) return full; } + /// /// + /// Creates a new stat icon and registers it to be able to be added to cards + /// + /// The guid of the mod adding the ability. + /// The name of the stat icon when it appears in the Rulebook. + /// The description of the stat icon when it appears in the Rulebook. + /// A subclass of VariableStatBehaviour that implements the logic for the stat icon. + /// An instance of StatIconInfo describing the new ability. public static StatIconInfo New(string guid, string rulebookName, string rulebookDescription, Type behavior) { StatIconInfo info = ScriptableObject.CreateInstance(); @@ -116,7 +165,15 @@ public static StatIconInfo New(string guid, string rulebookName, string rulebook return Add(guid, info, behavior).Info; } + /// + /// Removes a stat icon from the game based on stat icon ID. Can only remove mod-added stat icons, not vanilla stat icons. + /// + /// The unique ID of the stat icon to remove. public static void Remove(SpecialStatIcon id) => NewStatIcons.Remove(NewStatIcons.FirstOrDefault(x => x.Id == id)); + /// + /// Removes an stat icon from the game based on its FullStatIcon. Can only remove mod-added stat icons, not vanilla stat icons. + /// + /// The instance of the ability to remove. public static void Remove(FullStatIcon ability) => NewStatIcons.Remove(ability); [HarmonyPrefix] From 35d27dc59367f9e71e5bd19222b7539bad7a001d Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:07:23 -0800 Subject: [PATCH 23/74] Fix incorrect XML documentation --- InscryptionAPI/Card/AbilityManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 1a57bbb26..f8216ad1c 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -291,7 +291,7 @@ private static List GenBaseGameAbilityList() /// An instance of AbilityInfo describing the ability. /// A subclass of AbilityBehaviour that implements the logic for the ability. /// The ability icon as a 49x49 texture. - /// An instance of AbilityInfo describing the new ability. + /// An instance of FullAbility containing all this ability's data.. /// The actual unique identifier for the new ability will be found in the 'ability' field of /// the returned AbilityInfo object. There is no way for the modder to create a specific ability ID; it will /// always be assigned by the API. From e76ec26b8e462d9869f863fc44cca3b8e72aa062 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:09:18 -0800 Subject: [PATCH 24/74] Add XML to SpecialTriggeredAbilityManager --- .../Card/SpecialTriggeredAbilityManager.cs | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs b/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs index ae43c3294..5d67091cd 100644 --- a/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs +++ b/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs @@ -5,20 +5,50 @@ namespace InscryptionAPI.Card; -public static class SpecialTriggeredAbilityManager -{ +/// +/// Class for managing SpecialtriggeredAbilities created through the API. +/// +public static class SpecialTriggeredAbilityManager { + /// + /// A utility class that holds all of the required information about a special ability in order to be able to use it in-game. + /// public class FullSpecialTriggeredAbility { + /// + /// The unique ID for this special ability + /// public readonly SpecialTriggeredAbility Id; + /// + /// The guid of the mod that added this special ability + /// public readonly string ModGUID; + /// + /// The name of this special ability. Used internally. + /// public readonly string AbilityName; + /// + /// A subclass of SpecialCardBehaviour that implements the logic for this special ability + /// public readonly Type AbilityBehaviour; + /// + /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// + /// The unique ID for this special ability. + /// A subclass of SpecialCardBehaviour that implements the logic for the ability. + [Obsolete("Use the constructor that takes a guid parameter instead")] public FullSpecialTriggeredAbility(SpecialTriggeredAbility id, Type abilityBehaviour) : this(null, abilityBehaviour.ToString(), id, abilityBehaviour) { } + /// + /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// + /// The GUID of the mod that added this. + /// The name of this special ability. + /// The unique ID for this special ability. + /// A subclass of SpecialCardBehaviour that implements the logic for the ability. public FullSpecialTriggeredAbility(string guid, string name, SpecialTriggeredAbility id, Type abilityBehaviour) { Id = id; @@ -30,9 +60,15 @@ public FullSpecialTriggeredAbility(string guid, string name, SpecialTriggeredAbi } } + /// + /// All of the vanilla game's special abilities. + /// public readonly static ReadOnlyCollection BaseGameSpecialTriggers = new(GenBaseGameSpecialTriggersList()); private readonly static ObservableCollection NewSpecialTriggers = new(); + /// + /// The current processed list of all special abilities in the game, including vanilla and mod-added abilities. + /// public static List AllSpecialTriggers { get; private set; } = BaseGameSpecialTriggers.ToList(); static SpecialTriggeredAbilityManager() @@ -55,6 +91,12 @@ private static List GenBaseGameSpecialTriggersList( return baseGame; } + /// + /// Creates a new special ability and registers it to be able to be added to cards. + /// + /// The guid of the mod adding the special ability. + /// The name of the special ability. + /// A subclass of SpecialCardBehaviour that implements the logic for the ability. public static FullSpecialTriggeredAbility Add(string guid, string abilityName, Type behavior) { FullSpecialTriggeredAbility full = new(guid, abilityName, GuidManager.GetEnumValue(guid, abilityName), behavior); @@ -62,6 +104,14 @@ public static FullSpecialTriggeredAbility Add(string guid, string abilityName, T return full; } + /// + /// Removes a special ability from the game based on its ID. Can only remove mod-added special abilities, not vanilla ones. + /// + /// The unique ID of the special ability to remove. public static void Remove(SpecialTriggeredAbility id) => NewSpecialTriggers.Remove(NewSpecialTriggers.FirstOrDefault(x => x.Id == id)); + /// + /// Removes a special ability from the game based on its FullSpecialTriggeredAbility. Can only remove mod-added special abilities, not vanilla ones. + /// + /// The instance of the ability to remove. public static void Remove(FullSpecialTriggeredAbility ability) => NewSpecialTriggers.Remove(ability); } From b8701bcc53edc0e8deb7d51848d41114a41b71f0 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:13:05 -0800 Subject: [PATCH 25/74] Add XML to TribeManager --- InscryptionAPI/Card/TribeManager.cs | 39 +++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/InscryptionAPI/Card/TribeManager.cs b/InscryptionAPI/Card/TribeManager.cs index a654326ea..95eedb70d 100644 --- a/InscryptionAPI/Card/TribeManager.cs +++ b/InscryptionAPI/Card/TribeManager.cs @@ -17,26 +17,44 @@ namespace InscryptionAPI.Card; public static class TribeManager { /// - /// The internal object used to store all relevant info about a Tribe. - /// guid - The mod GUID that added the Tribe. - /// name - The internal name of the Tribe. - /// tribe - The enum value corresponding to this Tribe. - /// icon - The sprite displayed on cards with this Tribe. - /// tribeChoice - Whether or not this Tribe can appear at card tribe choice nodes. - /// cardBack - The texture displayed at card tribe choice nodes. If null, the API will create one using the icon Sprite. + /// A utility class that holds all of the required information about a tribe in order to be able to use it in-game. /// public class TribeInfo { + /// + /// The guid of the mod that added this ability + /// public string guid; + /// + /// The name of this tribe + /// public string name; + /// + /// The unique ID for this tribe + /// public Tribe tribe; + /// + /// The Sprite displayed on cards of this tribe + /// public Sprite icon; + /// + /// Whether or not this tribe can appear in tribe card choice nodes. + /// public bool tribeChoice; + /// + /// The cardback texture displayed when this tribe appears in tribe card choice nodes. If null, the API will create one using the icon. + /// public Texture2D cardback; } private static readonly List tribes = new(); private static readonly List tribeTypes = new(); + /// + /// All modded TribeInfos added through the API. + /// public static readonly ReadOnlyCollection NewTribes = new(tribes); + /// + /// All modded tribe IDs added through the API. + /// public static readonly ReadOnlyCollection NewTribesTypes = new(tribeTypes); private static readonly Texture2D TribeIconMissing = TextureHelper.GetImageAsTexture("tribeicon_none.png", Assembly.GetExecutingAssembly()); @@ -75,13 +93,18 @@ public static Tribe Add(string guid, string name, Texture2D tribeIcon = null, bo /// The name of the tribe. /// Path to the tribal icon that will appear as a watermark on all cards belonging to this tribe. /// Indicates if the card should appear in tribal choice nodes. - /// Path to the card back texture to display if the card should appear in tribal choice nodes. + /// Path to the card back texture to display if the card should appear in tribal choice nodes. /// The unique identifier for the new tribe. public static Tribe Add(string guid, string name, string pathToTribeIcon = null, bool appearInTribeChoices = false, string pathToChoiceCardBackTexture = null) { // Reason for 'is not null' is because if we pass 'null' to GetImageAsTexture, It will throw an exception. return Add(guid, name, pathToTribeIcon is not null ? TextureHelper.GetImageAsTexture(pathToTribeIcon) : null, appearInTribeChoices, pathToChoiceCardBackTexture is not null ? TextureHelper.GetImageAsTexture(pathToChoiceCardBackTexture) : null); } + /// + /// Determines if the given Tribe was added by a mod. + /// + /// The Tribe to check. + /// True if tribe is not from the base game. public static bool IsCustomTribe(Tribe tribe) => tribeTypes.Contains(tribe); /// From 4b597ebf66111bbef2dd44e94b4b29ae80088319 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:14:15 -0800 Subject: [PATCH 26/74] Move to patches subfolder --- InscryptionAPI/Card/{ => Patches}/DeathCardTranspilers.cs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename InscryptionAPI/Card/{ => Patches}/DeathCardTranspilers.cs (100%) diff --git a/InscryptionAPI/Card/DeathCardTranspilers.cs b/InscryptionAPI/Card/Patches/DeathCardTranspilers.cs similarity index 100% rename from InscryptionAPI/Card/DeathCardTranspilers.cs rename to InscryptionAPI/Card/Patches/DeathCardTranspilers.cs From b1484af11abde01b49f650615843ec0f234c8348 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 01:15:07 -0800 Subject: [PATCH 27/74] Add GainMultipleGems ability subclass so we can unify all those "give two gems" sigils floating about --- InscryptionAPI/Card/GainMultipleGems.cs | 60 +++++++++++++++++++ InscryptionAPI/Card/OpponentGemsManager.cs | 11 +++- .../Card/{ => Patches}/OpponentGemsPatches.cs | 16 ++++- 3 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 InscryptionAPI/Card/GainMultipleGems.cs rename InscryptionAPI/Card/{ => Patches}/OpponentGemsPatches.cs (89%) diff --git a/InscryptionAPI/Card/GainMultipleGems.cs b/InscryptionAPI/Card/GainMultipleGems.cs new file mode 100644 index 000000000..16260b1c9 --- /dev/null +++ b/InscryptionAPI/Card/GainMultipleGems.cs @@ -0,0 +1,60 @@ +using DiskCardGame; +using System.Collections; + +namespace InscryptionAPI.Card; + +/// +/// Class that allows for easily creating abilities that provide multiple gem types to their owner. +/// +public abstract class GainMultipleGems : AbilityBehaviour { + /// + /// Gem types that this ability should provide. + /// + public abstract GemType[] Gems { get; } + + /// + /// Adds provided gems when a card with this ability is played on the board. + /// + public override bool RespondsToResolveOnBoard() { + return true; + } + + /// + /// Add provided gems when a card with this ability is played on the board. + /// + public override IEnumerator OnResolveOnBoard() { + if (!base.Card.OpponentCard) { + foreach (GemType gem in Gems) { + yield return ResourcesManager.Instance.AddGem(gem); + } + } + else { + foreach (GemType gem in Gems) { + OpponentGemsManager.Instance.AddGem(gem); + } + } + } + + /// + /// Removes provided gems when a card with this ability dies. + /// + public override bool RespondsToDie(bool wasSacrifice, PlayableCard killer) { + return true; + } + + /// + /// Remove provided gems when a card with this ability dies. + /// + public override IEnumerator OnDie(bool wasSacrifice, PlayableCard killer) { + if (!base.Card.OpponentCard) { + foreach (GemType gem in Gems) { + yield return ResourcesManager.Instance.LoseGem(gem); + } + } + else { + foreach (GemType gem in Gems) { + OpponentGemsManager.Instance.LoseGem(gem); + } + } + } +} diff --git a/InscryptionAPI/Card/OpponentGemsManager.cs b/InscryptionAPI/Card/OpponentGemsManager.cs index 69e971e7d..4321e9a37 100644 --- a/InscryptionAPI/Card/OpponentGemsManager.cs +++ b/InscryptionAPI/Card/OpponentGemsManager.cs @@ -66,10 +66,15 @@ public void ForceGemsUpdate() foreach (GainGem gainGem in components) opponentGems.Add(gainGem.Gem); - GainGemTriple[] components2 = slot.Card.GetComponents(); - for (int i = 0; i < components2.Length; i++) + GainMultipleGems[] components2 = slot.Card.GetComponents(); + foreach (GainMultipleGems gainGems in components2) { + opponentGems.AddRange(gainGems.Gems); + } + + GainGemTriple[] components3 = slot.Card.GetComponents(); + for (int i = 0; i < components3.Length; i++) { - _ = components2[i]; + _ = components3[i]; opponentGems.Add(GemType.Green); opponentGems.Add(GemType.Orange); opponentGems.Add(GemType.Blue); diff --git a/InscryptionAPI/Card/OpponentGemsPatches.cs b/InscryptionAPI/Card/Patches/OpponentGemsPatches.cs similarity index 89% rename from InscryptionAPI/Card/OpponentGemsPatches.cs rename to InscryptionAPI/Card/Patches/OpponentGemsPatches.cs index a65a3117b..d1de1383a 100644 --- a/InscryptionAPI/Card/OpponentGemsPatches.cs +++ b/InscryptionAPI/Card/Patches/OpponentGemsPatches.cs @@ -24,7 +24,21 @@ private static void SetUpOpponentGems(ResourcesManager __instance) private static void CleanUpOpponentGems() => Singleton.Instance?.opponentGems.Clear(); [HarmonyPostfix, HarmonyPatch(typeof(ResourcesManager), nameof(ResourcesManager.ForceGemsUpdate))] - private static void ForceOpponentGemsUpdate() => Singleton.Instance?.ForceGemsUpdate(); + private static void ForceOpponentGemsUpdate(ResourcesManager __instance) { + foreach (CardSlot slot in Singleton.Instance.GetSlots(getPlayerSlots: true)) { + if (slot.Card != null && !slot.Card.Dead) { + GainMultipleGems[] components2 = slot.Card.GetComponents(); + foreach (GainMultipleGems gainGems in components2) { + __instance.gems.AddRange(gainGems.Gems); + } + } + } + for (int j = 0; j < 3; j++) { + __instance.SetGemOnImmediate((GemType)j, __instance.gems.Contains((GemType)j)); + } + + Singleton.Instance?.ForceGemsUpdate(); + } [HarmonyPostfix] [HarmonyPatch(typeof(FishHookGrab), nameof(FishHookGrab.PullHook))] From f635e9d3f7f11c5fae67fae80da27ff0d5c2c607 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:36:21 -0800 Subject: [PATCH 28/74] Add cref links to XML Add some missing XML and fix incorrect XML in AbilityExtensions --- InscryptionAPI/Card/AbilityExtensions.cs | 195 ++++++++------- InscryptionAPI/Card/AbilityManager.cs | 5 +- .../Card/CardAppearanceBehaviourManager.cs | 2 +- InscryptionAPI/Card/CardExtensions.cs | 72 +++--- InscryptionAPI/Card/CardExtensionsHelpers.cs | 86 +++---- .../Card/CardExtensionsPortraits.cs | 236 +++++++++--------- .../Card/CardExtensionsProperties.cs | 78 +++--- InscryptionAPI/Card/CardExtensionsSetters.cs | 154 ++++++------ InscryptionAPI/Card/CardManager.cs | 46 ++-- InscryptionAPI/Card/CostProperties.cs | 12 +- InscryptionAPI/Card/SpecialStatIconManager.cs | 2 +- .../Card/SpecialTriggeredAbilityManager.cs | 4 +- InscryptionAPI/Costs/CardCostManager.cs | 24 +- .../Helpers/Extensions/CardSlotExtensions.cs | 4 +- InscryptionAPI/Pelts/PeltManager.cs | 2 +- 15 files changed, 471 insertions(+), 451 deletions(-) diff --git a/InscryptionAPI/Card/AbilityExtensions.cs b/InscryptionAPI/Card/AbilityExtensions.cs index 42acc4bab..ceae0413f 100644 --- a/InscryptionAPI/Card/AbilityExtensions.cs +++ b/InscryptionAPI/Card/AbilityExtensions.cs @@ -29,8 +29,8 @@ public static class AbilityExtensions /// /// For internal use only. /// - /// This is instance-based: it will use the CWT in AbilityManager to get the *instance* of FullAbility - /// that corresponds to this *instance* of AbilityInfo. If either of these are clones that may get GCd, then + /// This is instance-based: it will use the CWT in to get the *instance* of + /// that corresponds to this *instance* of . If either of these are clones that may get GCd, then /// it would potentially be a mistake to use this helper. It should only be used internally when the implications /// are understood. internal static FullAbility GetFullAbility(this AbilityInfo info) @@ -42,6 +42,11 @@ internal static FullAbility GetFullAbility(this AbilityInfo info) return retval; } + /// + /// Retrieves the original, unmodified rulebook description of the given . + /// + /// The to access. + /// The original description for this ability. public static string GetBaseRulebookDescription(this AbilityInfo info) { FullAbility fullAbility = AllAbilities.Find(x => x.Info == info); @@ -54,13 +59,13 @@ public static string GetBaseRulebookDescription(this AbilityInfo info) /// /// Sets the icon texture for the ability. /// - /// The ability info to set the texture for. + /// The to set the texture for. /// A 49x49 texture containing the icon. - /// The same ability info so a chain can continue. - /// Thrown if the ability info has not yet been added to the AbilityManager + /// The same so a chain can continue. + /// Thrown if the has not yet been added to the AbilityManager /// You cannot do this unless the ability has been registered with the API. Unless the API knows about this /// ability, it will not have the required information to be able to process the texture, so an exception will be thrown - /// if you try to do this to an instance of AbilityInfo that did not get processed through the API. + /// if you try to do this to an instance of that did not get processed through the API. public static AbilityInfo SetIcon(this AbilityInfo info, Texture2D icon) { FullAbility ability = info.GetFullAbility(); @@ -74,7 +79,7 @@ public static AbilityInfo SetIcon(this AbilityInfo info, Texture2D icon) /// /// Sets the icon texture for the ability. /// - /// The ability info to set the texture for. + /// The to set the texture for. /// A 49x49 texture containing the icon. public static void SetIcon(this FullAbility info, Texture2D icon) { info.Texture = icon; @@ -83,13 +88,13 @@ public static void SetIcon(this FullAbility info, Texture2D icon) { /// /// Sets the flipped texture for the ability (used when the ability belongs to the opponent). /// - /// The ability info to set the texture for. + /// The to set the texture for. /// A 49x49 texture containing the icon. - /// The same ability info so a chain can continue. - /// Thrown if the ability info has not yet been added to the AbilityManager + /// The same so a chain can continue. + /// Thrown if the has not yet been added to the AbilityManager /// You cannot do this unless the ability has been registered with the API. Unless the API knows about this /// ability, it will not have the required information to be able to process the texture, so an exception will be thrown - /// if you try to do this to an instance of AbilityInfo that did not get processed through the API. + /// if you try to do this to an instance of that did not get processed through the API. public static AbilityInfo SetCustomFlippedTexture(this AbilityInfo info, Texture2D icon) { FullAbility ability = info.GetFullAbility(); @@ -103,7 +108,7 @@ public static AbilityInfo SetCustomFlippedTexture(this AbilityInfo info, Texture /// /// Sets the flipped texture for the ability (used when the ability belongs to the opponent). /// - /// The ability info to set the texture for. + /// The to set the texture for. /// A 49x49 texture containing the icon. public static void SetCustomFlippedTexture(this FullAbility info, Texture2D icon) { @@ -114,10 +119,10 @@ public static void SetCustomFlippedTexture(this FullAbility info, Texture2D icon /// /// Sets the icon that will be displayed for this ability icon in Act 2. /// - /// The instance of AbilityInfo. + /// The instance of . /// A 17x17 or 22x10 texture containing the icon; for regular and activated sigil icons respectively. /// The filter mode for the icon texture. Leave this at its default value unless you have a specific reason to change it. - /// The same ability so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetPixelAbilityIcon(this AbilityInfo info, Texture2D icon, FilterMode? filterMode = null) { TextureHelper.SpriteType spriteType = icon.width == 22 ? TextureHelper.SpriteType.PixelActivatedAbilityIcon : TextureHelper.SpriteType.PixelAbilityIcon; @@ -129,9 +134,9 @@ public static AbilityInfo SetPixelAbilityIcon(this AbilityInfo info, Texture2D i /// /// Adds one or more metacategories to the ability. Duplicate categories will not be added. /// - /// The instance of AbilityInfo. + /// The instance of . /// The metacategories to add. - /// The same ability so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo AddMetaCategories(this AbilityInfo info, params AbilityMetaCategory[] categories) { info.metaCategories ??= new(); @@ -142,27 +147,27 @@ public static AbilityInfo AddMetaCategories(this AbilityInfo info, params Abilit } /// - /// Helper method: automatically adds the Part1Modular and Part1Rulebook metacategories to the ability. + /// Helper method: automatically adds the Part1Modular and Part1Rulebook metacategories to the ability. /// - /// The instance of AbilityInfo. - /// The same ability so a chain can continue. + /// The instance of . + /// The same so a chain can continue. public static AbilityInfo SetDefaultPart1Ability(this AbilityInfo info) { return info.AddMetaCategories(AbilityMetaCategory.Part1Modular, AbilityMetaCategory.Part1Rulebook); } /// - /// Helper method: automatically adds the custom metacategory Part2Modular to the ability. + /// Helper method: automatically adds the custom metacategory Part2Modular to the ability. /// - /// The instance of AbilityInfo. - /// The same ability so a chain can continue. + /// The instance of . + /// The same so a chain can continue. public static AbilityInfo SetDefaultPart2Ability(this AbilityInfo info) => info.AddMetaCategories(Part2Modular); /// - /// Helper method: automatically adds the Part3Modular, Part3BuildACard, and Part3Rulebook metacategories to the ability. + /// Helper method: automatically adds the Part3Modular, Part3BuildACard, and Part3Rulebook metacategories to the ability. /// - /// The instance of AbilityInfo. - /// The same ability so a chain can continue. + /// The instance of . + /// The same so a chain can continue. public static AbilityInfo SetDefaultPart3Ability(this AbilityInfo info) { return info.AddMetaCategories(AbilityMetaCategory.Part3Modular, AbilityMetaCategory.Part3Rulebook, AbilityMetaCategory.Part3BuildACard); @@ -171,9 +176,9 @@ public static AbilityInfo SetDefaultPart3Ability(this AbilityInfo info) /// /// Sets the text displayed when this ability is marked as learned. /// - /// The instance of AbilityInfo. + /// The instance of . /// The text to display, represented by strings. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo, params string[] lines) { if (lines.Length > 0) @@ -190,9 +195,9 @@ public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo /// /// Sets the text displayed when this ability is marked as learned. /// - /// The instance of AbilityInfo. - /// The text to display, represented by DialogueEvent.Line's. - /// The same AbilityInfo so a chain can continue. + /// The instance of . + /// The text to display, represented by DialogueEvent.Line's. + /// The same so a chain can continue. public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo, params DialogueEvent.Line[] lines) { if (lines.Length > 0) @@ -202,22 +207,22 @@ public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo } /// - /// Sets the text displayed whenever OnAbilityTriggered is called by this ability in Act 2. + /// Sets the text displayed whenever OnAbilityTriggered is called by this ability in Act 2. /// - /// The instance of AbilityInfo. - /// The text to display when OnAbilityTriggered is called. - /// The same AbilityInfo so a chain can continue. + /// The instance of . + /// The text to display when OnAbilityTriggered is called. + /// The same so a chain can continue. public static AbilityInfo SetGBCTriggerText(this AbilityInfo abilityInfo, string triggerText) { abilityInfo.triggerText = triggerText; return abilityInfo; } /// - /// Sets the text displayed whenever OnAbilityTriggered is called by this ability in Act 2. + /// Sets the text displayed whenever OnAbilityTriggered is called by this ability in Act 2. /// - /// The instance of FullAbility. - /// The text to display when OnAbilityTriggered is called. - /// The same FullAbility so a chain can continue. + /// The instance of . + /// The text to display when OnAbilityTriggered is called. + /// The same so a chain can continue. public static FullAbility SetGBCTriggerText(this FullAbility fullAbility, string triggerText) { fullAbility.Info.triggerText = triggerText; return fullAbility; @@ -227,9 +232,9 @@ public static FullAbility SetGBCTriggerText(this FullAbility fullAbility, string /// Sets the power level of the ability, used in some game logic like determining the opponent totem's ability. /// Vanilla power levels range from -3 to 5, and values above or below are ignored in most cases. /// - /// The instance of AbilityInfo. + /// The instance of . /// The ability's power level. Should be equal to or between -3 and 5. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetPowerlevel(this AbilityInfo abilityInfo, int powerLevel) { abilityInfo.powerLevel = powerLevel; @@ -239,9 +244,9 @@ public static AbilityInfo SetPowerlevel(this AbilityInfo abilityInfo, int powerL /// Sets the power level of the ability, used in some game logic like determining the opponent totem's ability. /// Vanilla power levels range from -3 to 5, and values above or below are ignored in most cases. /// - /// The instance of FullAbility. + /// The instance of . /// The ability's power level. Should be equal to or between -3 and 5. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetPowerlevel(this FullAbility fullAbility, int powerLevel) { fullAbility.Info.powerLevel = powerLevel; return fullAbility; @@ -270,9 +275,9 @@ public static FullAbility SetRulebookName(this FullAbility fullAbility, string n /// /// Sets whether or not the ability is an activated ability. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability is activated. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetActivated(this AbilityInfo abilityInfo, bool activated = true) { abilityInfo.activated = activated; @@ -281,9 +286,9 @@ public static AbilityInfo SetActivated(this AbilityInfo abilityInfo, bool activa /// /// Sets whether or not the ability is an activated ability. /// - /// The instance of FullAbility. + /// The instance of . /// If the ability is activated. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetActivated(this FullAbility fullAbility, bool activated = true) { fullAbility.Info.activated = activated; return fullAbility; @@ -292,9 +297,9 @@ public static FullAbility SetActivated(this FullAbility fullAbility, bool activa /// /// Sets whether or not the ability is passive (will not trigger). /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability is passive. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetPassive(this AbilityInfo abilityInfo, bool passive = true) { abilityInfo.passive = passive; @@ -303,9 +308,9 @@ public static AbilityInfo SetPassive(this AbilityInfo abilityInfo, bool passive /// /// Sets whether or not the ability is passive (will not trigger). /// - /// The instance of FullAbility. + /// The instance of . /// If the ability is passive. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetPassive(this FullAbility fullAbility, bool passive = true) { fullAbility.Info.passive = passive; return fullAbility; @@ -314,9 +319,9 @@ public static FullAbility SetPassive(this FullAbility fullAbility, bool passive /// /// Sets whether or not the ability can be used by the opponent. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability is usable by the opponent. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetOpponentUsable(this AbilityInfo abilityInfo, bool opponentUsable = true) { abilityInfo.opponentUsable = opponentUsable; @@ -325,9 +330,9 @@ public static AbilityInfo SetOpponentUsable(this AbilityInfo abilityInfo, bool o /// /// Sets whether or not the ability can be used by the opponent. /// - /// The instance of FullAbility. + /// The instance of . /// If the ability is usable by the opponent. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetOpponentUsable(this FullAbility fullAbility, bool opponentUsable = true) { fullAbility.Info.opponentUsable = opponentUsable; return fullAbility; @@ -336,9 +341,9 @@ public static FullAbility SetOpponentUsable(this FullAbility fullAbility, bool o /// /// Sets whether or not the ability is a conduit. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability is a conduit. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetConduit(this AbilityInfo abilityInfo, bool conduit = true) { abilityInfo.conduit = conduit; @@ -347,9 +352,9 @@ public static AbilityInfo SetConduit(this AbilityInfo abilityInfo, bool conduit /// /// Sets whether or not the ability is a conduit. /// - /// The instance of FullAbility. + /// The instance of . /// If the ability is a conduit. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetConduit(this FullAbility fullAbility, bool conduit = true) { fullAbility.Info.conduit = conduit; return fullAbility; @@ -358,9 +363,9 @@ public static FullAbility SetConduit(this FullAbility fullAbility, bool conduit /// /// Sets whether or not the ability is a conduit cell. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability is a conduit cell. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetConduitCell(this AbilityInfo abilityInfo, bool conduitCell = true) { abilityInfo.conduitCell = conduitCell; @@ -369,9 +374,9 @@ public static AbilityInfo SetConduitCell(this AbilityInfo abilityInfo, bool cond /// /// Sets whether or not the ability is a conduit cell. /// - /// The instance of FullAbility. + /// The instance of . /// If the ability is a conduit cell. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetConduitCell(this FullAbility fullAbility, bool conduitCell = true) { fullAbility.Info.conduitCell = conduitCell; return fullAbility; @@ -381,9 +386,10 @@ public static FullAbility SetConduitCell(this FullAbility fullAbility, bool cond /// Sets whether or not the ability can stack on a card, triggering once for each stack. /// Optional parameter for setting the ability to only trigger once per stack when a card evolves (only affects abilities that can stack). /// - /// The instance of AbilityInfo. + /// The instance of . /// Whether or not to prevent double triggering. - /// The same AbilityInfo so a chain can continue. + /// If this ability should stack or not. + /// The same so a chain can continue. public static AbilityInfo SetCanStack(this AbilityInfo abilityInfo, bool canStack = true, bool triggersOncePerStack = false) { abilityInfo.canStack = canStack; @@ -394,9 +400,10 @@ public static AbilityInfo SetCanStack(this AbilityInfo abilityInfo, bool canStac /// Sets whether or not the ability can stack on a card, triggering once for each stack. /// Optional parameter for setting the ability to only trigger once per stack when a card evolves (only affects abilities that can stack). /// - /// The instance of FullAbility. + /// The instance of . /// Whether or not to prevent double triggering. - /// The same FullAbility so a chain can continue. + /// If this ability should stack or not. + /// The same so a chain can continue. public static FullAbility SetCanStack(this FullAbility fullAbility, bool canStack = true, bool triggersOncePerStack = false) { fullAbility.Info.SetCanStack(canStack, triggersOncePerStack); return fullAbility; @@ -405,9 +412,9 @@ public static FullAbility SetCanStack(this FullAbility fullAbility, bool canStac /// /// Sets whether or not the ability's icon should be flipped upside-down when it's on an opponent card. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the icon should be flipped. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetFlipYIfOpponent(this AbilityInfo abilityInfo, bool flipY = true) { abilityInfo.flipYIfOpponent = flipY; @@ -416,9 +423,9 @@ public static AbilityInfo SetFlipYIfOpponent(this AbilityInfo abilityInfo, bool /// /// Sets whether or not the ability's icon should be flipped upside-down when it's on an opponent card. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the icon should be flipped. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetFlipYIfOpponent(this FullAbility fullAbility, bool flipY = true) { fullAbility.Info.SetFlipYIfOpponent(flipY); return fullAbility; @@ -428,10 +435,10 @@ public static FullAbility SetFlipYIfOpponent(this FullAbility fullAbility, bool /// Sets whether or not the ability's icon's colour should be overridden, and what the override colour should be. /// The colour override only applies to the default ability icons; totem and merge icons are unaffected. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability icon's colour should be overridden. /// The colour that will override the icon. Only applies if hasOverride is true. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetHasColorOverride(this AbilityInfo abilityInfo, bool hasOverride, Color colorOverride = default) { abilityInfo.hasColorOverride = hasOverride; @@ -445,10 +452,10 @@ public static AbilityInfo SetHasColorOverride(this AbilityInfo abilityInfo, bool /// Sets whether or not the ability's icon's colour should be overridden, and what the override colour should be. /// The colour override only applies to the default ability icons; totem and merge icons are unaffected. /// - /// The instance of FullAbility. + /// The instance of . /// If the ability icon's colour should be overridden. /// The colour that will override the icon. Only applies if hasOverride is true. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetHasColorOverride(this FullAbility fullAbility, bool hasOverride, Color colorOverride = default) { fullAbility.Info.SetHasColorOverride(hasOverride, colorOverride); return fullAbility; @@ -458,9 +465,9 @@ public static FullAbility SetHasColorOverride(this FullAbility fullAbility, bool /// Sets whether or not the ability's name should precede its description in Act 2. /// If false, only the ability's description will be shown. /// - /// The instance of AbilityInfo. + /// The instance of . /// If the ability's name should precede its Act 2 description. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetKeywordAbility(this AbilityInfo abilityInfo, bool keyword = true) { abilityInfo.keywordAbility = keyword; @@ -471,9 +478,9 @@ public static AbilityInfo SetKeywordAbility(this AbilityInfo abilityInfo, bool k /// Sets whether or not the ability's name should precede its description in Act 2. /// If false, only the ability's description will be shown. /// - /// The instance of FullAbility. + /// The instance of . /// If the ability's name should precede its Act 2 description. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetKeywordAbility(this FullAbility fullAbility, bool keyword = true) { fullAbility.Info.keywordAbility = keyword; return fullAbility; @@ -483,8 +490,8 @@ public static FullAbility SetKeywordAbility(this FullAbility fullAbility, bool k /// Resets the AbilityInfo's rulebook description to its vanilla version. /// Useful for anyone messing with altering descriptions. /// - /// The instance of AbilityInfo. - /// The same AbilityInfo so a chain can continue. + /// The instance of . + /// The same so a chain can continue. public static AbilityInfo ResetDescription(this AbilityInfo abilityInfo) { abilityInfo.rulebookDescription = AllAbilities.AbilityByID(abilityInfo.ability).BaseRulebookDescription; @@ -508,6 +515,12 @@ public static FullAbility SetMagnificusRulebook(this FullAbility full) { return full; } + /// + /// Checks if the given has all given metacategories. + /// + /// The to access. + /// The metacategories to check for. + /// True if this ability has all the given metacategory. public static bool HasMetaCategories(this AbilityInfo info, params AbilityMetaCategory[] categories) { foreach (AbilityMetaCategory app in categories) @@ -517,6 +530,12 @@ public static bool HasMetaCategories(this AbilityInfo info, params AbilityMetaCa return true; } + /// + /// Checks if the given has the given metacategory. + /// + /// The to access. + /// The metacategory to check for. + /// True if this ability has the given metacategory. public static bool HasMetaCategory(this AbilityInfo info, AbilityMetaCategory category) { return info.metaCategories.Contains(category); @@ -631,9 +650,9 @@ public static StatIconInfo SetDefaultPart3Ability(this StatIconInfo info) { /// Sets the ability to only ever trigger once per stack. This prevents abilities from triggering twice per stack after a card evolves. /// This only affects cards that evolve into a card that possesses the same stackable ability (eg, default evolutions). /// - /// The instance of AbilityInfo. + /// The instance of . /// Whether or not to prevent double triggering. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetTriggersOncePerStack(this AbilityInfo abilityInfo, bool triggersOncePerStack = true) { abilityInfo.SetExtendedProperty("TriggersOncePerStack", triggersOncePerStack); @@ -653,7 +672,7 @@ public static bool GetTriggersOncePerStack(this Ability ability) /// /// Gets the value of TriggersOncePerStack. Returns false if TriggersOncePerStack has not been set. /// - /// The instance of AbilityInfo. + /// The instance of . /// Whether double triggering is disabled. public static bool GetTriggersOncePerStack(this AbilityInfo abilityInfo) { @@ -666,9 +685,9 @@ public static bool GetTriggersOncePerStack(this AbilityInfo abilityInfo) /// Sets an ability to only have one stack of it be hidden whenever the ability is added to a card status's hiddenAbilities field. /// Adding the same ability to hiddenAbilities will hide more stacks. Only affects cards that can stack. /// - /// The instance of AbilityInfo. + /// The instance of . /// Whether all stacks of this ability will be hidden when added to hiddenAbilities. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetHideSingleStacks(this AbilityInfo abilityInfo, bool hideSingleStacks = true) { abilityInfo.SetExtendedProperty("HideSingleStacks", hideSingleStacks); @@ -687,7 +706,7 @@ public static bool GetHideSingleStacks(this Ability ability) /// /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. /// - /// The instance of AbilityInfo. + /// The instance of . /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. public static bool GetHideSingleStacks(this AbilityInfo abilityInfo) { @@ -703,7 +722,7 @@ public static bool GetHideSingleStacks(this AbilityInfo abilityInfo) /// Ability to access. /// The name of the property to set. /// The value of the property. - /// The same AbilityInfo so a chain can continue. + /// The same so a chain can continue. public static AbilityInfo SetExtendedProperty(this AbilityInfo info, string propertyName, object value) { info.GetAbilityExtensionTable()[propertyName] = value?.ToString(); @@ -715,7 +734,7 @@ public static AbilityInfo SetExtendedProperty(this AbilityInfo info, string prop /// FullAbility object to access. /// The name of the property to set. /// The value of the property. - /// The same FullAbility so a chain can continue. + /// The same so a chain can continue. public static FullAbility SetExtendedProperty(this FullAbility fullAbility, string propertyName, object value) { fullAbility.Info.GetAbilityExtensionTable()[propertyName] = value?.ToString(); diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index f8216ad1c..1cc277d3d 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -81,8 +81,9 @@ public class FullAbility internal static ConditionalWeakTable ReverseMapper = new(); + // [TypeManager](InscryptionAPI.Guid.TypeManager) /// - /// Creates a new instance of FullAbility and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullAbility and registers its behaviour type with the . /// /// The unique ID for this ability. /// The description object for this ability. @@ -94,7 +95,7 @@ public FullAbility(Ability id, AbilityInfo info, Type behaviour, Texture texture } /// - /// Creates a new instance of FullAbility and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullAbility and registers its behaviour type with the . /// /// The GUID of the mod that added this. /// The unique ID for this ability. diff --git a/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs b/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs index 8212e1b9a..506a58e9d 100644 --- a/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs +++ b/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs @@ -24,7 +24,7 @@ public class FullCardAppearanceBehaviour /// public readonly Type AppearanceBehaviour; /// - /// Creates a new instance of FullCardAppearanceBehaviour and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullCardAppearanceBehaviour and registers its behaviour type with the . /// /// Appearance enum id. /// Type of the custom CardAppearanceBehaviour class. diff --git a/InscryptionAPI/Card/CardExtensions.cs b/InscryptionAPI/Card/CardExtensions.cs index 52355ee33..917ccb6ba 100644 --- a/InscryptionAPI/Card/CardExtensions.cs +++ b/InscryptionAPI/Card/CardExtensions.cs @@ -27,9 +27,9 @@ private static Sprite GetPortrait(Texture2D portrait, TextureHelper.SpriteType s /// /// Adds any number of abilities to the card. Abilities can be added multiple times. /// - /// CardInfo to access. + /// CardInfo to access. /// The abilities to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddAbilities(this CardInfo info, params Ability[] abilities) { info.abilities ??= new(); @@ -40,9 +40,9 @@ public static CardInfo AddAbilities(this CardInfo info, params Ability[] abiliti /// /// Adds any number of appearance behaviors to the card. Duplicate appearance behaviors are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The appearances to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddAppearances(this CardInfo info, params CardAppearanceBehaviour.Appearance[] appearances) { info.appearanceBehaviour ??= new(); @@ -55,9 +55,9 @@ public static CardInfo AddAppearances(this CardInfo info, params CardAppearanceB /// /// Adds any number of decals to the card. Duplicate decals are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The decals to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddDecal(this CardInfo info, params Texture[] decals) { info.decals ??= new(); @@ -71,9 +71,9 @@ public static CardInfo AddDecal(this CardInfo info, params Texture[] decals) /// /// Adds any number of decals to the card. Duplicate decals are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The paths to the .png files containing the decals (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddDecal(this CardInfo info, params string[] decals) { return decals == null @@ -85,9 +85,9 @@ public static CardInfo AddDecal(this CardInfo info, params string[] decals) /// /// Adds any number of metacategories to the card. Duplicate metacategories are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The categories to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddMetaCategories(this CardInfo info, params CardMetaCategory[] categories) { info.metaCategories ??= new(); @@ -100,9 +100,9 @@ public static CardInfo AddMetaCategories(this CardInfo info, params CardMetaCate /// /// Adds any number of special abilities to the card. Duplicate special abilities are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The abilities to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddSpecialAbilities(this CardInfo info, params SpecialTriggeredAbility[] abilities) { info.specialAbilities ??= new(); @@ -115,9 +115,9 @@ public static CardInfo AddSpecialAbilities(this CardInfo info, params SpecialTri /// /// Adds any number of traits to the card. Duplicate traits are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The traits to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddTraits(this CardInfo info, params Trait[] traits) { info.traits ??= new(); @@ -130,9 +130,9 @@ public static CardInfo AddTraits(this CardInfo info, params Trait[] traits) /// /// Adds any number of tribes to the card. Duplicate tribes are ignored. /// - /// CardInfo to access. + /// CardInfo to access. /// The tribes to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo AddTribes(this CardInfo info, params Tribe[] tribes) { info.tribes ??= new(); @@ -184,9 +184,9 @@ public static CardInfo RemoveAbilitiesSingle(this CardInfo info, params Ability[ /// /// Removes any number of special abilities from the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The special abilities to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveSpecialAbilities(this CardInfo info, params SpecialTriggeredAbility[] abilities) { if (info.specialAbilities?.Count > 0) @@ -202,9 +202,9 @@ public static CardInfo RemoveSpecialAbilities(this CardInfo info, params Special /// /// Removes any number of special abilities from the card. Will remove one instance of each passed ability; multiple instances can be passed. /// - /// CardInfo to access. + /// CardInfo to access. /// The special abilities to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveSpecialAbilitiesSingle(this CardInfo info, params SpecialTriggeredAbility[] abilities) { if (info.specialAbilities?.Count > 0) @@ -220,9 +220,9 @@ public static CardInfo RemoveSpecialAbilitiesSingle(this CardInfo info, params S /// /// Removes any number of appearance behaviors from the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The appearances to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveAppearances(this CardInfo info, params CardAppearanceBehaviour.Appearance[] appearances) { if (info.appearanceBehaviour?.Count > 0) @@ -238,9 +238,9 @@ public static CardInfo RemoveAppearances(this CardInfo info, params CardAppearan /// /// Removes any number of appearance behaviors from the card. Will remove one instance of each passed appearance; multiple instances can be passed. /// - /// CardInfo to access. + /// CardInfo to access. /// The appearances to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveAppearancesSingle(this CardInfo info, params CardAppearanceBehaviour.Appearance[] appearances) { if (info.appearanceBehaviour?.Count > 0) @@ -256,9 +256,9 @@ public static CardInfo RemoveAppearancesSingle(this CardInfo info, params CardAp /// /// Removes any number of decals from the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The decals to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveDecals(this CardInfo info, params Texture[] decals) { if (info.decals?.Count > 0) @@ -274,9 +274,9 @@ public static CardInfo RemoveDecals(this CardInfo info, params Texture[] decals) /// /// Removes any number of decals behaviors from the card. Will remove one instance of each passed decals; multiple instances can be passed. /// - /// CardInfo to access. + /// CardInfo to access. /// The decals to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveDecalsSingle(this CardInfo info, params Texture[] decals) { if (info.decals?.Count > 0) @@ -292,9 +292,9 @@ public static CardInfo RemoveDecalsSingle(this CardInfo info, params Texture[] d /// /// Removes any number of metacategories from the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The categories to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveMetaCategories(this CardInfo info, params CardMetaCategory[] categories) { if (info.metaCategories?.Count > 0) @@ -310,9 +310,9 @@ public static CardInfo RemoveMetaCategories(this CardInfo info, params CardMetaC /// /// Removes any number of metacategories behaviors from the card. Will remove one instance of each passed appearance; multiple instances can be passed. /// - /// CardInfo to access. + /// CardInfo to access. /// The categories to remove. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo RemoveMetaCategoriesSingle(this CardInfo info, params CardMetaCategory[] categories) { if (info.metaCategories?.Count > 0) @@ -392,7 +392,7 @@ public static CardInfo RemoveCardMetaCategories(this CardInfo info, params CardM /// /// Gets the GUID of the mod that created this card. /// - /// CardInfo to access. + /// CardInfo to access. /// The GUID of the mod that created this card or null if it wasn't found/is from the base game. public static string GetModTag(this CardInfo info) => info.GetExtendedProperty("CallStackModGUID"); @@ -402,16 +402,16 @@ public static CardInfo RemoveCardMetaCategories(this CardInfo info, params CardM /// /// Gets the card name prefix for this card. /// - /// CardInfo to access. + /// CardInfo to access. /// The mod prefix for this card, or null if it wasn't found/is from the base game. public static string GetModPrefix(this CardInfo info) => info.GetExtendedProperty("ModPrefix"); /// /// Checks whether the card's mod prefix is equal to the given string. /// - /// CardInfo to access. + /// CardInfo to access. /// The prefix to check for. - /// True if the CardInfo's mod prefix equals prefixToMatch. + /// True if the CardInfo's mod prefix equals prefixToMatch. public static bool ModPrefixIs(this CardInfo info, string prefixToMatch) => info.GetExtendedProperty("ModPrefix") == prefixToMatch; #endregion diff --git a/InscryptionAPI/Card/CardExtensionsHelpers.cs b/InscryptionAPI/Card/CardExtensionsHelpers.cs index 537e785ef..088360d33 100644 --- a/InscryptionAPI/Card/CardExtensionsHelpers.cs +++ b/InscryptionAPI/Card/CardExtensionsHelpers.cs @@ -16,9 +16,9 @@ public static partial class CardExtensions public static bool LacksAbility(this CardModificationInfo mod, Ability ability) => !mod.HasAbility(ability); /// - /// Checks if the CardInfo does not have a specific Ability. + /// Checks if the CardInfo does not have a specific Ability. /// - /// CardInfo to access. + /// CardInfo to access. /// The ability to check for. /// Returns true if the ability does not exist. public static bool LacksAbility(this CardInfo cardInfo, Ability ability) @@ -27,9 +27,9 @@ public static bool LacksAbility(this CardInfo cardInfo, Ability ability) } /// - /// Checks if the CardInfo has all of the given Abilities. + /// Checks if the CardInfo has all of the given Abilities. /// - /// CardInfo to access. + /// CardInfo to access. /// The Abilities to check for. /// Returns true if cardInfo has all of the given Abilities. public static bool HasAllAbilities(this CardInfo cardInfo, params Ability[] abilities) @@ -43,9 +43,9 @@ public static bool HasAllAbilities(this CardInfo cardInfo, params Ability[] abil } /// - /// Checks if the CardInfo has none of the specified Abilities. + /// Checks if the CardInfo has none of the specified Abilities. /// - /// CardInfo to access. + /// CardInfo to access. /// The Abilities to check for. /// Returns true if cardInfo has none of the given Abilities. public static bool LacksAllAbilities(this CardInfo cardInfo, params Ability[] abilities) @@ -59,9 +59,9 @@ public static bool LacksAllAbilities(this CardInfo cardInfo, params Ability[] ab } /// - /// Checks if the CardInfo has any of the specified Abilities. + /// Checks if the CardInfo has any of the specified Abilities. /// - /// CardInfo to access. + /// CardInfo to access. /// The Abilities to check for. /// Returns true if cardInfo has at least one of the given Abilities. public static bool HasAnyOfAbilities(this CardInfo cardInfo, params Ability[] abilities) @@ -77,11 +77,11 @@ public static bool HasAnyOfAbilities(this CardInfo cardInfo, params Ability[] ab #region SpecialAbility /// - /// Checks if the CardInfo has a specific SpecialTriggeredAbility. + /// Checks if the CardInfo has a specific SpecialTriggeredAbility. /// /// A condensed version of `cardInfo.SpecialAbilities.Contains(ability)`. /// - /// CardInfo to access. + /// CardInfo to access. /// The specialTriggeredAbility to check for. /// Returns true if the specialTriggeredAbility does exist. public static bool HasSpecialAbility(this CardInfo cardInfo, SpecialTriggeredAbility ability) @@ -90,9 +90,9 @@ public static bool HasSpecialAbility(this CardInfo cardInfo, SpecialTriggeredAbi } /// - /// Checks if the CardInfo does not have a specific SpecialTriggeredAbility. + /// Checks if the CardInfo does not have a specific SpecialTriggeredAbility. /// - /// CardInfo to access. + /// CardInfo to access. /// The specialTriggeredAbility to check for. /// Returns true if the specialTriggeredAbility does not exist. public static bool LacksSpecialAbility(this CardInfo cardInfo, SpecialTriggeredAbility ability) @@ -101,9 +101,9 @@ public static bool LacksSpecialAbility(this CardInfo cardInfo, SpecialTriggeredA } /// - /// Checks if the CardInfo has all of the specified SpecialTriggeredAbilities. + /// Checks if the CardInfo has all of the specified SpecialTriggeredAbilities. /// - /// CardInfo to access. + /// CardInfo to access. /// The SpecialTriggeredAbilities to check for. /// Returns true if cardInfo has all of the specified SpecialTriggeredAbilities. public static bool HasAllSpecialAbilities(this CardInfo cardInfo, params SpecialTriggeredAbility[] specialAbilities) @@ -117,9 +117,9 @@ public static bool HasAllSpecialAbilities(this CardInfo cardInfo, params Special } /// - /// Checks if the CardInfo has none of the specified SpecialTriggeredAbilities. + /// Checks if the CardInfo has none of the specified SpecialTriggeredAbilities. /// - /// CardInfo to access. + /// CardInfo to access. /// The SpecialTriggeredAbilitiess to check for. /// Returns true if cardInfo has none of the specified SpecialTriggeredAbilities. public static bool LacksAllSpecialAbilities(this CardInfo cardInfo, params SpecialTriggeredAbility[] specialAbilities) @@ -133,9 +133,9 @@ public static bool LacksAllSpecialAbilities(this CardInfo cardInfo, params Speci } /// - /// Checks if the CardInfo has any of the specified SpecialTriggeredAbilities. + /// Checks if the CardInfo has any of the specified SpecialTriggeredAbilities. /// - /// CardInfo to access. + /// CardInfo to access. /// The SpecialTriggeredAbilities to check for. /// Returns true if cardInfo has at least one of the specified SpecialTriggeredAbilities. public static bool HasAnyOfSpecialAbilities(this CardInfo cardInfo, params SpecialTriggeredAbility[] specialAbilities) @@ -151,25 +151,25 @@ public static bool HasAnyOfSpecialAbilities(this CardInfo cardInfo, params Speci #region Trait /// - /// Checks if the CardInfo does not belong to a specific Tribe. + /// Checks if the CardInfo does not belong to a specific Tribe. /// - /// CardInfo to access. + /// CardInfo to access. /// The tribe to check for. /// Returns true if the card is not of the specified tribe. public static bool IsNotOfTribe(this CardInfo cardInfo, Tribe tribe) => !cardInfo.IsOfTribe(tribe); /// - /// Checks if the CardInfo does not have a specific Trait. + /// Checks if the CardInfo does not have a specific Trait. /// - /// CardInfo to access. + /// CardInfo to access. /// The Trait to check for. /// Returns true if the card is does not have the specified Trait. public static bool LacksTrait(this CardInfo cardInfo, Trait trait) => !cardInfo.HasTrait(trait); /// - /// Checks if the CardInfo has all of the specified Traits. + /// Checks if the CardInfo has all of the specified Traits. /// - /// CardInfo to access. + /// CardInfo to access. /// The Traits to check for. /// Returns true if cardInfo has all of the specified Traits. public static bool HasAllTraits(this CardInfo cardInfo, params Trait[] traits) @@ -183,9 +183,9 @@ public static bool HasAllTraits(this CardInfo cardInfo, params Trait[] traits) } /// - /// Checks if the CardInfo has none of the specified Traits. + /// Checks if the CardInfo has none of the specified Traits. /// - /// CardInfo to access. + /// CardInfo to access. /// The Traits to check for. /// Returns true if cardInfo has none of the specified Traits. public static bool LacksAllTraits(this CardInfo cardInfo, params Trait[] traits) @@ -199,9 +199,9 @@ public static bool LacksAllTraits(this CardInfo cardInfo, params Trait[] traits) } /// - /// Checks if the CardInfo has any of the specified Traits. + /// Checks if the CardInfo has any of the specified Traits. /// - /// CardInfo to access. + /// CardInfo to access. /// The Traits to check for. /// Returns true if cardInfo has at least one of the specified Traits. public static bool HasAnyOfTraits(this CardInfo cardInfo, params Trait[] traits) @@ -228,25 +228,25 @@ public static bool HasAnyOfTraits(this CardInfo cardInfo, params Trait[] traits) #region CardMetaCategory /// - /// Checks if the CardInfo has a specific CardMetaCategory. + /// Checks if the CardInfo has a specific CardMetaCategory. /// - /// CardInfo to access. + /// CardInfo to access. /// The CardMetaCategory to check for. /// Returns true if the card is does not have the specified CardMetaCategory. public static bool HasCardMetaCategory(this CardInfo cardInfo, CardMetaCategory metaCategory) => cardInfo.metaCategories.Contains(metaCategory); /// - /// Checks if the CardInfo does not have a specific CardMetaCategory. + /// Checks if the CardInfo does not have a specific CardMetaCategory. /// - /// CardInfo to access. + /// CardInfo to access. /// The CardMetaCategory to check for. /// Returns true if the card is does not have the specified CardMetaCategory. public static bool LacksCardMetaCategory(this CardInfo cardInfo, CardMetaCategory metaCategory) => !cardInfo.HasCardMetaCategory(metaCategory); /// - /// Checks if the CardInfo has any of the specified CardMetaCategories. + /// Checks if the CardInfo has any of the specified CardMetaCategories. /// - /// CardInfo to access. + /// CardInfo to access. /// The CardMetaCategories to check for. /// Returns true if the card has at least one of the specified CardMetaCategories. public static bool HasAnyOfCardMetaCategories(this CardInfo cardInfo, params CardMetaCategory[] metaCategories) @@ -260,9 +260,9 @@ public static bool HasAnyOfCardMetaCategories(this CardInfo cardInfo, params Car } /// - /// Checks if the CardInfo has none of the specified CardMetaCategories. + /// Checks if the CardInfo has none of the specified CardMetaCategories. /// - /// CardInfo to access. + /// CardInfo to access. /// The CardMetaCategories to check for. /// Returns true if the card has none of the specified CardMetaCategories. public static bool LacksAllCardMetaCategories(this CardInfo cardInfo, params CardMetaCategory[] metaCategories) @@ -315,7 +315,7 @@ public static int GetAbilityStacks(this PlayableCard card, Ability ability) /// /// Gets the number of Ability stacks a card has. /// - /// The CardInfo to access. + /// The CardInfo to access. /// The Ability to check for. /// The number of Ability stacks the card has. public static int GetAbilityStacks(this CardInfo info, Ability ability) @@ -700,7 +700,7 @@ public static void RemoveTemporaryMods(this PlayableCard card, params CardModifi /// A version of TransformIntoCard tailored to visually work on cards in the hand. /// /// The PlayableCard to access. - /// The CardInfo to change the card into. + /// The CardInfo to change the card into. /// An Action to invoke before the evolvedInfo is set. /// An Action to invoke after the evolvedInfo is set. public static IEnumerator TransformIntoCardInHand(this PlayableCard card, CardInfo evolvedInfo, Action onTransformedCallback = null, Action preTransformCallback = null) @@ -908,9 +908,9 @@ public static bool HasShieldAbility(this PlayableCard card) return card.AllAbilities().Exists(x => x.IsShieldAbility()); } /// - /// Returns whether or not the CardInfo has an Ability that overrides DamageShieldBehaviour. + /// Returns whether or not the CardInfo has an Ability that overrides DamageShieldBehaviour. /// - /// The CardInfo object to check. + /// The CardInfo object to check. public static bool HasShieldAbility(this CardInfo cardInfo) { return cardInfo.Abilities.Exists(x => x.IsShieldAbility()); @@ -919,9 +919,9 @@ public static bool HasShieldAbility(this CardInfo cardInfo) #endregion /// - /// Spawns the CardInfo object to the player's hand. + /// Spawns the CardInfo object to the player's hand. /// - /// CardInfo to access. + /// CardInfo to access. /// The mods that will be added to the PlayableCard object. /// The position of where the card will appear from. Default is a Vector3 of (0, 6, 1.5). /// The amount of time to wait before being added to the hand. @@ -941,7 +941,7 @@ public static IEnumerator SpawnInHand(this CardInfo cardInfo, List - /// Creates a basic EncounterBlueprintData.CardBlueprint based off the CardInfo object. + /// Creates a basic EncounterBlueprintData.CardBlueprint based off the CardInfo object. /// /// CardInfo to create the blueprint with. /// The CardBlueprint object that can be used when creating EncounterData. diff --git a/InscryptionAPI/Card/CardExtensionsPortraits.cs b/InscryptionAPI/Card/CardExtensionsPortraits.cs index 0c2386387..75f111b35 100644 --- a/InscryptionAPI/Card/CardExtensionsPortraits.cs +++ b/InscryptionAPI/Card/CardExtensionsPortraits.cs @@ -10,9 +10,9 @@ public static partial class CardExtensions /// /// Sets the default card portrait for the card /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPortrait(this CardInfo info, string pathToArt) { try @@ -28,10 +28,10 @@ public static CardInfo SetPortrait(this CardInfo info, string pathToArt) /// /// Sets the default card portrait for the card /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -40,7 +40,7 @@ public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, Filte /// /// Sets the cards portrait and emission at the same time. /// - /// The CardInfon to access. + /// The CardInfon to access. /// The texture containing the card portrait. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. @@ -55,9 +55,9 @@ public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, Textu /// /// Sets the default card portrait for the card /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPortrait(this CardInfo info, Sprite sprite) { info.portraitTex = sprite; @@ -71,10 +71,10 @@ public static CardInfo SetPortrait(this CardInfo info, Sprite sprite) /// /// Sets the cards portrait and emission at the same time. /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the portrait artwork (relative to the Plugins directory). /// The path to the .png file containing the emission artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPortraitAndEmission(this CardInfo info, string pathToArt, string pathToEmission) { info.SetPortrait(pathToArt); @@ -85,11 +85,11 @@ public static CardInfo SetPortraitAndEmission(this CardInfo info, string pathToA /// /// Sets the cards portrait and emission at the same time. /// - /// CardInfo to access. + /// CardInfo to access. /// The texture containing the card portrait. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPortraitAndEmission(this CardInfo info, Texture2D portrait, Texture2D emission, FilterMode? filterMode = null) { info.SetPortrait(portrait, filterMode); @@ -100,10 +100,10 @@ public static CardInfo SetPortraitAndEmission(this CardInfo info, Texture2D port /// /// Sets the cards portrait and emission at the same time. /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the card portrait. /// The sprite containing the emission. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPortraitAndEmission(this CardInfo info, Sprite portrait, Sprite emission) { info.SetPortrait(portrait); @@ -117,9 +117,9 @@ public static CardInfo SetPortraitAndEmission(this CardInfo info, Sprite portrai /// /// Sets the card's alternate portrait. This portrait is only used when asked for by an ability or an appearance behavior. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetAltPortrait(this CardInfo info, string pathToArt) { return info.SetAltPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -128,10 +128,10 @@ public static CardInfo SetAltPortrait(this CardInfo info, string pathToArt) /// /// Sets the card's alternate portrait. This portrait is only used when asked for by an ability or an appearance behavior. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetAltPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetAltPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -140,9 +140,9 @@ public static CardInfo SetAltPortrait(this CardInfo info, Texture2D portrait, Fi /// /// Sets the card's alternate portrait. This portrait is only used when asked for by an ability or an appearance behavior. /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetAltPortrait(this CardInfo info, Sprite portrait) { info.alternatePortrait = portrait; @@ -160,9 +160,9 @@ public static CardInfo SetAltPortrait(this CardInfo info, Sprite portrait) /// /// Sets the emissive portrait for the card. This can only be done after the default portrait has been set (SetPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissivePortrait(this CardInfo info, string pathToArt) { try @@ -178,10 +178,10 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, string pathToArt) /// /// Sets the emissive portrait for the card. This can only be done after the default portrait has been set (SetPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissivePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissivePortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -190,9 +190,9 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, Texture2D portrai /// /// Sets the emissive portrait for the card. This can only be done after the default portrait has been set (SetPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the emission. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissivePortrait(this CardInfo info, Sprite sprite) { if (info.portraitTex == null) @@ -206,16 +206,16 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, Sprite sprite) /// /// Retrieves the given CardInfo's emissive portrait. /// - /// The CardInfo to access. + /// The CardInfo to access. /// Null if there is no emissive portrait. public static Sprite GetEmissivePortrait(this CardInfo info) => info.portraitTex.GetEmissionSprite(); /// /// Sets the emissive alternate portrait for the card. This can only be done after the alternate portrait has been set (SetAltPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveAltPortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveAltPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -224,10 +224,10 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, string pathToA /// /// Sets the emissive alternate portrait for the card. This can only be done after the alternate portrait has been set (SetAltPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveAltPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -236,9 +236,9 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Texture2D port /// /// Sets the emissive alternate portrait for the card. This can only be done after the alternate portrait has been set (SetAltPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the emission. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrait) { if (info.alternatePortrait == null) @@ -252,7 +252,7 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrai /// /// Retrives the given CardInfo's emissive alternate portrait. /// - /// The CardInfo to access. + /// The CardInfo to access. /// Null if there is no emissive alternate portrait. public static Sprite GetEmissiveAltPortrait(this CardInfo info) => info.alternatePortrait.GetEmissionSprite(); @@ -262,9 +262,9 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrai /// /// Sets the card's pixel portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelPortrait(this CardInfo info, string pathToArt) { return info.SetPixelPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -273,10 +273,10 @@ public static CardInfo SetPixelPortrait(this CardInfo info, string pathToArt) /// /// Sets the card's pixel portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -285,9 +285,9 @@ public static CardInfo SetPixelPortrait(this CardInfo info, Texture2D portrait, /// /// Sets the card's pixel portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelPortrait(this CardInfo info, Sprite portrait) { info.pixelPortrait = portrait; @@ -301,7 +301,7 @@ public static CardInfo SetPixelPortrait(this CardInfo info, Sprite portrait) /// /// Retrieves the given CardInfo's pixel portrait. /// - /// The CardInfo to access. + /// The CardInfo to access. /// Null if there is no pixel portrait. public static Sprite GetPixelPortrait(this CardInfo info) { @@ -314,9 +314,9 @@ public static Sprite GetPixelPortrait(this CardInfo 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. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetLostTailPortrait(this CardInfo info, string pathToArt) { if (info.tailParams == null) @@ -330,10 +330,10 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, string pathToArt) /// /// 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. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetLostTailPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { if (info.tailParams == null) @@ -347,9 +347,9 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, Texture2D portrai /// /// 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. + /// CardInfo to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetLostTailPortrait(this CardInfo info, Sprite portrait) { if (info.tailParams == null) @@ -363,9 +363,9 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, Sprite portrait) /// /// 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. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, string pathToArt) { if (info.tailParams == null) @@ -379,10 +379,10 @@ public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, string pa /// /// 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. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { if (info.tailParams == null) @@ -396,9 +396,9 @@ public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Texture2D /// /// 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. + /// CardInfo to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Sprite portrait) { if (info.tailParams == null) @@ -499,7 +499,7 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprit /// /// Retrieves the given CardInfo's emissive tail lost portrait. /// - /// The CardInfo to access. + /// The CardInfo to access. /// Null if there is no emissive tail lost portrait. public static Sprite GetEmissiveTailLostPortrait(this TailParams info) => info.tailLostPortrait?.GetEmissionSprite(); @@ -509,9 +509,9 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprit /// /// Sets the card's pixel alternate portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelAlternatePortrait(this CardInfo info, string pathToArt) { return info.SetPixelAlternatePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -519,10 +519,10 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, string path /// /// Sets the card's pixel alternate portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelAlternatePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -530,9 +530,9 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Texture2D p /// /// Sets the card's pixel alternate portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// CardInfo to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -545,7 +545,7 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Sprite port /// /// Retrieves the given CardInfo's alternate Act 2 portrait. /// - /// The CardInfo to access. + /// The CardInfo to access. /// Null if there is no alternate pixel portrait. public static Sprite GetPixelAlternatePortrait(this CardInfo info) => info.PixelAlternatePortrait(); #endregion @@ -554,9 +554,9 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Sprite port /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, string pathToArt) { return info.SetSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -565,10 +565,10 @@ public static CardInfo SetSteelTrapPortrait(this CardInfo info, string pathToArt /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetSteelTrapPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); @@ -577,9 +577,9 @@ public static CardInfo SetSteelTrapPortrait(this CardInfo info, Texture2D portra /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The Sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -592,9 +592,9 @@ public static CardInfo SetSteelTrapPortrait(this CardInfo info, Sprite portrait) /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, string pathToArt) { return info.SetPixelSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -602,10 +602,10 @@ public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, string path /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelSteelTrapPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -614,9 +614,9 @@ public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Texture2D p /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The Sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -629,9 +629,9 @@ public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Sprite port /// /// Sets the emissive steel trap portrait for the card. This can only be done after the default steel trap portrait has been set (SetSteelTrapPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -640,10 +640,10 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, string p /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveSteelTrapPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -652,9 +652,9 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Texture2 /// /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The Sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (info.SteelTrapPortrait() == null) @@ -676,9 +676,9 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite p /// /// Sets the card's alternate broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, string pathToArt) { return info.SetBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -687,10 +687,10 @@ public static CardInfo SetBrokenShieldPortrait(this CardInfo info, string pathTo /// /// Sets the card's broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetBrokenShieldPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); @@ -699,9 +699,9 @@ public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Texture2D por /// /// Sets the card's broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Portrait. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -714,9 +714,9 @@ public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Sprite portra /// /// Sets the card's alternate pixel broken shield portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, string pathToArt) { return info.SetPixelBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -725,10 +725,10 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, string p /// /// Sets the card's broken shield portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelBrokenShieldPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -737,9 +737,9 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Texture2 /// /// Sets the card's broken shield portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -752,9 +752,9 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Sprite p /// /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -763,10 +763,10 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, strin /// /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveBrokenShieldPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -775,9 +775,9 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Textu /// /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (info.BrokenShieldPortrait() == null) @@ -790,7 +790,7 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprit /// /// Retrieves the given CardInfo's emissive broken shield portrait. /// - /// The CardInfo to access. + /// The CardInfo to access. /// Null if there is no emissive broken shield portrait. public static Sprite GetEmissiveBrokenShieldPortrait(this CardInfo info) => info.BrokenShieldPortrait()?.GetEmissionSprite(); #endregion @@ -799,9 +799,9 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprit /// /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, string pathToArt) { return info.SetSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -809,10 +809,10 @@ public static CardInfo SetSacrificablePortrait(this CardInfo info, string pathTo /// /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetSacrificablePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); @@ -820,9 +820,9 @@ public static CardInfo SetSacrificablePortrait(this CardInfo info, Texture2D por /// /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. /// - /// CardInfo to access. + /// CardInfo to access. /// The sacrificable portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -835,9 +835,9 @@ public static CardInfo SetSacrificablePortrait(this CardInfo info, Sprite portra /// /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, string pathToArt) { return info.SetPixelSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -846,10 +846,10 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, string p /// /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The card portrait's Texture. /// The filter mode applied to the portrait in-game (defaults to Point). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelSacrificablePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -858,9 +858,9 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Texture2 /// /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// CardInfo to access. /// The card portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -873,9 +873,9 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Sprite p /// /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -884,10 +884,10 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, strin /// /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The card portrait's Texture. /// The filter mode applied to the portrait in-game (defaults to Point). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveSacrificablePortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -896,9 +896,9 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Textu /// /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// - /// CardInfo to access. + /// CardInfo to access. /// The card portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprite portrait) { if (info.SacrificablePortrait() == null) @@ -911,16 +911,16 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprit /// Retrieves the given CardInfo's sacrificable portrait's emission. /// /// - /// The CardInfo's emissive sacrificable portrait, or null if one doesn't exist. + /// The CardInfo's emissive sacrificable portrait, or null if one doesn't exist. public static Sprite GetEmissiveSacrificablePortrait(this CardInfo info) => info.SacrificablePortrait().GetEmissionSprite(); #endregion /// /// Sets the animated portrait for the given CardInfo. /// - /// CardInfo to access. + /// CardInfo to access. /// The to check for. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetAnimatedPortrait(this CardInfo info, GameObject portrait) { info.animatedPortrait = portrait; diff --git a/InscryptionAPI/Card/CardExtensionsProperties.cs b/InscryptionAPI/Card/CardExtensionsProperties.cs index e4b14332e..b20ebc884 100644 --- a/InscryptionAPI/Card/CardExtensionsProperties.cs +++ b/InscryptionAPI/Card/CardExtensionsProperties.cs @@ -9,10 +9,10 @@ public static partial class CardExtensions { /// /// Adds a custom property value to the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the property to set. /// The value of the property. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetExtendedProperty(this CardInfo info, string propertyName, object value) { info.GetCardExtensionTable()[propertyName] = value?.ToString(); @@ -22,7 +22,7 @@ public static CardInfo SetExtendedProperty(this CardInfo info, string propertyNa /// /// Gets a custom property value from the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the property to get the value of. /// The custom property value as a string. If it doesn't exist, returns null. public static string GetExtendedProperty(this CardInfo info, string propertyName) @@ -34,7 +34,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Gets a custom property as a nullable int. /// - /// CardInfo to access. + /// CardInfo to access. /// Property name to get value of. /// Returns the value of the property as an int or null if it didn't exist or couldn't be parsed as int. public static int? GetExtendedPropertyAsInt(this CardInfo info, string propertyName) @@ -46,7 +46,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Gets a custom property as a nullable float. /// - /// CardInfo to access. + /// CardInfo to access. /// Property name to get value of. /// Returns the value of the property as a float or null if it didn't exist or couldn't be parsed as float. public static float? GetExtendedPropertyAsFloat(this CardInfo info, string propertyName) @@ -58,7 +58,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Gets a custom property as a nullable boolean. /// - /// CardInfo to access. + /// CardInfo to access. /// Property name to get value of. /// Returns the value of the property as a boolean or null if it didn't exist or couldn't be parsed as boolean. public static bool? GetExtendedPropertyAsBool(this CardInfo info, string propertyName) @@ -77,16 +77,16 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Checks if this card info will be killed by the effect of Tidal Lock. /// - /// CardInfo to access. + /// CardInfo to access. /// True if the card info is affected by Tidal Lock. public static bool IsAffectedByTidalLock(this CardInfo info) => info.GetExtendedPropertyAsBool("AffectedByTidalLock") ?? false; /// /// Sets whether the card should be killed by Tidal Lock's effect. /// - /// CardInfo to access. + /// CardInfo to access. /// Whether or not this card should be affected by Tidal Lock. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetAffectedByTidalLock(this CardInfo info, bool affectedByTidalLock = true) { info.SetExtendedProperty("AffectedByTidalLock", affectedByTidalLock); @@ -104,16 +104,16 @@ public static CardInfo SetAffectedByTidalLock(this CardInfo info, bool affectedB /// /// Gets the string value of the extended property TransformerCardId. Can be null. /// - /// CardInfo to access. + /// CardInfo to access. /// The string value of the extended property TransformerCardId. public static string GetTransformerCardId(this CardInfo info) => info.GetExtendedProperty("TransformerCardId"); /// /// Sets whether the card should be killed by Tidal Lock's effect. /// - /// CardInfo to access. + /// CardInfo to access. /// The internal name of the card this card should transform into. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTransformerCardId(this CardInfo info, string transformerCardId) { info.SetExtendedProperty("TransformerCardId", transformerCardId); @@ -126,36 +126,36 @@ public static CardInfo SetTransformerCardId(this CardInfo info, string transform /// /// Determines if the given CardInfo has the given custom card cost. /// - /// The CardInfo to access. + /// The CardInfo to access. /// The custom card cost to check for. - /// True if the CardInfo needs the given custom cost to be played. + /// True if the CardInfo needs the given custom cost to be played. public static bool HasCustomCost(this CardInfo info, FullCardCost customCost) => info.GetCustomCost(customCost) != 0; /// - /// Sets a card's custom cost property using the provided FullCardCost object as a reference. + /// Sets a card's custom cost property using the provided FullCardCost object as a reference. /// - /// The CardInfo to modify. + /// The CardInfo to modify. /// The FullCardCost representing the cost we want to set. - /// How much of the custom cost the CardInfo should need to be played. - /// The same CardInfo so a chain can continue. + /// How much of the custom cost the CardInfo should need to be played. + /// The same CardInfo so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, FullCardCost customCost, int amount) => info.SetCustomCost(customCost.CostName, amount); /// - /// A variant of SetExtendedProperty intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. + /// A variant of intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. /// - /// The CardInfo to modify. + /// The CardInfo to modify. /// The name of the cost we want to set. - /// How much of the custom cost the CardInfo should need to be played. - /// The same CardInfo so a chain can continue. + /// How much of the custom cost the CardInfo should need to be played. + /// The same CardInfo so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, string costName, int amount) => info.SetExtendedProperty(costName, amount); /// - /// A variant of SetExtendedProperty intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. + /// A variant of intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. /// - /// The CardInfo to modify. + /// The CardInfo to modify. /// The class of the cost we want to set. - /// How much of the custom cost the CardInfo should need to be played. - /// The same CardInfo so a chain can continue. + /// How much of the custom cost the CardInfo should need to be played. + /// The same CardInfo so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, int amount) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); @@ -163,7 +163,7 @@ public static CardInfo SetCustomCost(this CardInfo info, int amount) where T } /// - /// Variant of GetCustomCost that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. + /// Variant of that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. /// /// The PlayableCard to access. /// The name of the custom card cost. @@ -171,17 +171,17 @@ public static CardInfo SetCustomCost(this CardInfo info, int amount) where T public static int GetCustomCostAmount(this PlayableCard card, string costName) => card.Info.GetCustomCostAmount(costName); /// - /// Variant of GetCustomCost that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. + /// Variant of that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. /// - /// The CardInfo to access. + /// The CardInfo to access. /// The name of the custom card cost. /// How much of the given cost is needed for the given card to be played. public static int GetCustomCostAmount(this CardInfo cardInfo, string costName) => cardInfo.GetCustomCost(costName, AllCustomCosts.Find(x => x.CostName == costName).CanBeNegative); /// - /// Retrieves the given PlayableCard's custom card cost amount. + /// Retrieves the given PlayableCard's custom card cost amount. /// - /// The PlayableCard to access. + /// The PlayableCard to access. /// The name of the custom card cost. /// Whether the card cost amount can be negative. If false, returns 0 for negative cost values. /// How much of the given cost is needed for the given card to be played. @@ -190,7 +190,7 @@ public static CardInfo SetCustomCost(this CardInfo info, int amount) where T /// /// Retrieves the given CardInfo's custom card cost amount. /// - /// The CardInfo to access. + /// The CardInfo to access. /// The name of the custom card cost. /// Whether the card cost amount can be negative. If false, returns 0 for negative cost values. /// How much of the given cost is needed for the given card to be played. @@ -224,7 +224,7 @@ public static int GetCustomCost(this PlayableCard card, bool canBeNegative = /// Retrieves the custom card cost amount of the given class Type from the given CardInfo. /// /// The class of the card cost to check. - /// The CardInfo to access. + /// The CardInfo to access. /// If the returned value can be negative. If false, returns 0 instead. /// The card cost amount this card costs. public static int GetCustomCost(this CardInfo cardInfo, bool canBeNegative = false) where T : CustomCardCost @@ -249,7 +249,7 @@ public static int GetCustomCostAmount(this PlayableCard card) where T : Custo /// Retrieves the custom card cost amount of the given class Type from the given CardInfo. /// /// The class of the card cost to check. - /// The CardInfo to access. + /// The CardInfo to access. /// The card cost amount this card costs. public static int GetCustomCostAmount(this CardInfo cardInfo) where T : CustomCardCost { @@ -272,7 +272,7 @@ public static int GetCustomCost(this PlayableCard card, FullCardCost fullCardCos /// Retrieves the given custom card cost amount from the given CardInfo. /// Only returns negative values if the custom cost allows it. /// - /// The CardInfo to access. + /// The CardInfo to access. /// The custom card cost to check for. /// The card cost amount this card costs. public static int GetCustomCost(this CardInfo cardInfo, FullCardCost fullCardCost) @@ -310,8 +310,8 @@ public static List GetCustomCardCosts(this DiskCardGame.Card car /// /// Retrieves all custom card costs from the given CardInfo. /// - /// The CardInfo to access. - /// A List of CustomCardCost objects for each custom cost the CardInfo needs to be played. + /// The CardInfo to access. + /// A List of CustomCardCost objects for each custom cost the CardInfo needs to be played. public static List GetCustomCosts(this CardInfo info) { List costs = new(); @@ -345,13 +345,13 @@ public static List GetCustomCosts(this CardInfo info) /// /// Set the Pelt that should be given when this card is slain by a trap. /// - /// The CardInfo this is being applied to. + /// The CardInfo this is being applied to. /// The Card to be given to the Player on Death by Trap public static void SetSteelTrapPelt(this CardInfo cardInfo, string peltName) => cardInfo.SetExtendedProperty("SteelTrapPelt", peltName); /// /// Get the Pelt that should be given when this card is slain by a trap. /// - /// The CardInfo this is being applied to. + /// The CardInfo this is being applied to. /// A string representing the Pelt that should be returned. public static string GetSteelTrapPelt(this CardInfo cardInfo) => cardInfo.GetExtendedProperty("SteelTrapPelt"); diff --git a/InscryptionAPI/Card/CardExtensionsSetters.cs b/InscryptionAPI/Card/CardExtensionsSetters.cs index 104ee2295..d43b43151 100644 --- a/InscryptionAPI/Card/CardExtensionsSetters.cs +++ b/InscryptionAPI/Card/CardExtensionsSetters.cs @@ -11,12 +11,12 @@ public static partial class CardExtensions /// /// Sets a number of basic properties of the card /// - /// CardInfo to access. + /// CardInfo to access. /// Displayed name of the card. /// Attack of the card. /// Health of the card. /// The description that plays when the card is seen for the first time. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetBasic(this CardInfo info, string displayedName, int attack, int health, string description = default) { info.displayedName = displayedName; @@ -29,10 +29,10 @@ public static CardInfo SetBasic(this CardInfo info, string displayedName, int at /// /// Sets the base attack and health of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The base attack for the card. /// The base health for the card. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetBaseAttackAndHealth(this CardInfo info, int? baseAttack = 0, int? baseHealth = 0) { if (baseAttack.HasValue) @@ -48,9 +48,9 @@ public static CardInfo SetBaseAttackAndHealth(this CardInfo info, int? baseAttac /// Sets the CardTemple for the card. Used to determine what cards are obtainable in each Act. /// Act 1 uses Nature cards, Act 2 uses all Temples for each region, Act 3 uses Tech cards. /// - /// CardInfo to access. + /// CardInfo to access. /// The CardTemple to use. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetCardTemple(this CardInfo info, CardTemple temple) { info.temple = temple; @@ -63,9 +63,9 @@ public static CardInfo SetCardTemple(this CardInfo info, CardTemple temple) /// Intermediate: unlocked after the second tutorial /// Advanced: unlocked after the third tutorial if all its abilities have been learned /// - /// CardInfo to access. + /// CardInfo to access. /// The CardComplexity to use. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetCardComplexity(this CardInfo info, CardComplexity complexity) { info.cardComplexity = complexity; @@ -75,9 +75,9 @@ public static CardInfo SetCardComplexity(this CardInfo info, CardComplexity comp /// /// Sets the displayed name of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The displayed name for the card. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetDisplayedName(this CardInfo info, string displayedName) { info.displayedName = displayedName.IsNullOrWhitespace() ? "" : displayedName; @@ -87,10 +87,10 @@ public static CardInfo SetDisplayedName(this CardInfo info, string displayedName /// /// Sets the name of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The name for the card. /// The string that will be prefixed to the card name if it doesn't already exist. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetName(this CardInfo info, string name, string modPrefix = default) { info.name = !string.IsNullOrEmpty(modPrefix) && !name.StartsWith(modPrefix) ? $"{modPrefix}_{name}" : name; @@ -100,11 +100,11 @@ public static CardInfo SetName(this CardInfo info, string name, string modPrefix /// /// Sets the card name and displayed name of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The name for the card. /// The displayed name for the card. /// The string that will be prefixed to the card name if it doesn't already exist. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetNames(this CardInfo info, string name, string displayedName, string modPrefix = default) { info.SetDisplayedName(displayedName); @@ -112,11 +112,11 @@ public static CardInfo SetNames(this CardInfo info, string name, string displaye } /// - /// Sets the CardInfo's special abilities field to any number of special abilities to the card. + /// Sets the CardInfo's special abilities field to any number of special abilities to the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The abilities to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetSpecialAbilities(this CardInfo info, params SpecialTriggeredAbility[] abilities) { info.specialAbilities = abilities?.ToList(); @@ -126,9 +126,9 @@ public static CardInfo SetSpecialAbilities(this CardInfo info, params SpecialTri /// /// Sets the stat icon to the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The stat icon to set. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetStatIcon(this CardInfo info, SpecialStatIcon statIcon) { info.specialStatIcon = statIcon; @@ -139,9 +139,9 @@ public static CardInfo SetStatIcon(this CardInfo info, SpecialStatIcon statIcon) /// /// Sets any number of traits to the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The traits to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTraits(this CardInfo info, params Trait[] traits) { info.traits = traits?.ToList(); @@ -152,9 +152,9 @@ public static CardInfo SetTraits(this CardInfo info, params Trait[] traits) /// /// Set any number of tribes to the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The tribes to add. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTribes(this CardInfo info, params Tribe[] tribes) { info.tribes = tribes?.ToList(); @@ -164,9 +164,9 @@ public static CardInfo SetTribes(this CardInfo info, params Tribe[] tribes) /// /// Sets whether the card should be Gemified or not. Can and will un-Gemify cards. /// - /// CardInfo to access. + /// CardInfo to access. /// Whether the card should be gemified. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetGemify(this CardInfo info, bool gemify = true) { if (gemify && !info.Mods.Exists(x => x.gemify)) @@ -183,8 +183,8 @@ public static CardInfo SetGemify(this CardInfo info, bool gemify = true) /// /// Sets the card to behave as a "normal" card in Part 1. The CardTemple is Nature and it will appear in choice nodes and trader nodes. /// - /// CardInfo to access. - /// The same CardInfo so a chain can continue. + /// CardInfo to access. + /// The same CardInfo so a chain can continue. public static CardInfo SetDefaultPart1Card(this CardInfo info) { if (!info.metaCategories.Contains(CardMetaCategory.Rare)) @@ -199,8 +199,8 @@ public static CardInfo SetDefaultPart1Card(this CardInfo info) /// /// Sets the card to behave as a "normal" card in Part 3. The CardTemple is Tech and it will appear in choice nodes and as a potential random card from GiftBot. /// - /// CardInfo to access. - /// The same CardInfo so a chain can continue. + /// CardInfo to access. + /// The same CardInfo so a chain can continue. public static CardInfo SetDefaultPart3Card(this CardInfo info) { if (!info.metaCategories.Contains(CardMetaCategory.Rare)) @@ -215,9 +215,9 @@ public static CardInfo SetDefaultPart3Card(this CardInfo info) /// /// Makes the card fully playable in GBC mode and able to appear in card packs. /// - /// CardInfo to access. + /// CardInfo to access. /// The temple that the card will exist under. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetGBCPlayable(this CardInfo info, CardTemple temple) { info.AddMetaCategories(CardMetaCategory.GBCPack, CardMetaCategory.GBCPlayable); @@ -229,8 +229,8 @@ public static CardInfo SetGBCPlayable(this CardInfo info, CardTemple temple) /// /// Sets the card so it shows up for rare card choices and applies the rare background. /// - /// CardInfo to access. - /// The same CardInfo so a chain can continue. + /// CardInfo to access. + /// The same CardInfo so a chain can continue. public static CardInfo SetRare(this CardInfo info) { info.AddMetaCategories(CardMetaCategory.Rare); @@ -260,9 +260,9 @@ public static CardInfo SetTerrain(this CardInfo info) /// /// Adds the Terrain trait and background to this card, with the option to not use TerrainLayout. /// - /// CardInfo to access. - /// Whether or not the CardInfo should be given the TerrainLayout appearance behaviour. - /// The same CardInfo so a chain can continue. + /// CardInfo to access. + /// Whether or not the CardInfo should be given the TerrainLayout appearance behaviour. + /// The same CardInfo so a chain can continue. public static CardInfo SetTerrain(this CardInfo info, bool useTerrainLayout) { info.AddTraits(Trait.Terrain); @@ -275,9 +275,9 @@ public static CardInfo SetTerrain(this CardInfo info, bool useTerrainLayout) /// /// Adds the Pelt trait and background to this card, and optionally adds the SpawnLice special ability. /// - /// CardInfo to access. + /// CardInfo to access. /// Whether or not the given CardInfo should also spawn lice. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetPelt(this CardInfo info, bool spawnLice = true) { info.AddTraits(Trait.Pelt); @@ -293,11 +293,11 @@ public static CardInfo SetPelt(this CardInfo info, bool spawnLice = true) /// /// Sets the evolve parameters of the card. These parameters are used to make the Evolve ability function correctly. /// - /// CardInfo to access. + /// CardInfo to access. /// The card that will be generated after the set number of turns. /// The number of turns before the card evolves. /// A set of card mods to be applied to the evolved card. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEvolve(this CardInfo info, CardInfo evolveCard, int numberOfTurns, IEnumerable mods = null) { info.evolveParams = new() @@ -319,11 +319,11 @@ public static CardInfo SetEvolve(this CardInfo info, CardInfo evolveCard, int nu /// Sets the evolve parameters of the card. These parameters are used to make the Evolve ability function correctly. /// This function uses delayed loading to attach the evolution to the card, so if the evolve card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of card that will be generated after the set number of turns. /// The number of turns before the card evolves. /// A set of card mods to be applied to the evolved card. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEvolve(this CardInfo info, string evolveInto, int numberOfTurns, IEnumerable mods = null) { CardInfo evolution = CardManager.AllCardsCopy.CardByName(evolveInto); @@ -354,9 +354,9 @@ public static CardInfo SetEvolve(this CardInfo info, string evolveInto, int numb /// /// Sets the default evolution name for the card. This is the name used when the card doesn't evolve into another card. /// - /// CardInfo to access. + /// CardInfo to access. /// The default evolution name to use. Pass in 'null' to use the vanilla default. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetDefaultEvolutionName(this CardInfo info, string defaultName) { info.defaultEvolutionName = defaultName; @@ -366,10 +366,10 @@ public static CardInfo SetDefaultEvolutionName(this CardInfo info, string defaul /// /// Sets the ice cube parameters of the card. These parameters are used to make the IceCube ability function correctly. /// - /// CardInfo to access. + /// CardInfo to access. /// The card that will be generated when this card dies. /// A set of card mods to be applied to the ice cube contents. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetIceCube(this CardInfo info, CardInfo iceCube, IEnumerable mods = null) { info.iceCubeParams = new() @@ -390,10 +390,10 @@ public static CardInfo SetIceCube(this CardInfo info, CardInfo iceCube, IEnumera /// Sets the ice cube parameters of the card. These parameters are used to make the IceCube ability function correctly. /// This function uses delayed loading to attach the ice cube to the card, so if the ice cube card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the card that will be generated when this card dies. /// A set of card mods to be applied to the ice cube contents. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetIceCube(this CardInfo info, string iceCubeName, IEnumerable mods = null) { CardInfo creatureWithin = CardManager.AllCardsCopy.CardByName(iceCubeName); @@ -426,11 +426,11 @@ public static CardInfo SetIceCube(this CardInfo info, string iceCubeName, IEnume /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// The path to the .png file containing the lost tail artwork (relative to the Plugins directory). /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, string tailName, string pathToLostTailArt = null, IEnumerable mods = null) { Texture2D lostTailPortrait = pathToLostTailArt == null ? null : TextureHelper.GetImageAsTexture(pathToLostTailArt); @@ -441,10 +441,10 @@ public static CardInfo SetTail(this CardInfo info, string tailName, string pathT /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, string tailName, IEnumerable mods = null) { return info.SetTail(tailName, tailLostPortrait: null, mods: mods); @@ -453,10 +453,10 @@ public static CardInfo SetTail(this CardInfo info, string tailName, IEnumerable< /// /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// - /// CardInfo to access. + /// CardInfo to access. /// The card that will be generated as the "tail" when the first hit is dodged. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, IEnumerable mods = null) { return info.SetTail(tail, null, mods); @@ -465,12 +465,12 @@ public static CardInfo SetTail(this CardInfo info, CardInfo tail, IEnumerable /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// - /// CardInfo to access. + /// CardInfo to access. /// The card that will be generated as the "tail" when the first hit is dodged. /// The texture containing the card portrait. /// The filter mode for the texture, or null if no change. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, Texture2D tailLostPortrait, FilterMode? filterMode = null, IEnumerable mods = null) { var tailLostSprite = !filterMode.HasValue @@ -482,11 +482,11 @@ public static CardInfo SetTail(this CardInfo info, CardInfo tail, Texture2D tail /// /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// - /// CardInfo to access. + /// CardInfo to access. /// The card that will be generated as the "tail" when the first hit is dodged. /// The sprite containing the card portrait. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, Sprite tailLostPortrait, IEnumerable mods = null) { info.tailParams = new() @@ -510,12 +510,12 @@ public static CardInfo SetTail(this CardInfo info, CardInfo tail, Sprite tailLos /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// The texture containing the card portrait. /// The filter mode for the texture, or null if no change. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetTail(this CardInfo info, string tailName, Texture2D tailLostPortrait, FilterMode? filterMode = null, IEnumerable mods = null) { var tailLostSprite = !filterMode.HasValue @@ -528,11 +528,11 @@ public static CardInfo SetTail(this CardInfo info, string tailName, Texture2D ta /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// CardInfo to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// The sprite containing the card portrait. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue.. + /// The same CardInfo so a chain can continue.. public static CardInfo SetTail(this CardInfo info, string tailName, Sprite tailLostPortrait, IEnumerable mods = null) { CardInfo tail = CardManager.AllCardsCopy.CardByName(tailName); @@ -566,12 +566,12 @@ public static CardInfo SetTail(this CardInfo info, string tailName, Sprite tailL /// /// Sets the cost of the card. Any and all costs can be set this way. /// - /// CardInfo to access. + /// CardInfo to access. /// The cost in blood (sacrifices). /// The cost in bones. /// The cost in energy. /// The cost in gems. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetCost(this CardInfo info, int? bloodCost = 0, int? bonesCost = 0, int? energyCost = 0, List gemsCost = null) { info.SetBloodCost(bloodCost); @@ -583,9 +583,9 @@ public static CardInfo SetCost(this CardInfo info, int? bloodCost = 0, int? bone /// /// Sets the blood cost of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The cost in blood (sacrifices). - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetBloodCost(this CardInfo info, int? bloodCost = 0) { if (bloodCost.HasValue) @@ -596,9 +596,9 @@ public static CardInfo SetBloodCost(this CardInfo info, int? bloodCost = 0) /// /// Sets the bones cost of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The cost in bones. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetBonesCost(this CardInfo info, int? bonesCost = 0) { if (bonesCost.HasValue) @@ -609,9 +609,9 @@ public static CardInfo SetBonesCost(this CardInfo info, int? bonesCost = 0) /// /// Sets the energy cost of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The cost in energy. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetEnergyCost(this CardInfo info, int? energyCost = 0) { if (energyCost.HasValue) @@ -622,9 +622,9 @@ public static CardInfo SetEnergyCost(this CardInfo info, int? energyCost = 0) /// /// Sets the gems cost of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The cost in Mox. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetGemsCost(this CardInfo info, List gemsCost = null) { info.gemsCost = gemsCost ?? new(); @@ -633,9 +633,9 @@ public static CardInfo SetGemsCost(this CardInfo info, List gemsCost = /// /// Sets the gems cost of the card. /// - /// CardInfo to access. + /// CardInfo to access. /// The cost in Mox. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetGemsCost(this CardInfo info, params GemType[] gemsCost) { info.gemsCost = gemsCost.ToList(); @@ -663,7 +663,7 @@ public static CardInfo SetHideStats(this CardInfo info, bool hideStats = true) return info; } /// - /// Sets whether or not the CardInfo's portrait will be flipped when Strafe and similar abilities change direction. + /// Sets whether or not the CardInfo's portrait will be flipped when Strafe and similar abilities change direction. /// /// The same card info so a chain can continue. public static CardInfo SetStrafeFlipsPortrait(this CardInfo info, bool flipPortrait = true) @@ -676,7 +676,7 @@ public static CardInfo SetStrafeFlipsPortrait(this CardInfo info, bool flipPortr /// /// Indicates if this is a base game card or not. /// - /// CardInfo to access. + /// CardInfo to access. /// True of this card came from the base game; false otherwise. public static bool IsBaseGameCard(this CardInfo info) => info.GetExtendedPropertyAsBool("BaseGameCard") ?? false; @@ -692,7 +692,7 @@ public static CardInfo SetStrafeFlipsPortrait(this CardInfo info, bool flipPortr /// /// The card. /// The custom unlock check, a func that needs to return true for the card to be unlocked. The bool argument is true when the game is in Kaycee's Mod mode and the int argument is the current Kaycee's Mod challenge level. - /// The same CardInfo so a chain can continue. + /// The same CardInfo so a chain can continue. public static CardInfo SetCustomUnlockCheck(this CardInfo c, Func check) { if (check == null && CardManager.CustomCardUnlocks.ContainsKey(c.name)) diff --git a/InscryptionAPI/Card/CardManager.cs b/InscryptionAPI/Card/CardManager.cs index 4a9bb9c7d..43ae997ac 100644 --- a/InscryptionAPI/Card/CardManager.cs +++ b/InscryptionAPI/Card/CardManager.cs @@ -335,15 +335,15 @@ public static CardInfo New(string modPrefix, string name, string displayName, in /// /// Retrieves the dictionary of card extended properties associated with the given CardInfo. /// - /// The CardInfo whose extended properties we wish to retrieve. + /// The CardInfo whose extended properties we wish to retrieve. /// The extension property dictionary for the given CardInfo. Creates and returns an empty dictionary if none exists. public static Dictionary GetCardExtensionTable(this CardInfo card) => CardExtensionProperties.GetOrCreateValue(card).StringMap; internal static CardAltPortraits GetAltPortraits(this CardInfo card) => CardAlternatePortraits.GetOrCreateValue(card); /// - /// Retrieves the Sprite for the CardInfo's alternate portrait in Act 2 if it exists. + /// Retrieves the Sprite for the CardInfo's alternate portrait in Act 2 if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the pixel alternate portrait or null if it doesn't exist. /// /// Pixel alternate portraits are added through the API; they are not a vanilla feature. @@ -353,9 +353,9 @@ public static Sprite PixelAlternatePortrait(this CardInfo card) return card.GetAltPortraits().PixelAlternatePortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait used when Steel Trap activates if it exists. + /// Retrieves the Sprite for the CardInfo's portrait used when Steel Trap activates if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the Steel Trap portrait or null if it doesn't exist. /// /// Steel Trap portraits are added through the API; they are not a vanilla feature. @@ -365,9 +365,9 @@ public static Sprite SteelTrapPortrait(this CardInfo card) return card.GetAltPortraits().SteelTrapPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait emission used when Steel Trap activates if it exists. + /// Retrieves the Sprite for the CardInfo's portrait emission used when Steel Trap activates if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the Steel Trap portrait emission or null if it doesn't exist. /// /// Steel Trap portraits are added through the API; they are not a vanilla feature. @@ -377,9 +377,9 @@ public static Sprite EmissiveSteelTrapPortrait(this CardInfo card) return card.GetAltPortraits().SteelTrapPortrait.GetEmissionSprite(); } /// - /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when Steel Trap activates if it exists. + /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when Steel Trap activates if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the pixel Steel Trap portrait or null if it doesn't exist. /// /// Pixel Steel Trap portraits are added through the API; they are not a vanilla feature. @@ -389,9 +389,9 @@ public static Sprite PixelSteelTrapPortrait(this CardInfo card) return card.GetAltPortraits().PixelSteelTrapPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait used when a card's shield breaks if it exists. + /// Retrieves the Sprite for the CardInfo's portrait used when a card's shield breaks if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the broken shield portrait or null if it doesn't exist. /// /// Broken shield portraits are added through the API; they are not a vanilla feature. @@ -401,9 +401,9 @@ public static Sprite BrokenShieldPortrait(this CardInfo card) return card.GetAltPortraits().BrokenShieldPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait emission used when a card's shield breaks if it exists. + /// Retrieves the Sprite for the CardInfo's portrait emission used when a card's shield breaks if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the broken shield portrait emission or null if it doesn't exist. /// /// Broken shield portraits are added through the API; they are not a vanilla feature. @@ -413,9 +413,9 @@ public static Sprite EmissiveBrokenShieldPortrait(this CardInfo card) return card.GetAltPortraits().BrokenShieldPortrait.GetEmissionSprite(); } /// - /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when a card's shield breaks if it exists. + /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when a card's shield breaks if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the pixel broken shield portrait or null if it doesn't exist. /// /// Pixel broken shield portraits are added through the API; they are not a vanilla feature. @@ -425,9 +425,9 @@ public static Sprite PixelBrokenShieldPortrait(this CardInfo card) return card.GetAltPortraits().PixelBrokenShieldPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait used when a card on the board can be sacrificed if it exists. + /// Retrieves the Sprite for the CardInfo's portrait used when a card on the board can be sacrificed if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the sacrificable portrait or null if it doesn't exist. /// /// Sacrificable portraits are added through the API; they are not a vanilla feature. @@ -437,9 +437,9 @@ public static Sprite SacrificablePortrait(this CardInfo card) return card.GetAltPortraits().SacrificablePortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait emission used when a card on the board can be sacrificed if it exists. + /// Retrieves the Sprite for the CardInfo's portrait emission used when a card on the board can be sacrificed if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the sacrificable portrait emission or null if it doesn't exist. /// /// Sacrificable portraits are added through the API; they are not a vanilla feature. @@ -449,9 +449,9 @@ public static Sprite EmissiveSacrificablePortrait(this CardInfo card) return card.GetAltPortraits().SacrificablePortrait.GetEmissionSprite(); } /// - /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when a card on the board can be sacrificed if it exists. + /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when a card on the board can be sacrificed if it exists. /// - /// The CardInfo whose portrait we're retrieving. + /// The CardInfo whose portrait we're retrieving. /// The Sprite for the pixel sacrificable portrait or null if it doesn't exist. /// /// Pixel sacrificable portraits are added through the API; they are not a vanilla feature. @@ -611,8 +611,8 @@ private static IEnumerable Transpiler(IEnumerable /// Adds a null check when calling GetCardByName. If the returned CardInfo is null, outputs a console log error. /// - /// The CardInfo being returned by GetCardByName. - /// The internal name of the CardInfo attempting to be retrieved. + /// The CardInfo being returned by GetCardByName. + /// The internal name of the CardInfo attempting to be retrieved. /// The return value of GetCardByName. public static CardInfo LogCardInfo(CardInfo info, string cardInfoName) { diff --git a/InscryptionAPI/Card/CostProperties.cs b/InscryptionAPI/Card/CostProperties.cs index ac1b5d2dd..69b4a6cca 100644 --- a/InscryptionAPI/Card/CostProperties.cs +++ b/InscryptionAPI/Card/CostProperties.cs @@ -152,7 +152,7 @@ public static List ImprovedGemsCost(CardInfo instance) /// Determines whether or not Gemified should reduce the blood cost on a multicost card. /// /// The gemified PlayableCard we're checking. - /// The PlayableCard's blood cost. Defaults to using the CardInfo's blood cost if null. + /// The PlayableCard's blood cost. Defaults to using the CardInfo's blood cost if null. /// True if Gemified should reduce the blood cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -166,7 +166,7 @@ public static bool ReduceGemifiedBlood(PlayableCard card, int? bloodCost = null) /// Determines whether or not Gemified should reduce the gems cost on a multicost card. /// /// The gemified PlayableCard we're checking. - /// The PlayableCard's gems cost. Defaults to using the CardInfo's gems cost if null. + /// The PlayableCard's gems cost. Defaults to using the CardInfo's gems cost if null. /// True if Gemified should reduce the gems cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -180,7 +180,7 @@ public static bool ReduceGemifiedMox(PlayableCard card, List gemsCost = /// Determines whether or not Gemified should reduce the bone cost on a multicost card. /// /// The gemified PlayableCard we're checking. - /// The PlayableCard's bone cost. Defaults to using the CardInfo's bone cost if null. + /// The PlayableCard's bone cost. Defaults to using the CardInfo's bone cost if null. /// True if Gemified should reduce the bone cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -194,7 +194,7 @@ public static bool ReduceGemifiedBones(PlayableCard card, int? bonesCost = null) /// Determines whether or not Gemified should reduce the energy cost on a multicost card. /// /// The gemified PlayableCard we're checking. - /// The PlayableCard's energy cost. Defaults to using the CardInfo's energy cost if null. + /// The PlayableCard's energy cost. Defaults to using the CardInfo's energy cost if null. /// True if Gemified should reduce the energy cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -264,7 +264,7 @@ private static bool DisableVanillaEnergyCost(PlayableCard __instance, ref int __ //private static void GetCardInfoReferences(PlayableCard __instance) { // // if this is a new PlayableCard being associated with the given CardInfo - // // returns true if the CardInfo is in the table + // // returns true if the CardInfo is in the table // if (CostProperties.CardInfoToPlayableCardReferences.TryGetValue(__instance.Info, out List> connectedCards)) { // PlayableCard card = null; // for (int i = connectedCards.Count - 1; i >= 0; i--) { @@ -302,7 +302,7 @@ private static void Postfix(PlayableCard __instance) refreshCostDisplay.playableCard = __instance; // if this is a new PlayableCard being associated with the given CardInfo - // returns true if the CardInfo is in the table + // returns true if the CardInfo is in the table if (CostProperties.CardInfoToCard.TryGetValue(__instance.Info, out List> cardList)) { PlayableCard card = null; for (int i = cardList.Count - 1; i >= 0; i--) { diff --git a/InscryptionAPI/Card/SpecialStatIconManager.cs b/InscryptionAPI/Card/SpecialStatIconManager.cs index 67353e691..6b7a31ac1 100644 --- a/InscryptionAPI/Card/SpecialStatIconManager.cs +++ b/InscryptionAPI/Card/SpecialStatIconManager.cs @@ -57,7 +57,7 @@ public class FullStatIcon public Dictionary RulebookDescriptionRedirects = new(); /// - /// Creates a new instance of FullStatIcon and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullStatIcon and registers its behaviour type with the . /// /// The unique ID for this stat icon. /// The unique ID for this stat icon's associated special ability. diff --git a/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs b/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs index 5d67091cd..e7c7c64ef 100644 --- a/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs +++ b/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs @@ -32,7 +32,7 @@ public class FullSpecialTriggeredAbility public readonly Type AbilityBehaviour; /// - /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the . /// /// The unique ID for this special ability. /// A subclass of SpecialCardBehaviour that implements the logic for the ability. @@ -43,7 +43,7 @@ public FullSpecialTriggeredAbility(SpecialTriggeredAbility id, Type abilityBehav } /// - /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the . /// /// The GUID of the mod that added this. /// The name of this special ability. diff --git a/InscryptionAPI/Costs/CardCostManager.cs b/InscryptionAPI/Costs/CardCostManager.cs index 5beab1464..fbab5b029 100644 --- a/InscryptionAPI/Costs/CardCostManager.cs +++ b/InscryptionAPI/Costs/CardCostManager.cs @@ -54,7 +54,7 @@ public class FullCardCost /// /// Retrieves the correct texture corresponding to CardInfo's cost. Used in the 3D Acts (Act 1, Act 3, etc.). /// Parameters: - /// int: how much of the custom cost the CardInfo/PlayableCard needs to be played. + /// int: how much of the custom cost the CardInfo/PlayableCard needs to be played. /// CardInfo: the base CardInfo of the current card. /// PlayableCard: the PlayableCard possessing the base CardInfo. Can be null. /// Returns: @@ -64,7 +64,7 @@ public class FullCardCost /// /// Retrieves the correct texture corresponding to CardInfo's cost. Used in Act 2. /// Parameters: - /// int: how much of the custom cost the CardInfo/PlayableCard needs to be played. + /// int: how much of the custom cost the CardInfo/PlayableCard needs to be played. /// CardInfo: the base CardInfo of the current card. /// PlayableCard: the PlayableCard possessing the base CardInfo. Can be null. /// Returns: @@ -119,8 +119,8 @@ public Texture2D CostTexture(int amount, CardInfo cardInfo, PlayableCard playabl return GetCostTexture(amount, cardInfo, playableCard); } - /// The cost value of the CardInfo being checked. - /// The CardInfo being checked. + /// The cost value of the CardInfo being checked. + /// The CardInfo being checked. /// The PlayableCard associated with the card. Can be null. /// The texture for this cost based on the amount. Used in Act 2. public Texture2D PixelCostTexture(int amount, CardInfo cardInfo, PlayableCard playableCard) @@ -139,8 +139,8 @@ public int CostTier(int amount) return GetCostTier(amount); } - /// The cost value of the CardInfo being checked. - /// The CardInfo being checked. + /// The cost value of the CardInfo being checked. + /// The CardInfo being checked. /// The list of other cards in the player's hand. /// Whether or not the provided card can be played by turn 2. public bool CanBePlayedByTurn2WithHand(int amount, CardInfo card, List hand) @@ -152,7 +152,7 @@ public bool CanBePlayedByTurn2WithHand(int amount, CardInfo card, List } /// - /// Creates a new instance of FullCardCost and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullCardCost and registers its behaviour type with the . /// /// The GUID of the mod that added this. /// The unique id/name for this cost. @@ -189,7 +189,7 @@ public FullCardCost(string modGUID, string costName, Type costBehaviour, } /// - /// Creates a new instance of FullCardCost and registers its behaviour type with the [TypeManager](InscryptionAPI.Guid.TypeManager). + /// Creates a new instance of FullCardCost and registers its behaviour type with the . /// Simplified version of the full constructor. /// /// The GUID of the mod that added this. @@ -806,7 +806,7 @@ private static IEnumerator CustomCostChoiceChosen(IEnumerator enumerator, CardSi /// For use in the Act 1 card cost choice node. /// /// The random seed for the current run. - /// The CardInfo of a valid Energy card, or null if none exists. + /// The CardInfo of a valid Energy card, or null if none exists. public static CardInfo GetRandomChoosableEnergyCard(int randomSeed) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll(x => x.energyCost > 0); @@ -818,7 +818,7 @@ public static CardInfo GetRandomChoosableEnergyCard(int randomSeed) /// /// The random seed for the current run. /// The gem colour valid cards must have to be valid. - /// The CardInfo of a valid Gems card, or null if none exists. + /// The CardInfo of a valid Gems card, or null if none exists. public static CardInfo GetRandomChoosableMoxCard(int randomSeed, GemType gem) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll(x => x.gemsCost.Count > 0 && x.gemsCost.Contains(gem)); @@ -831,7 +831,7 @@ public static CardInfo GetRandomChoosableMoxCard(int randomSeed, GemType gem) /// /// The random seed for the current run. /// The List of custom costs to check for a random card for. - /// The CardInfo of a valid custom cost card, or null if none exists. + /// The CardInfo of a valid custom cost card, or null if none exists. public static CardInfo GetRandomChoosableCustomCostCard(int randomSeed, List customCosts) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature) @@ -849,7 +849,7 @@ public static CardInfo GetRandomChoosableCustomCostCard(int randomSeed, ListThe random seed for the current run. /// The custom cost valid cards will have. /// The collection of cost amounts to search for. - /// The CardInfo of a valid card, or null if none exists. + /// The CardInfo of a valid card, or null if none exists. public static CardInfo GetRandomChoosableCustomCostCardWithAmounts(int randomSeed, FullCardCost customCost, params int[] costAmounts) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature) diff --git a/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs b/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs index 832fb8ba5..98621e1de 100644 --- a/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs +++ b/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs @@ -1,4 +1,4 @@ -using DiskCardGame; +using DiskCardGame; using System.Collections; namespace InscryptionAPI.Helpers.Extensions; @@ -34,7 +34,7 @@ public static bool HasCard(this CardSlot cardSlot, string cardName) /// Create a card in a specific slot from the CardSlot object. A much more robust way that's the same as `yield return BoardManager.Instance.CreateCardInSlot()`. /// /// The slot to spawn in. - /// The CardInfo object to spawn in said slot. + /// The CardInfo object to spawn in said slot. /// Time to transition the card to the slot. The longer the time, the longer it will take to be placed at the slot. /// Whether or not to activate these triggers, in order: cards on board OtherCardAssignedToSlot, this card ResolveOnBoard, cards on board OtherCardResolve. /// The enumeration of the card being placed in the slot. diff --git a/InscryptionAPI/Pelts/PeltManager.cs b/InscryptionAPI/Pelts/PeltManager.cs index cc35a9ebe..76170d885 100644 --- a/InscryptionAPI/Pelts/PeltManager.cs +++ b/InscryptionAPI/Pelts/PeltManager.cs @@ -124,7 +124,7 @@ private static List CreateBasePelts() /// Creates a new instance of CustomPeltData then adds it to the game. /// /// GUID of the mod adding this pelt. - /// The CardInfo for the actual pelt card. + /// The CardInfo for the actual pelt card. /// The list of possible cards the Trader will offer for this pelt. /// The starting price of this pelt when buying from the Trapper. /// The number of extra sigils card choices will have when trading this pelt to the Trader. From a79384b52ce330e08db5ff7cd98c8c3df73db068 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:45:14 -0800 Subject: [PATCH 29/74] Add missing XML, cref tags --- InscryptionAPI/Card/AbilityExtensions.cs | 133 ++++++++++++++++------- 1 file changed, 91 insertions(+), 42 deletions(-) diff --git a/InscryptionAPI/Card/AbilityExtensions.cs b/InscryptionAPI/Card/AbilityExtensions.cs index ceae0413f..9de75cb47 100644 --- a/InscryptionAPI/Card/AbilityExtensions.cs +++ b/InscryptionAPI/Card/AbilityExtensions.cs @@ -251,22 +251,44 @@ public static FullAbility SetPowerlevel(this FullAbility fullAbility, int powerL fullAbility.Info.powerLevel = powerLevel; return fullAbility; } - + /// + /// Sets the rulebook description for this ability. + /// + /// The to access. + /// The ability's rulebook name. + /// The same so a chain can continue. public static AbilityInfo SetRulebookDescription(this AbilityInfo abilityInfo, string description) { abilityInfo.rulebookDescription = description; return abilityInfo; } + /// + /// Sets the rulebook description for this ability. + /// + /// The to access. + /// The ability's rulebook name. + /// The same so a chain can continue. public static FullAbility SetRulebookDescription(this FullAbility fullAbility, string description) { fullAbility.Info.rulebookDescription = description; return fullAbility; } - + /// + /// Sets the rulebook name for this ability. + /// + /// The to access. + /// The ability's rulebook name. + /// The same so a chain can continue. public static AbilityInfo SetRulebookName(this AbilityInfo abilityInfo, string name) { abilityInfo.rulebookName = name; return abilityInfo; } + /// + /// Sets the rulebook name for this ability. + /// + /// The to access. + /// The ability's rulebook name. + /// The same so a chain can continue. public static FullAbility SetRulebookName(this FullAbility fullAbility, string name) { fullAbility.Info.rulebookName = name; return fullAbility; @@ -498,18 +520,38 @@ public static AbilityInfo ResetDescription(this AbilityInfo abilityInfo) return abilityInfo; } + /// + /// Marks the given ability as appearing in the rulebook during Act 1. + /// + /// The to access. + /// The same so a chain can continue. public static FullAbility SetPart1Rulebook(this FullAbility full) { full.Info.AddMetaCategories(AbilityMetaCategory.Part1Rulebook); return full; } + /// + /// Marks the given ability as appearing in the rulebook during Act 3. + /// + /// The to access. + /// The same so a chain can continue. public static FullAbility SetPart3Rulebook(this FullAbility full) { full.Info.AddMetaCategories(AbilityMetaCategory.Part3Rulebook); return full; } + /// + /// Marks the given ability as appearing in the rulebook during Grimora's act. + /// + /// The to access. + /// The same so a chain can continue. public static FullAbility SetGrimoraRulebook(this FullAbility full) { full.Info.AddMetaCategories(AbilityMetaCategory.GrimoraRulebook); return full; } + /// + /// Marks the given ability as appearing in the rulebook during Magnificus's act. + /// + /// The to access. + /// The same so a chain can continue. public static FullAbility SetMagnificusRulebook(this FullAbility full) { full.Info.AddMetaCategories(AbilityMetaCategory.MagnificusRulebook); return full; @@ -545,10 +587,10 @@ public static bool HasMetaCategory(this AbilityInfo info, AbilityMetaCategory ca /// /// Sets the icon that will be displayed for this stat icon when the card is in the player's hand. /// - /// The instance of StatIconInfo. + /// The instance of . /// A 49x49 texture containing the icon. /// The filter mode for the icon texture. Leave this at its default value unless you have a specific reason to change it. - /// The same StatIconInfo so a chain can continue. + /// The same so a chain can continue. public static StatIconInfo SetIcon(this StatIconInfo info, Texture2D icon, FilterMode? filterMode = null) { info.iconGraphic = icon; if (filterMode.HasValue) @@ -559,10 +601,10 @@ public static StatIconInfo SetIcon(this StatIconInfo info, Texture2D icon, Filte /// /// Sets the icon that will be displayed for this stat icon when the card is in the player's hand. /// - /// The instance of StatIconInfo. + /// The instance of . /// The path to a 49x49 texture containing the icon on disk. /// The filter mode for the icon texture. Leave this at its default value unless you have a specific reason to change it. - /// The same StatIconInfo so a chain can continue. + /// The same so a chain can continue. public static StatIconInfo SetIcon(this StatIconInfo info, string pathToArt, FilterMode? filterMode = null) { info.iconGraphic = TextureHelper.GetImageAsTexture(pathToArt); if (filterMode.HasValue) @@ -571,24 +613,24 @@ public static StatIconInfo SetIcon(this StatIconInfo info, string pathToArt, Fil } /// - /// Set the StatIconInfo's rulebookName and rulebookDescription. Does not make the stat icon appear in the Rulebook. + /// Set the stat icon's rulebook name and description. Does not make the stat icon appear in the Rulebook. /// - /// - /// - /// - /// The same StatIconInfo so a chain can continue. + /// The instance of + /// The stat icon's rulebook name. + /// The stat icon's rulebook description. + /// The same so a chain can continue. public static StatIconInfo SetRulebookInfo(this StatIconInfo info, string rulebookName, string rulebookDescription = null) { info.rulebookName = rulebookName; info.rulebookDescription = rulebookDescription; return info; } /// - /// Sets the StatIconInfo's appliesToAttack and appliesToHealth fields. Note these fields don't make the stat icon affect the stat; you still need to implement that logic. + /// Sets the stat icon's appliesToAttack and appliesToHealth fields. Note these fields don't make the stat icon affect the stat; you still need to implement that logic. /// - /// + /// The instance of /// If the stat icon should cover a card's Power. /// If the stat icon should cover a card's Health. - /// The same StatIconInfo so a chain can continue. + /// The same so a chain can continue. public static StatIconInfo SetAppliesToStats(this StatIconInfo info, bool appliesToAttack, bool appliesToHealth) { info.appliesToAttack = appliesToAttack; info.appliesToHealth = appliesToHealth; @@ -598,14 +640,21 @@ public static StatIconInfo SetAppliesToStats(this StatIconInfo info, bool applie /// /// Sets the icon that will be displayed for this stat icon when the card is in the player's hand in Act 2. /// - /// The instance of StatIconInfo. - /// A 16x8 texture containing the icon . + /// The instance of . + /// A 16x8 texture containing the icon. /// The filter mode for the icon texture. Leave this at its default value unless you have a specific reason to change it. - /// The same StatIconInfo so a chain can continue. + /// The same so a chain can continue. public static StatIconInfo SetPixelIcon(this StatIconInfo info, Texture2D icon, FilterMode? filterMode = null) { info.pixelIconGraphic = TextureHelper.ConvertTexture(icon, TextureHelper.SpriteType.PixelStatIcon, filterMode ?? FilterMode.Point); return info; } + /// + /// Sets the icon that will be displayed for this stat icon when the card is in the player's hand in Act 2. + /// + /// The instance of . + /// The file path to the 16x8 texture file containing the icon. + /// The filter mode for the icon texture. Leave this at its default value unless you have a specific reason to change it. + /// The same so a chain can continue. public static StatIconInfo SetPixelIcon(this StatIconInfo info, string pathToArt, FilterMode? filterMode = null) { Texture2D tex = TextureHelper.GetImageAsTexture(pathToArt, filterMode ?? FilterMode.Point); info.pixelIconGraphic = TextureHelper.ConvertTexture(tex, TextureHelper.SpriteType.PixelStatIcon); @@ -615,9 +664,9 @@ public static StatIconInfo SetPixelIcon(this StatIconInfo info, string pathToArt /// /// Adds one or more metacategories to the stati icon. Duplicate categories will not be added. /// - /// The instance of StatIconInfo. + /// The instance of . /// The metacategories to add. - /// The same StatIconInfo so a chain can continue. + /// The same so a chain can continue. public static StatIconInfo AddMetaCategories(this StatIconInfo info, params AbilityMetaCategory[] categories) { info.metaCategories ??= new(); foreach (var app in categories) @@ -627,19 +676,19 @@ public static StatIconInfo AddMetaCategories(this StatIconInfo info, params Abil } /// - /// Helper method: automatically adds the Part1Rulebook metacategories to the stat icon. + /// Helper method: automatically adds the Part1Rulebook metacategory to the stat icon. /// - /// The instance of StatIconInfo. + /// The instance of . /// The same stati icon so a chain can continue. public static StatIconInfo SetDefaultPart1Ability(this StatIconInfo info) { return info.AddMetaCategories(AbilityMetaCategory.Part1Rulebook); } /// - /// Helper method: automatically adds the Part3Rulebook metacategories to the stat icon. + /// Helper method: automatically adds the Part3Rulebook metacategory to the stat icon. /// - /// The instance of StatIconInfo. - /// The same StatIconInfo so a chain can continue. + /// The instance of . + /// The same so a chain can continue. public static StatIconInfo SetDefaultPart3Ability(this StatIconInfo info) { return info.AddMetaCategories(AbilityMetaCategory.Part3Rulebook); } @@ -660,20 +709,20 @@ public static AbilityInfo SetTriggersOncePerStack(this AbilityInfo abilityInfo, } /// - /// Gets the value of TriggersOncePerStack. Returns false if TriggersOncePerStack has not been set. + /// Gets the value of TriggersOncePerStack. Returns false if TriggersOncePerStack has not been set. /// - /// Ability to access. - /// Whether double triggering is disabled. + /// Ability to access. + /// True if double triggering is enabled. False otherwise. public static bool GetTriggersOncePerStack(this Ability ability) { AbilityInfo abilityInfo = AllAbilityInfos.AbilityByID(ability); return abilityInfo.GetTriggersOncePerStack(); } /// - /// Gets the value of TriggersOncePerStack. Returns false if TriggersOncePerStack has not been set. + /// Gets the value of TriggersOncePerStack. Returns false if TriggersOncePerStack has not been set. /// /// The instance of . - /// Whether double triggering is disabled. + /// True if double triggering is enabled. False otherwise. public static bool GetTriggersOncePerStack(this AbilityInfo abilityInfo) { return abilityInfo.GetExtendedPropertyAsBool("TriggersOncePerStack") ?? false; @@ -695,19 +744,19 @@ public static AbilityInfo SetHideSingleStacks(this AbilityInfo abilityInfo, bool } /// - /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. + /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. /// - /// Ability to access. - /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. + /// Ability to access. + /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. public static bool GetHideSingleStacks(this Ability ability) { return AllAbilityInfos.AbilityByID(ability).GetHideSingleStacks(); } /// - /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. + /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. /// /// The instance of . - /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. + /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. public static bool GetHideSingleStacks(this AbilityInfo abilityInfo) { return abilityInfo.GetExtendedPropertyAsBool("HideSingleStacks") ?? false; @@ -717,9 +766,9 @@ public static bool GetHideSingleStacks(this AbilityInfo abilityInfo) #region ExtendedProperties /// - /// Adds a custom property value to the AbilityInfo. + /// Adds a custom property value to the . /// - /// Ability to access. + /// to access. /// The name of the property to set. /// The value of the property. /// The same so a chain can continue. @@ -729,9 +778,9 @@ public static AbilityInfo SetExtendedProperty(this AbilityInfo info, string prop return info; } /// - /// Adds a custom property value to the FullAbility's AbilityInfo - intended as a shorthand for when modders are first adding abilities to the game. + /// Adds a custom property value to the 's info field - intended as a shorthand for when modders are first adding abilities to the game. /// - /// FullAbility object to access. + /// object to access. /// The name of the property to set. /// The value of the property. /// The same so a chain can continue. @@ -755,7 +804,7 @@ public static string GetExtendedProperty(this Ability ability, string propertyNa /// /// Gets a custom property value from the card. /// - /// Ability to access. + /// to access. /// The name of the property to get the value of. /// The retrieved property if it exists. public static string GetExtendedProperty(this AbilityInfo info, string propertyName) @@ -778,7 +827,7 @@ public static string GetExtendedProperty(this AbilityInfo info, string propertyN /// /// Gets a custom property as an int (can by null) /// - /// Ability to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as an int or null if it didn't exist or couldn't be parsed as int. public static int? GetExtendedPropertyAsInt(this AbilityInfo info, string propertyName) @@ -801,7 +850,7 @@ public static string GetExtendedProperty(this AbilityInfo info, string propertyN /// /// Gets a custom property as a float (can by null) /// - /// Ability to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as a float or null if it didn't exist or couldn't be parsed as float. public static float? GetExtendedPropertyAsFloat(this AbilityInfo info, string propertyName) @@ -824,7 +873,7 @@ public static string GetExtendedProperty(this AbilityInfo info, string propertyN /// /// Gets a custom property as a boolean (can be null) /// - /// Ability to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as a boolean or null if it didn't exist or couldn't be parsed as boolean. public static bool? GetExtendedPropertyAsBool(this AbilityInfo info, string propertyName) From 38ee55c5f51affd7c207ccc3b1a0890bf2216790 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 11:50:55 -0800 Subject: [PATCH 30/74] Add cref tags --- InscryptionAPI/Card/AbilityManager.cs | 56 ++++++++++++++------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 1cc277d3d..a090bd16b 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -49,7 +49,7 @@ public class FullAbility public readonly AbilityInfo Info; /// - /// A subclass of AbilityBehaviour that implements the logic for the ability + /// A subclass of that implements the logic for the ability /// public readonly Type AbilityBehavior; @@ -83,11 +83,11 @@ public class FullAbility // [TypeManager](InscryptionAPI.Guid.TypeManager) /// - /// Creates a new instance of FullAbility and registers its behaviour type with the . + /// Creates a new instance of and registers its behaviour type with the . /// /// The unique ID for this ability. /// The description object for this ability. - /// A subclass of AbilityBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. /// A 49x49 texture for the ability icon. [Obsolete("Use the constructor that takes a modGUID parameter instead")] public FullAbility(Ability id, AbilityInfo info, Type behaviour, Texture texture) : this("", id, info, behaviour, texture) @@ -95,12 +95,12 @@ public FullAbility(Ability id, AbilityInfo info, Type behaviour, Texture texture } /// - /// Creates a new instance of FullAbility and registers its behaviour type with the . + /// Creates a new instance of and registers its behaviour type with the . /// /// The GUID of the mod that added this. /// The unique ID for this ability. /// The description object for this ability. - /// A subclass of AbilityBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. /// A 49x49 texture for the ability icon. public FullAbility(string modGUID, Ability id, AbilityInfo info, Type behaviour, Texture texture) { @@ -116,7 +116,7 @@ public FullAbility(string modGUID, Ability id, AbilityInfo info, Type behaviour, } /// - /// Makes a deep copy of the current FullAbility object + /// Makes a deep copy of the current object /// public FullAbility Clone() { @@ -166,10 +166,11 @@ public FullAbility Clone() public static List AllAbilities { get; private set; } = BaseGameAbilities.ToList(); /// - /// The current processed list of all AbilityInfos in the game, including vanilla and mod-added abilities. + /// The current processed list of all objects in the game, including vanilla and mod-added abilities. /// public static List AllAbilityInfos { get; private set; } = BaseGameAbilities.Select(x => x.Info).ToList(); + // [SyncAbilityList](xref:InscryptionAPI.AbilityManager.SyncAbilityList) /// /// A hook for modders to add custom code to modify the ability list dynamically. /// @@ -180,20 +181,20 @@ public FullAbility Clone() /// /// The way this operates is as follows: /// - /// 1. The AbilityManager makes a copy of all FullAbility objects. Note that unlike the similar code in CardManager, this is actually a *deep* copy of the AbilityInfo. - /// 2. The code in ModifyAbiltyList is executed on the copy of those abilities. + /// 1. The makes a copy of all objects. Note that unlike the similar code in CardManager, this is actually a *deep* copy of the AbilityInfo. + /// 2. The code in is executed on the copy of those abilities. /// 3. The modified list becomes the game's new official list of abilities. /// /// The reason the abilities are cloned before processing is so that you can make any change to them you wish /// without affecting the original ability. This means that you do not need to try to track changes or remember - /// what the original version of the ability looked like before you started changing it; the next time - /// [SyncAbilityList](xref:InscryptionAPI.AbilityManager.SyncAbilityList) is called, all changes will be reverted + /// what the original version of the ability looked like before you started changing it; the next time + /// is called, all changes will be reverted /// and then re-applied. /// /// To use this, you need to add a delegate that accepts the current list of all abilities, then returns /// that same list back. /// - /// ```c# + /// ```c# /// AbilityManager.ModifyAbilityList += delegate(List<FullAbility> abilities) /// { /// // Add the rulebook metacategories to every single ability @@ -201,18 +202,19 @@ public FullAbility Clone() /// ability.info.AddMetaCategories(AbilityMetaCategory.Part1Rulebook, AbilityMetaCategory.Part3Rulebook); /// return abilities; /// } - /// ``` + /// ``` /// public static event Func, List> ModifyAbilityList; /// - /// Custom AbilityMetaCategory enum for marking an ability as modular in Part 2. + /// Custom AbilityMetaCategory enum for marking an ability as modular in Part 2. /// public static AbilityMetaCategory Part2Modular => GuidManager.GetEnumValue(InscryptionAPIPlugin.ModGUID, "Part2Modular"); + // [ModifyAbilityList](xref:InscryptionAPI.AbilityManager.ModifyAbilityList) /// /// Resynchronizes the ablity list. /// - /// Most importantly, this re-executes all custom code that was added to the [ModifyAbilityList](xref:InscryptionAPI.AbilityManager.ModifyAbilityList) + /// Most importantly, this re-executes all custom code that was added to the /// event. If you are doing any sort of context-aware processing of the ability list, you may need to manually /// call this method in order to make sure that your code executes correctly. However, this automatically gets called /// every time that the game transitions from either the main menu into the base game, or whenever a new run is @@ -289,12 +291,12 @@ private static List GenBaseGameAbilityList() /// Creates a new ability and registers it to be able to be added to cards /// /// The guid of the mod adding the ability. - /// An instance of AbilityInfo describing the ability. - /// A subclass of AbilityBehaviour that implements the logic for the ability. + /// An instance of describing the ability. + /// A subclass of that implements the logic for the ability. /// The ability icon as a 49x49 texture. - /// An instance of FullAbility containing all this ability's data.. + /// An instance of containing all this ability's data.. /// The actual unique identifier for the new ability will be found in the 'ability' field of - /// the returned AbilityInfo object. There is no way for the modder to create a specific ability ID; it will + /// the returned object. There is no way for the modder to create a specific ability ID; it will /// always be assigned by the API. /// /// **NOTE**: Even if you manually create an Ability identifier for your ability and attach it to the AbilityInfo @@ -316,11 +318,11 @@ public static FullAbility Add(string guid, AbilityInfo info, Type behavior, Text /// The guid of the mod adding the ability. /// The name of the ability. /// The description as it appears in the game's rulebook. - /// A subclass of AbilityBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. /// Path to the ability texture on disk. - /// An instance of AbilityInfo describing the new ability. + /// An instance of describing the new ability. /// The actual unique identifier for the new ability will be found in the 'ability' field of - /// the returned AbilityInfo object. There is no way for the modder to create a specific ability ID; it will + /// the returned object. There is no way for the modder to create a specific ability ID; it will /// always be assigned by the API. public static AbilityInfo New(string guid, string rulebookName, string rulebookDescription, Type behavior, string pathToArt) { @@ -333,11 +335,11 @@ public static AbilityInfo New(string guid, string rulebookName, string rulebookD /// The guid of the mod adding the ability. /// The name of the ability. /// The description as it appears in the game's rulebook. - /// A subclass of AbilityBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. /// The ability icon as a 49x49 texture. - /// An instance of AbilityInfo describing the new ability. + /// An instance of describing the new ability. /// The actual unique identifier for the new ability will be found in the 'ability' field of - /// the returned AbilityInfo object. There is no way for the modder to create a specific ability ID; it will + /// the returned object. There is no way for the modder to create a specific ability ID; it will /// always be assigned by the API. public static AbilityInfo New(string guid, string rulebookName, string rulebookDescription, Type behavior, Texture tex) { @@ -355,7 +357,7 @@ public static AbilityInfo New(string guid, string rulebookName, string rulebookD public static void Remove(Ability id) => NewAbilities.Remove(NewAbilities.FirstOrDefault(x => x.Id == id)); /// - /// Removes an ability from the game based on its FullAbility. Can only remove mod-added abilities, not vanilla abilities. + /// Removes an ability from the game based on its . Can only remove mod-added abilities, not vanilla abilities. /// /// The instance of the ability to remove. public static void Remove(FullAbility ability) => NewAbilities.Remove(ability); @@ -367,7 +369,7 @@ internal static Dictionary GetAbilityExtensionTable(this Ability #region LoadAbilityIcon /// - /// Reverse patch that provides access to the original, unmodified LoadAbilityIcon method. + /// Reverse patch that provides access to the original, unmodified method. /// [HarmonyReversePatch(HarmonyReversePatchType.Original)] [HarmonyPatch(typeof(AbilitiesUtil), nameof(AbilitiesUtil.LoadAbilityIcon))] From 65fbf9863003e225a0706681fd7193b790c0fc30 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:23:47 -0800 Subject: [PATCH 31/74] Add cref tags --- .../Card/CardAppearanceBehaviourManager.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs b/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs index 506a58e9d..fb967535a 100644 --- a/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs +++ b/InscryptionAPI/Card/CardAppearanceBehaviourManager.cs @@ -6,7 +6,7 @@ namespace InscryptionAPI.Card; /// -/// Class for managing custom CardAppearanceBehaviours. +/// Class for managing custom s. /// public static class CardAppearanceBehaviourManager { /// @@ -24,10 +24,10 @@ public class FullCardAppearanceBehaviour /// public readonly Type AppearanceBehaviour; /// - /// Creates a new instance of FullCardAppearanceBehaviour and registers its behaviour type with the . + /// Creates a new instance of and registers its behaviour type with the . /// /// Appearance enum id. - /// Type of the custom CardAppearanceBehaviour class. + /// Type of the custom class. public FullCardAppearanceBehaviour(CardAppearanceBehaviour.Appearance id, Type appearanceBehaviour) { Id = id; @@ -38,13 +38,13 @@ public FullCardAppearanceBehaviour(CardAppearanceBehaviour.Appearance id, Type a } /// - /// A collection of all CardAppearanceBehaviours from the base game. + /// A collection of all s from the base game. /// public readonly static ReadOnlyCollection BaseGameAppearances = new(GenBaseGameAppearanceList()); private readonly static ObservableCollection NewAppearances = new(); /// - /// All of CardAppearanceBehaviours, including vanilla and custom. + /// All of s, including vanilla and custom. /// public static List AllAppearances { get; private set; } = BaseGameAppearances.ToList(); @@ -68,12 +68,12 @@ private static List GenBaseGameAppearanceList() return baseGame; } /// - /// Registers a custom CardAppearanceBehaviour with the API. + /// Registers a custom with the API. /// /// The GUID of the mod adding the behaviour. /// The internal name identifier for the behaviour. - /// The Type of the custom CardAppearanceBehaviour class. - /// A FullCardAppearanceBehaviour object containing all the custom CardAppearanceBehaviour's data. + /// The Type of the custom class. + /// A object containing all the custom 's data. public static FullCardAppearanceBehaviour Add(string guid, string abilityName, Type behavior) { FullCardAppearanceBehaviour full = new(GuidManager.GetEnumValue(guid, abilityName), behavior); @@ -82,13 +82,13 @@ public static FullCardAppearanceBehaviour Add(string guid, string abilityName, T } /// - /// Unregisters a CardAppearanceBehaviour from the API. + /// Unregisters a from the API. /// /// The Appearance enum of the behaviour to remove. public static void Remove(CardAppearanceBehaviour.Appearance id) => NewAppearances.Remove(NewAppearances.FirstOrDefault(x => x.Id == id)); /// - /// Unregisters a CardAppearanceBehaviour from the API. + /// Unregisters a from the API. /// - /// The FullCardAppearanceBehaviour object of the behaviour to remove. + /// The object of the behaviour to remove. public static void Remove(FullCardAppearanceBehaviour ability) => NewAppearances.Remove(ability); } From dd870da206edc493a0463fe8f5fdb29a0f6fec04 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:32:44 -0800 Subject: [PATCH 32/74] Add cref tags --- InscryptionAPI/Card/CardExtensions.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensions.cs b/InscryptionAPI/Card/CardExtensions.cs index 917ccb6ba..374866737 100644 --- a/InscryptionAPI/Card/CardExtensions.cs +++ b/InscryptionAPI/Card/CardExtensions.cs @@ -149,9 +149,9 @@ public static CardInfo AddTribes(this CardInfo info, params Tribe[] tribes) /// /// Removes all stacks of any number of abilities from the card. /// - /// Card to access. + /// to access. /// The abilities to remove. - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveAbilities(this CardInfo info, params Ability[] abilities) { if (info.abilities?.Count > 0) @@ -166,9 +166,9 @@ public static CardInfo RemoveAbilities(this CardInfo info, params Ability[] abil /// /// Removes any number of abilities from the card. Will remove one instance of each passed ability; multiple instances can be passed. /// - /// Card to access. + /// to access. /// The abilities to remove. - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveAbilitiesSingle(this CardInfo info, params Ability[] abilities) { if (info.abilities?.Count > 0) @@ -328,9 +328,9 @@ public static CardInfo RemoveMetaCategoriesSingle(this CardInfo info, params Car /// /// Removes any number of traits from the card. /// - /// Card to access. + /// to access. /// The traits to remove. - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveTraits(this CardInfo info, params Trait[] traits) { if (info.traits?.Count > 0) @@ -347,9 +347,9 @@ public static CardInfo RemoveTraits(this CardInfo info, params Trait[] traits) /// /// Removes any number of traits from the card. /// - /// Card to access. + /// to access. /// The tribes to remove. - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveTribes(this CardInfo info, params Tribe[] tribes) { if (info.traits?.Count > 0) @@ -364,11 +364,11 @@ public static CardInfo RemoveTribes(this CardInfo info, params Tribe[] tribes) } /// - /// Removes any number of CardMetaCategories from the card. + /// Removes any number of metaategories from the card. /// - /// Card to access. - /// The CardMetaCategories to remove. - /// The same card info so a chain can continue. + /// to access. + /// The metacategories to remove. + /// The same so a chain can continue. public static CardInfo RemoveCardMetaCategories(this CardInfo info, params CardMetaCategory[] cardMetaCategories) { if (info.metaCategories?.Count > 0) From d46af02e718bc0cda5e6270f171d4f7885cec9a1 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 12:52:44 -0800 Subject: [PATCH 33/74] Add cref tags --- InscryptionAPI/Card/CardExtensionsCosts.cs | 28 +- InscryptionAPI/Card/CardExtensionsHelpers.cs | 350 +++++++++---------- 2 files changed, 189 insertions(+), 189 deletions(-) diff --git a/InscryptionAPI/Card/CardExtensionsCosts.cs b/InscryptionAPI/Card/CardExtensionsCosts.cs index 36ea93301..91d4eae77 100644 --- a/InscryptionAPI/Card/CardExtensionsCosts.cs +++ b/InscryptionAPI/Card/CardExtensionsCosts.cs @@ -5,11 +5,11 @@ namespace InscryptionAPI.Card; public static partial class CardExtensions { /// - /// Gets a PlayableCards using this specific CardInfo. - /// Inscryption often clones CardInfos and sometimes they're reused, meaning there can be more than 1 card using the same CardInfo object. + /// Gets a using this specific . + /// Inscryption often clones s and sometimes they're reused, meaning there can be more than 1 card using the same object. /// - /// CardInfo to check for. - /// The PlayableCard with the specified CardInfo. Checks the board, the player's hand and miscellaneous card displays. + /// to check for. + /// The with the specified . Checks the board, the player's hand and miscellaneous card displays. public static PlayableCard GetPlayableCard(this CardInfo cardInfo) { if (CostProperties.CostProperties.CardInfoToCard.TryGetValue(cardInfo, out List> cardList)) @@ -107,26 +107,26 @@ public static List GemsCost(this PlayableCard card) } /// - /// Checks if the given PlayableCard is gemified in either its CardInfo or TemporaryMods. + /// Checks if the given is gemified in either its or TemporaryMods. /// - /// True if the PlayableCard is gemified. + /// True if this card is gemified. public static bool IsGemified(this PlayableCard card) => card.Info.Gemified || card.TemporaryMods.Exists((CardModificationInfo x) => x.gemify); /// - /// Determines if the given PlayableCard's owner possesses a blue gem. Works for the opponent and player. + /// Determines if the given 's owner possesses a blue gem. Works for the opponent and player. /// public static bool OwnerHasBlueGem(this PlayableCard card) { return card.OpponentCard ? OpponentGemsManager.Instance.HasGem(GemType.Blue) : ResourcesManager.Instance.HasGem(GemType.Blue); } /// - /// Whether or not the given PlayableCard is affected by a blue gem and should have its cost reduced. + /// Whether or not the given is affected by a blue gem and should have its cost reduced. /// public static bool IsUsingBlueGem(this PlayableCard card) => card.IsGemified() && card.OwnerHasBlueGem(); /// /// Determines if this card provides its owner with a blue gem. /// - /// Card to check + /// to check. public static bool ProvidesBlueGem(this PlayableCard card) { return card.HasAbility(Ability.GainGemTriple) || card.HasAbility(Ability.GainGemBlue); @@ -134,7 +134,7 @@ public static bool ProvidesBlueGem(this PlayableCard card) /// /// Determines if this card provides its owner with a green gem. /// - /// Card to check + /// to check. public static bool ProvidesGreenGem(this PlayableCard card) { return card.HasAbility(Ability.GainGemTriple) || card.HasAbility(Ability.GainGemGreen); @@ -142,7 +142,7 @@ public static bool ProvidesGreenGem(this PlayableCard card) /// /// Determines if this card provides its owner with a orange gem. /// - /// Card to check + /// to check. public static bool ProvidesOrangeGem(this PlayableCard card) { return card.HasAbility(Ability.GainGemTriple) || card.HasAbility(Ability.GainGemOrange); @@ -151,7 +151,7 @@ public static bool ProvidesOrangeGem(this PlayableCard card) /// /// Determines if this card provides its owner with a blue gem. /// - /// CardInfo to check + /// to check. public static bool ProvidesBlueGem(this CardInfo card) { return card.HasAbility(Ability.GainGemTriple) || card.HasAbility(Ability.GainGemBlue); @@ -159,7 +159,7 @@ public static bool ProvidesBlueGem(this CardInfo card) /// /// Determines if this card provides its owner with a green gem. /// - /// CardInfo to check + /// to check. public static bool ProvidesGreenGem(this CardInfo card) { return card.HasAbility(Ability.GainGemTriple) || card.HasAbility(Ability.GainGemGreen); @@ -167,7 +167,7 @@ public static bool ProvidesGreenGem(this CardInfo card) /// /// Determines if this card provides its owner with a orange gem. /// - /// CardInfo to check + /// to check. public static bool ProvidesOrangeGem(this CardInfo card) { return card.HasAbility(Ability.GainGemTriple) || card.HasAbility(Ability.GainGemOrange); diff --git a/InscryptionAPI/Card/CardExtensionsHelpers.cs b/InscryptionAPI/Card/CardExtensionsHelpers.cs index 088360d33..00f37ef76 100644 --- a/InscryptionAPI/Card/CardExtensionsHelpers.cs +++ b/InscryptionAPI/Card/CardExtensionsHelpers.cs @@ -8,17 +8,17 @@ public static partial class CardExtensions { #region Ability /// - /// Checks if the CardModificationInfo does not have a specific Ability. + /// Checks if the does not have a specific Ability. /// - /// CardModificationInfo to access. + /// to access. /// The ability to check for. /// Returns true if the ability does not exist. public static bool LacksAbility(this CardModificationInfo mod, Ability ability) => !mod.HasAbility(ability); /// - /// Checks if the CardInfo does not have a specific Ability. + /// Checks if the does not have a specific Ability. /// - /// CardInfo to access. + /// to access. /// The ability to check for. /// Returns true if the ability does not exist. public static bool LacksAbility(this CardInfo cardInfo, Ability ability) @@ -27,11 +27,11 @@ public static bool LacksAbility(this CardInfo cardInfo, Ability ability) } /// - /// Checks if the CardInfo has all of the given Abilities. + /// Checks if the has all of the given Abilities. /// - /// CardInfo to access. + /// to access. /// The Abilities to check for. - /// Returns true if cardInfo has all of the given Abilities. + /// Returns true if this card has all of the given Abilities. public static bool HasAllAbilities(this CardInfo cardInfo, params Ability[] abilities) { foreach (Ability ability in abilities) @@ -43,11 +43,11 @@ public static bool HasAllAbilities(this CardInfo cardInfo, params Ability[] abil } /// - /// Checks if the CardInfo has none of the specified Abilities. + /// Checks if the has none of the specified Abilities. /// - /// CardInfo to access. + /// to access. /// The Abilities to check for. - /// Returns true if cardInfo has none of the given Abilities. + /// Returns true if this card has none of the given Abilities. public static bool LacksAllAbilities(this CardInfo cardInfo, params Ability[] abilities) { foreach (Ability ability in abilities) @@ -59,11 +59,11 @@ public static bool LacksAllAbilities(this CardInfo cardInfo, params Ability[] ab } /// - /// Checks if the CardInfo has any of the specified Abilities. + /// Checks if the has any of the specified Abilities. /// - /// CardInfo to access. + /// to access. /// The Abilities to check for. - /// Returns true if cardInfo has at least one of the given Abilities. + /// Returns true if this card has at least one of the given Abilities. public static bool HasAnyOfAbilities(this CardInfo cardInfo, params Ability[] abilities) { foreach (Ability ability in abilities) @@ -77,11 +77,11 @@ public static bool HasAnyOfAbilities(this CardInfo cardInfo, params Ability[] ab #region SpecialAbility /// - /// Checks if the CardInfo has a specific SpecialTriggeredAbility. + /// Checks if the has a specific SpecialTriggeredAbility. /// - /// A condensed version of `cardInfo.SpecialAbilities.Contains(ability)`. + /// An extension version of cardInfo.SpecialAbilities.Contains(ability). /// - /// CardInfo to access. + /// to access. /// The specialTriggeredAbility to check for. /// Returns true if the specialTriggeredAbility does exist. public static bool HasSpecialAbility(this CardInfo cardInfo, SpecialTriggeredAbility ability) @@ -90,9 +90,9 @@ public static bool HasSpecialAbility(this CardInfo cardInfo, SpecialTriggeredAbi } /// - /// Checks if the CardInfo does not have a specific SpecialTriggeredAbility. + /// Checks if the does not have a specific SpecialTriggeredAbility. /// - /// CardInfo to access. + /// to access. /// The specialTriggeredAbility to check for. /// Returns true if the specialTriggeredAbility does not exist. public static bool LacksSpecialAbility(this CardInfo cardInfo, SpecialTriggeredAbility ability) @@ -101,11 +101,11 @@ public static bool LacksSpecialAbility(this CardInfo cardInfo, SpecialTriggeredA } /// - /// Checks if the CardInfo has all of the specified SpecialTriggeredAbilities. + /// Checks if the has all of the specified SpecialTriggeredAbilities. /// - /// CardInfo to access. + /// to access. /// The SpecialTriggeredAbilities to check for. - /// Returns true if cardInfo has all of the specified SpecialTriggeredAbilities. + /// Returns true if this card has all of the specified SpecialTriggeredAbilities. public static bool HasAllSpecialAbilities(this CardInfo cardInfo, params SpecialTriggeredAbility[] specialAbilities) { foreach (SpecialTriggeredAbility special in specialAbilities) @@ -117,11 +117,11 @@ public static bool HasAllSpecialAbilities(this CardInfo cardInfo, params Special } /// - /// Checks if the CardInfo has none of the specified SpecialTriggeredAbilities. + /// Checks if the has none of the specified SpecialTriggeredAbilities. /// - /// CardInfo to access. + /// to access. /// The SpecialTriggeredAbilitiess to check for. - /// Returns true if cardInfo has none of the specified SpecialTriggeredAbilities. + /// Returns true if this card has none of the specified SpecialTriggeredAbilities. public static bool LacksAllSpecialAbilities(this CardInfo cardInfo, params SpecialTriggeredAbility[] specialAbilities) { foreach (SpecialTriggeredAbility special in specialAbilities) @@ -133,11 +133,11 @@ public static bool LacksAllSpecialAbilities(this CardInfo cardInfo, params Speci } /// - /// Checks if the CardInfo has any of the specified SpecialTriggeredAbilities. + /// Checks if the has any of the specified SpecialTriggeredAbilities. /// - /// CardInfo to access. + /// to access. /// The SpecialTriggeredAbilities to check for. - /// Returns true if cardInfo has at least one of the specified SpecialTriggeredAbilities. + /// Returns true if this card has at least one of the specified SpecialTriggeredAbilities. public static bool HasAnyOfSpecialAbilities(this CardInfo cardInfo, params SpecialTriggeredAbility[] specialAbilities) { foreach (SpecialTriggeredAbility special in specialAbilities) @@ -151,27 +151,27 @@ public static bool HasAnyOfSpecialAbilities(this CardInfo cardInfo, params Speci #region Trait /// - /// Checks if the CardInfo does not belong to a specific Tribe. + /// Checks if the does not belong to a specific Tribe. /// - /// CardInfo to access. + /// to access. /// The tribe to check for. /// Returns true if the card is not of the specified tribe. public static bool IsNotOfTribe(this CardInfo cardInfo, Tribe tribe) => !cardInfo.IsOfTribe(tribe); /// - /// Checks if the CardInfo does not have a specific Trait. + /// Checks if the does not have a specific Trait. /// - /// CardInfo to access. + /// to access. /// The Trait to check for. /// Returns true if the card is does not have the specified Trait. public static bool LacksTrait(this CardInfo cardInfo, Trait trait) => !cardInfo.HasTrait(trait); /// - /// Checks if the CardInfo has all of the specified Traits. + /// Checks if the has all of the specified Traits. /// - /// CardInfo to access. + /// to access. /// The Traits to check for. - /// Returns true if cardInfo has all of the specified Traits. + /// Returns true if this card has all of the specified Traits. public static bool HasAllTraits(this CardInfo cardInfo, params Trait[] traits) { foreach (Trait trait in traits) @@ -183,11 +183,11 @@ public static bool HasAllTraits(this CardInfo cardInfo, params Trait[] traits) } /// - /// Checks if the CardInfo has none of the specified Traits. + /// Checks if the has none of the specified Traits. /// - /// CardInfo to access. + /// to access. /// The Traits to check for. - /// Returns true if cardInfo has none of the specified Traits. + /// Returns true if this card has none of the specified Traits. public static bool LacksAllTraits(this CardInfo cardInfo, params Trait[] traits) { foreach (Trait trait in traits) @@ -199,11 +199,11 @@ public static bool LacksAllTraits(this CardInfo cardInfo, params Trait[] traits) } /// - /// Checks if the CardInfo has any of the specified Traits. + /// Checks if the has any of the specified Traits. /// - /// CardInfo to access. + /// to access. /// The Traits to check for. - /// Returns true if cardInfo has at least one of the specified Traits. + /// Returns true if this card has at least one of the specified Traits. public static bool HasAnyOfTraits(this CardInfo cardInfo, params Trait[] traits) { foreach (Trait trait in traits) @@ -228,25 +228,25 @@ public static bool HasAnyOfTraits(this CardInfo cardInfo, params Trait[] traits) #region CardMetaCategory /// - /// Checks if the CardInfo has a specific CardMetaCategory. + /// Checks if the has a specific CardMetaCategory. /// - /// CardInfo to access. + /// to access. /// The CardMetaCategory to check for. /// Returns true if the card is does not have the specified CardMetaCategory. public static bool HasCardMetaCategory(this CardInfo cardInfo, CardMetaCategory metaCategory) => cardInfo.metaCategories.Contains(metaCategory); /// - /// Checks if the CardInfo does not have a specific CardMetaCategory. + /// Checks if the does not have a specific CardMetaCategory. /// - /// CardInfo to access. + /// to access. /// The CardMetaCategory to check for. /// Returns true if the card is does not have the specified CardMetaCategory. public static bool LacksCardMetaCategory(this CardInfo cardInfo, CardMetaCategory metaCategory) => !cardInfo.HasCardMetaCategory(metaCategory); /// - /// Checks if the CardInfo has any of the specified CardMetaCategories. + /// Checks if the has any of the specified CardMetaCategories. /// - /// CardInfo to access. + /// to access. /// The CardMetaCategories to check for. /// Returns true if the card has at least one of the specified CardMetaCategories. public static bool HasAnyOfCardMetaCategories(this CardInfo cardInfo, params CardMetaCategory[] metaCategories) @@ -260,9 +260,9 @@ public static bool HasAnyOfCardMetaCategories(this CardInfo cardInfo, params Car } /// - /// Checks if the CardInfo has none of the specified CardMetaCategories. + /// Checks if the has none of the specified CardMetaCategories. /// - /// CardInfo to access. + /// to access. /// The CardMetaCategories to check for. /// Returns true if the card has none of the specified CardMetaCategories. public static bool LacksAllCardMetaCategories(this CardInfo cardInfo, params CardMetaCategory[] metaCategories) @@ -278,10 +278,10 @@ public static bool LacksAllCardMetaCategories(this CardInfo cardInfo, params Car #region PlayableCard /// - /// Gets the health adjustment given by a PlayableCard's Stat Icon. + /// Gets the health adjustment given by a 's stat icon. /// - /// The PlayableCard to access. - /// How much Health the Stat Icon gives. + /// The to access. + /// How much Health the stat icon gives. public static int GetStatIconHealthBuffs(this PlayableCard card) { int num = 0; @@ -295,7 +295,7 @@ public static int GetStatIconHealthBuffs(this PlayableCard card) /// /// Gets the number of Ability stacks a card has. /// - /// The PlayableCard to access. + /// The to access. /// The Ability to check for. /// The number of Ability stacks the card has. public static int GetAbilityStacks(this PlayableCard card, Ability ability) @@ -315,7 +315,7 @@ public static int GetAbilityStacks(this PlayableCard card, Ability ability) /// /// Gets the number of Ability stacks a card has. /// - /// The CardInfo to access. + /// The to access. /// The Ability to check for. /// The number of Ability stacks the card has. public static int GetAbilityStacks(this CardInfo info, Ability ability) @@ -329,10 +329,10 @@ public static int GetAbilityStacks(this CardInfo info, Ability ability) } /// - /// Check if the other PlayableCard is on the same side of the board as this PlayableCard. + /// Check if the other is on the same side of the board as this . /// - /// The PlayableCard to access. - /// The other PlayableCard. + /// The to access. + /// The other to check. /// Returns true if both cards are on the board and both are on the opponent cards or both are player cards. public static bool OtherCardIsOnSameSide(this PlayableCard playableCard, PlayableCard otherCard) { @@ -340,22 +340,22 @@ public static bool OtherCardIsOnSameSide(this PlayableCard playableCard, Playabl } /// - /// Retrieve a list of all abilities that exist on the PlayableCard. + /// Retrieve a list of all abilities that exist on the . /// - /// This will retrieve all Abilities from both TemporaryMods and from the underlying CardInfo object. + /// This will retrieve all Abilities from both TemporaryMods and from the underlying object. /// - /// The PlayableCard to access. - /// A list of Abilities from the PlayableCard and underlying CardInfo object. + /// The to access. + /// A list of Abilities from the and underlying object. public static List AllAbilities(this PlayableCard playableCard) { return playableCard.GetAbilitiesFromAllMods().Concat(playableCard.Info.Abilities).ToList(); } /// - /// A variant of PlayableCard.AllAbilities that can account for negated abilities in the PlayableCard's TemporaryMods. + /// A variant of that can account for negated abilities in the 's TemporaryMods. /// - /// The PlayableCard to access. - /// Whether or not to check TemporaryMods for negated abilities. - /// A list of Abilities from the PlayableCard and underlying CardInfo object + /// The to access. + /// Whether or not to check TemporaryMods for negated abilities. + /// A list of Abilities from the and underlying object public static List AllAbilities(this PlayableCard playableCard, bool accountForNegation) { List retval = playableCard.AllAbilities(); @@ -373,24 +373,24 @@ public static List AllAbilities(this PlayableCard playableCard, bool ac } /// - /// Retrieve a list of all CardModificationInfos that exist on the PlayableCard. + /// Retrieve a list of all CardModificationInfos that exist on the . /// - /// This will retrieve all mods from TemporaryMods and the underlying CardInfo.Mods. + /// This will retrieve all mods from TemporaryMods and the underlying CardInfo.Mods. /// - /// The PlayableCard to access. - /// A list of CardModificationInfos from the PlayableCard and underlying CardInfo object. + /// The to access. + /// A list of s from the and underlying object. public static List AllCardModificationInfos(this PlayableCard playableCard) { return playableCard.TemporaryMods.Concat(playableCard.Info.Mods).ToList(); } /// - /// Removes the provided CardModificationInfo from the PlayableCard. + /// Removes the provided CardModificationInfo from the . /// - /// Searches both its TemporaryMods list and its CardInfo.Mods list. + /// Searches both its TemporaryMods list and its CardInfo.Mods list. /// - /// The PlayableCard to access. - /// The CardModificationInfo object to remove. + /// The to access. + /// The object to remove. /// Whether or not to call OnStatsChanged after removing the card mod. /// True if the mod was successfully removed or false if the mod was not removed or was null. public static bool RemoveCardModificationInfo(this PlayableCard playableCard, CardModificationInfo modToRemove, bool updateDisplay = true) @@ -418,22 +418,22 @@ public static bool RemoveCardModificationInfo(this PlayableCard playableCard, Ca return false; } /// - /// Retrieve a list of all special triggered abilities that exist on the PlayableCard. + /// Retrieve a list of all special triggered abilities that exist on the . /// - /// This will retrieve all SpecialTriggeredAbility from both TemporaryMods and from the underlying CardInfo object. + /// This will retrieve all SpecialTriggeredAbility from both TemporaryMods and from the underlying object. /// - /// The PlayableCard to access. - /// A list of SpecialTriggeredAbility from the PlayableCard and underlying CardInfo object. + /// The to access. + /// A list of SpecialTriggeredAbility from the and underlying object. public static List AllSpecialAbilities(this PlayableCard playableCard) { return new List(playableCard.TemporaryMods.Concat(playableCard.Info.Mods).SelectMany(mod => mod.specialAbilities)); } /// - /// Retrieve a list of Ability that exist in TemporaryMods and the underlying CardInfo.Mods lists. + /// Retrieve a list of Ability that exist in TemporaryMods and the underlying CardInfo.Mods lists. /// - /// The PlayableCard to access. - /// A list of Ability from the PlayableCard and underlying CardInfo object. + /// The to access. + /// A list of Ability from the and underlying object. public static List GetAbilitiesFromAllMods(this PlayableCard playableCard) { return AbilitiesUtil.GetAbilitiesFromMods(playableCard.TemporaryMods.Concat(playableCard.Info.Mods).ToList()); @@ -442,7 +442,7 @@ public static List GetAbilitiesFromAllMods(this PlayableCard playableCa /// /// Checks if the card has a specific Trait. /// - /// PlayableCard to access. + /// to access. /// The trait to check for. /// Returns true if the card has the specified trait. public static bool HasTrait(this PlayableCard playableCard, Trait trait) => playableCard.Info.HasTrait(trait); @@ -450,47 +450,47 @@ public static List GetAbilitiesFromAllMods(this PlayableCard playableCa /// /// Checks if the card does not have a specific Trait. /// - /// PlayableCard to access. + /// to access. /// The trait to check for. /// Returns true if the card does not have the specified trait. public static bool LacksTrait(this PlayableCard playableCard, Trait trait) => playableCard.Info.LacksTrait(trait); /// - /// Checks if the PlayableCard has all of the specified Traits. + /// Checks if the has all of the specified Traits. /// - /// PlayableCard to access. + /// to access. /// The Traits to check for. - /// Returns true if playableCard has all of the specified Traits. + /// Returns true if playableCard has all of the specified Traits. public static bool HasAllTraits(this PlayableCard playableCard, params Trait[] traits) => playableCard.Info.HasAllTraits(traits); /// - /// Checks if the PlayableCard has none of the specified Traits. + /// Checks if the has none of the specified Traits. /// - /// PlayableCard to access. + /// to access. /// The Traits to check for. - /// Returns true if playableCard has none of the specified Traits. + /// Returns true if playableCard has none of the specified Traits. public static bool LacksAllTraits(this PlayableCard playableCard, params Trait[] traits) => playableCard.Info.LacksAllTraits(traits); /// - /// Checks if the PlayableCard has any of the specified Traits. + /// Checks if the has any of the specified Traits. /// - /// PlayableCard to access. + /// to access. /// The Traits to check for. - /// Returns true if playableCard has at least one of the specified Traits. + /// Returns true if this card has at least one of the specified Traits. public static bool HasAnyOfTraits(this PlayableCard playableCard, params Trait[] traits) => playableCard.Info.HasAnyOfTraits(traits); /// - /// Checks if the PlayableCard is of a specified Tribe. + /// Checks if the is of a specified Tribe. /// - /// PlayableCard to access. + /// to access. /// The tribe to check for. /// Returns true if the card is of the specified tribe. public static bool IsOfTribe(this PlayableCard playableCard, Tribe tribe) => playableCard.Info.IsOfTribe(tribe); /// - /// Checks if the PlayableCard is not of a specified Tribe. + /// Checks if the is not of a specified Tribe. /// - /// PlayableCard to access. + /// to access. /// The tribe to check for. /// Returns true if the card is not of the specified tribe. public static bool IsNotOfTribe(this PlayableCard playableCard, Tribe tribe) => playableCard.Info.IsNotOfTribe(tribe); @@ -498,33 +498,33 @@ public static List GetAbilitiesFromAllMods(this PlayableCard playableCa /// /// Checks if the card is not null and not Dead. /// - /// PlayableCard to access. + /// to access. /// Returns true if the card is not null or not Dead. public static bool NotDead(this PlayableCard playableCard) => playableCard && !playableCard.Dead; /// /// Checks if the card is not the opponent's card. /// - /// PlayableCard to access. + /// to access. /// Returns true if card is not the opponent's card. public static bool IsPlayerCard(this PlayableCard playableCard) => !playableCard.OpponentCard; /// - /// Check the PlayableCard not having a specific Ability. + /// Check the not having a specific Ability. /// - /// PlayableCard to access. + /// to access. /// The ability to check for. /// Returns true if the ability does not exist. public static bool LacksAbility(this PlayableCard playableCard, Ability ability) => !playableCard.HasAbility(ability); /// - /// Check if the PlayableCard has all of the given abilities. + /// Check if the has all of the given abilities. /// - /// A condensed version of `CardInfo.HasAllAbilities`. + /// An extension version of . /// - /// PlayableCard to access. + /// to access. /// The Abilities to check for. - /// Returns true if playableCard has all of the given Abilities. + /// Returns true if the card has all of the given Abilities. public static bool HasAllAbilities(this PlayableCard playableCard, params Ability[] abilities) { foreach (Ability ability in abilities) @@ -536,13 +536,13 @@ public static bool HasAllAbilities(this PlayableCard playableCard, params Abilit } /// - /// Checks if the PlayableCard has none of the specified Abilities. + /// Checks if the has none of the specified Abilities. /// - /// A condensed version of `CardInfo.LacksAllSpecialAbilities`. + /// An extension version of . /// - /// PlayableCard to access. + /// to access. /// The Abilities to check for. - /// Returns true if playableCard has none of the given Abilities. + /// Returns true if this card has none of the given Abilities. public static bool LacksAllAbilities(this PlayableCard playableCard, params Ability[] abilities) { foreach (Ability ability in abilities) @@ -554,13 +554,13 @@ public static bool LacksAllAbilities(this PlayableCard playableCard, params Abil } /// - /// Check if the PlayableCard has any of the specified Abilities. + /// Check if the has any of the specified Abilities. /// - /// A condensed version of `CardInfo.HasAnyOfAbilities`. + /// An extension version of . /// - /// PlayableCard to access. + /// to access. /// The Abilities to check for. - /// Returns true if playableCard has at least one of the given Abilities. + /// Returns true if this card has at least one of the given Abilities. public static bool HasAnyOfAbilities(this PlayableCard playableCard, params Ability[] abilities) { foreach (Ability ability in abilities) @@ -572,21 +572,21 @@ public static bool HasAnyOfAbilities(this PlayableCard playableCard, params Abil } /// - /// Check the PlayableCard not having a specific SpecialTriggeredAbility. + /// Check the not having a specific SpecialTriggeredAbility. /// - /// A condensed version of `!playableCard.Info.SpecialAbilities.Contains(ability)`. + /// An extension version of !. /// - /// PlayableCard to access. + /// to access. /// The specialTriggeredAbility to check for. /// Returns true if the specialTriggeredAbility does not exist. public static bool LacksSpecialAbility(this PlayableCard playableCard, SpecialTriggeredAbility ability) => !playableCard.HasSpecialAbility(ability); /// - /// Check the PlayableCard having a specific SpecialTriggeredAbility. + /// Check the having a specific SpecialTriggeredAbility. /// - /// A condensed version of `playableCard.Info.SpecialAbilities.Contains(ability)`. + /// An extension version of playableCard.Info.SpecialAbilities.Contains(ability). /// - /// PlayableCard to access. + /// to access. /// The specialTriggeredAbility to check for. /// Returns true if the specialTriggeredAbility does exist. public static bool HasSpecialAbility(this PlayableCard playableCard, SpecialTriggeredAbility ability) @@ -596,13 +596,13 @@ public static bool HasSpecialAbility(this PlayableCard playableCard, SpecialTrig } /// - /// Checks if the PlayableCard has all of the specified SpecialTriggeredAbilities. + /// Checks if the has all of the specified SpecialTriggeredAbilities. /// - /// A condensed version of `CardInfo.HasAllSpecialAbilities`. + /// An extension version of . /// - /// PlayableCard to access. + /// to access. /// The SpecialTriggeredAbilities to check for. - /// Returns true if playableCard has all of the specified SpecialTriggeredAbilities. + /// Returns true if this card has all of the specified SpecialTriggeredAbilities. public static bool HasAllSpecialAbilities(this PlayableCard playableCard, params SpecialTriggeredAbility[] specialAbilities) { foreach (SpecialTriggeredAbility special in specialAbilities) @@ -614,11 +614,11 @@ public static bool HasAllSpecialAbilities(this PlayableCard playableCard, params } /// - /// Checks if the PlayableCard has none of the specified SpecialTriggeredAbilities. + /// Checks if the has none of the specified SpecialTriggeredAbilities. /// - /// A condensed version of `CardInfo.LacksAllSpecialAbilities`. + /// An extension version of . /// - /// PlayableCard to access. + /// to access. /// The SpecialTriggeredAbilitiess to check for. /// Returns true if playableCard has none of the specified SpecialTriggeredAbilities. public static bool LacksAllSpecialAbilities(this PlayableCard playableCard, params SpecialTriggeredAbility[] specialAbilities) @@ -632,12 +632,12 @@ public static bool LacksAllSpecialAbilities(this PlayableCard playableCard, para } /// - /// Checks if the PlayableCard has any of the specified SpecialTriggeredAbilities. + /// Checks if the has any of the specified SpecialTriggeredAbilities. /// - /// A condensed version of `CardInfo.HasAnyOfSpecialAbilities`. + /// An extension version of . /// - /// PlayableCard to access. - /// The SpecialTriggeredAbilities to check for. + /// to access. + /// The special abilities to check for. /// Returns true if playableCard has at least one of the specified SpecialTriggeredAbilities. public static bool HasAnyOfSpecialAbilities(this PlayableCard playableCard, params SpecialTriggeredAbility[] specialAbilities) { @@ -650,35 +650,35 @@ public static bool HasAnyOfSpecialAbilities(this PlayableCard playableCard, para } /// - /// Check if the PlayableCard has a card opposing it in the opposite slot. + /// Check if the has a card opposing it in the opposite slot. /// - /// Also acts as a null check if this PlayableCard is in a slot. + /// Also acts as a null check if this is in a slot. /// - /// PlayableCard to access. + /// to access. /// Returns true if a card exists in the opposing slot. public static bool HasOpposingCard(this PlayableCard playableCard) => playableCard.Slot && playableCard.Slot.opposingSlot.Card; /// - /// Retrieve the CardSlot object that is opposing this PlayableCard. + /// Retrieve the CardSlot object that is opposing this . /// /// It is on the implementer to check if the returned value is not null - /// PlayableCard to access. - /// The card slot opposite of this playableCard, otherwise return null. + /// to access. + /// The card slot opposite of this , otherwise return null. public static CardSlot OpposingSlot(this PlayableCard playableCard) => playableCard.Slot ? playableCard.Slot.opposingSlot : null; /// - /// Retrieve the PlayableCard that is opposing this PlayableCard in the opposite slot. + /// Retrieve the that is opposing this in the opposite slot. /// /// It is on the implementer to check if the returned value is not null - /// PlayableCard to access. + /// to access. /// The card in the opposing slot, otherwise return null. public static PlayableCard OpposingCard(this PlayableCard playableCard) => playableCard.OpposingSlot()?.Card; /// - /// Adds all given CardModificationInfos to a PlayableCard as temporary mods. + /// Adds all given s to a as temporary mods. /// - /// The PlayableCard to access. - /// The collection of CardModificationInfos to add as temporary mods to the card. + /// The to access. + /// The collection of s to add as temporary mods to the card. public static void AddTemporaryMods(this PlayableCard card, params CardModificationInfo[] mods) { foreach (CardModificationInfo mod in mods) @@ -686,10 +686,10 @@ public static void AddTemporaryMods(this PlayableCard card, params CardModificat } /// - /// Removes all given CardModificationInfos from a PlayableCard's list of temporary mods. + /// Removes all given s from a 's list of temporary mods. /// - /// The PlayableCard to access. - /// The collection of CardModificationInfos to remove from the card's temporary mods. + /// The to access. + /// The collection of s to remove from the card's temporary mods. public static void RemoveTemporaryMods(this PlayableCard card, params CardModificationInfo[] mods) { foreach (CardModificationInfo mod in mods) @@ -697,10 +697,10 @@ public static void RemoveTemporaryMods(this PlayableCard card, params CardModifi } /// - /// A version of TransformIntoCard tailored to visually work on cards in the hand. + /// A version of tailored to visually work on cards in the hand. /// - /// The PlayableCard to access. - /// The CardInfo to change the card into. + /// The to access. + /// The to change the card into. /// An Action to invoke before the evolvedInfo is set. /// An Action to invoke after the evolvedInfo is set. public static IEnumerator TransformIntoCardInHand(this PlayableCard card, CardInfo evolvedInfo, Action onTransformedCallback = null, Action preTransformCallback = null) @@ -715,7 +715,7 @@ public static IEnumerator TransformIntoCardInHand(this PlayableCard card, CardIn AbilityManager.FixStackTriggers(card); } /// - /// A version of TransformIntoCardInHand that incorporates MoveCardAboveHand. + /// A version of that incorporates . /// public static IEnumerator TransformIntoCardAboveHand(this PlayableCard card, CardInfo evolvedInfo, Action onTransformedCallback = null, Action preTransformCallback = null) { @@ -736,7 +736,7 @@ public static IEnumerator TransformIntoCardAboveHand(this PlayableCard card, Car /// /// Increases the amount of shields the card has. Affects the internal counter; does not add or remove shield sigil stacks. /// - /// The PlayableCard to access. + /// The to access. /// How many shields to add. /// Whether to update the card's display, meaning sigil stack numbers and any shield effects. public static void AddShieldCount(this PlayableCard card, int amount, bool updateDisplay = true) @@ -746,7 +746,7 @@ public static void AddShieldCount(this PlayableCard card, int amount, bool updat /// /// Increases the amount of shields a specific ability is currently giving. /// - /// The PlayableCard to access. + /// The to access. /// How many shields to add. /// The shield-giving ability to add more shields to. /// Whether to update the card's display, meaning sigil stack numbers and any shield effects. @@ -761,7 +761,7 @@ public static void AddShieldCount(this PlayableCard card, int amount, Ability ab component.AddShields(amount, updateDisplay); } /// - /// Increases the amount of shields a specific ability's AbilityBehaviour is currently giving. + /// Increases the amount of shields a specific ability's is currently giving. /// public static void AddShieldCount(this PlayableCard card, int amount, bool updateDisplay = true) where T : DamageShieldBehaviour { @@ -769,9 +769,9 @@ public static void AddShieldCount(this PlayableCard card, int amount, bool up } /// - /// Removes shields from the given PlayableCard. + /// Removes shields from the given . /// - /// The PlayableCard to access. + /// The to access. /// How many shields to add. /// Whether to update the card's display, meaning sigil stack numbers and any shield effects. public static void RemoveShieldCount(this PlayableCard card, int amount, bool updateDisplay = true) @@ -781,7 +781,7 @@ public static void RemoveShieldCount(this PlayableCard card, int amount, bool up /// /// Reduces the amount of shields a specific ability is currently giving. /// - /// The PlayableCard to access. + /// The to access. /// How many shields to add. /// The shield-giving ability to remove shields from. /// Whether to update the card's display, meaning sigil stack numbers and any shield effects. @@ -799,7 +799,7 @@ public static void RemoveShieldCount(this PlayableCard card, int amount, Ability /// Reduces a card's shield count from a specific shield-giving ability. /// /// The class of the ability to remove shield count from. - /// PlayableCard instance to remove shield from. + /// instance to remove shield from. /// How many shields to remove. /// Whether or not to update the card's rendering. public static void RemoveShieldCount(this PlayableCard card, int amount, bool updateDisplay = true) where T : DamageShieldBehaviour @@ -810,7 +810,7 @@ public static void RemoveShieldCount(this PlayableCard card, int amount, bool /// /// Gets the number of shields the target card has. Each shield negates one damaging hit. /// - /// The PlayableCard to access. + /// The to access. /// The number of shields the card has. public static int GetTotalShields(this PlayableCard card) { @@ -841,11 +841,11 @@ public static int GetTotalShields(this PlayableCard card) } /// - /// Retrieves the current value of a DamageShieldBehaviour's NumShield. + /// Retrieves the current value of a 's NumShield. /// - /// - /// - /// The current value of the DamageShieldBehaviour's NumShield. + /// The to access. + /// The to access. + /// The current value of the 's NumShield. public static int GetShieldCount(this PlayableCard card) where T : DamageShieldBehaviour { T comp = card.GetComponent(); @@ -853,11 +853,11 @@ public static int GetShieldCount(this PlayableCard card) where T : DamageShie } /// - /// Retrieves the DamageShieldBehaviour component corresponding to the given Ability, or null if it does not exist. + /// Retrieves the component corresponding to the given Ability, or null if it does not exist. /// - /// - /// - /// The DamageShieldBehaviour component of the given Ability, or null if it does not exist. + /// The to access. + /// The shield-giving ability to access. + /// The component of the given Ability, or null if it does not exist. public static DamageShieldBehaviour GetShieldBehaviour(this PlayableCard card, Ability ability) { Type type = ShieldManager.AllShieldAbilities.AbilityByID(ability)?.AbilityBehavior; @@ -867,9 +867,9 @@ public static DamageShieldBehaviour GetShieldBehaviour(this PlayableCard card, A return card.GetComponent(type) as DamageShieldBehaviour; } /// - /// A variant of ResetShield that only resets shields belonging is a certain ability. + /// An extension variant of that only resets shields belonging is a certain ability. /// - /// The PlayableCard to access. + /// The to access. /// The shield ability to look for. public static void ResetShield(this PlayableCard card, Ability ability) { @@ -891,16 +891,16 @@ public static bool IsShieldAbility(this Ability ability) return ShieldManager.AllShieldInfos.AbilityByID(ability) != null; } /// - /// Determines whether the given AbilityInfo corresponds to a shield-giving ability. + /// Determines whether the given corresponds to a shield-giving ability. /// - /// The AbilityInfo for the ability to check. - /// True if the AbilityInfo is for an ability that gives sigils using the API's features. + /// The for the ability to check. + /// True if the is for an ability that gives sigils using the API's features. public static bool IsShieldAbility(this AbilityInfo abilityInfo) { return ShieldManager.AllShieldInfos.Contains(abilityInfo); } /// - /// Returns whether or not the PlayableCard has an Ability that overrides DamageShieldBehaviour. + /// Returns whether or not the has an Ability that overrides . /// /// The PlayableCard object to check. public static bool HasShieldAbility(this PlayableCard card) @@ -908,9 +908,9 @@ public static bool HasShieldAbility(this PlayableCard card) return card.AllAbilities().Exists(x => x.IsShieldAbility()); } /// - /// Returns whether or not the CardInfo has an Ability that overrides DamageShieldBehaviour. + /// Returns whether or not the has an Ability that overrides . /// - /// The CardInfo object to check. + /// The object to check. public static bool HasShieldAbility(this CardInfo cardInfo) { return cardInfo.Abilities.Exists(x => x.IsShieldAbility()); @@ -919,10 +919,10 @@ public static bool HasShieldAbility(this CardInfo cardInfo) #endregion /// - /// Spawns the CardInfo object to the player's hand. + /// Spawns the object to the player's hand. /// - /// CardInfo to access. - /// The mods that will be added to the PlayableCard object. + /// to access. + /// The mods that will be added to the object. /// The position of where the card will appear from. Default is a Vector3 of (0, 6, 1.5). /// The amount of time to wait before being added to the hand. /// @@ -941,10 +941,10 @@ public static IEnumerator SpawnInHand(this CardInfo cardInfo, List - /// Creates a basic EncounterBlueprintData.CardBlueprint based off the CardInfo object. + /// Creates a basic based off the object. /// - /// CardInfo to create the blueprint with. - /// The CardBlueprint object that can be used when creating EncounterData. + /// to create the blueprint with. + /// The CardBlueprint object that can be used when creating . public static EncounterBlueprintData.CardBlueprint CreateBlueprint(this CardInfo cardInfo) { return new EncounterBlueprintData.CardBlueprint From 838c3e8a86055c3dda5910ed45872a2c26f980dd Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:11:32 -0800 Subject: [PATCH 34/74] Add cref tags, fix mistakes --- InscryptionAPI/Card/AbilityManager.cs | 1 - InscryptionAPI/Card/CardExtensions.cs | 2 +- .../Card/CardExtensionsPortraits.cs | 336 +++++++++--------- .../Card/CardExtensionsProperties.cs | 124 +++---- InscryptionAPI/Card/CardExtensionsSetters.cs | 200 +++++------ InscryptionAPI/Card/CardManager.cs | 94 ++--- .../Card/CardModificationInfoExtensions.cs | 322 ++++++++--------- .../Card/CardModificationInfoManager.cs | 31 +- InscryptionAPI/Card/CostProperties.cs | 58 +-- InscryptionAPI/Card/DamageShieldBehaviour.cs | 22 +- InscryptionAPI/Card/DeathCardManager.cs | 12 +- InscryptionAPI/Card/DefaultBoneGainOnDeath.cs | 12 +- .../Card/ExtendedAbilityBehaviour.cs | 16 +- .../Card/ExtendedActivatedAbilityBehaviour.cs | 14 +- InscryptionAPI/Card/OpponentGemsManager.cs | 8 +- InscryptionAPI/Card/ShieldManager.cs | 10 +- InscryptionAPI/Card/SpecialStatIconManager.cs | 16 +- .../Card/SpecialTriggeredAbilityManager.cs | 18 +- InscryptionAPI/Card/TribeManager.cs | 26 +- 19 files changed, 662 insertions(+), 660 deletions(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index a090bd16b..9d9bca0c2 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -4,7 +4,6 @@ using InscryptionAPI.Helpers; using InscryptionAPI.Helpers.Extensions; using InscryptionAPI.RuleBook; -using Sirenix.Utilities; using System.Collections; using System.Collections.ObjectModel; using System.Reflection; diff --git a/InscryptionAPI/Card/CardExtensions.cs b/InscryptionAPI/Card/CardExtensions.cs index 374866737..2232cc4eb 100644 --- a/InscryptionAPI/Card/CardExtensions.cs +++ b/InscryptionAPI/Card/CardExtensions.cs @@ -364,7 +364,7 @@ public static CardInfo RemoveTribes(this CardInfo info, params Tribe[] tribes) } /// - /// Removes any number of metaategories from the card. + /// Removes any number of metacategories from the card. /// /// to access. /// The metacategories to remove. diff --git a/InscryptionAPI/Card/CardExtensionsPortraits.cs b/InscryptionAPI/Card/CardExtensionsPortraits.cs index 75f111b35..2ece25794 100644 --- a/InscryptionAPI/Card/CardExtensionsPortraits.cs +++ b/InscryptionAPI/Card/CardExtensionsPortraits.cs @@ -10,9 +10,9 @@ public static partial class CardExtensions /// /// Sets the default card portrait for the card /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPortrait(this CardInfo info, string pathToArt) { try @@ -28,10 +28,10 @@ public static CardInfo SetPortrait(this CardInfo info, string pathToArt) /// /// Sets the default card portrait for the card /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -40,7 +40,7 @@ public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, Filte /// /// Sets the cards portrait and emission at the same time. /// - /// The CardInfon to access. + /// The n to access. /// The texture containing the card portrait. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. @@ -55,9 +55,9 @@ public static CardInfo SetPortrait(this CardInfo info, Texture2D portrait, Textu /// /// Sets the default card portrait for the card /// - /// CardInfo to access. + /// to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPortrait(this CardInfo info, Sprite sprite) { info.portraitTex = sprite; @@ -71,10 +71,10 @@ public static CardInfo SetPortrait(this CardInfo info, Sprite sprite) /// /// Sets the cards portrait and emission at the same time. /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the portrait artwork (relative to the Plugins directory). /// The path to the .png file containing the emission artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPortraitAndEmission(this CardInfo info, string pathToArt, string pathToEmission) { info.SetPortrait(pathToArt); @@ -85,11 +85,11 @@ public static CardInfo SetPortraitAndEmission(this CardInfo info, string pathToA /// /// Sets the cards portrait and emission at the same time. /// - /// CardInfo to access. + /// to access. /// The texture containing the card portrait. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPortraitAndEmission(this CardInfo info, Texture2D portrait, Texture2D emission, FilterMode? filterMode = null) { info.SetPortrait(portrait, filterMode); @@ -100,10 +100,10 @@ public static CardInfo SetPortraitAndEmission(this CardInfo info, Texture2D port /// /// Sets the cards portrait and emission at the same time. /// - /// CardInfo to access. + /// to access. /// The sprite containing the card portrait. /// The sprite containing the emission. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPortraitAndEmission(this CardInfo info, Sprite portrait, Sprite emission) { info.SetPortrait(portrait); @@ -117,9 +117,9 @@ public static CardInfo SetPortraitAndEmission(this CardInfo info, Sprite portrai /// /// Sets the card's alternate portrait. This portrait is only used when asked for by an ability or an appearance behavior. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetAltPortrait(this CardInfo info, string pathToArt) { return info.SetAltPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -128,10 +128,10 @@ public static CardInfo SetAltPortrait(this CardInfo info, string pathToArt) /// /// Sets the card's alternate portrait. This portrait is only used when asked for by an ability or an appearance behavior. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetAltPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetAltPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -140,9 +140,9 @@ public static CardInfo SetAltPortrait(this CardInfo info, Texture2D portrait, Fi /// /// Sets the card's alternate portrait. This portrait is only used when asked for by an ability or an appearance behavior. /// - /// CardInfo to access. + /// to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetAltPortrait(this CardInfo info, Sprite portrait) { info.alternatePortrait = portrait; @@ -160,9 +160,9 @@ public static CardInfo SetAltPortrait(this CardInfo info, Sprite portrait) /// /// Sets the emissive portrait for the card. This can only be done after the default portrait has been set (SetPortrait). /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissivePortrait(this CardInfo info, string pathToArt) { try @@ -178,10 +178,10 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, string pathToArt) /// /// Sets the emissive portrait for the card. This can only be done after the default portrait has been set (SetPortrait). /// - /// CardInfo to access. + /// to access. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissivePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissivePortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -190,9 +190,9 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, Texture2D portrai /// /// Sets the emissive portrait for the card. This can only be done after the default portrait has been set (SetPortrait). /// - /// CardInfo to access. + /// to access. /// The sprite containing the emission. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissivePortrait(this CardInfo info, Sprite sprite) { if (info.portraitTex == null) @@ -204,18 +204,18 @@ public static CardInfo SetEmissivePortrait(this CardInfo info, Sprite sprite) } /// - /// Retrieves the given CardInfo's emissive portrait. + /// Retrieves the given 's emissive portrait. /// - /// The CardInfo to access. + /// The to access. /// Null if there is no emissive portrait. public static Sprite GetEmissivePortrait(this CardInfo info) => info.portraitTex.GetEmissionSprite(); /// /// Sets the emissive alternate portrait for the card. This can only be done after the alternate portrait has been set (SetAltPortrait). /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveAltPortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveAltPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -224,10 +224,10 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, string pathToA /// /// Sets the emissive alternate portrait for the card. This can only be done after the alternate portrait has been set (SetAltPortrait). /// - /// CardInfo to access. + /// to access. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveAltPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -236,9 +236,9 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Texture2D port /// /// Sets the emissive alternate portrait for the card. This can only be done after the alternate portrait has been set (SetAltPortrait). /// - /// CardInfo to access. + /// to access. /// The sprite containing the emission. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrait) { if (info.alternatePortrait == null) @@ -250,9 +250,9 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrai } /// - /// Retrives the given CardInfo's emissive alternate portrait. + /// Retrives the given 's emissive alternate portrait. /// - /// The CardInfo to access. + /// The to access. /// Null if there is no emissive alternate portrait. public static Sprite GetEmissiveAltPortrait(this CardInfo info) => info.alternatePortrait.GetEmissionSprite(); @@ -262,9 +262,9 @@ public static CardInfo SetEmissiveAltPortrait(this CardInfo info, Sprite portrai /// /// Sets the card's pixel portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelPortrait(this CardInfo info, string pathToArt) { return info.SetPixelPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -273,10 +273,10 @@ public static CardInfo SetPixelPortrait(this CardInfo info, string pathToArt) /// /// Sets the card's pixel portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -285,9 +285,9 @@ public static CardInfo SetPixelPortrait(this CardInfo info, Texture2D portrait, /// /// Sets the card's pixel portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelPortrait(this CardInfo info, Sprite portrait) { info.pixelPortrait = portrait; @@ -299,9 +299,9 @@ public static CardInfo SetPixelPortrait(this CardInfo info, Sprite portrait) } /// - /// Retrieves the given CardInfo's pixel portrait. + /// Retrieves the given 's pixel portrait. /// - /// The CardInfo to access. + /// The to access. /// Null if there is no pixel portrait. public static Sprite GetPixelPortrait(this CardInfo info) { @@ -312,11 +312,11 @@ public static Sprite GetPixelPortrait(this CardInfo info) #region LostTail /// - /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// Sets the card's lost tail portrait. This portrait is used when the card has the ability and has dodged a hit. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetLostTailPortrait(this CardInfo info, string pathToArt) { if (info.tailParams == null) @@ -328,12 +328,12 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, string pathToArt) } /// - /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// Sets the card's lost tail portrait. This portrait is used when the card has the ability and has dodged a hit. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetLostTailPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { if (info.tailParams == null) @@ -345,11 +345,11 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, Texture2D portrai } /// - /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// Sets the card's lost tail portrait. This portrait is used when the card has the ability and has dodged a hit. /// - /// CardInfo to access. + /// to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetLostTailPortrait(this CardInfo info, Sprite portrait) { if (info.tailParams == null) @@ -363,9 +363,9 @@ public static CardInfo SetLostTailPortrait(this CardInfo info, Sprite portrait) /// /// 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. + /// 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. + /// The same so a chain can continue. public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, string pathToArt) { if (info.tailParams == null) @@ -379,10 +379,10 @@ public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, string pa /// /// 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. + /// 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. + /// The same so a chain can continue. public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { if (info.tailParams == null) @@ -396,9 +396,9 @@ public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Texture2D /// /// 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. + /// to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Sprite portrait) { if (info.tailParams == null) @@ -410,12 +410,12 @@ public static CardInfo SetEmissiveLostTailPortrait(this CardInfo info, Sprite po } /// - /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// Sets the card's lost tail portrait. This portrait is used when the card has the ability and has dodged a hit. /// - /// Tail to access. + /// to access. /// The path to the .png file containing the portrait artwork (relative to the Plugins directory). /// The card that the tail parameters belongs to. - /// The same TailParams so a chain can continue. + /// The same so a chain can continue. public static TailParams SetLostTailPortrait(this TailParams info, string pathToArt, CardInfo owner) { owner.tailParams = info; @@ -423,13 +423,13 @@ public static TailParams SetLostTailPortrait(this TailParams info, string pathTo } /// - /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// Sets the card's lost tail portrait. This portrait is used when the card has the ability and has dodged a hit. /// - /// Tail to access. + /// to access. /// The texture containing the card portrait. /// The filter mode for the texture, or null if no change. /// The card that the tail parameters belongs to. - /// The same TailParams so a chain can continue. + /// The same so a chain can continue. public static TailParams SetLostTailPortrait(this TailParams info, Texture2D portrait, CardInfo owner, FilterMode? filterMode = null) { var tailSprite = !filterMode.HasValue @@ -440,12 +440,12 @@ public static TailParams SetLostTailPortrait(this TailParams info, Texture2D por } /// - /// Sets the card's lost tail portrait. This portrait is used when the card has the TailOnHit ability and has dodged a hit. + /// Sets the card's lost tail portrait. This portrait is used when the card has the ability and has dodged a hit. /// - /// Tail to access. + /// to access. /// The sprite containing the card portrait. /// The card that the tail parameters belongs to. - /// The same TailParams so a chain can continue. + /// The same so a chain can continue. public static TailParams SetLostTailPortrait(this TailParams info, Sprite portrait, CardInfo owner) { info.tailLostPortrait = portrait; @@ -461,9 +461,9 @@ public static TailParams SetLostTailPortrait(this TailParams info, Sprite portra /// /// 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. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same TailParams so a chain can continue. + /// The same so a chain can continue. public static TailParams SetEmissiveLostTailPortrait(this TailParams info, string pathToArt) { return info.SetEmissiveLostTailPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -472,10 +472,10 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, strin /// /// 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. + /// 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. + /// The same 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)); @@ -484,9 +484,9 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Textu /// /// 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. + /// to access. /// The Sprite containing the card portrait. - /// The same TailParams so a chain can continue. + /// The same so a chain can continue. public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprite portrait) { if (info.tailLostPortrait == null) @@ -497,9 +497,9 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprit } /// - /// Retrieves the given CardInfo's emissive tail lost portrait. + /// Retrieves the given 's emissive tail lost portrait. /// - /// The CardInfo to access. + /// The to access. /// Null if there is no emissive tail lost portrait. public static Sprite GetEmissiveTailLostPortrait(this TailParams info) => info.tailLostPortrait?.GetEmissionSprite(); @@ -509,9 +509,9 @@ public static TailParams SetEmissiveLostTailPortrait(this TailParams info, Sprit /// /// Sets the card's pixel alternate portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelAlternatePortrait(this CardInfo info, string pathToArt) { return info.SetPixelAlternatePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -519,10 +519,10 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, string path /// /// Sets the card's pixel alternate portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelAlternatePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -530,9 +530,9 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Texture2D p /// /// Sets the card's pixel alternate portrait. This portrait is used when the card is displayed in GBC mode (Act 2). /// - /// CardInfo to access. + /// to access. /// The sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -543,43 +543,43 @@ public static CardInfo SetPixelAlternatePortrait(this CardInfo info, Sprite port } /// - /// Retrieves the given CardInfo's alternate Act 2 portrait. + /// Retrieves the given 's alternate Act 2 portrait. /// - /// The CardInfo to access. + /// The to access. /// Null if there is no alternate pixel portrait. public static Sprite GetPixelAlternatePortrait(this CardInfo info) => info.PixelAlternatePortrait(); #endregion #region Steel Trap Alt /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, string pathToArt) { return info.SetSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetSteelTrapPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// to access. /// The Sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -590,33 +590,33 @@ public static CardInfo SetSteelTrapPortrait(this CardInfo info, Sprite portrait) } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, string pathToArt) { return info.SetPixelSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelSteelTrapPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// to access. /// The Sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -629,32 +629,32 @@ public static CardInfo SetPixelSteelTrapPortrait(this CardInfo info, Sprite port /// /// Sets the emissive steel trap portrait for the card. This can only be done after the default steel trap portrait has been set (SetSteelTrapPortrait). /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveSteelTrapPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveSteelTrapPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); } /// - /// Sets the card's alternate steep trap portrait. This portrait is only used when the Steel Trap ability triggers in Act 2. + /// Sets the card's alternate steep trap portrait. This portrait is only used when the ability triggers in Act 2. /// - /// CardInfo to access. + /// to access. /// The Sprite containing the card portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite portrait) { if (info.SteelTrapPortrait() == null) @@ -665,7 +665,7 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite p } /// - /// Retrieves the given CardInfo's emissive steel trap portrait. + /// Retrieves the given 's emissive steel trap portrait. /// /// /// Null if there is no emissive steel trap portrait. @@ -674,34 +674,34 @@ public static CardInfo SetEmissiveSteelTrapPortrait(this CardInfo info, Sprite p #region Shield Alt /// - /// Sets the card's alternate broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. + /// Sets the card's alternate broken shield portrait. This portrait is only used when a card with this has its shield broken. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, string pathToArt) { return info.SetBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); } /// - /// Sets the card's broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. + /// Sets the card's broken shield portrait. This portrait is only used when a card with this has its shield broken. /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetBrokenShieldPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); } /// - /// Sets the card's broken shield portrait. This portrait is only used when a card with this CardInfo has its shield broken. + /// Sets the card's broken shield portrait. This portrait is only used when a card with this has its shield broken. /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Portrait. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -714,9 +714,9 @@ public static CardInfo SetBrokenShieldPortrait(this CardInfo info, Sprite portra /// /// Sets the card's alternate pixel broken shield portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, string pathToArt) { return info.SetPixelBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -725,10 +725,10 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, string p /// /// Sets the card's broken shield portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelBrokenShieldPortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -737,9 +737,9 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Texture2 /// /// Sets the card's broken shield portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -752,9 +752,9 @@ public static CardInfo SetPixelBrokenShieldPortrait(this CardInfo info, Sprite p /// /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveBrokenShieldPortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -763,10 +763,10 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, strin /// /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveBrokenShieldPortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -775,9 +775,9 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Textu /// /// Sets the emissive broken shield portrait for the card. This can only be done after the default broken shield portrait has been set (SetBrokenShieldPortrait). /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprite portrait) { if (info.BrokenShieldPortrait() == null) @@ -788,41 +788,41 @@ public static CardInfo SetEmissiveBrokenShieldPortrait(this CardInfo info, Sprit } /// - /// Retrieves the given CardInfo's emissive broken shield portrait. + /// Retrieves the given 's emissive broken shield portrait. /// - /// The CardInfo to access. + /// The to access. /// Null if there is no emissive broken shield portrait. public static Sprite GetEmissiveBrokenShieldPortrait(this CardInfo info) => info.BrokenShieldPortrait()?.GetEmissionSprite(); #endregion #region Sacrifice Alt /// - /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. + /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this is on the board when the player is selecting sacrifices. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, string pathToArt) { return info.SetSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); } /// - /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. + /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this is on the board when the player is selecting sacrifices. /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Texture. /// Filter mode to apply to the texture in-game. Defaults to Point. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetSacrificablePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.CardPortrait, filterMode ?? default)); } /// - /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this CardInfo is on the board when the player is selecting sacrifices. + /// Sets the card's alternate sacricable portrait. This portrait is only used when a card with this is on the board when the player is selecting sacrifices. /// - /// CardInfo to access. + /// to access. /// The sacrificable portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetSacrificablePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -835,9 +835,9 @@ public static CardInfo SetSacrificablePortrait(this CardInfo info, Sprite portra /// /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// 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. + /// The same so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, string pathToArt) { return info.SetPixelSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -846,10 +846,10 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, string p /// /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// to access. /// The card portrait's Texture. /// The filter mode applied to the portrait in-game (defaults to Point). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetPixelSacrificablePortrait(portrait.ConvertTexture(TextureHelper.SpriteType.PixelPortrait, filterMode ?? default)); @@ -858,9 +858,9 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Texture2 /// /// Sets the card's pixel sacrificable portrait. This portrait is only used in Act 2. /// - /// CardInfo to access. + /// to access. /// The card portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Sprite portrait) { if (!string.IsNullOrEmpty(info.name)) @@ -873,9 +873,9 @@ public static CardInfo SetPixelSacrificablePortrait(this CardInfo info, Sprite p /// /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// - /// CardInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, string pathToArt) { return info.SetEmissiveSacrificablePortrait(TextureHelper.GetImageAsTexture(pathToArt)); @@ -884,10 +884,10 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, strin /// /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// - /// CardInfo to access. + /// to access. /// The card portrait's Texture. /// The filter mode applied to the portrait in-game (defaults to Point). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetEmissiveSacrificablePortrait(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -896,9 +896,9 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Textu /// /// Sets the emissive sacrificable portrait for the card. This can only be done after the sacrificable portrait has been set (SetSacrifablePortrait). /// - /// CardInfo to access. + /// to access. /// The card portrait's Sprite. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprite portrait) { if (info.SacrificablePortrait() == null) @@ -908,19 +908,19 @@ public static CardInfo SetEmissiveSacrificablePortrait(this CardInfo info, Sprit return info; } /// - /// Retrieves the given CardInfo's sacrificable portrait's emission. + /// Retrieves the given 's sacrificable portrait's emission. /// /// - /// The CardInfo's emissive sacrificable portrait, or null if one doesn't exist. + /// The 's emissive sacrificable portrait, or null if one doesn't exist. public static Sprite GetEmissiveSacrificablePortrait(this CardInfo info) => info.SacrificablePortrait().GetEmissionSprite(); #endregion /// - /// Sets the animated portrait for the given CardInfo. + /// Sets the animated portrait for the given . /// - /// CardInfo to access. + /// to access. /// The to check for. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetAnimatedPortrait(this CardInfo info, GameObject portrait) { info.animatedPortrait = portrait; @@ -928,47 +928,47 @@ public static CardInfo SetAnimatedPortrait(this CardInfo info, GameObject portra } /// - /// Returns whether or not the given PlayableCard's CardInfo has an alternate card portrait. + /// Returns whether or not this card has an alternate card portrait. /// public static bool HasAlternatePortrait(this PlayableCard card) => card.Info.HasAlternatePortrait(); /// - /// Returns whether or not the given CardInfo has an alternate card portrait. + /// Returns whether or not the given has an alternate card portrait. /// public static bool HasAlternatePortrait(this CardInfo info) => info.alternatePortrait != null; /// - /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait. + /// Returns whether or not the given has an alternate Act 2 card portrait. /// public static bool HasPixelAlternatePortrait(this CardInfo info) => info.PixelAlternatePortrait() != null; /// - /// Returns whether or not the given CardInfo has an alternate Steel Trap card portrait for when Steel Trap triggers on a card. + /// Returns whether or not the given has an alternate Steel Trap card portrait for when Steel Trap triggers on a card. /// public static bool HasSteelTrapPortrait(this CardInfo info) => info.SteelTrapPortrait() != null; /// - /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when Steel Trap triggers on a card. + /// Returns whether or not the given has an alternate Act 2 card portrait for when Steel Trap triggers on a card. /// public static bool HasPixelSteelTrapPortrait(this CardInfo info) => info.PixelSteelTrapPortrait() != null; /// - /// Returns whether or not the given CardInfo has an alternate card portrait for when a card's shield is broken. + /// Returns whether or not the given has an alternate card portrait for when a card's shield is broken. /// public static bool HasBrokenShieldPortrait(this CardInfo info) => info.BrokenShieldPortrait() != null; /// - /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when a card's shield is broken. + /// Returns whether or not the given has an alternate Act 2 card portrait for when a card's shield is broken. /// public static bool HasPixelBrokenShieldPortrait(this CardInfo info) => info.PixelBrokenShieldPortrait() != null; /// - /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when a card can be sacrificed. + /// Returns whether or not the given has an alternate Act 2 card portrait for when a card can be sacrificed. /// public static bool HasSacrificablePortrait(this CardInfo info) => info.SacrificablePortrait() != null; /// - /// Returns whether or not the given CardInfo has an alternate Act 2 card portrait for when a card can be sacrificed. + /// Returns whether or not the given has an alternate Act 2 card portrait for when a card can be sacrificed. /// public static bool HasPixelSacrificablePortrait(this CardInfo info) => info.PixelSacrificablePortrait() != null; } \ No newline at end of file diff --git a/InscryptionAPI/Card/CardExtensionsProperties.cs b/InscryptionAPI/Card/CardExtensionsProperties.cs index b20ebc884..54c1630a0 100644 --- a/InscryptionAPI/Card/CardExtensionsProperties.cs +++ b/InscryptionAPI/Card/CardExtensionsProperties.cs @@ -9,10 +9,10 @@ public static partial class CardExtensions { /// /// Adds a custom property value to the card. /// - /// CardInfo to access. + /// to access. /// The name of the property to set. /// The value of the property. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetExtendedProperty(this CardInfo info, string propertyName, object value) { info.GetCardExtensionTable()[propertyName] = value?.ToString(); @@ -22,7 +22,7 @@ public static CardInfo SetExtendedProperty(this CardInfo info, string propertyNa /// /// Gets a custom property value from the card. /// - /// CardInfo to access. + /// to access. /// The name of the property to get the value of. /// The custom property value as a string. If it doesn't exist, returns null. public static string GetExtendedProperty(this CardInfo info, string propertyName) @@ -34,7 +34,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Gets a custom property as a nullable int. /// - /// CardInfo to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as an int or null if it didn't exist or couldn't be parsed as int. public static int? GetExtendedPropertyAsInt(this CardInfo info, string propertyName) @@ -46,7 +46,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Gets a custom property as a nullable float. /// - /// CardInfo to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as a float or null if it didn't exist or couldn't be parsed as float. public static float? GetExtendedPropertyAsFloat(this CardInfo info, string propertyName) @@ -58,7 +58,7 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Gets a custom property as a nullable boolean. /// - /// CardInfo to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as a boolean or null if it didn't exist or couldn't be parsed as boolean. public static bool? GetExtendedPropertyAsBool(this CardInfo info, string propertyName) @@ -71,22 +71,22 @@ public static string GetExtendedProperty(this CardInfo info, string propertyName /// /// Checks if this card will be killed by the effect of Tidal Lock. /// - /// PlayableCard to access. + /// to access. /// True if the card is affected by Tidal Lock. public static bool IsAffectedByTidalLock(this PlayableCard item) => item.Info.IsAffectedByTidalLock(); /// /// Checks if this card info will be killed by the effect of Tidal Lock. /// - /// CardInfo to access. + /// to access. /// True if the card info is affected by Tidal Lock. public static bool IsAffectedByTidalLock(this CardInfo info) => info.GetExtendedPropertyAsBool("AffectedByTidalLock") ?? false; /// /// Sets whether the card should be killed by Tidal Lock's effect. /// - /// CardInfo to access. + /// to access. /// Whether or not this card should be affected by Tidal Lock. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetAffectedByTidalLock(this CardInfo info, bool affectedByTidalLock = true) { info.SetExtendedProperty("AffectedByTidalLock", affectedByTidalLock); @@ -98,22 +98,22 @@ public static CardInfo SetAffectedByTidalLock(this CardInfo info, bool affectedB /// /// Gets the string value of the extended property TransformerCardId. Can be null. /// - /// PlayableCard to access. + /// to access. /// The string value of the extended property TransformerCardId. public static string GetTransformerCardId(this PlayableCard item) => item.Info.GetTransformerCardId(); /// /// Gets the string value of the extended property TransformerCardId. Can be null. /// - /// CardInfo to access. + /// to access. /// The string value of the extended property TransformerCardId. public static string GetTransformerCardId(this CardInfo info) => info.GetExtendedProperty("TransformerCardId"); /// /// Sets whether the card should be killed by Tidal Lock's effect. /// - /// CardInfo to access. + /// to access. /// The internal name of the card this card should transform into. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTransformerCardId(this CardInfo info, string transformerCardId) { info.SetExtendedProperty("TransformerCardId", transformerCardId); @@ -124,38 +124,38 @@ public static CardInfo SetTransformerCardId(this CardInfo info, string transform #region Custom Costs /// - /// Determines if the given CardInfo has the given custom card cost. + /// Determines if the given has the given custom card cost. /// - /// The CardInfo to access. + /// The to access. /// The custom card cost to check for. - /// True if the CardInfo needs the given custom cost to be played. + /// True if the needs the given custom cost to be played. public static bool HasCustomCost(this CardInfo info, FullCardCost customCost) => info.GetCustomCost(customCost) != 0; /// - /// Sets a card's custom cost property using the provided FullCardCost object as a reference. + /// Sets a card's custom cost property using the provided object as a reference. /// - /// The CardInfo to modify. - /// The FullCardCost representing the cost we want to set. - /// How much of the custom cost the CardInfo should need to be played. - /// The same CardInfo so a chain can continue. + /// The to modify. + /// The representing the cost we want to set. + /// How much of the custom cost the should need to be played. + /// The same so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, FullCardCost customCost, int amount) => info.SetCustomCost(customCost.CostName, amount); /// /// A variant of intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. /// - /// The CardInfo to modify. + /// The to modify. /// The name of the cost we want to set. - /// How much of the custom cost the CardInfo should need to be played. - /// The same CardInfo so a chain can continue. + /// How much of the custom cost the should need to be played. + /// The same so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, string costName, int amount) => info.SetExtendedProperty(costName, amount); /// /// A variant of intended to be used to set properties representing custom costs. Primarily provided for clarity of purpose. /// - /// The CardInfo to modify. - /// The class of the cost we want to set. - /// How much of the custom cost the CardInfo should need to be played. - /// The same CardInfo so a chain can continue. + /// The to modify. + /// The we want to set. + /// How much of the custom cost the should need to be played. + /// The same so a chain can continue. public static CardInfo SetCustomCost(this CardInfo info, int amount) where T : CustomCardCost { FullCardCost cost = CardCostManager.AllCustomCosts.Find(x => x.CostBehaviour == typeof(T)); @@ -165,7 +165,7 @@ public static CardInfo SetCustomCost(this CardInfo info, int amount) where T /// /// Variant of that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. /// - /// The PlayableCard to access. + /// The to access. /// The name of the custom card cost. /// How much of the given cost is needed for the given card to be played. public static int GetCustomCostAmount(this PlayableCard card, string costName) => card.Info.GetCustomCostAmount(costName); @@ -173,24 +173,24 @@ public static CardInfo SetCustomCost(this CardInfo info, int amount) where T /// /// Variant of that automatically retrieves the given cost's canBeNegative value when retrieving the cost amount. /// - /// The CardInfo to access. + /// The to access. /// The name of the custom card cost. /// How much of the given cost is needed for the given card to be played. public static int GetCustomCostAmount(this CardInfo cardInfo, string costName) => cardInfo.GetCustomCost(costName, AllCustomCosts.Find(x => x.CostName == costName).CanBeNegative); /// - /// Retrieves the given PlayableCard's custom card cost amount. + /// Retrieves the given 's custom card cost amount. /// - /// The PlayableCard to access. + /// The to access. /// The name of the custom card cost. /// Whether the card cost amount can be negative. If false, returns 0 for negative cost values. /// How much of the given cost is needed for the given card to be played. public static int GetCustomCost(this PlayableCard card, string costName, bool canBeNegative = false) => card.Info.GetCustomCost(costName, canBeNegative); /// - /// Retrieves the given CardInfo's custom card cost amount. + /// Retrieves the given 's custom card cost amount. /// - /// The CardInfo to access. + /// The to access. /// The name of the custom card cost. /// Whether the card cost amount can be negative. If false, returns 0 for negative cost values. /// How much of the given cost is needed for the given card to be played. @@ -208,10 +208,10 @@ public static int GetCustomCost(this CardInfo cardInfo, string costName, bool ca } /// - /// Retrieves the custom card cost amount of the given class Type from the given PlayableCard. + /// Retrieves the custom card cost amount of the given class Type from the given . /// /// The class of the card cost to check. - /// The PlayableCard to access. + /// The to access. /// If the returned value can be negative. If false, returns 0 instead. /// The card cost amount this card costs. public static int GetCustomCost(this PlayableCard card, bool canBeNegative = false) where T : CustomCardCost @@ -221,10 +221,10 @@ public static int GetCustomCost(this PlayableCard card, bool canBeNegative = } /// - /// Retrieves the custom card cost amount of the given class Type from the given CardInfo. + /// Retrieves the custom card cost amount of the given class Type from the given . /// /// The class of the card cost to check. - /// The CardInfo to access. + /// The to access. /// If the returned value can be negative. If false, returns 0 instead. /// The card cost amount this card costs. public static int GetCustomCost(this CardInfo cardInfo, bool canBeNegative = false) where T : CustomCardCost @@ -234,10 +234,10 @@ public static int GetCustomCost(this CardInfo cardInfo, bool canBeNegative = } /// - /// Retrieves the custom card cost amount of the given class Type from the given PlayableCard. + /// Retrieves the custom card cost amount of the given class Type from the given . /// /// The class of the card cost to check. - /// The PlayableCard to access. + /// The to access. /// The card cost amount this card costs. public static int GetCustomCostAmount(this PlayableCard card) where T : CustomCardCost { @@ -246,10 +246,10 @@ public static int GetCustomCostAmount(this PlayableCard card) where T : Custo } /// - /// Retrieves the custom card cost amount of the given class Type from the given CardInfo. + /// Retrieves the custom card cost amount of the given class Type from the given . /// /// The class of the card cost to check. - /// The CardInfo to access. + /// The to access. /// The card cost amount this card costs. public static int GetCustomCostAmount(this CardInfo cardInfo) where T : CustomCardCost { @@ -258,10 +258,10 @@ public static int GetCustomCostAmount(this CardInfo cardInfo) where T : Custo } /// - /// Retrieves the given custom card cost amount from the given PlayableCard. + /// Retrieves the given custom card cost amount from the given . /// Only returns negative values if the custom cost allows it. /// - /// The PlayableCard to access. + /// The to access. /// The custom card cost to check for. /// The card cost amount this card costs. public static int GetCustomCost(this PlayableCard card, FullCardCost fullCardCost) @@ -269,10 +269,10 @@ public static int GetCustomCost(this PlayableCard card, FullCardCost fullCardCos return card.GetCustomCostAmount(fullCardCost.CostName); } /// - /// Retrieves the given custom card cost amount from the given CardInfo. + /// Retrieves the given custom card cost amount from the given . /// Only returns negative values if the custom cost allows it. /// - /// The CardInfo to access. + /// The to access. /// The custom card cost to check for. /// The card cost amount this card costs. public static int GetCustomCost(this CardInfo cardInfo, FullCardCost fullCardCost) @@ -280,10 +280,10 @@ public static int GetCustomCost(this CardInfo cardInfo, FullCardCost fullCardCos return cardInfo.GetCustomCostAmount(fullCardCost.CostName); } /// - /// Retrieves all custom card costs from the given Card. + /// Retrieves all custom card costs from the given . /// - /// The Card to access. - /// A List of CustomCardCost objects for each custom cost the Card needs to be played. + /// The to access. + /// A List of objects for each custom cost the needs to be played. public static List GetCustomCardCosts(this DiskCardGame.Card card) { try @@ -308,10 +308,10 @@ public static List GetCustomCardCosts(this DiskCardGame.Card car } /// - /// Retrieves all custom card costs from the given CardInfo. + /// Retrieves all custom card costs from the given . /// - /// The CardInfo to access. - /// A List of CustomCardCost objects for each custom cost the CardInfo needs to be played. + /// The to access. + /// A List of objects for each custom cost the needs to be played. public static List GetCustomCosts(this CardInfo info) { List costs = new(); @@ -331,27 +331,27 @@ public static List GetCustomCosts(this CardInfo info) #region SteelTrapPelt /// - /// Set the Pelt that should be given when this card is slain by a trap. + /// Set the pelt card that should be given when this card is killed by the ability. /// - /// The Card this is being applied to. - /// The Card to be given to the Player on Death by Trap + /// The card this is being applied to. + /// The card to be given to the Player on Death by Trap public static void SetSteelTrapPelt(this PlayableCard card, string peltName) => SetSteelTrapPelt(card.Info, peltName); /// - /// Get the Pelt that should be given when this card is slain by a trap. + /// Set the pelt card that should be given when this card is killed by the ability. /// - /// The Card this is being applied to. + /// The card this is being applied to. /// A string representing the Pelt that should be returned. public static string GetSteelTrapPelt(this PlayableCard card) => GetSteelTrapPelt(card.Info); /// - /// Set the Pelt that should be given when this card is slain by a trap. + /// Set the pelt card that should be given when this card is killed by the ability. /// - /// The CardInfo this is being applied to. + /// The this is being applied to. /// The Card to be given to the Player on Death by Trap public static void SetSteelTrapPelt(this CardInfo cardInfo, string peltName) => cardInfo.SetExtendedProperty("SteelTrapPelt", peltName); /// - /// Get the Pelt that should be given when this card is slain by a trap. + /// Set the pelt card that should be given when this card is killed by the ability. /// - /// The CardInfo this is being applied to. + /// The this is being applied to. /// A string representing the Pelt that should be returned. public static string GetSteelTrapPelt(this CardInfo cardInfo) => cardInfo.GetExtendedProperty("SteelTrapPelt"); diff --git a/InscryptionAPI/Card/CardExtensionsSetters.cs b/InscryptionAPI/Card/CardExtensionsSetters.cs index d43b43151..608589d1f 100644 --- a/InscryptionAPI/Card/CardExtensionsSetters.cs +++ b/InscryptionAPI/Card/CardExtensionsSetters.cs @@ -11,12 +11,12 @@ public static partial class CardExtensions /// /// Sets a number of basic properties of the card /// - /// CardInfo to access. + /// to access. /// Displayed name of the card. /// Attack of the card. /// Health of the card. /// The description that plays when the card is seen for the first time. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetBasic(this CardInfo info, string displayedName, int attack, int health, string description = default) { info.displayedName = displayedName; @@ -29,10 +29,10 @@ public static CardInfo SetBasic(this CardInfo info, string displayedName, int at /// /// Sets the base attack and health of the card. /// - /// CardInfo to access. + /// to access. /// The base attack for the card. /// The base health for the card. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetBaseAttackAndHealth(this CardInfo info, int? baseAttack = 0, int? baseHealth = 0) { if (baseAttack.HasValue) @@ -48,9 +48,9 @@ public static CardInfo SetBaseAttackAndHealth(this CardInfo info, int? baseAttac /// Sets the CardTemple for the card. Used to determine what cards are obtainable in each Act. /// Act 1 uses Nature cards, Act 2 uses all Temples for each region, Act 3 uses Tech cards. /// - /// CardInfo to access. + /// to access. /// The CardTemple to use. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetCardTemple(this CardInfo info, CardTemple temple) { info.temple = temple; @@ -63,9 +63,9 @@ public static CardInfo SetCardTemple(this CardInfo info, CardTemple temple) /// Intermediate: unlocked after the second tutorial /// Advanced: unlocked after the third tutorial if all its abilities have been learned /// - /// CardInfo to access. + /// to access. /// The CardComplexity to use. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetCardComplexity(this CardInfo info, CardComplexity complexity) { info.cardComplexity = complexity; @@ -75,9 +75,9 @@ public static CardInfo SetCardComplexity(this CardInfo info, CardComplexity comp /// /// Sets the displayed name of the card. /// - /// CardInfo to access. + /// to access. /// The displayed name for the card. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetDisplayedName(this CardInfo info, string displayedName) { info.displayedName = displayedName.IsNullOrWhitespace() ? "" : displayedName; @@ -87,10 +87,10 @@ public static CardInfo SetDisplayedName(this CardInfo info, string displayedName /// /// Sets the name of the card. /// - /// CardInfo to access. + /// to access. /// The name for the card. /// The string that will be prefixed to the card name if it doesn't already exist. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetName(this CardInfo info, string name, string modPrefix = default) { info.name = !string.IsNullOrEmpty(modPrefix) && !name.StartsWith(modPrefix) ? $"{modPrefix}_{name}" : name; @@ -100,11 +100,11 @@ public static CardInfo SetName(this CardInfo info, string name, string modPrefix /// /// Sets the card name and displayed name of the card. /// - /// CardInfo to access. + /// to access. /// The name for the card. /// The displayed name for the card. /// The string that will be prefixed to the card name if it doesn't already exist. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetNames(this CardInfo info, string name, string displayedName, string modPrefix = default) { info.SetDisplayedName(displayedName); @@ -112,11 +112,11 @@ public static CardInfo SetNames(this CardInfo info, string name, string displaye } /// - /// Sets the CardInfo's special abilities field to any number of special abilities to the card. + /// Sets the 's special abilities field to any number of special abilities to the card. /// - /// CardInfo to access. + /// to access. /// The abilities to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetSpecialAbilities(this CardInfo info, params SpecialTriggeredAbility[] abilities) { info.specialAbilities = abilities?.ToList(); @@ -126,9 +126,9 @@ public static CardInfo SetSpecialAbilities(this CardInfo info, params SpecialTri /// /// Sets the stat icon to the card. /// - /// CardInfo to access. + /// to access. /// The stat icon to set. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetStatIcon(this CardInfo info, SpecialStatIcon statIcon) { info.specialStatIcon = statIcon; @@ -139,9 +139,9 @@ public static CardInfo SetStatIcon(this CardInfo info, SpecialStatIcon statIcon) /// /// Sets any number of traits to the card. /// - /// CardInfo to access. + /// to access. /// The traits to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTraits(this CardInfo info, params Trait[] traits) { info.traits = traits?.ToList(); @@ -152,9 +152,9 @@ public static CardInfo SetTraits(this CardInfo info, params Trait[] traits) /// /// Set any number of tribes to the card. /// - /// CardInfo to access. + /// to access. /// The tribes to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTribes(this CardInfo info, params Tribe[] tribes) { info.tribes = tribes?.ToList(); @@ -164,9 +164,9 @@ public static CardInfo SetTribes(this CardInfo info, params Tribe[] tribes) /// /// Sets whether the card should be Gemified or not. Can and will un-Gemify cards. /// - /// CardInfo to access. + /// to access. /// Whether the card should be gemified. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetGemify(this CardInfo info, bool gemify = true) { if (gemify && !info.Mods.Exists(x => x.gemify)) @@ -181,10 +181,11 @@ public static CardInfo SetGemify(this CardInfo info, bool gemify = true) #region MetaCategories /// - /// Sets the card to behave as a "normal" card in Part 1. The CardTemple is Nature and it will appear in choice nodes and trader nodes. + /// Sets the card to behave as a "normal" card in Part 1. + /// The CardTemple is Nature and it will appear in choice nodes and trader nodes. /// - /// CardInfo to access. - /// The same CardInfo so a chain can continue. + /// to access. + /// The same so a chain can continue. public static CardInfo SetDefaultPart1Card(this CardInfo info) { if (!info.metaCategories.Contains(CardMetaCategory.Rare)) @@ -197,10 +198,11 @@ public static CardInfo SetDefaultPart1Card(this CardInfo info) } /// - /// Sets the card to behave as a "normal" card in Part 3. The CardTemple is Tech and it will appear in choice nodes and as a potential random card from GiftBot. + /// Sets the card to behave as a "normal" card in Part 3. + /// The CardTemple is Tech and it will appear in choice nodes and as a potential random card from GiftBot. /// - /// CardInfo to access. - /// The same CardInfo so a chain can continue. + /// to access. + /// The same so a chain can continue. public static CardInfo SetDefaultPart3Card(this CardInfo info) { if (!info.metaCategories.Contains(CardMetaCategory.Rare)) @@ -215,9 +217,9 @@ public static CardInfo SetDefaultPart3Card(this CardInfo info) /// /// Makes the card fully playable in GBC mode and able to appear in card packs. /// - /// CardInfo to access. + /// to access. /// The temple that the card will exist under. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetGBCPlayable(this CardInfo info, CardTemple temple) { info.AddMetaCategories(CardMetaCategory.GBCPack, CardMetaCategory.GBCPlayable); @@ -229,8 +231,8 @@ public static CardInfo SetGBCPlayable(this CardInfo info, CardTemple temple) /// /// Sets the card so it shows up for rare card choices and applies the rare background. /// - /// CardInfo to access. - /// The same CardInfo so a chain can continue. + /// to access. + /// The same so a chain can continue. public static CardInfo SetRare(this CardInfo info) { info.AddMetaCategories(CardMetaCategory.Rare); @@ -249,8 +251,8 @@ public static CardInfo SetRare(this CardInfo info) /// /// Adds the terrain trait and background to this card. /// - /// Card to access. - /// The same card info so a chain can continue. + /// to access. + /// The same so a chain can continue. public static CardInfo SetTerrain(this CardInfo info) { info.AddTraits(Trait.Terrain); @@ -258,11 +260,11 @@ public static CardInfo SetTerrain(this CardInfo info) return info; } /// - /// Adds the Terrain trait and background to this card, with the option to not use TerrainLayout. + /// Adds the Terrain trait and background to this card, with the option to not use . /// - /// CardInfo to access. - /// Whether or not the CardInfo should be given the TerrainLayout appearance behaviour. - /// The same CardInfo so a chain can continue. + /// to access. + /// Whether or not the should be given the appearance behaviour. + /// The same so a chain can continue. public static CardInfo SetTerrain(this CardInfo info, bool useTerrainLayout) { info.AddTraits(Trait.Terrain); @@ -273,11 +275,11 @@ public static CardInfo SetTerrain(this CardInfo info, bool useTerrainLayout) } /// - /// Adds the Pelt trait and background to this card, and optionally adds the SpawnLice special ability. + /// Adds the Pelt trait and background to this card, and optionally adds the special ability. /// - /// CardInfo to access. - /// Whether or not the given CardInfo should also spawn lice. - /// The same CardInfo so a chain can continue. + /// to access. + /// Whether or not the given should also spawn lice. + /// The same so a chain can continue. public static CardInfo SetPelt(this CardInfo info, bool spawnLice = true) { info.AddTraits(Trait.Pelt); @@ -291,13 +293,13 @@ public static CardInfo SetPelt(this CardInfo info, bool spawnLice = true) #region EvolveIceCubeTail /// - /// Sets the evolve parameters of the card. These parameters are used to make the Evolve ability function correctly. + /// Sets the evolve parameters of the card. These parameters are used to make the ability function correctly. /// - /// CardInfo to access. + /// to access. /// The card that will be generated after the set number of turns. /// The number of turns before the card evolves. /// A set of card mods to be applied to the evolved card. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEvolve(this CardInfo info, CardInfo evolveCard, int numberOfTurns, IEnumerable mods = null) { info.evolveParams = new() @@ -316,14 +318,14 @@ public static CardInfo SetEvolve(this CardInfo info, CardInfo evolveCard, int nu } /// - /// Sets the evolve parameters of the card. These parameters are used to make the Evolve ability function correctly. + /// Sets the evolve parameters of the card. These parameters are used to make the ability function correctly. /// This function uses delayed loading to attach the evolution to the card, so if the evolve card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// to access. /// The name of card that will be generated after the set number of turns. /// The number of turns before the card evolves. /// A set of card mods to be applied to the evolved card. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEvolve(this CardInfo info, string evolveInto, int numberOfTurns, IEnumerable mods = null) { CardInfo evolution = CardManager.AllCardsCopy.CardByName(evolveInto); @@ -354,9 +356,9 @@ public static CardInfo SetEvolve(this CardInfo info, string evolveInto, int numb /// /// Sets the default evolution name for the card. This is the name used when the card doesn't evolve into another card. /// - /// CardInfo to access. + /// to access. /// The default evolution name to use. Pass in 'null' to use the vanilla default. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetDefaultEvolutionName(this CardInfo info, string defaultName) { info.defaultEvolutionName = defaultName; @@ -364,12 +366,12 @@ public static CardInfo SetDefaultEvolutionName(this CardInfo info, string defaul } /// - /// Sets the ice cube parameters of the card. These parameters are used to make the IceCube ability function correctly. + /// Sets the ice cube parameters of the card. These parameters are used to make the ability function correctly. /// - /// CardInfo to access. + /// to access. /// The card that will be generated when this card dies. /// A set of card mods to be applied to the ice cube contents. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetIceCube(this CardInfo info, CardInfo iceCube, IEnumerable mods = null) { info.iceCubeParams = new() @@ -387,13 +389,13 @@ public static CardInfo SetIceCube(this CardInfo info, CardInfo iceCube, IEnumera } /// - /// Sets the ice cube parameters of the card. These parameters are used to make the IceCube ability function correctly. + /// Sets the ice cube parameters of the card. These parameters are used to make the ability function correctly. /// This function uses delayed loading to attach the ice cube to the card, so if the ice cube card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// to access. /// The name of the card that will be generated when this card dies. /// A set of card mods to be applied to the ice cube contents. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetIceCube(this CardInfo info, string iceCubeName, IEnumerable mods = null) { CardInfo creatureWithin = CardManager.AllCardsCopy.CardByName(iceCubeName); @@ -423,14 +425,14 @@ public static CardInfo SetIceCube(this CardInfo info, string iceCubeName, IEnume } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// The path to the .png file containing the lost tail artwork (relative to the Plugins directory). /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTail(this CardInfo info, string tailName, string pathToLostTailArt = null, IEnumerable mods = null) { Texture2D lostTailPortrait = pathToLostTailArt == null ? null : TextureHelper.GetImageAsTexture(pathToLostTailArt); @@ -438,39 +440,39 @@ public static CardInfo SetTail(this CardInfo info, string tailName, string pathT } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTail(this CardInfo info, string tailName, IEnumerable mods = null) { return info.SetTail(tailName, tailLostPortrait: null, mods: mods); } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// - /// CardInfo to access. + /// to access. /// The card that will be generated as the "tail" when the first hit is dodged. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, IEnumerable mods = null) { return info.SetTail(tail, null, mods); } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// - /// CardInfo to access. + /// to access. /// The card that will be generated as the "tail" when the first hit is dodged. /// The texture containing the card portrait. /// The filter mode for the texture, or null if no change. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, Texture2D tailLostPortrait, FilterMode? filterMode = null, IEnumerable mods = null) { var tailLostSprite = !filterMode.HasValue @@ -480,13 +482,13 @@ public static CardInfo SetTail(this CardInfo info, CardInfo tail, Texture2D tail } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// - /// CardInfo to access. + /// to access. /// The card that will be generated as the "tail" when the first hit is dodged. /// The sprite containing the card portrait. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTail(this CardInfo info, CardInfo tail, Sprite tailLostPortrait, IEnumerable mods = null) { info.tailParams = new() @@ -507,15 +509,15 @@ public static CardInfo SetTail(this CardInfo info, CardInfo tail, Sprite tailLos } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// The texture containing the card portrait. /// The filter mode for the texture, or null if no change. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetTail(this CardInfo info, string tailName, Texture2D tailLostPortrait, FilterMode? filterMode = null, IEnumerable mods = null) { var tailLostSprite = !filterMode.HasValue @@ -525,14 +527,14 @@ public static CardInfo SetTail(this CardInfo info, string tailName, Texture2D ta } /// - /// Sets the tail parameters of the card. These parameters are used to make the TailOnHit ability function correctly. + /// Sets the tail parameters of the card. These parameters are used to make the ability function correctly. /// This function uses delayed loading to attach the tail to the card, so if the tail card doesn't exist yet, this function will still work. /// - /// CardInfo to access. + /// to access. /// The name of the card that will be generated as the "tail" when the first hit is dodged. /// The sprite containing the card portrait. /// A set of card mods to be applied to the tail. - /// The same CardInfo so a chain can continue.. + /// The same so a chain can continue.. public static CardInfo SetTail(this CardInfo info, string tailName, Sprite tailLostPortrait, IEnumerable mods = null) { CardInfo tail = CardManager.AllCardsCopy.CardByName(tailName); @@ -566,12 +568,12 @@ public static CardInfo SetTail(this CardInfo info, string tailName, Sprite tailL /// /// Sets the cost of the card. Any and all costs can be set this way. /// - /// CardInfo to access. + /// to access. /// The cost in blood (sacrifices). /// The cost in bones. /// The cost in energy. /// The cost in gems. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetCost(this CardInfo info, int? bloodCost = 0, int? bonesCost = 0, int? energyCost = 0, List gemsCost = null) { info.SetBloodCost(bloodCost); @@ -583,9 +585,9 @@ public static CardInfo SetCost(this CardInfo info, int? bloodCost = 0, int? bone /// /// Sets the blood cost of the card. /// - /// CardInfo to access. + /// to access. /// The cost in blood (sacrifices). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetBloodCost(this CardInfo info, int? bloodCost = 0) { if (bloodCost.HasValue) @@ -596,9 +598,9 @@ public static CardInfo SetBloodCost(this CardInfo info, int? bloodCost = 0) /// /// Sets the bones cost of the card. /// - /// CardInfo to access. + /// to access. /// The cost in bones. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetBonesCost(this CardInfo info, int? bonesCost = 0) { if (bonesCost.HasValue) @@ -609,9 +611,9 @@ public static CardInfo SetBonesCost(this CardInfo info, int? bonesCost = 0) /// /// Sets the energy cost of the card. /// - /// CardInfo to access. + /// to access. /// The cost in energy. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetEnergyCost(this CardInfo info, int? energyCost = 0) { if (energyCost.HasValue) @@ -622,9 +624,9 @@ public static CardInfo SetEnergyCost(this CardInfo info, int? energyCost = 0) /// /// Sets the gems cost of the card. /// - /// CardInfo to access. + /// to access. /// The cost in Mox. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetGemsCost(this CardInfo info, List gemsCost = null) { info.gemsCost = gemsCost ?? new(); @@ -633,9 +635,9 @@ public static CardInfo SetGemsCost(this CardInfo info, List gemsCost = /// /// Sets the gems cost of the card. /// - /// CardInfo to access. + /// to access. /// The cost in Mox. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetGemsCost(this CardInfo info, params GemType[] gemsCost) { info.gemsCost = gemsCost.ToList(); @@ -645,9 +647,9 @@ public static CardInfo SetGemsCost(this CardInfo info, params GemType[] gemsCost #region Bools /// - /// Sets the card's onePerDeck field, which controls whether the player can own multiple copies of it in their deck. + /// Sets the card's onePerDeck field, which controls whether the player can own multiple copies of it in their deck. /// - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetOnePerDeck(this CardInfo info, bool onePerDeck = true) { info.onePerDeck = onePerDeck; @@ -656,16 +658,16 @@ public static CardInfo SetOnePerDeck(this CardInfo info, bool onePerDeck = true) /// /// Sets whether or not the card's Power and Health stats will be displayed. /// - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetHideStats(this CardInfo info, bool hideStats = true) { info.hideAttackAndHealth = hideStats; return info; } /// - /// Sets whether or not the CardInfo's portrait will be flipped when Strafe and similar abilities change direction. + /// Sets whether or not the 's portrait will be flipped when and similar abilities change direction. /// - /// The same card info so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetStrafeFlipsPortrait(this CardInfo info, bool flipPortrait = true) { info.flipPortraitForStrafe = flipPortrait; @@ -676,7 +678,7 @@ public static CardInfo SetStrafeFlipsPortrait(this CardInfo info, bool flipPortr /// /// Indicates if this is a base game card or not. /// - /// CardInfo to access. + /// to access. /// True of this card came from the base game; false otherwise. public static bool IsBaseGameCard(this CardInfo info) => info.GetExtendedPropertyAsBool("BaseGameCard") ?? false; @@ -692,7 +694,7 @@ public static CardInfo SetStrafeFlipsPortrait(this CardInfo info, bool flipPortr /// /// The card. /// The custom unlock check, a func that needs to return true for the card to be unlocked. The bool argument is true when the game is in Kaycee's Mod mode and the int argument is the current Kaycee's Mod challenge level. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo SetCustomUnlockCheck(this CardInfo c, Func check) { if (check == null && CardManager.CustomCardUnlocks.ContainsKey(c.name)) diff --git a/InscryptionAPI/Card/CardManager.cs b/InscryptionAPI/Card/CardManager.cs index 43ae997ac..3b76c04e0 100644 --- a/InscryptionAPI/Card/CardManager.cs +++ b/InscryptionAPI/Card/CardManager.cs @@ -25,26 +25,26 @@ private class CardExt // Needs to be defined first so the implicit static constr public readonly Dictionary StringMap = new(); } /// - /// Class for storing the data for custom portrait Sprites added via the API. + /// Class for storing the data for custom portrait sprites added via the API. /// /// - /// Only tracks custom API portraits like sacrificable steel trap, etc. + /// Only tracks custom API portraits like sacrificable, steel trap, etc. /// public class CardAltPortraits { /// - /// Portrait sprite used when calling GetAlternatePortrait in Act 2. + /// Portrait sprite used when calling in Act 2. /// public Sprite PixelAlternatePortrait = null; /// - /// Portrait sprite used when the Steel Trap sigil is triggered. + /// Portrait sprite used when the sigil is triggered. /// /// /// Example: Leaping Trap /// public Sprite SteelTrapPortrait = null; /// - /// Portrait sprite used when the Steel Trap sigil is triggered in Act 2. + /// Portrait sprite used when the sigil is triggered in Act 2. /// public Sprite PixelSteelTrapPortrait = null; /// @@ -76,7 +76,7 @@ public class CardAltPortraits internal static readonly Dictionary> CustomCardUnlocks = new(); /// - /// The set of cards that are in the base game + /// The set of cards that are in the base game. /// /// . public static readonly ReadOnlyCollection BaseGameCards = new(GetBaseGameCards().ToList()); @@ -297,7 +297,7 @@ public static void Remove(CardInfo card) /// The Power of the card. /// The Health of the card. /// The spoken description when the card is first encountered. - /// The newly created card's CardInfo. + /// The newly created card's . public static CardInfo New(string modPrefix, string name, string displayName, int attack, int health, string description = default) { CardInfo retval = ScriptableObject.CreateInstance(); @@ -333,18 +333,18 @@ public static CardInfo New(string modPrefix, string name, string displayName, in } /// - /// Retrieves the dictionary of card extended properties associated with the given CardInfo. + /// Retrieves the dictionary of card extended properties associated with the given . /// - /// The CardInfo whose extended properties we wish to retrieve. - /// The extension property dictionary for the given CardInfo. Creates and returns an empty dictionary if none exists. + /// The whose extended properties we wish to retrieve. + /// The extension property dictionary for the given . Creates and returns an empty dictionary if none exists. public static Dictionary GetCardExtensionTable(this CardInfo card) => CardExtensionProperties.GetOrCreateValue(card).StringMap; internal static CardAltPortraits GetAltPortraits(this CardInfo card) => CardAlternatePortraits.GetOrCreateValue(card); /// - /// Retrieves the Sprite for the CardInfo's alternate portrait in Act 2 if it exists. + /// Retrieves the for the 's alternate portrait in Act 2 if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the pixel alternate portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the pixel alternate portrait or null if it doesn't exist. /// /// Pixel alternate portraits are added through the API; they are not a vanilla feature. /// @@ -353,46 +353,46 @@ public static Sprite PixelAlternatePortrait(this CardInfo card) return card.GetAltPortraits().PixelAlternatePortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait used when Steel Trap activates if it exists. + /// Retrieves the for the 's portrait used when activates if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the Steel Trap portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the steel trap portrait or null if it doesn't exist. /// - /// Steel Trap portraits are added through the API; they are not a vanilla feature. + /// Steel trap portraits are added through the API; they are not a vanilla feature. /// public static Sprite SteelTrapPortrait(this CardInfo card) { return card.GetAltPortraits().SteelTrapPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait emission used when Steel Trap activates if it exists. + /// Retrieves the for the 's portrait emission used when activates if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the Steel Trap portrait emission or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the steel trap portrait emission or null if it doesn't exist. /// - /// Steel Trap portraits are added through the API; they are not a vanilla feature. + /// Steel trap portraits are added through the API; they are not a vanilla feature. /// public static Sprite EmissiveSteelTrapPortrait(this CardInfo card) { return card.GetAltPortraits().SteelTrapPortrait.GetEmissionSprite(); } /// - /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when Steel Trap activates if it exists. + /// Retrieves the for the 's Act 2 portrait used when activates if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the pixel Steel Trap portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the pixel steel trap portrait or null if it doesn't exist. /// - /// Pixel Steel Trap portraits are added through the API; they are not a vanilla feature. + /// Pixel Steel trap portraits are added through the API; they are not a vanilla feature. /// public static Sprite PixelSteelTrapPortrait(this CardInfo card) { return card.GetAltPortraits().PixelSteelTrapPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait used when a card's shield breaks if it exists. + /// Retrieves the for the 's portrait used when a card's shield breaks if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the broken shield portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the broken shield portrait or null if it doesn't exist. /// /// Broken shield portraits are added through the API; they are not a vanilla feature. /// @@ -401,10 +401,10 @@ public static Sprite BrokenShieldPortrait(this CardInfo card) return card.GetAltPortraits().BrokenShieldPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait emission used when a card's shield breaks if it exists. + /// Retrieves the for the 's portrait emission used when a card's shield breaks if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the broken shield portrait emission or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the broken shield portrait emission or null if it doesn't exist. /// /// Broken shield portraits are added through the API; they are not a vanilla feature. /// @@ -413,10 +413,10 @@ public static Sprite EmissiveBrokenShieldPortrait(this CardInfo card) return card.GetAltPortraits().BrokenShieldPortrait.GetEmissionSprite(); } /// - /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when a card's shield breaks if it exists. + /// Retrieves the for the 's Act 2 portrait used when a card's shield breaks if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the pixel broken shield portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the pixel broken shield portrait or null if it doesn't exist. /// /// Pixel broken shield portraits are added through the API; they are not a vanilla feature. /// @@ -425,10 +425,10 @@ public static Sprite PixelBrokenShieldPortrait(this CardInfo card) return card.GetAltPortraits().PixelBrokenShieldPortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait used when a card on the board can be sacrificed if it exists. + /// Retrieves the for the 's portrait used when a card on the board can be sacrificed if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the sacrificable portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the sacrificable portrait or null if it doesn't exist. /// /// Sacrificable portraits are added through the API; they are not a vanilla feature. /// @@ -437,10 +437,10 @@ public static Sprite SacrificablePortrait(this CardInfo card) return card.GetAltPortraits().SacrificablePortrait; } /// - /// Retrieves the Sprite for the CardInfo's portrait emission used when a card on the board can be sacrificed if it exists. + /// Retrieves the for the 's portrait emission used when a card on the board can be sacrificed if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the sacrificable portrait emission or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the sacrificable portrait emission or null if it doesn't exist. /// /// Sacrificable portraits are added through the API; they are not a vanilla feature. /// @@ -449,10 +449,10 @@ public static Sprite EmissiveSacrificablePortrait(this CardInfo card) return card.GetAltPortraits().SacrificablePortrait.GetEmissionSprite(); } /// - /// Retrieves the Sprite for the CardInfo's Act 2 portrait used when a card on the board can be sacrificed if it exists. + /// Retrieves the for the 's Act 2 portrait used when a card on the board can be sacrificed if it exists. /// - /// The CardInfo whose portrait we're retrieving. - /// The Sprite for the pixel sacrificable portrait or null if it doesn't exist. + /// The whose portrait we're retrieving. + /// The for the pixel sacrificable portrait or null if it doesn't exist. /// /// Pixel sacrificable portraits are added through the API; they are not a vanilla feature. /// @@ -609,11 +609,11 @@ private static IEnumerable Transpiler(IEnumerable - /// Adds a null check when calling GetCardByName. If the returned CardInfo is null, outputs a console log error. + /// Adds a null check when calling . If the returned is null, outputs a console log error. /// - /// The CardInfo being returned by GetCardByName. - /// The internal name of the CardInfo attempting to be retrieved. - /// The return value of GetCardByName. + /// The being returned by . + /// The internal name of the attempting to be retrieved. + /// The return value of . public static CardInfo LogCardInfo(CardInfo info, string cardInfoName) { if (info == null) diff --git a/InscryptionAPI/Card/CardModificationInfoExtensions.cs b/InscryptionAPI/Card/CardModificationInfoExtensions.cs index bff055811..46f7f5bdd 100644 --- a/InscryptionAPI/Card/CardModificationInfoExtensions.cs +++ b/InscryptionAPI/Card/CardModificationInfoExtensions.cs @@ -5,24 +5,24 @@ namespace InscryptionAPI.Card; /// -/// Class of helper extensions for CardModificationInfo objects. +/// Class of helper extensions for objects. /// public static class CardModificationInfoExtensions { /// - /// Determines if the given CardModificationInfo contains info for a death card. + /// Determines if the given contains info for a death card. /// - /// The CardModificationInfo to access. - /// True if the CardModificationInfo has death card info. + /// The to access. + /// True if the has death card info. public static bool HasDeathCardInfo(this CardModificationInfo mod) => mod.deathCardInfo != null; #region Adders /// - /// Adds decal ID strings to the given CardModificationInfo. + /// Adds decal ID strings to the given . /// - /// The CardModificationInfo to access. + /// The to access. /// The decal IDs to add. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo AddDecalIds(this CardModificationInfo mod, params string[] decalIds) { foreach (string decalId in decalIds) @@ -33,12 +33,12 @@ public static CardModificationInfo AddDecalIds(this CardModificationInfo mod, pa return mod; } /// - /// Adds the given abilities to the given CardModificationInfos list of negated abilities. + /// Adds the given abilities to the given s list of negated abilities. /// THIS WILL NOT NEGATE THE GIVEN ABILITIES ON ITS OWN. /// - /// The CardModificationInfo to access. + /// The to access. /// The list of abilities to negate. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo AddNegateAbilities(this CardModificationInfo mod, params Ability[] negateAbilities) { mod.negateAbilities ??= new(); @@ -49,22 +49,22 @@ public static CardModificationInfo AddNegateAbilities(this CardModificationInfo #region Setters /// - /// Sets the name replacement field for the given CardModificationInfo. + /// Sets the name replacement field for the given . /// - /// The CardModification to access. + /// The to access. /// The name replacement. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetNameReplacement(this CardModificationInfo mod, string name = null) { mod.nameReplacement = name; return mod; } /// - /// Sets the singleton ID field for the given CardModificationInfo. + /// Sets the singleton ID field for the given . /// - /// The CardModification to access. + /// The to access. /// The singleton ID. If null, does not set it. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetSingletonId(this CardModificationInfo mod, string id = null) { if (id != null) @@ -72,12 +72,12 @@ public static CardModificationInfo SetSingletonId(this CardModificationInfo mod, return mod; } /// - /// Sets the attack and health adjustment fields for the given CardModificationInfo. + /// Sets the attack and health adjustment fields for the given . /// - /// The CardModification to access. + /// The to access. /// How much attack this mod should give. Can be negative. /// How much health this mod should give. Can be negative. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetAttackAndHealth(this CardModificationInfo mod, int attack = 0, int health = 0) { mod.attackAdjustment = attack; @@ -85,57 +85,57 @@ public static CardModificationInfo SetAttackAndHealth(this CardModificationInfo return mod; } /// - /// Sets the cost adjustment fields for the given CardModificationInfo. + /// Sets the cost adjustment fields for the given . /// - /// The CardModification to access. + /// The to access. /// The amount the mod should modify a card's blood cost. Can be negative. /// The amount the mod should modify a card's bones cost. Can be negative. /// The amount the mod should modify a card's energy cost. Can be negative. /// The amount the mod should modify a card's gems cost. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetCosts(this CardModificationInfo mod, int blood = 0, int bones = 0, int energy = 0, List gems = null) { return mod.SetBloodCost(blood).SetBonesCost(bones).SetEnergyCost(energy).SetGemsCost(gems); } /// - /// Sets the blood cost adjustment field for the given CardModificationInfo. + /// Sets the blood cost adjustment field for the given . /// - /// The CardModification to access. + /// The to access. /// The amount the mod should modify a card's blood cost. Can be negative. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetBloodCost(this CardModificationInfo mod, int cost = 0) { mod.bloodCostAdjustment = cost; return mod; } /// - /// Sets the bones cost adjustment field for the given CardModificationInfo. + /// Sets the bones cost adjustment field for the given . /// - /// The CardModification to access. + /// The to access. /// The amount the mod should modify a card's bones cost. Can be negative. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetBonesCost(this CardModificationInfo mod, int cost = 0) { mod.bonesCostAdjustment = cost; return mod; } /// - /// Sets the energy cost adjustment field for the given CardModificationInfo. + /// Sets the energy cost adjustment field for the given . /// - /// The CardModification to access. + /// The to access. /// The amount the mod should modify a card's energy cost. Can be negative. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetEnergyCost(this CardModificationInfo mod, int cost = 0) { mod.energyCostAdjustment = cost; return mod; } /// - /// Sets the addGemsCost field for the given CardModificationInfo. + /// Sets the addGemsCost field for the given . /// - /// The CardModification to access. + /// The to access. /// List of gems cost this mod should add to a card. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetGemsCost(this CardModificationInfo mod, List cost = null) { if (cost != null) @@ -143,11 +143,11 @@ public static CardModificationInfo SetGemsCost(this CardModificationInfo mod, Li return mod; } /// - /// Sets the addGemsCost field for the given CardModificationInfo. + /// Sets the addGemsCost field for the given . /// - /// The CardModification to access. + /// The to access. /// Collection of gems cost this mod should add to a card. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetGemsCost(this CardModificationInfo mod, params GemType[] cost) { if (cost.Length > 0) @@ -155,25 +155,25 @@ public static CardModificationInfo SetGemsCost(this CardModificationInfo mod, pa return mod; } /// - /// Adds the given abilities to the given CardModificationInfo. + /// Adds the given abilities to the given . /// - /// The CardModificationInfo to access. + /// The to access. /// - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo AddAbilities(this CardModificationInfo mod, params Ability[] abilities) { mod.abilities.AddRange(abilities); return mod; } /// - /// Sets the given CardModificationInfo's deathCardInfo field with a new death card portrait. + /// Sets the given 's deathCardInfo field with a new death card portrait. /// - /// The CardModificationInfo to access. + /// The to access. /// What head the portrait should use. /// What mouth the portrait should use. /// What eyes the portrait should use. /// If the portrait should be missing an eye. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetDeathCardPortrait(this CardModificationInfo mod, CompositeFigurine.FigurineType headType = CompositeFigurine.FigurineType.SettlerMan, int mouthIndex = 0, int eyesIndex = 0, bool lostEye = false) @@ -189,17 +189,17 @@ public static CardModificationInfo SetDeathCardPortrait(this CardModificationInf /// public static void SetTemporaryDecal(this CardModificationInfo mod) => mod.SetExtendedProperty("API:TemporaryDecal", true); /// - /// Determines if the given CardModificationInfo is an API temporary decal. + /// Determines if the given is an API temporary decal. /// public static bool IsTemporaryDecal(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("API:TemporaryDecal") ?? false; #region Singleton ID /// - /// Removes the custom properties field from a CardModificationInfo's singletonId. + /// Removes the custom properties field from a 's singletonId. /// - /// The CardModificationInfo object whose properties we want to clear. - /// The same CardModificationInfo so a chain can continue. + /// The object whose properties we want to clear. + /// The same so a chain can continue. public static CardModificationInfo ClearCustomPropertiesId(this CardModificationInfo mod) { string properties = GetCustomPropertiesIdString(mod); @@ -209,15 +209,15 @@ public static CardModificationInfo ClearCustomPropertiesId(this CardModification return mod; } /// - /// Removes the custom costs ID field from a CardModificationInfo's singletonId. + /// Removes the custom costs ID field from a 's singletonId. /// - /// The CardModificationInfo object whose custom costs ID we want to clear. - /// The same CardModificationInfo so a chain can continue. + /// The object whose custom costs ID we want to clear. + /// The same so a chain can continue. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo mod) @@ -231,9 +231,9 @@ public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo #region Properties /// - /// Determines if the given CardModificationInfo has a singleton ID containing an API custom (extended) property. + /// Determines if the given has a singleton ID containing an API custom (extended) property. /// - /// The CardModificationInfo to access. + /// The to access. /// What custom property to look for. /// True if the given property is present, false if it isn't present or there is no custom property section. public static bool HasCustomPropertyId(this CardModificationInfo mod, string propertyName) => HasCustomPropertiesId(mod.singletonId) && mod.singletonId.Contains(propertyName); @@ -245,9 +245,9 @@ public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo /// True if the given property is present, false if it isn't present or there is no custom property section. public static bool HasCustomPropertyId(this string singletonId, string propertyName) => HasCustomPropertiesId(singletonId) && singletonId.Contains(propertyName); /// - /// Determines if the given CardModificationInfo has any custom (extended) properties in its singleton ID. + /// Determines if the given has any custom (extended) properties in its singleton ID. /// - /// The CardModificationInfo to access. + /// The to access. /// True if there are any custom properties, false otherwise. public static bool HasCustomPropertiesId(this CardModificationInfo mod) => !mod.singletonId.IsNullOrWhitespace() && mod.singletonId.Contains(PROPERTIES); /// @@ -257,12 +257,12 @@ public static CardModificationInfo ClearCustomCostsId(this CardModificationInfo /// True if there are any custom properties, false otherwise. public static bool HasCustomPropertiesId(this string singletonId) => !singletonId.IsNullOrWhitespace() && singletonId.Contains(PROPERTIES); /// - /// Creates and/or modifies the custom properties section inside the given CardModificationInfo's singleton ID. + /// Creates and/or modifies the custom properties section inside the given 's singleton ID. /// - /// The CardModificationInfo to access. + /// The to access. /// The name of the property to add. /// What value to set for the property. Will be converted to a string. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetPropertiesId(this CardModificationInfo mod, string propertyName, object value) { string valuePair = $"{propertyName},{value}"; @@ -298,16 +298,16 @@ public static CardModificationInfo SetPropertiesId(this CardModificationInfo mod } /// - /// Determines if the given CardModificationInfo has a custom property with the given name. Checks extended properties before checking the singleton ID. + /// Determines if the given has a custom property with the given name. Checks extended properties before checking the singleton ID. /// /// The CardModificationInfo /// The custom property to search for. - /// True if the CardModificationInfo has an extended property or custom property ID with the given name. False otherwise. + /// True if the has an extended property or custom property ID with the given name. False otherwise. public static bool HasCustomProperty(this CardModificationInfo mod, string propertyName) => mod.GetCustomProperty(propertyName) != null; /// - /// Gets the custom property value from the given CardModificationInfo using the given property name. Checks extended properties before checking the singleton ID. + /// Gets the custom property value from the given using the given property name. Checks extended properties before checking the singleton ID. /// - /// The CardModificationInfo to access. + /// The to access. /// The custom property's name. /// The value of the custom property, or null. public static string GetCustomProperty(this CardModificationInfo mod, string propertyName) @@ -315,9 +315,9 @@ public static string GetCustomProperty(this CardModificationInfo mod, string pro return mod.GetExtendedProperty(propertyName) ?? mod.GetCustomPropertyId(propertyName); } /// - /// Retrieves the value of the given custom property ID in the given CardModificationInfo. + /// Retrieves the value of the given custom property ID in the given . /// - /// The CardModificationInfo to access. + /// The to access. /// The custom property whose value we want. /// The value of the custom property, or null if there is none. public static string GetCustomPropertyId(this CardModificationInfo mod, string propertyName) @@ -342,16 +342,16 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p #region CustomCosts /// - /// Determines if the given CardModificationInfo adds the given custom cost. + /// Determines if the given adds the given custom cost. /// - /// The CardModificationInfo to access. + /// The to access. /// The name of the custom cost to search for. /// True if the CardModification adds the given card cost. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -360,29 +360,29 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// /// Determines if the given singleton ID string has the given custom cost in its custom costs substring. /// - /// The CardModificationInfo to access. + /// The to access. /// The name of the custom cost to search for. /// True if the string has the given card cost in its custom costs substring. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostId(this string singletonId, string costName) => HasCustomCostsId(singletonId) && singletonId.Contains(costName); /// - /// Determines if the given CardModificationInfo adds any custom costs. + /// Determines if the given adds any custom costs. /// - /// The CardModificationInfo to access. + /// The to access. /// True if the CardModification adds any card costs. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -391,30 +391,30 @@ public static string GetCustomPropertyId(this CardModificationInfo mod, string p /// /// Determines if the given singleton ID string has the custom costs substring. /// - /// The CardModificationInfo to access. + /// The to access. /// True if the string has the custom costs substring. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCostsId(this string singletonId) => !singletonId.IsNullOrWhitespace() && singletonId.Contains(CUSTOM_COSTS); /// - /// Sets the custom cost ID and play amount to the given CardModificationInfo's singleton ID. + /// Sets the custom cost ID and play amount to the given 's singleton ID. /// - /// The CardModificationInfo to access. + /// The to access. /// /// - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -451,22 +451,22 @@ public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod } /// - /// Whetehr or not the given CardModificationInfo has the given custom cost. + /// Whetehr or not the given has the given custom cost. /// - /// The CardModificationInfo to access. + /// The to access. /// The name of the custom cost to find. - /// True if the CardModificationInfo uses the given custom cost. False otherwise; + /// True if the uses the given custom cost. False otherwise; /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] public static bool HasCustomCost(this CardModificationInfo mod, string costName) => (mod.GetExtendedProperty(costName) ?? mod.GetCustomCostId(costName)) != null; /// - /// Retrieves the play amount of the given custom cost on the given CardModificationInfo. + /// Retrieves the play amount of the given custom cost on the given . /// Checks extended properties before checking custom cost IDs. /// /// The CardModificationinfo to access. @@ -474,9 +474,9 @@ public static CardModificationInfo SetCustomCostId(this CardModificationInfo mod /// The custom cost's play amount as an int. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -485,16 +485,16 @@ public static int GetCustomCost(this CardModificationInfo mod, string costName) return mod.GetExtendedPropertyAsInt(costName) ?? mod.GetCustomCostIdValue(costName); } /// - /// Retrieves the amount of the given custom cost the given CardModificationInfo costs as a string. + /// Retrieves the amount of the given custom cost the given costs as a string. /// - /// The CardModificationInfo to access. + /// The to access. /// The name of the custom cost to find. /// The string representation of the custom cost's play amount, or null if the custom cost ID is not present. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -517,16 +517,16 @@ public static string GetCustomCostId(this CardModificationInfo mod, string costN return pairString.Substring(0, valueIdx).Replace(costName + ",", ""); } /// - /// Retrieves the cost amount of the given custom cost on the given CardModificationInfo. + /// Retrieves the cost amount of the given custom cost on the given . /// - /// The CardModificationInfo to access. + /// The to access. /// Name of the custom cost to check for. /// How much of the custom cost this CardModificationInfo needs, or 0 if the cost is not present. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -539,15 +539,15 @@ public static int GetCustomCostIdValue(this CardModificationInfo mod, string cos return int.TryParse(valueStr, out int result) ? result : 0; } /// - /// Retrieves a list of all custom costs that the given CardModificationInfo adds. + /// Retrieves a list of all custom costs that the given adds. /// - /// The CardModificationInfo to access. - /// A List of all FullCardCosts the given CardModificationInfo adds to the attached card. + /// The to access. + /// A List of all FullCardCosts the given adds to the attached card. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
// [Obsolete("Custom cost IDs on CardModInfos have been deprecated, please use the CardCostManager instead.")] @@ -572,16 +572,16 @@ public static int GetCustomCostIdValue(this CardModificationInfo mod, string cos #region ID Getters /// - /// Creates a copy of the given CardModificationInfo's singleton ID without any of the API's custom property or cost substrings. + /// Creates a copy of the given 's singleton ID without any of the API's custom property or cost substrings. /// - /// The CardModificationInfo to access. - /// A new string that is a copy of the CardModificationInfo's singleton ID but without any API-added substrings. + /// The to access. + /// A new string that is a copy of the 's singleton ID but without any API-added substrings. public static string CleanId(this CardModificationInfo mod) => mod.IdWithoutCosts().IdWithoutProperties(); /// - /// Creates a new string that is a copy of the given CardModificationInfo's singleton ID string without the custom properties ID substring. + /// Creates a new string that is a copy of the given 's singleton ID string without the custom properties ID substring. /// - /// The CardModificationInfo to access. - /// A clean copy of the CardModificationInfo's singleton ID without the custom properties ID substring. + /// The to access. + /// A clean copy of the 's singleton ID without the custom properties ID substring. public static string IdWithoutProperties(this CardModificationInfo mod) => mod.singletonId.IdWithoutProperties(); /// /// Creates a new string that is a copy of the given string without the custom properties ID substring. @@ -597,10 +597,10 @@ public static string IdWithoutProperties(this string singletonId) return singletonId.Replace(properties, ""); } /// - /// Creates a new string that is a copy of the given CardModificationInfo's singleton ID string without the custom costs ID substring. + /// Creates a new string that is a copy of the given 's singleton ID string without the custom costs ID substring. /// - /// The CardModificationInfo to access. - /// A clean copy of the CardModificationInfo's singleton ID without the custom costs substring. + /// The to access. + /// A clean copy of the 's singleton ID without the custom costs substring. public static string IdWithoutCosts(this CardModificationInfo mod) => mod.singletonId.IdWithoutCosts(); /// /// Creates a new string that is a copy of the given string without the custom costs substring. @@ -623,13 +623,13 @@ public static string IdWithoutCosts(this string singletonId) #region Extended Properties /// - /// Adds a custom property value to the CardModificationInfo. + /// Adds a custom property value to the . /// - /// CardModificationInfo to access. + /// to access. /// The name of the property to set. /// The value of the property. /// Appends a string containing the custom property name and value to the mod's singletonId in the forme of "[ExtProperty:{propertyName},{value}:ExtProperty]". - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo SetExtendedProperty(this CardModificationInfo mod, string propertyName, object value, bool addToSingletonId = false) { mod.GetCardModExtensionTable()[propertyName] = value?.ToString(); @@ -642,7 +642,7 @@ public static CardModificationInfo SetExtendedProperty(this CardModificationInfo /// /// Gets a custom property value from the card. /// - /// CardModificationInfo to access. + /// to access. /// The name of the property to get the value of. /// The custom property value as a string. If it doesn't exist, returns null. public static string GetExtendedProperty(this CardModificationInfo mod, string propertyName) @@ -654,7 +654,7 @@ public static string GetExtendedProperty(this CardModificationInfo mod, string p /// /// Gets a custom property as an int (can be null). /// - /// CardModificationInfo to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as an int or null if it didn't exist or couldn't be parsed as int. public static int? GetExtendedPropertyAsInt(this CardModificationInfo mod, string propertyName) @@ -666,7 +666,7 @@ public static string GetExtendedProperty(this CardModificationInfo mod, string p /// /// Gets a custom property as a float (can be null). /// - /// CardModificationInfo to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as a float or null if it didn't exist or couldn't be parsed as float. public static float? GetExtendedPropertyAsFloat(this CardModificationInfo mod, string propertyName) @@ -678,7 +678,7 @@ public static string GetExtendedProperty(this CardModificationInfo mod, string p /// /// Gets a custom property as a boolean (can be null). /// - /// CardModificationInfo to access. + /// to access. /// Property name to get value of. /// Returns the value of the property as a boolean or null if it didn't exist or couldn't be parsed as boolean. public static bool? GetExtendedPropertyAsBool(this CardModificationInfo mod, string propertyName) @@ -690,10 +690,10 @@ public static string GetExtendedProperty(this CardModificationInfo mod, string p #region RemoveGems /// - /// Removes all gem cost negations on the CardModificationInfo. + /// Removes all gem cost negations on the . /// Only considers extended properties. /// - /// The CardModificationInfo to access. + /// The to access. public static void ClearAllRemovedGemsCosts(this CardModificationInfo mod) { if (mod.HasRemovedGreenGemCost()) @@ -706,9 +706,9 @@ public static void ClearAllRemovedGemsCosts(this CardModificationInfo mod) mod.RemoveBlueGemCost(false); } /// - /// Determines which gem costs have been removed/negated by the given CardModificationInfo using extended properties. + /// Determines which gem costs have been removed/negated by the given using extended properties. /// - /// The CardModificationInfo to access. + /// The to access. /// A List of all removed gem cost colours. public static List RemovedGemsCosts(this CardModificationInfo mod) { @@ -725,11 +725,11 @@ public static List RemovedGemsCosts(this CardModificationInfo mod) return gems; } /// - /// Clears extended properties on the given CardModificationInfo that remove single gem costs with the given types. + /// Clears extended properties on the given that remove single gem costs with the given types. /// - /// The CardModificationInfo to access. + /// The to access. /// A collection of all gem colours that should be re-added/stop being negated. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo RemoveGemsCost(this CardModificationInfo mod, params GemType[] gemTypes) { if (gemTypes.Contains(GemType.Green)) @@ -744,11 +744,11 @@ public static CardModificationInfo RemoveGemsCost(this CardModificationInfo mod, return mod; } /// - /// Clears all extended properties on the given CardModificationInfo that remove single gem costs. + /// Clears all extended properties on the given that remove single gem costs. /// - /// The CardModificationInfo to access. + /// The to access. /// A collection of all gem colours that should be re-added/stop being negated. - /// The same CardModificationInfo so a chain can continue. + /// The same so a chain can continue. public static CardModificationInfo ClearRemovedGemsCost(this CardModificationInfo mod, params GemType[] gemTypes) { if (gemTypes.Contains(GemType.Green)) @@ -763,64 +763,64 @@ public static CardModificationInfo ClearRemovedGemsCost(this CardModificationInf return mod; } /// - /// Uses extended properties to make the given CardModificationInfo negate a single green gem cost. + /// Uses extended properties to make the given negate a single green gem cost. /// - /// The CardModificationInfo to access. - /// Whether the given CardModificationInfo should remove a single green gem from the play cost. - /// The same CardModificationInfo so a chain can continue. - /// If you want to negate multiple gems of the same colour, you'll need to create multiple CardModificationInfos. + /// The to access. + /// Whether the given should remove a single green gem from the play cost. + /// The same so a chain can continue. + /// If you want to negate multiple gems of the same colour, you'll need to create multiple s. public static CardModificationInfo RemoveGreenGemCost(this CardModificationInfo mod, bool remove) => mod.SetExtendedProperty("RemoveGreenGem", remove, true); /// - /// Uses extended properties to make the given CardModificationInfo negate a single orange gem cost. + /// Uses extended properties to make the given negate a single orange gem cost. /// - /// The CardModificationInfo to access. - /// Whether the given CardModificationInfo should remove a single orange gem from the play cost. - /// The same CardModificationInfo so a chain can continue. - /// If you want to negate multiple gems of the same colour, you'll need to create multiple CardModificationInfos. + /// The to access. + /// Whether the given should remove a single orange gem from the play cost. + /// The same so a chain can continue. + /// If you want to negate multiple gems of the same colour, you'll need to create multiple s. public static CardModificationInfo RemoveOrangeGemCost(this CardModificationInfo mod, bool remove) => mod.SetExtendedProperty("RemoveOrangeGem", remove, true); /// - /// Uses extended properties to make the given CardModificationInfo negate a single blue gem cost. + /// Uses extended properties to make the given negate a single blue gem cost. /// - /// The CardModificationInfo to access. - /// Whether the given CardModificationInfo should remove a single blue gem from the play cost. - /// The same CardModificationInfo so a chain can continue. - /// If you want to negate multiple gems of the same colour, you'll need to create multiple CardModificationInfos. + /// The to access. + /// Whether the given should remove a single blue gem from the play cost. + /// The same so a chain can continue. + /// If you want to negate multiple gems of the same colour, you'll need to create multiple s. public static CardModificationInfo RemoveBlueGemCost(this CardModificationInfo mod, bool remove) => mod.SetExtendedProperty("RemoveBlueGem", remove, true); /// - /// Determines if the given CardModificationInfo removes a green gems cost. + /// Determines if the given removes a green gems cost. /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. /// - /// The CardModificationInfo to access. - /// True if the CardModificationInfo negates a green gem. + /// The to access. + /// True if the negates a green gem. public static bool HasRemovedGreenGemCost(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("RemoveGreenGem") ?? false; /// - /// Determines if the given CardModificationInfo removes a orange gems cost. + /// Determines if the given removes a orange gems cost. /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. /// - /// The CardModificationInfo to access. - /// True if the CardModificationInfo negates a orange gem. + /// The to access. + /// True if the negates a orange gem. public static bool HasRemovedOrangeGemCost(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("RemoveOrangeGem") ?? false; /// - /// Determines if the given CardModificationInfo removes a blue gems cost. + /// Determines if the given removes a blue gems cost. /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. /// - /// The CardModificationInfo to access. - /// True if the CardModificationInfo negates a blue gem. + /// The to access. + /// True if the negates a blue gem. public static bool HasRemoveBlueGemCost(this CardModificationInfo mod) => mod.GetExtendedPropertyAsBool("RemoveBlueGem") ?? false; /// - /// Determines if the given CardModificationInfo removes any gem costs using the API's extended properties. + /// Determines if the given removes any gem costs using the API's extended properties. /// Does not check nullifyGemsCost. /// - /// The CardModificationInfo to access. - /// True if the CardModificationInfo negates any single gem. + /// The to access. + /// True if the negates any single gem. public static bool HasRemovedAnyGemCost(this CardModificationInfo mod) => mod.HasRemovedGreenGemCost() || mod.HasRemovedOrangeGemCost() || mod.HasRemoveBlueGemCost(); /// - /// Determines if the given CardModificationInfo removes a gems cost of the given colour. + /// Determines if the given removes a gems cost of the given colour. /// Separate from the vanilla nullifyGemsCost, which negates all gem costs. /// - /// The CardModificationInfo to access. + /// The to access. /// The colour gem to search for. - /// True if the CardModificationInfo negates a gem with the given colour. + /// True if the negates a gem with the given colour. public static bool HasRemovedGemCost(this CardModificationInfo mod, GemType gemType) { return gemType switch diff --git a/InscryptionAPI/Card/CardModificationInfoManager.cs b/InscryptionAPI/Card/CardModificationInfoManager.cs index 1a93c812f..6c791ca1d 100644 --- a/InscryptionAPI/Card/CardModificationInfoManager.cs +++ b/InscryptionAPI/Card/CardModificationInfoManager.cs @@ -7,7 +7,7 @@ namespace InscryptionAPI.Card; /// -/// Class for managing special CardModificationInfos. +/// Class for managing special s. /// These include persistent extended properties and custom costs. /// [HarmonyPatch] @@ -27,7 +27,7 @@ private class CardModExt // Needs to be defined first so the implicit static con /// Get a custom extension class that will exist on all clones of a card /// /// Card to access. - /// The custom class + /// The custom class. /// The instance of T for this card. public static T GetExtendedClass(this CardModificationInfo card) where T : class, new() { @@ -74,7 +74,7 @@ internal static Dictionary GetCardModExtensionTable(this CardMod return exp.StringMap; } /// - /// Re-executes events and rebuilds the special CardModificationInfo pool. + /// Re-executes events and rebuilds the special pool. /// public static void SyncCardMods() { @@ -125,8 +125,11 @@ public static List GetCustomPropertiesFromId(string singletonId) /// The singleton ID string to retrieve custom costs from. /// A List of all custom costs stored by the singleton ID. /// - /// With the improved system of adding custom costs using the [CardCostManager](InscryptionAPI.CardCosts.CardCostManager), - /// it's recommended to avoid using the custom costs ID system unless you want to do something akin to the vanilla CardModInfo cost adjustments. + /// + /// Avoid using s to add custom costs to cards. Instead use and the much better . + ///

+ /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. + ///
///
public static List GetCustomCostsFromId(string singletonId) { @@ -146,9 +149,9 @@ public static List GetCustomCostsFromId(string singletonId) } /// - /// Retrieves the custom properties substring from the given CardModificationInfo's singleton ID. + /// Retrieves the custom properties substring from the given 's singleton ID. /// - /// The CardModificationInfo to access. + /// The to access. /// The custom properties substring or null if one doesn't exist. public static string GetCustomPropertiesIdString(CardModificationInfo mod) => mod.HasCustomPropertiesId() ? GetCustomPropertiesIdString(mod.singletonId) : null; /// @@ -169,15 +172,15 @@ public static string GetCustomPropertiesIdString(string singletonId) } /// - /// Retrieves the custom costs substring from the given CardModificationInfo's singleton ID. + /// Retrieves the custom costs substring from the given 's singleton ID. /// - /// The CardModificationInfo to access. + /// The to access. /// The custom costs substring or null if one doesn't exist. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
public static string GetCustomCostsIdString(CardModificationInfo mod) => mod.HasCustomCostsId() ? GetCustomCostsIdString(mod.singletonId) : null; @@ -188,9 +191,9 @@ public static string GetCustomPropertiesIdString(string singletonId) /// The custom costs substring or null if one doesn't exist. /// /// - /// Avoid using CardModificationInfos to add custom costs to cards. Instead use CardInfo.SetCustomCost and the much better [CardCostManager](InscryptionAPI.CardCosts.CardCostManager). + /// Avoid using s to add custom costs to cards. Instead use and the much better . ///

- /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and CardModificationInfos. + /// Only use this if you're trying to do cost adjustments like you can with vanilla costs and s. ///
///
public static string GetCustomCostsIdString(string singletonId) @@ -206,7 +209,7 @@ public static string GetCustomCostsIdString(string singletonId) } /// - /// Retrieves the property name and associated value from the provided 'properties' string. + /// Retrieves the property name and associated value from the provided properties string. /// /// A string representing all properties. /// The property name to search for. diff --git a/InscryptionAPI/Card/CostProperties.cs b/InscryptionAPI/Card/CostProperties.cs index 69b4a6cca..eee2f4bfd 100644 --- a/InscryptionAPI/Card/CostProperties.cs +++ b/InscryptionAPI/Card/CostProperties.cs @@ -8,16 +8,16 @@ namespace InscryptionAPI.Card.CostProperties; /// -/// Class that handles dynamic costs on PlayableCards. +/// Class that handles dynamic costs on objects. /// [HarmonyPatch] public static class CostProperties { /// - /// Class that's attached to PlayableCard objects to ensure their costs are updated appropriately. + /// Class that's attached to objects to ensure their costs are updated appropriately. /// public class RefreshCostMonoBehaviour : MonoBehaviour { /// - /// PlayableCard instance this behaviour is attached to. + /// instance this behaviour is attached to. /// public PlayableCard playableCard; private int cachedBloodCost = -1, cachedBoneCost = -1; @@ -62,10 +62,10 @@ private bool DidCostsChangeThisFrame() /// /// Determines if a card's list of Gem costs has been updated. /// - /// - /// - /// - /// + /// GemType. + /// First list of gems. + /// Second list of gems. + /// True if a does not equal b public bool GemsChanged(List a, List b) { if (a.Count != b.Count) @@ -82,43 +82,43 @@ public bool GemsChanged(List a, List b) } /// - /// A table that maps a CardInfo object to a list of weak references to every PlayableCard that uses that same CardInfo + /// A table that maps a object to a list of weak references to every that uses that same . /// public static ConditionalWeakTable>> CardInfoToCard = new(); - + // duplicate of above, kept in case something breaks //public static ConditionalWeakTable>> CardInfoToPlayableCardReferences = new(); /// - /// ChangeCardCostGetter patches BloodCost so we can change the cost on the fly + /// patches so we can change the cost on the fly /// This reverse patch gives us access to the original method without any changes. - /// This method has a copy of all the code that CardInfo.BloodCost had so it doesn't result in a StackOverflow and freezing the game when called. + /// This method has a copy of all the code that had so it doesn't result in a StackOverflow and freezing the game when called. /// [HarmonyReversePatch, HarmonyPatch(typeof(CardInfo), nameof(CardInfo.BloodCost), MethodType.Getter), MethodImpl(MethodImplOptions.NoInlining)] public static int OriginalBloodCost(CardInfo __instance) { return 0; } /// - /// ChangeCardCostGetter patches BoneCost so we can change the cost on the fly + /// patches so we can change the cost on the fly /// This reverse patch gives us access to the original method without any changes. - /// This method has a copy of all the code that CardInfo.BoneCost had so it doesn't result in a StackOverflow and freezing the game when called. + /// This method has a copy of all the code that had so it doesn't result in a StackOverflow and freezing the game when called. /// [HarmonyReversePatch, HarmonyPatch(typeof(CardInfo), nameof(CardInfo.BonesCost), MethodType.Getter), MethodImpl(MethodImplOptions.NoInlining)] public static int OriginalBonesCost(CardInfo __instance) { return 0; } /// - /// ChangeCardCostGetter patches GemsCost so we can change the cost on the fly + /// patches so we can change the cost on the fly /// This reverse patch gives us access to the original method without any changes. - /// This method has a copy of all the code that CardInfo.GemsCost had so it doesn't result in a StackOverflow and freezing the game when called. + /// This method has a copy of all the code that had so it doesn't result in a StackOverflow and freezing the game when called. /// [HarmonyReversePatch, HarmonyPatch(typeof(CardInfo), nameof(CardInfo.GemsCost), MethodType.Getter), MethodImpl(MethodImplOptions.NoInlining)] public static List OriginalGemsCost(CardInfo __instance) { return null; } /// - /// Improved version of CardInfo.GemsCost that accounts for addGemCost and RemovedGemsCost(). + /// Improved version of that accounts for addGemCost and . /// - /// For consistency's sake, it's recommended you use this method over OriginalGemsCost in most cases. + /// For consistency's sake, it's recommended you use this method over in most cases. /// public static List ImprovedGemsCost(CardInfo instance) { @@ -141,9 +141,9 @@ public static List ImprovedGemsCost(CardInfo instance) } /// - /// ChangeCardCostGetter patches EnergyCost so we can change the cost on the fly + /// patches so we can change the cost on the fly /// This reverse patch gives us access to the original method without any changes. - /// This method has a copy of all the code that CardInfo.EnergyCost had so it doesn't result in a StackOverflow and freezing the game when called. + /// This method has a copy of all the code that had so it doesn't result in a StackOverflow and freezing the game when called. /// [HarmonyReversePatch, HarmonyPatch(typeof(CardInfo), nameof(CardInfo.EnergyCost), MethodType.Getter), MethodImpl(MethodImplOptions.NoInlining)] public static int OriginalEnergyCost(CardInfo __instance) { return 0; } @@ -151,8 +151,8 @@ public static List ImprovedGemsCost(CardInfo instance) /// /// Determines whether or not Gemified should reduce the blood cost on a multicost card. /// - /// The gemified PlayableCard we're checking. - /// The PlayableCard's blood cost. Defaults to using the CardInfo's blood cost if null. + /// The gemified we're checking. + /// The 's blood cost. Defaults to using the 's blood cost if null. /// True if Gemified should reduce the blood cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -165,8 +165,8 @@ public static bool ReduceGemifiedBlood(PlayableCard card, int? bloodCost = null) /// /// Determines whether or not Gemified should reduce the gems cost on a multicost card. /// - /// The gemified PlayableCard we're checking. - /// The PlayableCard's gems cost. Defaults to using the CardInfo's gems cost if null. + /// The gemified we're checking. + /// The 's gems cost. Defaults to using the 's gems cost if null. /// True if Gemified should reduce the gems cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -179,8 +179,8 @@ public static bool ReduceGemifiedMox(PlayableCard card, List gemsCost = /// /// Determines whether or not Gemified should reduce the bone cost on a multicost card. /// - /// The gemified PlayableCard we're checking. - /// The PlayableCard's bone cost. Defaults to using the CardInfo's bone cost if null. + /// The gemified we're checking. + /// The 's bone cost. Defaults to using the 's bone cost if null. /// True if Gemified should reduce the bone cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -193,8 +193,8 @@ public static bool ReduceGemifiedBones(PlayableCard card, int? bonesCost = null) /// /// Determines whether or not Gemified should reduce the energy cost on a multicost card. /// - /// The gemified PlayableCard we're checking. - /// The PlayableCard's energy cost. Defaults to using the CardInfo's energy cost if null. + /// The gemified we're checking. + /// The 's energy cost. Defaults to using the 's energy cost if null. /// True if Gemified should reduce the energy cost by 1. /// /// Used for multicost cards to determine which cost Gemified should affect. @@ -264,7 +264,7 @@ private static bool DisableVanillaEnergyCost(PlayableCard __instance, ref int __ //private static void GetCardInfoReferences(PlayableCard __instance) { // // if this is a new PlayableCard being associated with the given CardInfo - // // returns true if the CardInfo is in the table + // // returns true if the is in the table // if (CostProperties.CardInfoToPlayableCardReferences.TryGetValue(__instance.Info, out List> connectedCards)) { // PlayableCard card = null; // for (int i = connectedCards.Count - 1; i >= 0; i--) { @@ -302,7 +302,7 @@ private static void Postfix(PlayableCard __instance) refreshCostDisplay.playableCard = __instance; // if this is a new PlayableCard being associated with the given CardInfo - // returns true if the CardInfo is in the table + // returns true if the is in the table if (CostProperties.CardInfoToCard.TryGetValue(__instance.Info, out List> cardList)) { PlayableCard card = null; for (int i = cardList.Count - 1; i >= 0; i--) { diff --git a/InscryptionAPI/Card/DamageShieldBehaviour.cs b/InscryptionAPI/Card/DamageShieldBehaviour.cs index 31b20de4e..8ae03b80b 100644 --- a/InscryptionAPI/Card/DamageShieldBehaviour.cs +++ b/InscryptionAPI/Card/DamageShieldBehaviour.cs @@ -9,7 +9,7 @@ namespace InscryptionAPI.Card; /// /// A custom class implementing shield-giving behaviour. -/// With the most recent API versions, shield-giving sigils like DeathShield/Nano Armour/ Armoured can now stack and instead use a counter rather than a simple boolean. +/// With the most recent API versions, shield-giving sigils like DeathShield/Nano Armour/Armoured can now stack and instead use a counter rather than a simple boolean. /// public abstract class DamageShieldBehaviour : AbilityBehaviour { /// @@ -54,7 +54,7 @@ public virtual void Start() } /// - /// Method for adding more shield count to this ability. Resets the loseShields Status boolean if the net shields are > 0. + /// Method for adding more shield count to this ability. Resets the loseShields Status boolean if the net shields are > 0. /// /// How many more shields this ability should give. /// Whether or not to update the card's render. @@ -116,7 +116,7 @@ public virtual void ResetShields(bool updateDisplay) } /// -/// A custom class combining [DamageShieldBehaviour](InscryptionAPI.Card.DamageShieldBehaviour) and [ExtendedActivatedBehaviour](InscryptionAPI.Card.ExtendedActivatedBehaviour). +/// A custom class combining and . /// public abstract class ActivatedDamageShieldBehaviour : DamageShieldBehaviour { /// @@ -223,31 +223,31 @@ public List GemsCost { public int HealthCost => Mathf.Max(0, StartingHealthCost + healthCostMod); /// - /// Dictionary of CardSlots that have been selected for sacrifices and the associated CardInfo. + /// Dictionary of CardSlots that have been selected for sacrifices and the associated . /// public Dictionary currentSacrificedCardInfos = new(); /// - /// Determines if the PostResolveOnBoard trigger should activate. + /// Determines if the trigger should activate. /// - /// True if PostResolveOnBoard should activate. + /// True if should activate. public virtual bool RespondsToPostResolveOnBoard() { return false; } /// /// Trigger that's called after card's with this ability resolve on the board. - /// Used since ResolveOnBoard is sealed to prevent the ability breaking. + /// Used since is sealed to prevent the ability breaking. /// public virtual IEnumerator OnPostResolveOnBoard() { yield break; } /// - /// If the ResolveOnBoard trigger should be called. + /// If the trigger should be called. /// /// True if it should be activated. public sealed override bool RespondsToResolveOnBoard() => RespondsToPostResolveOnBoard() || LearnMechanic(); /// - /// Runs the logic that teaches the player how activated abilities work in Act 2, plus any PostResolveOnBoard logic. + /// Runs the logic that teaches the player how activated abilities work in Act 2, plus any logic. /// public sealed override IEnumerator OnResolveOnBoard() { if (LearnMechanic()) // Act 2 tutorial dialogue @@ -357,7 +357,6 @@ public sealed override IEnumerator OnActivatedAbility() { /// /// Sequence called after the ability finishes activation. /// - /// public virtual IEnumerator PostActivate() { yield break; } @@ -369,7 +368,6 @@ public virtual IEnumerator PostActivate() { /// /// Player-implemented sequence for what this ability will actually do when activated. /// - /// public abstract IEnumerator Activate(); private IEnumerator ChooseSacrifices() { @@ -468,7 +466,7 @@ private int SacrificeValue() { } /// -/// A custom AbilityBehaviour that's attached to the DeathShield ability so it functions with the API's shield logic changes. +/// A custom that's attached to the ability so it functions with the API's shield logic changes. /// public class APIDeathShield : DamageShieldBehaviour { /// diff --git a/InscryptionAPI/Card/DeathCardManager.cs b/InscryptionAPI/Card/DeathCardManager.cs index 169f77c68..56d02e9c8 100644 --- a/InscryptionAPI/Card/DeathCardManager.cs +++ b/InscryptionAPI/Card/DeathCardManager.cs @@ -11,7 +11,7 @@ namespace InscryptionAPI.Card; public static class DeathCardManager { /// - /// The prefix used by the API to demark custom death cards added through the DeathCardManager. + /// The prefix used by the API to demark custom death cards added through the . /// public const string CardPrefix = "apiDeathCard"; /// @@ -24,8 +24,8 @@ public static class DeathCardManager /// /// Adds a death card to the list of default death cards available at the start of each run. /// - /// The CardModificationInfo containing the death card data. - /// If true, will add deathCardMod to the list of ascension death cards rather than the default (Part 1) pool. + /// The containing the death card data. + /// If true, will add deathCardMod to the list of ascension death cards rather than the default (Part 1) pool. public static void AddDefaultDeathCard(CardModificationInfo deathCardMod, bool addToAscension = false) { if (addToAscension) @@ -42,11 +42,11 @@ private static bool MatchingDeathCardInfo(DeathCardInfo info, DeathCardInfo comp info.mouthIndex == compareAgainst.mouthIndex; } /// - /// Gets the name of an API-added death card from the given CardModificationInfo. Can also create a new death card using the given CardModificationInfo. + /// Gets the name of an API-added death card from the given . Can also create a new death card using the given . /// - /// The CardModificationInfo to access. + /// The to access. /// Whether or not to create a new death card with the given name. Appends a number for duplicate card names. - /// The internal name of the death card associated with the given CardModificationInfo. + /// The internal name of the death card associated with the given . public static string GetAPIDeathCardName(CardModificationInfo mod, bool createNewCard = false) { string cleanId = mod.CleanId(); // use the clean singleton id to reduce chance of duplicate name diff --git a/InscryptionAPI/Card/DefaultBoneGainOnDeath.cs b/InscryptionAPI/Card/DefaultBoneGainOnDeath.cs index fc40bb0bf..c2844849e 100644 --- a/InscryptionAPI/Card/DefaultBoneGainOnDeath.cs +++ b/InscryptionAPI/Card/DefaultBoneGainOnDeath.cs @@ -7,7 +7,7 @@ namespace InscryptionAPI.Card; /// -/// Class for handling exposing the bone-on-death behaviour present in the vanilla PlayableCard.Die method. +/// Class for handling exposing the bone-on-death behaviour present in the vanilla method. /// Allows for modifying the default behaviour through Harmony patches. /// [HarmonyPatch] @@ -117,17 +117,17 @@ private static IEnumerable InsertBoneMethodHook(IEnumerable /// Simple boolean check that by default replicates the vanilla check for whether a card should award a Bone on death. /// - /// The PlayableCard that has died. - /// The CardSlot of card. + /// The that has died. + /// The of card. /// True if card should give a Bone (calls DoDefaultBoneGain). public static bool ShouldDoDefaultBoneGain(PlayableCard card, CardSlot slotBeforeDeath) { return slotBeforeDeath.IsPlayerSlot && !card.HasAbility(Ability.QuadrupleBones); } /// - /// A simple call to ResourcesManager.AddBones, intended to give modders some more flexibility over the default death behaviour of player cards giving 1 Bone. + /// A simple call to , intended to give modders some more flexibility over the default death behaviour of player cards giving 1 Bone. /// - /// The PlayableCard that has died. - /// The CardSlot of card. + /// The that has died. + /// The of card. /// How many Bones to drop whenever a player's card dies (default is 1). public static IEnumerator DoDefaultBoneGain(PlayableCard card, CardSlot slotBeforeDeath, int amount) { yield return Singleton.Instance.AddBones(amount, slotBeforeDeath); diff --git a/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs b/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs index 89273f681..cc35e9d42 100644 --- a/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs +++ b/InscryptionAPI/Card/ExtendedAbilityBehaviour.cs @@ -6,7 +6,7 @@ namespace InscryptionAPI.Card; /// -/// Extended subclass of AbilityBehaviour that implements several custom API triggers. +/// Extended subclass of that implements several custom API triggers. /// [HarmonyPatch] public abstract class ExtendedAbilityBehaviour : AbilityBehaviour, IGetOpposingSlots, IActivateWhenFacedown, IPassiveAttackBuff, IPassiveHealthBuff @@ -32,16 +32,16 @@ public abstract class ExtendedAbilityBehaviour : AbilityBehaviour, IGetOpposingS public virtual bool ShouldTriggerCustomWhenFaceDown(Type customTrigger) => TriggerWhenFacedown; /// - /// Whether or not this ability should modify what CardSlots cards with this ability will target when attacking. + /// Whether or not this ability should modify what s cards with this ability will target when attacking. /// /// True if this ability should modify the list of cards being added. public virtual bool RespondsToGetOpposingSlots() => false; /// - /// Gets an additional list of CardSlots that cards with this ability should target when attacking. + /// Gets an additional list of s that cards with this ability should target when attacking. /// - /// List of CardSlots that were originally being targeted before custom abilities were applied. - /// Other CardSlots added by other abilities to the list of targeted slots. - /// List of CardSlots that should be added to the list of targeted slots. + /// List of s that were originally being targeted before custom abilities were applied. + /// Other s added by other abilities to the list of targeted slots. + /// List of s that should be added to the list of targeted slots. public virtual List GetOpposingSlots(List originalSlots, List otherAddedSlots) => new(); /// @@ -104,7 +104,7 @@ private static List GetHealthBuffs(PlayableCard card) /// /// Determines the passive attack buff given by this ability if one is given. /// - /// The PlayableCard current being checked. + /// The current being checked. /// The attack buff to give to the target card. public virtual int GetPassiveAttackBuff(PlayableCard target) { @@ -125,7 +125,7 @@ public virtual int GetPassiveAttackBuff(PlayableCard target) /// /// Determines the passive health buff given by this ability if one is given. /// - /// The PlayableCard current being checked. + /// The current being checked. /// The health buff to give to the target card. public virtual int GetPassiveHealthBuff(PlayableCard target) { diff --git a/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs b/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs index 2fd2bfcf2..a93145b18 100644 --- a/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs +++ b/InscryptionAPI/Card/ExtendedActivatedAbilityBehaviour.cs @@ -8,7 +8,7 @@ namespace InscryptionAPI.Card; /// -/// A version of ActivatedAbilityBehaviour that allows for the creation of activated abilities that cost Blood, Gems, or Health. Also supports dynamic activation costs. +/// A version of that allows for the creation of activated abilities that cost Blood, Gems, or Health. Also supports dynamic activation costs. /// public abstract class ExtendedActivatedAbilityBehaviour : AbilityBehaviour { @@ -116,33 +116,33 @@ public List GemsCost { public int HealthCost => Mathf.Max(0, StartingHealthCost + healthCostMod); /// - /// Dictionary of CardSlots that have been selected for sacrifices and the associated CardInfo. + /// Dictionary of s that have been selected for sacrifices and the associated CardInfo. /// public Dictionary currentSacrificedCardInfos = new(); /// - /// Determines if the PostResolveOnBoard trigger should activate. + /// Determines if should activate. /// - /// True if PostResolveOnBoard should activate. + /// True if should activate. public virtual bool RespondsToPostResolveOnBoard() { return false; } /// /// Trigger that's called after card's with this ability resolve on the board. - /// Used since ResolveOnBoard is sealed to prevent the ability breaking. + /// Used since is sealed to prevent the ability breaking. /// public virtual IEnumerator OnPostResolveOnBoard() { yield break; } /// - /// If the ResolveOnBoard trigger should be called. + /// If the trigger should be called. /// /// True if it should be activated. public sealed override bool RespondsToResolveOnBoard() => RespondsToPostResolveOnBoard() || LearnMechanic(); /// - /// Runs the logic that teaches the player how activated abilities work in Act 2, plus any PostResolveOnBoard logic. + /// Runs the logic that teaches the player how activated abilities work in Act 2, plus any logic. /// public sealed override IEnumerator OnResolveOnBoard() { diff --git a/InscryptionAPI/Card/OpponentGemsManager.cs b/InscryptionAPI/Card/OpponentGemsManager.cs index 4321e9a37..6a73f9aac 100644 --- a/InscryptionAPI/Card/OpponentGemsManager.cs +++ b/InscryptionAPI/Card/OpponentGemsManager.cs @@ -24,17 +24,17 @@ public class OpponentGemsManager : Singleton { /// True if the opponent owns at least one gem of the given type. False otherwise. public bool HasGem(GemType gem) => opponentGems.Contains(gem); /// - /// Adds a gem of the given type to the List of opponent-owned gems. + /// Adds a gem of the given type to the list of opponent-owned gems. /// /// Type of gem to add to the opponent's possession. public void AddGem(GemType gem) => opponentGems.Add(gem); /// - /// Removes a gem of the given type from the List of opponent-owned gems. + /// Removes a gem of the given type from the list of opponent-owned gems. /// /// Type of gem to remove from the opponent's possession. public void LoseGem(GemType gem) => opponentGems.Remove(gem); /// - /// Adds gems of the given types to the List of opponent-owned gems. + /// Adds gems of the given types to the list of opponent-owned gems. /// /// Types of gems to add to the opponent's possession. public void AddGems(params GemType[] gems) @@ -43,7 +43,7 @@ public void AddGems(params GemType[] gems) opponentGems.Add(gem); } /// - /// Removes gems of the given types from the List of opponent-owned gems. + /// Removes gems of the given types from the list of opponent-owned gems. /// /// Types of gems to remove from the opponent's possession. public void LoseGems(params GemType[] gems) diff --git a/InscryptionAPI/Card/ShieldManager.cs b/InscryptionAPI/Card/ShieldManager.cs index 76d39b498..ba6b6f725 100644 --- a/InscryptionAPI/Card/ShieldManager.cs +++ b/InscryptionAPI/Card/ShieldManager.cs @@ -18,16 +18,16 @@ namespace InscryptionAPI.Card; public static class ShieldManager { /// - /// A list of FullAbilities whose AbilityBehaviour inherits from DamageShieldBehaviour. + /// A list of FullAbilities whose inherits from . /// public static List AllShieldAbilities { get; internal set; } = new(AllAbilities); /// - /// The current processed list of all AbilityInfos in the game that inherit from DamageShieldBehaviour. + /// The current processed list of all s in the game that inherit from . /// public static List AllShieldInfos { get; internal set; } = AllShieldAbilities.Select(x => x.Info).ToList(); /// - /// IEnumerator method that wraps BreakShield. Also contains code for triggering IShieldPreventedDamage and IShieldPreventedDamageInHand. + /// IEnumerator method that wraps . Also contains code for triggering and . /// /// Card getting attacked. /// Damage being dealt. @@ -58,7 +58,7 @@ public static IEnumerator TriggerBreakShield(PlayableCard target, int damage, Pl } /// /// The method used for when a shielded card is damaged. Includes extra parameters for modders looking to modify this further. - /// This method is only called when damage > 0 and the target has a shield. + /// This method is only called when damage > 0 and the target has a shield. /// /// Card getting attacked. /// Damage being dealt. @@ -109,7 +109,7 @@ private static bool PreventShieldReset(PlayableCard target) } /// - /// Modified version of PlayableCard.HasShield that replaces the original method's result. + /// Modified version of that replaces the original method's result. /// public static bool NewHasShield(PlayableCard instance) { diff --git a/InscryptionAPI/Card/SpecialStatIconManager.cs b/InscryptionAPI/Card/SpecialStatIconManager.cs index 6b7a31ac1..ae4d87440 100644 --- a/InscryptionAPI/Card/SpecialStatIconManager.cs +++ b/InscryptionAPI/Card/SpecialStatIconManager.cs @@ -43,26 +43,26 @@ public class FullStatIcon /// public readonly StatIconInfo Info; /// - /// A subclass of VariableStatBehaviour that implements the logic for this stat icon. + /// A subclass of that implements the logic for this stat icon. /// public readonly Type VariableStatBehavior; /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. + /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. /// public Dictionary RulebookDescriptionRedirects = new(); /// - /// Creates a new instance of FullStatIcon and registers its behaviour type with the . + /// Creates a new instance of and registers its behaviour type with the . /// /// The unique ID for this stat icon. /// The unique ID for this stat icon's associated special ability. /// The description object for this ability. - /// A subclass of VariableStatBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. public FullStatIcon(SpecialStatIcon id, SpecialTriggeredAbility abilityId, StatIconInfo info, Type variableStatBehavior) { Id = id; @@ -85,7 +85,7 @@ public FullStatIcon(SpecialStatIcon id, SpecialTriggeredAbility abilityId, StatI /// public static List AllStatIcons { get; private set; } = BaseGameStatIcons.ToList(); /// - /// The current processed list of all StatIconInfos in the game, including vanilla and mod-added abilities. + /// The current processed list of all s in the game, including vanilla and mod-added abilities. /// public static List AllStatIconInfos { get; private set; } = BaseGameStatIcons.Select(x => x.Info).ToList(); @@ -134,8 +134,8 @@ private static List GenBaseGameStatIconList() /// /// The guid of the mod adding the ability. /// An instance of StatIconInfo describing the ability. - /// A subclass of VariableStatBehaviour that implements the logic for the stat icon. - /// An instance of FullStatIcon containing all necessary data for the stat icon to work.. + /// A subclass of that implements the logic for the stat icon. + /// An instance of containing all necessary data for the stat icon to work. public static FullStatIcon Add(string guid, StatIconInfo info, Type behavior) { // Register the special ability at the same time @@ -154,7 +154,7 @@ public static FullStatIcon Add(string guid, StatIconInfo info, Type behavior) /// The guid of the mod adding the ability. /// The name of the stat icon when it appears in the Rulebook. /// The description of the stat icon when it appears in the Rulebook. - /// A subclass of VariableStatBehaviour that implements the logic for the stat icon. + /// A subclass of that implements the logic for the stat icon. /// An instance of StatIconInfo describing the new ability. public static StatIconInfo New(string guid, string rulebookName, string rulebookDescription, Type behavior) { diff --git a/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs b/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs index e7c7c64ef..a5fbbc617 100644 --- a/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs +++ b/InscryptionAPI/Card/SpecialTriggeredAbilityManager.cs @@ -15,11 +15,11 @@ public static class SpecialTriggeredAbilityManager { public class FullSpecialTriggeredAbility { /// - /// The unique ID for this special ability + /// The unique ID for this special ability. /// public readonly SpecialTriggeredAbility Id; /// - /// The guid of the mod that added this special ability + /// The guid of the mod that added this special ability. /// public readonly string ModGUID; /// @@ -27,15 +27,15 @@ public class FullSpecialTriggeredAbility /// public readonly string AbilityName; /// - /// A subclass of SpecialCardBehaviour that implements the logic for this special ability + /// A subclass of that implements the logic for this special ability. /// public readonly Type AbilityBehaviour; /// - /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the . + /// Creates a new instance of and registers its behaviour type with the . /// /// The unique ID for this special ability. - /// A subclass of SpecialCardBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. [Obsolete("Use the constructor that takes a guid parameter instead")] public FullSpecialTriggeredAbility(SpecialTriggeredAbility id, Type abilityBehaviour) : this(null, abilityBehaviour.ToString(), id, abilityBehaviour) { @@ -43,12 +43,12 @@ public FullSpecialTriggeredAbility(SpecialTriggeredAbility id, Type abilityBehav } /// - /// Creates a new instance of FullSpecialTriggeredAbility and registers its behaviour type with the . + /// Creates a new instance of and registers its behaviour type with the . /// /// The GUID of the mod that added this. /// The name of this special ability. /// The unique ID for this special ability. - /// A subclass of SpecialCardBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. public FullSpecialTriggeredAbility(string guid, string name, SpecialTriggeredAbility id, Type abilityBehaviour) { Id = id; @@ -96,7 +96,7 @@ private static List GenBaseGameSpecialTriggersList( /// /// The guid of the mod adding the special ability. /// The name of the special ability. - /// A subclass of SpecialCardBehaviour that implements the logic for the ability. + /// A subclass of that implements the logic for the ability. public static FullSpecialTriggeredAbility Add(string guid, string abilityName, Type behavior) { FullSpecialTriggeredAbility full = new(guid, abilityName, GuidManager.GetEnumValue(guid, abilityName), behavior); @@ -110,7 +110,7 @@ public static FullSpecialTriggeredAbility Add(string guid, string abilityName, T /// The unique ID of the special ability to remove. public static void Remove(SpecialTriggeredAbility id) => NewSpecialTriggers.Remove(NewSpecialTriggers.FirstOrDefault(x => x.Id == id)); /// - /// Removes a special ability from the game based on its FullSpecialTriggeredAbility. Can only remove mod-added special abilities, not vanilla ones. + /// Removes a special ability from the game based on its . Can only remove mod-added special abilities, not vanilla ones. /// /// The instance of the ability to remove. public static void Remove(FullSpecialTriggeredAbility ability) => NewSpecialTriggers.Remove(ability); diff --git a/InscryptionAPI/Card/TribeManager.cs b/InscryptionAPI/Card/TribeManager.cs index 95eedb70d..9322c1d00 100644 --- a/InscryptionAPI/Card/TribeManager.cs +++ b/InscryptionAPI/Card/TribeManager.cs @@ -21,19 +21,19 @@ public static class TribeManager ///
public class TribeInfo { /// - /// The guid of the mod that added this ability + /// The guid of the mod that added this ability. /// public string guid; /// - /// The name of this tribe + /// The name of this tribe. /// public string name; /// - /// The unique ID for this tribe + /// The unique ID for this tribe. /// public Tribe tribe; /// - /// The Sprite displayed on cards of this tribe + /// The Sprite displayed on cards of this tribe. /// public Sprite icon; /// @@ -101,24 +101,24 @@ public static Tribe Add(string guid, string name, string pathToTribeIcon = null, } /// - /// Determines if the given Tribe was added by a mod. + /// Determines if the given was added by a mod. /// - /// The Tribe to check. - /// True if tribe is not from the base game. + /// The to check. + /// True if tribe is not from the base game. public static bool IsCustomTribe(Tribe tribe) => tribeTypes.Contains(tribe); /// - /// Retrieves the TribeInfo object associated with the given Tribe enum value. + /// Retrieves the object associated with the given enum value. /// - /// Tribe to retrieve the TribeInfo of. - /// Only custom Tribes have an associated TribeInfo; returns null for vanilla Tribes. + /// Tribe to retrieve the of. + /// Only custom tribes have an associated ; returns null for vanilla tribes. public static TribeInfo GetCustomTribeInfo(Tribe tribe) => tribes.Find(x => x.tribe == tribe); /// - /// Returns the icon texture associated with the given Tribe. + /// Returns the icon texture associated with the given . /// - /// Tribe to get the icon of. - /// If true, return the missing icon texure when the checked Tribe has no icon texture. + /// to get the icon of. + /// If true, return the missing icon texure when the checked has no icon texture. public static Texture2D GetTribeIcon(Tribe tribe, bool useMissingIconIfNull = true) { Texture2D texture2D = null; if (IsCustomTribe(tribe)) { From 4433c9e791525e87e48c890cfbcf42c2d7920168 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 22:23:11 -0800 Subject: [PATCH 35/74] Add XML, comment out unused field --- .../Ascension/AscensionChallengePaginator.cs | 69 +++++++++++++++++-- 1 file changed, 64 insertions(+), 5 deletions(-) diff --git a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs index aaff322d4..715af23a7 100644 --- a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs +++ b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs @@ -6,11 +6,18 @@ using UnityEngine; namespace InscryptionAPI.Ascension; +/// +/// Class that handles adding displaying custom challenges in the challenge select screen. +/// +public class AscensionChallengePaginator : MonoBehaviour { + // not sure if this will break any mods but it's not being used or assigned to. + //public bool initialized; -public class AscensionChallengePaginator : MonoBehaviour -{ - public bool initialized; - + /// + /// Initialises the challenge screen, adding custom challenges and UI elements. + /// + /// + /// public void Initialize(AscensionChallengeScreen screen, AscensionMenuScreenTransition transition = null) { if (challengeObjectsForPages == null) @@ -39,6 +46,10 @@ public void Initialize(AscensionChallengeScreen screen, AscensionMenuScreenTrans this.screen = screen; } + /// + /// Creates the for the placeholder challenge. + /// This placeholder is used when errors occur when loading challenges. + /// public void InitialiseMissingChallengeInfo() { missingChallengeInfo = ScriptableObject.CreateInstance(); @@ -51,6 +62,11 @@ public void InitialiseMissingChallengeInfo() missingChallengeInfo.pointValue = 0; } + /// + /// Adds a new page of challenges to the list of pages. + /// Pages contain (by default) up to 14 challenge icons. Excess challenges overflow onto new pages. + /// + /// public void AddPage(List challengeInfos) { // create the challenge info for missingChallengeInfo challenges @@ -165,6 +181,9 @@ private GameObject CreateIconGameObject(GameObject objectRef, int index, Ascensi return newIcon; } + /// + /// Initialise the challenge screen and pages whenever the challenge screen is enabled. + /// public void OnEnable() { // if there are still active challenges, don't rebuild the pages @@ -291,6 +310,13 @@ public void OnEnable() InstantiateArrowObjects(icons); } + /// + /// Creates the leftArrow and rightArrow UI elements for the challenge screen. + /// Positioning is determined by the positions of the challenge icons. + /// By default, the API tries to place the arrows on the left and right sides of the screen. + /// If there isn't enough space due to screen resolution (or if the user has toggled the config option), the arrows are placed at the top of the screen instead. + /// + /// public void InstantiateArrowObjects(List icons) { Vector3 topRight = new(float.MinValue, float.MinValue); @@ -343,6 +369,9 @@ public void InstantiateArrowObjects(List icons) rightArrow.ClearDelegates(); rightArrow.CursorSelectStarted += (x) => NextPage(); } + /// + /// Loads the next page. Wraps around to the first page if currently on the last page. + /// public void NextPage() { pageIndex++; @@ -351,6 +380,9 @@ public void NextPage() LoadPage(pageIndex); } + /// + /// Loads the previous page. Wraps around to the last page if currently on the first page. + /// public void PreviousPage() { pageIndex--; @@ -359,7 +391,10 @@ public void PreviousPage() LoadPage(pageIndex); } - + /// + /// Loads the challenge page at the given index. + /// + /// Index of the page to load. public void LoadPage(int page) { // if page index corresponds to an index in challengeObjects @@ -463,17 +498,41 @@ private char DebugArrayCode(GameObject icon, AscensionChallengeInfo info = null) /// public List> challengeObjectsForPages; + /// + /// The current page index. Determines what challenges are currently displayed. + /// public int pageIndex; + /// + /// How many icons are displayed on each page. + /// public int pageLength; + /// + /// Object that handles displaying challenges. + /// public AscensionChallengeScreen screen; + /// + /// Object that handles the transition to and from the menu screens. + /// public AscensionMenuScreenTransition transition; + /// + /// The UI interactable for moving to the previous page. + /// public AscensionMenuInteractable leftArrow; + /// + /// The UI interactable for moving to the next page. + /// public AscensionMenuInteractable rightArrow; + /// + /// for the placeholder challenge that appears in empty slots or when an error occurs. + /// public static Sprite missingChallengeSprite; + /// + /// for the placeholder challenge that appears in empty slots or when an error occurs. + /// public static AscensionChallengeInfo missingChallengeInfo; private class NoneChallengeDisplayer : MonoBehaviour From 699110729877148fca07265d63585744aa9a3187 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:23:36 -0800 Subject: [PATCH 36/74] Rename files to indicate they contain patches, fix minor error in StarterDeckSelectScreenPatches class name --- ...ionChallengeScreen.cs => AscensionChallengeScreenPatches.cs} | 0 ...terDeckSelectScreen.cs => StarterDeckSelectScreenPatches.cs} | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename InscryptionAPI/Ascension/{AscensionChallengeScreen.cs => AscensionChallengeScreenPatches.cs} (100%) rename InscryptionAPI/Ascension/{StarterDeckSelectScreen.cs => StarterDeckSelectScreenPatches.cs} (99%) diff --git a/InscryptionAPI/Ascension/AscensionChallengeScreen.cs b/InscryptionAPI/Ascension/AscensionChallengeScreenPatches.cs similarity index 100% rename from InscryptionAPI/Ascension/AscensionChallengeScreen.cs rename to InscryptionAPI/Ascension/AscensionChallengeScreenPatches.cs diff --git a/InscryptionAPI/Ascension/StarterDeckSelectScreen.cs b/InscryptionAPI/Ascension/StarterDeckSelectScreenPatches.cs similarity index 99% rename from InscryptionAPI/Ascension/StarterDeckSelectScreen.cs rename to InscryptionAPI/Ascension/StarterDeckSelectScreenPatches.cs index e5af2ed1c..931578f73 100644 --- a/InscryptionAPI/Ascension/StarterDeckSelectScreen.cs +++ b/InscryptionAPI/Ascension/StarterDeckSelectScreenPatches.cs @@ -8,7 +8,7 @@ namespace InscryptionAPI.Ascension; [HarmonyPatch] -internal static class StarterDeckSelectscreenPatches +internal static class StarterDeckSelectScreenPatches { [HarmonyPatch(typeof(AscensionChooseStarterDeckScreen), "Start")] [HarmonyPostfix] From 652ca8d3ea1b43d69fde55bba184f1ede629960a Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:33:47 -0800 Subject: [PATCH 37/74] Add xml --- .../Ascension/AscensionChallengePaginator.cs | 8 +- .../AscensionChallengePaginatorSetupifier.cs | 6 + .../Ascension/AscensionRunSetupScreenBase.cs | 174 ++++++++++++++++-- .../Ascension/AscensionScreenManager.cs | 10 + .../Ascension/AscensionScreenSort.cs | 29 ++- .../Ascension/ChallengeDisplayerPlus.cs | 47 ++++- InscryptionAPI/Ascension/ChallengeManager.cs | 18 +- .../Ascension/StarterDeckExtensions.cs | 17 +- .../StarterDeckExtensionsPortraits.cs | 12 +- .../Ascension/StarterDeckManager.cs | 86 ++++++++- .../Ascension/StarterDeckPaginator.cs | 44 ++++- InscryptionAPI/Card/AbilityManager.cs | 20 +- 12 files changed, 412 insertions(+), 59 deletions(-) diff --git a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs index 715af23a7..1866bdba1 100644 --- a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs +++ b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs @@ -7,7 +7,7 @@ namespace InscryptionAPI.Ascension; /// -/// Class that handles adding displaying custom challenges in the challenge select screen. +/// Class that handles adding displaying custom challenges and allows for multiple pages of challenges. /// public class AscensionChallengePaginator : MonoBehaviour { // not sure if this will break any mods but it's not being used or assigned to. @@ -16,8 +16,8 @@ public class AscensionChallengePaginator : MonoBehaviour { /// /// Initialises the challenge screen, adding custom challenges and UI elements. /// - /// - /// + /// The to attach this paginator to. + /// The default transition object to use. public void Initialize(AscensionChallengeScreen screen, AscensionMenuScreenTransition transition = null) { if (challengeObjectsForPages == null) @@ -66,7 +66,7 @@ public void InitialiseMissingChallengeInfo() /// Adds a new page of challenges to the list of pages. /// Pages contain (by default) up to 14 challenge icons. Excess challenges overflow onto new pages. ///
- /// + /// s that will be displayed on this page. public void AddPage(List challengeInfos) { // create the challenge info for missingChallengeInfo challenges diff --git a/InscryptionAPI/Ascension/AscensionChallengePaginatorSetupifier.cs b/InscryptionAPI/Ascension/AscensionChallengePaginatorSetupifier.cs index 5e85925d3..efd02129d 100644 --- a/InscryptionAPI/Ascension/AscensionChallengePaginatorSetupifier.cs +++ b/InscryptionAPI/Ascension/AscensionChallengePaginatorSetupifier.cs @@ -3,8 +3,14 @@ namespace InscryptionAPI.Ascension; // adding this comment to say that setupifier is a ridiculous word, very fun +/// +/// Handles adding the to the ascension menu object. +/// public class AscensionChallengePaginatorSetupifier : ManagedBehaviour { + /// + /// Adds the to the ascension menu object. + /// public void Start() { AscensionMenuScreenTransition screen = gameObject.GetComponent(); diff --git a/InscryptionAPI/Ascension/AscensionRunSetupScreenBase.cs b/InscryptionAPI/Ascension/AscensionRunSetupScreenBase.cs index bcbcad6a4..31135226a 100644 --- a/InscryptionAPI/Ascension/AscensionRunSetupScreenBase.cs +++ b/InscryptionAPI/Ascension/AscensionRunSetupScreenBase.cs @@ -5,49 +5,106 @@ namespace InscryptionAPI.Ascension; +/// +/// Abstract class for creating custom menu screens to be displayed in Kaycee's Mod. +/// public abstract class AscensionRunSetupScreenBase : ManagedBehaviour { - // This will display near the top of the screen. - // The very top will be the challenge level text; below that will be this + /// + /// Header name of this screen. + /// + /// + /// This will display near the top of the screen. + /// The very top will be the challenge level text; below that will be this. + /// public abstract string headerText { get; } - // If this is true, it will show the card displayer at the footer below the challenge text - // Seting this to true will also enable the DisplayCardInfo and ClearCardInfo methods - // If this is not true, those methods will do nothing + /// + /// Whether the card displayer should be shown and usable on this screen. + /// + /// + /// If this is true, it will show the card displayer at the footer below the challenge text + /// Seting this to true will also enable the and methods + /// If this is not true, those methods will do nothing + /// public abstract bool showCardDisplayer { get; } - // If this is true, it will put a card panel in the middle of the screen - // The card panel will be able to display up to 7 cards - // and will have a left/right button + /// + /// Whether the card panel should be shown on this screen. + /// + /// + /// If this is true, it will put a card panel in the middle of the screen + /// The card panel will be able to display up to 7 cards and will have a left/right button + /// public abstract bool showCardPanel { get; } // This is the hook for the implementer to build their own UI elements. + /// + /// Hook for building this screen's UI elements. + /// + /// public virtual void InitializeScreen(GameObject partialScreen) { } + /// + /// Objects for handling the text lines that appear in the card displayer when a card is selected/hovered over. + /// public SequentialPixelTextLines cardInfoLines; + /// + /// Object for handling the footer text lines. + /// public SequentialPixelTextLines challengeFooterLines; + /// + /// Object for storing the header text. + /// public ChallengeLevelText challengeHeaderDisplay; + /// + /// All cards currently displayed in the card displayer. + /// public List cards; + /// + /// Object for the card panel. + /// public GameObject cardPanel; + /// + /// UI interactable for going to the previous page (if applicable). + /// public MainInputInteractable leftButton; + /// + /// UI interactable for going to the next page (if applicable). + /// public MainInputInteractable rightButton; + /// + /// UI interactble for continuing to the next screen.. + /// public AscensionMenuInteractable continueButton; + /// + /// UI interactable for backing out of the current screen. + /// public AscensionMenuBackButton backButton; + /// + /// Text object for displaying the screen's title. + /// public PixelText screenTitle; + /// + /// Text object for displaying information without using the card displayer. + /// public PixelText secondaryInfoDisplayer; + /// + /// Object that handles transitions to and from this screen. + /// public AscensionMenuScreenTransition transitionController; @@ -65,6 +122,12 @@ private static void CleanupGameObject(GameObject obj, AscensionMenuScreenTransit GameObject.Destroy(obj); } + /// + /// Constructs this screen's paginator buttons. Used to transition to the previous and next screens. + /// + /// The object the paginators will be parented to. + /// If the paginator should be anchored to the top of the screen. + /// public static (AscensionMenuInteractable, AscensionMenuInteractable) BuildPaginators(Transform parent, bool upperPosition = false) { GameObject leftPseudoPrefab = AscensionMenuScreens.Instance.cardUnlockSummaryScreen.transform.Find("Unlocks/ScreenAnchor/PageLeftButton").gameObject; @@ -120,6 +183,13 @@ public static (AscensionMenuInteractable, AscensionMenuInteractable) BuildPagina return (leftIcon.GetComponent(), rightIcon.GetComponent()); } + /// + /// Constructs this screen and adds it to the game. + /// + /// The to build. + /// The ID of the screen that comes before this screen. + /// The ID of the screen that comes after this screen. + /// public static AscensionRunSetupScreenBase BuildScreen(Type screenType, AscensionMenuScreens.Screen previousScreen, AscensionMenuScreens.Screen nextScreen) { // Create the new screen @@ -314,6 +384,11 @@ private static void TransitionToGame() } } + /// + /// Clears any message currently being displayed. + /// If is true, clears the message using . + /// Otherwise, sets the to inactive. + /// public virtual void ClearMessage() { if (this.gameObject.activeSelf) @@ -329,6 +404,12 @@ public virtual void ClearMessage() } } + /// + /// Displays the given message. + /// If is true, displays the message using . + /// Otherwise, uses the to display the message. + /// + /// String to show. public virtual void DisplayMessage(string message) { if (this.showCardDisplayer) @@ -342,22 +423,41 @@ public virtual void DisplayMessage(string message) } } + /// + /// Hook for when the left button is clicked. + /// + /// Interactable corresponding to the left button. public virtual void LeftButtonClicked(MainInputInteractable button) { } + /// + /// Hook for when the right button is clicked. + /// + /// Interactable corresponding to the right button. public virtual void RightButtonClicked(MainInputInteractable button) { } + /// + /// Hook for when a card is moused over in the card displayer. + /// + /// The card that was moused over. + /// + /// If is true, will call by default. + /// public virtual void CardCursorEntered(PixelSelectableCard card) { if (this.showCardDisplayer) this.DisplayCardInfo(card.Info); } + /// + /// Hook for when a card is selected in the card panel displayer. + /// + /// The card that was selected. public virtual void CardClicked(PixelSelectableCard card) { @@ -367,6 +467,13 @@ public virtual void CardClicked(PixelSelectableCard card) private static Vector2 BETWEEN_CARD_OFFSET = new Vector2(0.5f, 0f); + /// + /// Displays the given cards in the card displayer. + /// + /// The s to display. + /// + /// Only functions if is true. + /// public void ShowCards(List cardsToDisplay) { if (!this.showCardDisplayer) @@ -388,9 +495,26 @@ public void ShowCards(List cardsToDisplay) } } + /// + /// String comprised entirely of dashes. + /// Used for displaying the centre delimiters. + /// public const string CENTER_DASHES = "-------------------------------------------------------------------------------------------------------------------------------"; + /// + /// String comprised entirely of dashes that covers the entire screen horizontal. + /// public const string FULL_DASHES = "---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------"; + /// + /// Displays the given information in the card displayer. + /// + /// The to display. + /// String to display instead of the default displayed name. Use null to use the default. + /// String to display instead of the default description. Leave null to use the default. + /// If the text should be immediately updated or play a transition. + /// + /// Only functions if is true. + /// public void DisplayCardInfo(CardInfo info, string nameOverride = null, string descOverride = null, bool immediate = false) { if (!showCardDisplayer) @@ -408,6 +532,13 @@ public void DisplayCardInfo(CardInfo info, string nameOverride = null, string de }, immediate); } + /// + /// Clears the displayed information in the card displayer. + /// + /// If the text should be immediately updated or play a transition. + /// + /// Only functions if is true. + /// public void ClearCardInfo(bool immediate = true) { if (!showCardDisplayer) @@ -421,6 +552,12 @@ public void ClearCardInfo(bool immediate = true) }, immediate); } + /// + /// Displays the given information in the same format as challenges. + /// + /// The message to display on line 1. + /// The points amount to be displayed on line 2. + /// If a transition should play before displaying the challenge. public void DisplayChallengeInfo(string message, int points, bool immediate = false) { string lineOne = Localization.Translate(message); @@ -468,6 +605,20 @@ public void DisplayChallengeInfo(string message, int points, bool immediate = fa challengeHeaderDisplay.UpdateText(); } + /// + /// Displays information on the given challenge. + /// + /// The challenge to display. + /// If a transition should play before displaying the challenge. + public void DisplayChallengeInfo(AscensionChallenge challenge, bool immediate = false) { + AscensionChallengeInfo info = AscensionChallengesUtil.GetInfo(challenge); + int points = info.pointValue * (AscensionSaveData.Data.ChallengeIsActive(challenge) ? 1 : -1); + DisplayChallengeInfo(info.title, points, immediate); + } + + /// + /// Corrects the viewport cameras in this screen's children's components. + /// public override void OnEnable() { // Set all the viewport camera stuff @@ -476,11 +627,4 @@ public override void OnEnable() base.OnEnable(); } - - public void DisplayChallengeInfo(AscensionChallenge challenge, bool immediate = false) - { - AscensionChallengeInfo info = AscensionChallengesUtil.GetInfo(challenge); - int points = info.pointValue * (AscensionSaveData.Data.ChallengeIsActive(challenge) ? 1 : -1); - DisplayChallengeInfo(info.title, points, immediate); - } } \ No newline at end of file diff --git a/InscryptionAPI/Ascension/AscensionScreenManager.cs b/InscryptionAPI/Ascension/AscensionScreenManager.cs index a2242720c..257048829 100644 --- a/InscryptionAPI/Ascension/AscensionScreenManager.cs +++ b/InscryptionAPI/Ascension/AscensionScreenManager.cs @@ -5,6 +5,9 @@ namespace InscryptionAPI.Ascension; +/// +/// Manager class for handling custom menu screens in Kaycee's Mod. +/// [HarmonyPatch] public static class AscensionScreenManager { @@ -18,6 +21,10 @@ public static class AscensionScreenManager private static string challengeScreenHoverText = "START RUN"; + /// + /// Creates a new ascension menu screen and registers it with the API. + /// + /// public static void RegisterScreen() where T : AscensionRunSetupScreenBase { registeredScreens.Add(typeof(T)); @@ -32,6 +39,9 @@ private static AscensionScreenSort.Direction GetPreferredDirection(Type t) return sortAttr.preferredDirection; } + /// + /// Creates and initialises registered menu screens. + /// public static void InitializeAllScreens() { // Sort the screens diff --git a/InscryptionAPI/Ascension/AscensionScreenSort.cs b/InscryptionAPI/Ascension/AscensionScreenSort.cs index 7033c8117..296fd6c18 100644 --- a/InscryptionAPI/Ascension/AscensionScreenSort.cs +++ b/InscryptionAPI/Ascension/AscensionScreenSort.cs @@ -1,19 +1,46 @@ namespace InscryptionAPI.Ascension; -// Decorates a custom screen and marks how it should be sorted +/// +/// Decorates a custom screen and marks how it should be sorted. +/// public class AscensionScreenSort : System.Attribute { + /// + /// Where in the new run sequence a custom screen should appear. + /// public enum Direction : int { + /// + /// Requires being the starting screen when selecting a new run. + /// RequiresStart = 1, + /// + /// Prefers being the starting screen when selecting a new run. + /// PrefersStart = 2, + /// + /// Does not care where in the line up of screen this screen appears. + /// NoPreference = 3, + /// + /// Prefers being the final screen when selecting a new run. + /// PrefersEnd = 4, + /// + /// Requires being the starting screen when selecting a new run. + /// RequiresEnd = 5, } + /// + /// The preferred position for this custom screen. + /// public Direction preferredDirection; + /// + /// Marks a custom screen with its preferred direction. + /// + /// public AscensionScreenSort(Direction preferredDirection = Direction.NoPreference) { this.preferredDirection = preferredDirection; diff --git a/InscryptionAPI/Ascension/ChallengeDisplayerPlus.cs b/InscryptionAPI/Ascension/ChallengeDisplayerPlus.cs index 67cf82728..529f6bc70 100644 --- a/InscryptionAPI/Ascension/ChallengeDisplayerPlus.cs +++ b/InscryptionAPI/Ascension/ChallengeDisplayerPlus.cs @@ -5,8 +5,16 @@ namespace InscryptionAPI.Ascension; +/// +/// Improved version of that can handle custom challenges. +/// public class ChallengeDisplayerPlus : ManagedBehaviour { + /// + /// Attempts to attach this class to the vanilla . + /// + /// The vanilla displayer instance. + /// The newly added API displayer. public static ChallengeDisplayerPlus TryAddChallengeDisplayerPlusToDisplayer(AscensionChallengeDisplayer displayer) { ChallengeDisplayerPlus plus = displayer.GetComponent(); @@ -70,6 +78,10 @@ public static ChallengeDisplayerPlus TryAddChallengeDisplayerPlusToDisplayer(Asc return plus; } + /// + /// Retrieves the best y position for anchoring footer text. + /// + /// The best available y-value. public float GetBestAvailableY() { float y = originalTitlePos; @@ -84,8 +96,16 @@ public float GetBestAvailableY() return y; } + /// + /// A reference to the . + /// public AscensionChallengeDisplayer displayer => GetComponent(); + /// + /// Displays the challenge icon for the given . + /// + /// The to display. + /// If the challenge should be displayed immediately or after a transition plays. public void DisplayChallenge(AscensionChallengeInfo challengeInfo, bool immediate = false) { string dependency = "", incompatibility = ""; @@ -153,6 +173,12 @@ public void DisplayChallenge(AscensionChallengeInfo challengeInfo, bool immediat DisplayText(dependency, incompatibility, immediate); } + /// + /// Handles displaying the footer text that appears when hovering over a challenge icon. + /// + /// String that lists this challenge's dependencies. + /// String that lists this challenge's incompatibiities. + /// If the challenge should be displayed immediately or after a transition plays. public void DisplayText(string dependency, string incompatibility, bool immediate = false) { float yOffset = (!string.IsNullOrEmpty(dependency) ? 0.11f : 0f) + (!string.IsNullOrEmpty(incompatibility) ? 0.11f : 0f); @@ -217,12 +243,29 @@ private IEnumerator DisplayTextSequence(string dependency, string incompatibilit private float originalDescriptionPos; private float originalPointsPos; - public class PrefixedString - { + /// + /// Handles displaying challenge dependency strings when hovering over a challenge icon. + /// + public class PrefixedString { + /// + /// The full dependency string. + /// public string FullText => prefix + (number > 1 ? " (x" + number + ")" : ""); + /// + /// The full dependency string with the number (if applicable) coloured red. + /// public string RedPrefixText => prefix + (number > 1 ? " [c:R](x" + number + ")[c]" : ""); + /// + /// Prefix string for the dependency. + /// public string prefix; + /// + /// The dependency challenge's ID. + /// public AscensionChallenge challenge; + /// + /// How many of the given challenge are required. + /// public int number; } } \ No newline at end of file diff --git a/InscryptionAPI/Ascension/ChallengeManager.cs b/InscryptionAPI/Ascension/ChallengeManager.cs index 5824764b8..fc5f532aa 100644 --- a/InscryptionAPI/Ascension/ChallengeManager.cs +++ b/InscryptionAPI/Ascension/ChallengeManager.cs @@ -288,6 +288,12 @@ public FullChallenge SetCustomUnlock(Func check) CustomUnlockCheck = check; return this; } + /// + /// Marks this challenge as using the boss icon appearance in the select screen. + /// This means occupying an entire column. + /// + /// Whether or not this challenge's icon should occupy an entire column of its page. + /// The same so a chain can continue. public FullChallenge SetBoss(bool boss) { Boss = boss; @@ -295,12 +301,12 @@ public FullChallenge SetBoss(bool boss) } } /// - /// The list of all base game challenges in the form of ChallengeManager.FullChallenge. + /// The list of all base game challenges in the form of . /// public static readonly ReadOnlyCollection BaseGameChallenges = new(GenBaseGameChallenges()); internal static readonly ObservableCollection NewInfos = new(); /// - /// The list of all new challenges added with the API in the form of ChallengeManager.FullChallenge. + /// The list of all new challenges added with the API in the form of . /// public static readonly ReadOnlyCollection NewChallenges = new(NewInfos); @@ -349,7 +355,9 @@ internal static FullChallenge[] GetChallengeIcons() return screen.icons?.FindAll(x => x != null && x.challengeInfo != null && x.challengeInfo.challengeType != AscensionChallenge.None && x.challengeInfo.GetFullChallenge() != null)? .ConvertAll(x => x.challengeInfo.challengeType.GetFullChallenge())?.ToArray() ?? new FullChallenge[0]; } - + /// + /// A hook for modders to add custom code to modify the challenge list dynamically. + /// public static event Func, List> ModifyChallenges; private static AscensionChallengeInfo CloneChallengeInfo(AscensionChallengeInfo info) @@ -366,7 +374,9 @@ private static AscensionChallengeInfo CloneChallengeInfo(AscensionChallengeInfo }; return retval; } - + /// + /// Resynchronizes the challenge list. + /// public static void SyncChallengeList() { List asci = new(NewInfos); diff --git a/InscryptionAPI/Ascension/StarterDeckExtensions.cs b/InscryptionAPI/Ascension/StarterDeckExtensions.cs index 92baaa61b..1c0959e2e 100644 --- a/InscryptionAPI/Ascension/StarterDeckExtensions.cs +++ b/InscryptionAPI/Ascension/StarterDeckExtensions.cs @@ -4,6 +4,9 @@ namespace InscryptionAPI.Ascension; +/// +/// Class that stores extensions related to starter decks. +/// public static partial class StarterDeckExtensions { private static Sprite GetPortrait(Texture2D portrait, TextureHelper.SpriteType spriteType, FilterMode? filterMode = null) @@ -12,10 +15,10 @@ private static Sprite GetPortrait(Texture2D portrait, TextureHelper.SpriteType s } /// - /// Sets the Unlock Level of a Starter Deck. + /// Sets this starter deck's unlock level. /// - /// The StarterDeckInfo of the Deck. - /// The Unlock Level to set the Starter Deck with. + /// The of the Deck. + /// The challenge level required before this starter deck is available. public static void SetUnlockLevel(this StarterDeckInfo info, int unlockLevel) { StarterDeckManager.FullStarterDeck fullStarterDeck = StarterDeckManager.AllDecks.FirstOrDefault(x => x.Info == info); @@ -26,10 +29,10 @@ public static void SetUnlockLevel(this StarterDeckInfo info, int unlockLevel) } /// - /// Gets the Unlock Level associated with a Starter deck. + /// Gets the unlock level for the given . /// - /// The StarterDeckInfo of the Deck. - /// Returns the Unlock Level, if it fails it will return . + /// The to access. + /// Returns the starter deck's unlock level, or -1 if an error occurs. public static int GetUnlockLevel(this StarterDeckInfo info) { StarterDeckManager.FullStarterDeck fullStarterDeck = StarterDeckManager.AllDecks.FirstOrDefault(x => x.Info == info); @@ -37,6 +40,6 @@ public static int GetUnlockLevel(this StarterDeckInfo info) { return fullStarterDeck.UnlockLevel; } - return int.MaxValue; + return -1; } } \ No newline at end of file diff --git a/InscryptionAPI/Ascension/StarterDeckExtensionsPortraits.cs b/InscryptionAPI/Ascension/StarterDeckExtensionsPortraits.cs index 14889232d..2a733db84 100644 --- a/InscryptionAPI/Ascension/StarterDeckExtensionsPortraits.cs +++ b/InscryptionAPI/Ascension/StarterDeckExtensionsPortraits.cs @@ -10,9 +10,9 @@ public static partial class StarterDeckExtensions /// /// Sets the icon texture for the starter deck. /// - /// StarterDeckInfo to access. + /// to access. /// The path to the .png file containing the artwork (relative to the Plugins directory). - /// The same StarterDeckInfo so a chain can continue. + /// The same so a chain can continue. public static StarterDeckInfo SetIconTexture(this StarterDeckInfo info, string pathToArt) { try @@ -28,10 +28,10 @@ public static StarterDeckInfo SetIconTexture(this StarterDeckInfo info, string p /// /// Sets the icon texture for the starter deck. /// - /// StarterDeckInfo to access. + /// to access. /// The texture containing the emission. /// The filter mode for the texture, or null if no change. - /// The same StarterDeckInfo so a chain can continue. + /// The same so a chain can continue. public static StarterDeckInfo SetIconTexture(this StarterDeckInfo info, Texture2D portrait, FilterMode? filterMode = null) { return info.SetIconTexture(GetPortrait(portrait, TextureHelper.SpriteType.CardPortrait, filterMode)); @@ -40,9 +40,9 @@ public static StarterDeckInfo SetIconTexture(this StarterDeckInfo info, Texture2 /// /// Sets the icon texture for the starter deck. /// - /// StarterDeckInfo to access. + /// to access. /// The sprite containing the emission. - /// The same StarterDeckInfo so a chain can continue. + /// The same so a chain can continue. public static StarterDeckInfo SetIconTexture(this StarterDeckInfo info, Sprite sprite) { if (info.iconSprite == null) diff --git a/InscryptionAPI/Ascension/StarterDeckManager.cs b/InscryptionAPI/Ascension/StarterDeckManager.cs index 2b5e36803..3b77a25e8 100644 --- a/InscryptionAPI/Ascension/StarterDeckManager.cs +++ b/InscryptionAPI/Ascension/StarterDeckManager.cs @@ -7,28 +7,51 @@ namespace InscryptionAPI.Ascension; +/// +/// This manager class handles the creation and management of mod-added starter decks. +/// [HarmonyPatch] -public static class StarterDeckManager -{ +public static class StarterDeckManager { + /// + /// A utility class that holds all of the required information about a starter deck in order to be able to use it in-game. + /// public class FullStarterDeck { + /// + /// The description object for this starter deck. + /// public StarterDeckInfo Info { get; set; } + /// + /// The challenge level this starter deck becomes available. + /// public int UnlockLevel { get; set; } /// /// A function that needs to return true for the starter deck to be unlocked. Optional. If this isn't set, this check will be bypassed. The int argument is the current Kaycee's Mod challenge level. /// public Func CustomUnlockCheck { get; set; } + /// + /// The internal names of the cards contained in this starter deck. + /// public List CardNames { get; set; } // For delayed loading of actual card names } + /// + /// All of the vanilla game's starter decks. + /// public static readonly ReadOnlyCollection BaseGameDecks = new(GetBaseGameDecks()); internal static readonly ObservableCollection NewDecks = new(); - public static List AllDecks = BaseGameDecks.ToList(); - public static List AllDeckInfos = BaseGameDecks.Select(fsd => fsd.Info).ToList(); + /// + /// The current processed list of all starter decks in the game, including vanilla and mod-added starter decks. + /// + public static List AllDecks { get; private set; } = BaseGameDecks.ToList(); + /// + /// The current processed list of all objects in the game, including vanilla and mod-added starter decks. + /// + public static List AllDeckInfos { get; private set; } = BaseGameDecks.Select(fsd => fsd.Info).ToList(); private static List GetBaseGameDecks() { @@ -63,8 +86,14 @@ private static FullStarterDeck CloneStarterDeck(FullStarterDeck info) return retval; } + /// + /// A hook for modders to add custom code to modify the starter deck list dynamically. + /// public static event Func, List> ModifyDeckList; + /// + /// Resynchronizes the starter deck list. + /// public static void SyncDeckList() { var decks = BaseGameDecks.Concat(NewDecks).Select(CloneStarterDeck).ToList(); @@ -118,6 +147,13 @@ static StarterDeckManager() }; } + /// + /// Creates a new starter deck using the given and registers it with the API. + /// + /// The GUID of the mod adding this starter deck. + /// The for this starter deck. + /// The minimum challenge level for this starter deck to become available. + /// The object containing this starter deck's information. public static FullStarterDeck Add(string pluginGuid, StarterDeckInfo info, int unlockLevel = 0) { info.name = pluginGuid + "_" + (info.title ?? info.name); @@ -133,6 +169,15 @@ public static FullStarterDeck Add(string pluginGuid, StarterDeckInfo info, int u return fsd; } + /// + /// Creates a new starter deck and registers it with the API. + /// + /// The GUID of the mod adding this starter deck. + /// The title and internal name of this starter deck. + /// The icon texture to display for this starter deck in the deck selection screen. + /// The internal names of the cards contained in this starter deck. + /// The minimum challenge level for this starter deck to become available. + /// The object containing this starter deck's information. public static FullStarterDeck New(string pluginGuid, string title, Texture2D iconTexture, string[] cardNames, int unlockLevel = 0) { StarterDeckInfo info = ScriptableObject.CreateInstance(); @@ -149,7 +194,17 @@ public static FullStarterDeck New(string pluginGuid, string title, Texture2D ico return fsd; } - + + /// + /// Variant of that allows for a separate internal name to be defined rather than using the title. + /// + /// The GUID of the mod adding this starter deck. + /// The internal name of this starter deck. + /// The title/name of this starter deck. + /// The icon texture to display for this starter deck in the deck selection screen. + /// The internal names of the cards contained in this starter deck. + /// The minimum challenge level for this starter deck to become available. + /// The object containing this starter deck's information. public static FullStarterDeck New(string pluginGuid, string name, string title, Texture2D iconTexture, string[] cardNames, int unlockLevel = 0) { StarterDeckInfo info = ScriptableObject.CreateInstance(); @@ -167,12 +222,31 @@ public static FullStarterDeck New(string pluginGuid, string name, string title, return fsd; } + /// + /// Creates a new starter deck and registers it with the API. + /// + /// The GUID of the mod adding this starter deck. + /// The title/name of this starter deck. + /// The file path for the icon texture to display for this starter deck in the deck selection screen (relative to the Plugins folder). + /// The internal names of the cards contained in this starter deck. + /// The minimum challenge level for this starter deck to become available. + /// The object containing this starter deck's information. public static FullStarterDeck New(string pluginGuid, string title, string pathToIconTexture, string[] cardNames, int unlockLevel = 0) { Texture2D texture = TextureHelper.GetImageAsTexture(pathToIconTexture); return New(pluginGuid, title, texture, cardNames, unlockLevel); } - + + /// + /// Variant of that allows for a separate internal name to be defined rather than using the title. + /// + /// The GUID of the mod adding this starter deck. + /// The internal name of this starter deck. + /// The title/name of this starter deck. + /// The file path for the icon texture to display for this starter deck in the deck selection screen (relative to the Plugins folder). + /// The internal names of the cards contained in this starter deck. + /// The minimum challenge level for this starter deck to become available. + /// The object containing this starter deck's information. public static FullStarterDeck New(string pluginGuid, string name, string title, string pathToIconTexture, string[] cardNames, int unlockLevel = 0) { Texture2D texture = TextureHelper.GetImageAsTexture(pathToIconTexture); diff --git a/InscryptionAPI/Ascension/StarterDeckPaginator.cs b/InscryptionAPI/Ascension/StarterDeckPaginator.cs index 2580b5fe2..8ce8ec464 100644 --- a/InscryptionAPI/Ascension/StarterDeckPaginator.cs +++ b/InscryptionAPI/Ascension/StarterDeckPaginator.cs @@ -5,6 +5,9 @@ namespace InscryptionAPI.Ascension; +/// +/// Class that handles adding displaying starter decks and allows for multiple pages of starter decks. +/// public class StarterDeckPaginator : MonoBehaviour { private static Sprite noneDeckSprite; @@ -15,7 +18,11 @@ private void Initialize(AscensionChooseStarterDeckScreen screen) pageLength = screen.deckIcons.Count; this.screen = screen; } - + /// + /// Adds a new page of starter decks to the list of pages. + /// Pages contain (by default) up to 8 starter deck. Excess decks overflow onto new pages. + /// + /// s that will be displayed on this page. public void AddPage(List page) { if (page.Count < pageLength) @@ -27,7 +34,9 @@ public void AddPage(List page) } pages.Add(page); } - + /// + /// Loads the next page. Wraps around to the first page if currently on the last page. + /// public void NextPage() { pageIndex++; @@ -37,7 +46,9 @@ public void NextPage() } LoadPage(pages[pageIndex]); } - + /// + /// Loads the previous page. Wraps around to the last page if currently on the first page. + /// public void PreviousPage() { pageIndex--; @@ -48,6 +59,10 @@ public void PreviousPage() LoadPage(pages[pageIndex]); } + /// + /// Loads the challenge page at the given index. + /// + /// Index of the page to load. public void LoadPage(List page) { List sorted = new List(screen.deckIcons); @@ -82,7 +97,9 @@ public void LoadPage(List page) } CommandLineTextDisplayer.PlayCommandLineClickSound(); } - + /// + /// Initialise the starter deck screen and pages whenever the starter deck screen is enabled. + /// public void OnEnable() { StarterDeckManager.SyncDeckList(); @@ -156,10 +173,29 @@ public void OnEnable() LoadPage(pages[0]); } + /// + /// The UI interactable for moving to the previous page. + /// public GameObject leftArrow; + /// + /// The UI interactable for moving to the next page. + /// public GameObject rightArrow; + /// + /// The current page index. Determines what starter decks are currently displayed. + /// public int pageIndex; + /// + /// A List representing the entire collection of pages. + /// public List> pages; + /// + /// How many decks are displayed on each page. + /// public int pageLength; + + /// + /// Object that handles displaying starter decks. + /// public AscensionChooseStarterDeckScreen screen; } \ No newline at end of file diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 9d9bca0c2..4f9de7fe4 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -33,33 +33,33 @@ private class AbilityExt public class FullAbility { /// - /// The unique ID for this ability + /// The unique ID for this ability. /// public readonly Ability Id; /// - /// The guid of the mod that added this ability + /// The GUID of the mod that added this ability. /// public readonly string ModGUID; /// - /// The description object for this ability + /// The description object for this ability. /// public readonly AbilityInfo Info; /// - /// A subclass of that implements the logic for the ability + /// A subclass of that implements the logic for the ability. /// public readonly Type AbilityBehavior; /// - /// A 49x49 texture for the ability icon + /// A 49x49 texture for the ability icon. /// /// public Texture Texture { get; internal set; } /// - /// A 49x49 texture for the ability icon, used when the card belongs to the opponent + /// A 49x49 texture for the ability icon, used when the card belongs to the opponent. /// /// public Texture CustomFlippedTexture { get; internal set; } @@ -287,9 +287,9 @@ private static List GenBaseGameAbilityList() } /// - /// Creates a new ability and registers it to be able to be added to cards + /// Creates a new ability and registers it to be able to be added to cards. /// - /// The guid of the mod adding the ability. + /// The GUID of the mod adding the ability. /// An instance of describing the ability. /// A subclass of that implements the logic for the ability. /// The ability icon as a 49x49 texture. @@ -314,7 +314,7 @@ public static FullAbility Add(string guid, AbilityInfo info, Type behavior, Text /// /// Creates a new ability and registers it to be able to be added to cards /// - /// The guid of the mod adding the ability. + /// The GUID of the mod adding the ability. /// The name of the ability. /// The description as it appears in the game's rulebook. /// A subclass of that implements the logic for the ability. @@ -331,7 +331,7 @@ public static AbilityInfo New(string guid, string rulebookName, string rulebookD /// /// Creates a new ability and registers it to be able to be added to cards /// - /// The guid of the mod adding the ability. + /// The GUID of the mod adding the ability. /// The name of the ability. /// The description as it appears in the game's rulebook. /// A subclass of that implements the logic for the ability. From 7425126d12c23a1c80923070f18d9143a384b49b Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:46:15 -0800 Subject: [PATCH 38/74] Add XML --- InscryptionAPI/Boons/BoonBehaviour.cs | 20 ++++++++++---------- InscryptionAPI/Boons/BoonManager.cs | 23 ++++++++++++++++++++++- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/InscryptionAPI/Boons/BoonBehaviour.cs b/InscryptionAPI/Boons/BoonBehaviour.cs index 27dfc811f..e6934dfe7 100644 --- a/InscryptionAPI/Boons/BoonBehaviour.cs +++ b/InscryptionAPI/Boons/BoonBehaviour.cs @@ -4,24 +4,24 @@ namespace InscryptionAPI.Boons; /// -/// Base class for all custom Boons +/// Base class for all custom Boons. /// public class BoonBehaviour : NonCardTriggerReceiver { private static List instances; /// - /// The unique id for this boon + /// The unique id for this boon. /// public BoonManager.FullBoon boon { get; internal set; } /// - /// The instance number for this boon once instantiated + /// The instance number for this boon once instantiated. /// public int instanceNumber { get; internal set; } /// - /// Fires when the boon behavior starts up + /// Fires when the starts up. /// public void Start() { @@ -32,7 +32,7 @@ public void Start() } /// - /// Fires when the boon behaviour is destroyed + /// Fires when the is destroyed. /// public new void OnDestroy() { @@ -40,27 +40,27 @@ public void Start() } /// - /// Gets all active boon behaviours for the given boon type + /// Gets all active s for the given boon type. /// /// The boon type to search for. - /// A list of all boon behaviours that are active in battle. + /// A list of all s that are active in battle. public static List FindInstancesOfType(BoonData.Type type) { return Instances.FindAll((x) => x.boon.boon.type == type); } /// - /// Gets the count of active boon behaviours for the given boon type + /// Gets the count of active s for the given boon type /// /// The boon type to search for. - /// The count of all boon behaviours that are active in battle. + /// The count of all s that are active in battle. public static int CountInstancesOfType(BoonData.Type type) { return FindInstancesOfType(type).Count; } /// - /// Indicates if there are any active boon behaviours of the given type + /// Indicates if there are any active s of the given type /// /// The boon type to search for. /// True if there is at least one boon of the given type; false otherwise. diff --git a/InscryptionAPI/Boons/BoonManager.cs b/InscryptionAPI/Boons/BoonManager.cs index 7046ba0ce..cb182c1c8 100644 --- a/InscryptionAPI/Boons/BoonManager.cs +++ b/InscryptionAPI/Boons/BoonManager.cs @@ -26,7 +26,7 @@ public class FullBoon public BoonData boon; /// - /// A subclass of [BoonBehaviour](xref:InscryptionAPI.Boons.BoonBehaviour) that implements the boon's behaviour. + /// A subclass of that implements the boon's logic. /// public Type boonHandlerType; @@ -40,6 +40,9 @@ public class FullBoon ///
public bool stacks; + /// + /// Metacategories for what rulebooks this boon should appear in. + /// public List metaCategories = new(); /// @@ -56,6 +59,10 @@ public class FullBoon /// All boons that come as part of the vanilla game. /// public static readonly ReadOnlyCollection BaseGameBoons = new(Resources.LoadAll("Data/Boons")); + + /// + /// All of the vanilla game's boons as objects. + /// public static readonly List FullBaseGameBoons = BaseGameBoons.Select(x => new FullBoon() { appearInRulebook = true, @@ -66,6 +73,9 @@ public class FullBoon }).ToList(); internal static readonly ObservableCollection NewBoons = new(); + /// + /// The current processed list of all boons in the game, including vanilla and mod-added boons. + /// public static List AllFullBoons { get; private set; } = new(FullBaseGameBoons); /// @@ -163,6 +173,12 @@ public static BoonData.Type New(string guid, string name, string rulebookDesc return New(guid, name, rulebookDescription, pathToIcon, pathToCardArt, stackable, appearInLeshyTrials, appearInRulebook); } + /// + /// Extension method for adding metacategories to a boon based on its ID. + /// + /// The boon ID. + /// Metacategories to add. + /// The same Boon ID so a chain can continue. public static BoonData.Type AddRuleBookCategories(this BoonData.Type boonType, params AbilityMetaCategory[] categories) { FullBoon boon = boonType.GetFullBoon(); @@ -176,6 +192,11 @@ public static BoonData.Type AddRuleBookCategories(this BoonData.Type boonType, p } return boonType; } + /// + /// Retrieves the object associated with the given boon ID. + /// + /// The boon ID. + /// The boon's object, or null if not found. public static FullBoon GetFullBoon(this BoonData.Type boonType) { return AllFullBoons.Find(x => x.boon.type == boonType); From 1f05ef6fa038d96a28d7a36d9033820370403062 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:48:17 -0800 Subject: [PATCH 39/74] Add tag --- InscryptionAPI/Card/AbilityManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 4f9de7fe4..49ff0a2d0 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -173,7 +173,8 @@ public FullAbility Clone() /// /// A hook for modders to add custom code to modify the ability list dynamically. /// - /// There are two primary use cases for this hook: + /// + /// There are two primary use cases for this hook: /// /// - Making changes to abilities that may be added after your plugin initializes /// - Making context-aware changes to abilities @@ -193,7 +194,7 @@ public FullAbility Clone() /// To use this, you need to add a delegate that accepts the current list of all abilities, then returns /// that same list back. /// - /// ```c# + /// /// AbilityManager.ModifyAbilityList += delegate(List<FullAbility> abilities) /// { /// // Add the rulebook metacategories to every single ability @@ -201,7 +202,7 @@ public FullAbility Clone() /// ability.info.AddMetaCategories(AbilityMetaCategory.Part1Rulebook, AbilityMetaCategory.Part3Rulebook); /// return abilities; /// } - /// ``` + /// /// public static event Func, List> ModifyAbilityList; From e4c956b35ce0c94e4e7988158b213ac9f6263a68 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:49:40 -0800 Subject: [PATCH 40/74] Add break tags to retain XML formatting in actual documentation --- InscryptionAPI/Card/AbilityManager.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 49ff0a2d0..8cecfa618 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -175,25 +175,25 @@ public FullAbility Clone() /// /// /// There are two primary use cases for this hook: - /// + ///

/// - Making changes to abilities that may be added after your plugin initializes /// - Making context-aware changes to abilities - /// + ///

/// The way this operates is as follows: - /// + ///

/// 1. The makes a copy of all objects. Note that unlike the similar code in CardManager, this is actually a *deep* copy of the AbilityInfo. /// 2. The code in is executed on the copy of those abilities. /// 3. The modified list becomes the game's new official list of abilities. - /// + ///

/// The reason the abilities are cloned before processing is so that you can make any change to them you wish /// without affecting the original ability. This means that you do not need to try to track changes or remember /// what the original version of the ability looked like before you started changing it; the next time /// is called, all changes will be reverted /// and then re-applied. - /// + ///

/// To use this, you need to add a delegate that accepts the current list of all abilities, then returns /// that same list back. - /// + ///

/// /// AbilityManager.ModifyAbilityList += delegate(List<FullAbility> abilities) /// { @@ -214,7 +214,8 @@ public FullAbility Clone() /// /// Resynchronizes the ablity list. /// - /// Most importantly, this re-executes all custom code that was added to the + /// + /// Most importantly, this re-executes all custom code that was added to the /// event. If you are doing any sort of context-aware processing of the ability list, you may need to manually /// call this method in order to make sure that your code executes correctly. However, this automatically gets called /// every time that the game transitions from either the main menu into the base game, or whenever a new run is From b000129c551b1c2be538257d029c42208cc24e21 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:50:20 -0800 Subject: [PATCH 41/74] Fix duplicate /// --- InscryptionAPI/Card/SpecialStatIconManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InscryptionAPI/Card/SpecialStatIconManager.cs b/InscryptionAPI/Card/SpecialStatIconManager.cs index ae4d87440..8e2fa1bca 100644 --- a/InscryptionAPI/Card/SpecialStatIconManager.cs +++ b/InscryptionAPI/Card/SpecialStatIconManager.cs @@ -148,7 +148,7 @@ public static FullStatIcon Add(string guid, StatIconInfo info, Type behavior) return full; } - /// /// + /// /// Creates a new stat icon and registers it to be able to be added to cards /// /// The guid of the mod adding the ability. From 1b7df0459271952e7b8ad7c92ea66354b1545021 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Fri, 13 Nov 2026 23:51:31 -0800 Subject: [PATCH 42/74] Fix numbered list in XML --- InscryptionAPI/Card/AbilityManager.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 8cecfa618..dc65222e6 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -182,17 +182,15 @@ public FullAbility Clone() /// The way this operates is as follows: ///

/// 1. The makes a copy of all objects. Note that unlike the similar code in CardManager, this is actually a *deep* copy of the AbilityInfo. - /// 2. The code in is executed on the copy of those abilities. - /// 3. The modified list becomes the game's new official list of abilities. + ///
2. The code in is executed on the copy of those abilities. + ///
3. The modified list becomes the game's new official list of abilities. ///

/// The reason the abilities are cloned before processing is so that you can make any change to them you wish /// without affecting the original ability. This means that you do not need to try to track changes or remember /// what the original version of the ability looked like before you started changing it; the next time - /// is called, all changes will be reverted - /// and then re-applied. + /// is called, all changes will be reverted and then re-applied. ///

- /// To use this, you need to add a delegate that accepts the current list of all abilities, then returns - /// that same list back. + /// To use this, you need to add a delegate that accepts the current list of all abilities, then returns that same list back. ///

/// /// AbilityManager.ModifyAbilityList += delegate(List<FullAbility> abilities) From 6d64474a5907293a4eb47b0ed613432a8b5b0b70 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sat, 14 Nov 2026 21:56:02 -0800 Subject: [PATCH 43/74] XML for files in folders: Dialogue, Encounters XML for NewNodeManager Fixes to XML in other areas Some minor code fixes I forget --- .../Ascension/StarterDeckManager.cs | 2 +- InscryptionAPI/Card/AbilityManager.cs | 4 +- InscryptionAPI/Card/ShieldManager.cs | 2 +- InscryptionAPI/Dialogue/CustomLine.cs | 45 +++++++ InscryptionAPI/Dialogue/DialogueManager.cs | 123 +++++++++++++++++- InscryptionAPI/Encounters/AIManager.cs | 30 ++++- .../Encounters/CachedGBCNPCDescriptor.cs | 22 ++++ InscryptionAPI/Encounters/CustomNodeData.cs | 3 + InscryptionAPI/Encounters/EncounterBuilder.cs | 23 ++++ .../Encounters/EncounterExtensions.cs | 110 +++++++++++++--- InscryptionAPI/Encounters/EncounterManager.cs | 6 + .../Encounters/ICustomExhaustSequence.cs | 9 +- .../Encounters/ICustomNodeSequence.cs | 2 +- InscryptionAPI/Encounters/NodeManager.cs | 34 ++++- InscryptionAPI/Encounters/OpponentManager.cs | 69 +++++++++- .../Encounters/SpecialSequenceManager.cs | 30 +++++ InscryptionAPI/Encounters/TurnBuilder.cs | 22 ++++ InscryptionAPI/Nodes/NewNodeManager.cs | 66 ++++++++-- 18 files changed, 556 insertions(+), 46 deletions(-) diff --git a/InscryptionAPI/Ascension/StarterDeckManager.cs b/InscryptionAPI/Ascension/StarterDeckManager.cs index 3b77a25e8..4eae29631 100644 --- a/InscryptionAPI/Ascension/StarterDeckManager.cs +++ b/InscryptionAPI/Ascension/StarterDeckManager.cs @@ -8,7 +8,7 @@ namespace InscryptionAPI.Ascension; /// -/// This manager class handles the creation and management of mod-added starter decks. +/// Manager class that handles the creation and management of mod-added starter decks. /// [HarmonyPatch] public static class StarterDeckManager { diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index dc65222e6..988ea6221 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -15,7 +15,7 @@ namespace InscryptionAPI.Card; /// -/// This manager class handles the creation and management of mod-added abilities (sigils). +/// Manager class that handles the creation and management of mod-added abilities (sigils). /// [HarmonyPatch] public static class AbilityManager @@ -293,7 +293,7 @@ private static List GenBaseGameAbilityList() /// An instance of describing the ability. /// A subclass of that implements the logic for the ability. /// The ability icon as a 49x49 texture. - /// An instance of containing all this ability's data.. + /// An instance of containing all this ability's data. /// The actual unique identifier for the new ability will be found in the 'ability' field of /// the returned object. There is no way for the modder to create a specific ability ID; it will /// always be assigned by the API. diff --git a/InscryptionAPI/Card/ShieldManager.cs b/InscryptionAPI/Card/ShieldManager.cs index ba6b6f725..aee63373a 100644 --- a/InscryptionAPI/Card/ShieldManager.cs +++ b/InscryptionAPI/Card/ShieldManager.cs @@ -12,7 +12,7 @@ namespace InscryptionAPI.Card; /// -/// This manager class handles the logic for shields. +/// Manager class that handles the logic for shields. /// [HarmonyPatch] public static class ShieldManager diff --git a/InscryptionAPI/Dialogue/CustomLine.cs b/InscryptionAPI/Dialogue/CustomLine.cs index d3f37043c..1f277acac 100644 --- a/InscryptionAPI/Dialogue/CustomLine.cs +++ b/InscryptionAPI/Dialogue/CustomLine.cs @@ -2,10 +2,26 @@ namespace InscryptionAPI.Dialogue; +/// +/// Struct representing a line of dialogue. Compatible with use in all acts. +/// +/// +/// For simple dialogue, you can substitute strings for this object in methods like +/// ; they are automatically converted. +/// public struct CustomLine { + /// + /// Constructs a new, empty . + /// public CustomLine() { } + /// + /// Converts this object to the vanilla . + /// + /// + /// + /// public DialogueEvent.Line ToLine(List speakers, DialogueEvent.Speaker defaultSpeaker = DialogueEvent.Speaker.Single) { if (speaker == DialogueEvent.Speaker.Single) @@ -28,18 +44,47 @@ public DialogueEvent.Line ToLine(List speakers, DialogueE storyConditionMustBeMet = storyConditionMustBeMet }; } + /// + /// Implicitly converts strings to objects in relevant cases. + /// + /// public static implicit operator CustomLine(string str) { return new CustomLine { text = str }; } + /// + /// What face P03 should make when playing this dialogue. + /// public P03AnimationController.Face p03Face = default; + /// + /// What emotion the speaker should use when playing this dialogue. + /// public Emotion emotion = default; + /// + /// How the dialogue text should be animated. + /// public TextDisplayer.LetterAnimation letterAnimation = default; + /// + /// What speaker data should be used when playing this dialogue. Controls the voice and font used. + /// public DialogueEvent.Speaker speaker = default; + /// + /// The actual dialogue text. + /// public string text = default; + /// + /// String representing special instruction to control other parts of the speaker not otherwise covered. + /// See for more information. + /// public string specialInstruction = default; + /// + /// The story condition that must be met if storyConditionMustBemet is true. + /// public StoryEvent storyCondition = StoryEvent.BasicTutorialCompleted; + /// + /// Whether the specific story condition must be met before this dialogue can be played. + /// public bool storyConditionMustBeMet = default; } \ No newline at end of file diff --git a/InscryptionAPI/Dialogue/DialogueManager.cs b/InscryptionAPI/Dialogue/DialogueManager.cs index c19f5e519..d4354998c 100644 --- a/InscryptionAPI/Dialogue/DialogueManager.cs +++ b/InscryptionAPI/Dialogue/DialogueManager.cs @@ -8,25 +8,63 @@ namespace InscryptionAPI.Dialogue; +/// +/// Manager class for handling custom dialogue. +/// public static class DialogueManager { + /// + /// Utility class that associates a custom with the GUID of the mod that added it. + /// public class Dialogue { + /// + /// The actual dialogue data. + /// public DialogueEvent DialogueEvent; + /// + /// GUID of the mod that added this dialogue. + /// public string PluginGUID; } - public class DialogueColor - { + /// + /// Utility class for custom colour codes. Used in dialogue to colour text. + /// + public class DialogueColor { + /// + /// The custom colour. + /// public Color Color; + /// + /// The dialogue code used to colour text. + /// public string ColorCode; + /// + /// GUID of the mod that added this colour. + /// public string PluginGUID; } + /// + /// All custom dialogue added through the API. + /// public static List CustomDialogue = new(); + /// + /// All custom dialogue colours added through the API. + /// public static List CustomDialogueColor = new(); + /// + /// Dictionary that matches custom colour codes to the correct colour. + /// public static Dictionary ColorLookup = new(); + /// + /// Adds a new to the API. + /// + /// GUID of the mod adding this event. + /// The to add. + /// A object containing the event and associated GUID. public static Dialogue Add(string pluginGUID, DialogueEvent dialogueEvent) { Dialogue dialogue = new() @@ -44,6 +82,35 @@ public static Dialogue Add(string pluginGUID, DialogueEvent dialogueEvent) return dialogue; } + /// + /// Adds a new colour code that can be used in dialogue events to colour text. + ///

+ /// Colour codes are in the following format:
+ /// [c:{code}]{dialogue}[c:] + ///

+ /// Vanilla codes are: + ///
dB - dark blue + ///
g2 - gold + ///
G - gold + ///
bG - bright gold + ///
bB - bright blue + ///
g3 - blue + ///
B - blue + ///
brnO - brown orange + ///
O - orange + ///
bR - bright red + ///
dlGr - dark lime green + ///
lGr - lime green + ///
g1 - bright lime green + ///
blGr - bright lime green + ///
dSG - dark seafoam green + ///
bSG - glow seafom green + ///
gray - 40% gray
+ ///
+ /// The GUID of the mod adding this colour. + /// The dialogue code for using this colour in text. + /// The colour associated with the code. + /// The new colour's data object. public static DialogueColor AddColor(string pluginGUID, string code, Color color) { DialogueColor data = new() @@ -57,6 +124,16 @@ public static DialogueColor AddColor(string pluginGUID, string code, Color color return data; } + /// + /// Creates a custom and registers it with the API so it can be used in-game. + /// + /// GUID of the mod adding this event. + /// Name of this event. + /// The dialogue to play when this event plays. + /// The dialogue to play when entering an already-introduced region. + /// How this event should handle repeat plays after all repeat dialogue has been exhausted. + /// The speaker ID for this event. Controls the font and voice used. + /// The new . public static DialogueEvent GenerateEvent(string pluginGUID, string name, List mainLines, List> repeatLines = null, DialogueEvent.MaxRepeatsBehaviour afterMaxRepeats = DialogueEvent.MaxRepeatsBehaviour.RandomDefinedRepeat, DialogueEvent.Speaker defaultSpeaker = DialogueEvent.Speaker.Single) { @@ -72,19 +149,53 @@ public static DialogueEvent GenerateEvent(string pluginGUID, string name, List + /// Creates a new with the correct prefix needed to make it play when trading the given pelt type. + ///
+ /// GUID of the mod adding this event. + /// of the pelt this event plays for. + /// The dialogue to play when this event plays. + /// The dialogue to play when entering an already-introduced region. + /// A for the given pelt's trade dialogue. public static DialogueEvent GenerateTraderPeltsEvent(string pluginGUID, PeltManager.PeltData peltData, List lines, List> repeatLines = null) { return GenerateTraderPeltsEvent(pluginGUID, peltData.peltTierName ?? PeltManager.GetTierNameFromData(peltData), lines, repeatLines); } + + /// + /// Creates a new with the correct prefix needed to make it play when trading the given pelt type. + /// + /// GUID of the mod adding this event. + /// Name of the pelt this event plays for. + /// The dialogue to play when this event plays. + /// The dialogue to play when entering an already-introduced region. + /// A for the given pelt's trade dialogue. public static DialogueEvent GenerateTraderPeltsEvent(string pluginGUID, string peltTierName, List lines, List> repeatLines = null) { return GenerateEvent(pluginGUID, "TraderPelts" + peltTierName, lines, repeatLines); } + /// + /// Creates a new with the correct prefix needed to make it play when entering a new region. + /// + /// GUID of the mod adding this event. + /// of the region this event is for. + /// The dialogue to play when this event plays. + /// The dialogue to play when entering an already-introduced region. + /// A for the given region introduction. public static DialogueEvent GenerateRegionIntroductionEvent(string pluginGUID, RegionData regionData, List lines, List> repeatLines = null) { return GenerateRegionIntroductionEvent(pluginGUID, regionData.name, lines, repeatLines); } + + /// + /// Creates a new with the correct prefix needed to make it play when entering a new region. + /// + /// GUID of the mod adding this event. + /// Name of the region this event is introducing. + /// The dialogue to play when this event plays. + /// The dialogue to play when entering an already-introduced region. + /// A for the given region introduction. public static DialogueEvent GenerateRegionIntroductionEvent(string pluginGUID, string regionName, List lines, List> repeatLines = null) { return GenerateEvent(pluginGUID, "Region" + regionName, lines, repeatLines); @@ -146,9 +257,9 @@ public static TextBox.Style GetStyleFromAmbition() #region Patches [HarmonyPatch(typeof(DialogueDataUtil), nameof(DialogueDataUtil.ReadDialogueData), new System.Type[] { })] - public class DialogueDataUtil_ReadDialogueData + private class DialogueDataUtil_ReadDialogueData { - public static void Postfix() + private static void Postfix() { List ids = DialogueDataUtil.data.events.Select((a) => a.id).ToList(); @@ -164,9 +275,9 @@ public static void Postfix() } [HarmonyPatch(typeof(DialogueParser), nameof(DialogueParser.GetColorFromCode), new System.Type[] { typeof(string), typeof(Color) })] - public class DialogueParser_GetColorFromCode + private class DialogueParser_GetColorFromCode { - public static bool Prefix(DialogueParser __instance, string code, Color defaultColor, ref Color __result) + private static bool Prefix(DialogueParser __instance, string code, Color defaultColor, ref Color __result) { string stringValue = DialogueParser.GetStringValue(code, "c"); if (ColorLookup.TryGetValue(stringValue, out Color value)) diff --git a/InscryptionAPI/Encounters/AIManager.cs b/InscryptionAPI/Encounters/AIManager.cs index a8fc40045..668938f00 100644 --- a/InscryptionAPI/Encounters/AIManager.cs +++ b/InscryptionAPI/Encounters/AIManager.cs @@ -5,13 +5,29 @@ namespace InscryptionAPI.Encounters; +/// +/// Manager class for custom opponent AIs. +/// public static class AIManager { - public class FullAI - { + /// + /// A utility class that holds all of the required information about an AI in order to be able to use it in-game. + /// + public class FullAI { + /// + /// The ID of the AI. Contains the GUID of the mod adding this AI. + /// public readonly string Id; + /// + /// The subclass for this AI. + /// public readonly Type AI; + /// + /// Creates a new instance of and registers its behaviour type with the . + /// + /// The ID of this AI. + /// The subclass that implements this AI's logic. public FullAI(string id, Type aiType) { Id = id; @@ -21,9 +37,15 @@ public FullAI(string id, Type aiType) } } + /// + /// All of the vanilla game's opponent AIs. + /// public readonly static ReadOnlyCollection BaseGameAIs = new(GenBaseGameAIsList()); private readonly static ObservableCollection NewAIs = new(); + /// + /// The current processed list of all opponent AIs in the game, including vanilla and mod-added AIs. + /// public static List AllAIs { get; private set; } = BaseGameAIs.ToList(); static AIManager() @@ -44,7 +66,9 @@ private static List GenBaseGameAIsList() } return baseGame; } - + /// + /// Creates a new AI and registers it to be able to be used for opponents. + /// public static FullAI Add(string guid, string aiName, Type sequencer) { FullAI full = new("AI_" + GuidManager.GetFullyQualifiedName(guid, aiName), sequencer); diff --git a/InscryptionAPI/Encounters/CachedGBCNPCDescriptor.cs b/InscryptionAPI/Encounters/CachedGBCNPCDescriptor.cs index 27cf274ca..c4ac6cd35 100644 --- a/InscryptionAPI/Encounters/CachedGBCNPCDescriptor.cs +++ b/InscryptionAPI/Encounters/CachedGBCNPCDescriptor.cs @@ -2,14 +2,36 @@ namespace InscryptionAPI.Encounters; +/// +/// Utility class for caching NPCs in Act 2. Primarily used for tracking the last triggered battle NPC. +/// public class CachedGCBNPCDescriptor { + /// + /// The ID of this NPC. + /// public string ID { get; set; } + /// + /// This NPC's . Used to determine the dialogue box style. + /// public CardTemple BossTemple { get; set; } + /// + /// If this NPC is a boss. + /// public bool IsBoss { get; set; } + /// + /// The board style used in this NPC's battle. + /// public PixelBoardSpriteSetter.BoardTheme BattleBackgroundTheme { get; set; } + /// + /// The dialogue object for the NPC. + /// public DialogueSpeaker DialogueSpeaker { get; set; } + /// + /// Creates a new + /// + /// public CachedGCBNPCDescriptor(CardBattleNPC npc) { ID = npc.ID; diff --git a/InscryptionAPI/Encounters/CustomNodeData.cs b/InscryptionAPI/Encounters/CustomNodeData.cs index 0748e0195..7aefe38d8 100644 --- a/InscryptionAPI/Encounters/CustomNodeData.cs +++ b/InscryptionAPI/Encounters/CustomNodeData.cs @@ -31,6 +31,9 @@ public class CustomNodeData : SpecialNodeData /// public override List ForceGenerationConditions => forceGenerationConditions; + /// + /// Default constructor that populates connectedNodes with an empty list. + /// public CustomNodeData() { this.connectedNodes = new List(); diff --git a/InscryptionAPI/Encounters/EncounterBuilder.cs b/InscryptionAPI/Encounters/EncounterBuilder.cs index 2d16cadd7..9ca0e9074 100644 --- a/InscryptionAPI/Encounters/EncounterBuilder.cs +++ b/InscryptionAPI/Encounters/EncounterBuilder.cs @@ -2,10 +2,18 @@ namespace InscryptionAPI.Encounters; +/// +/// Utility class that builds a basic and associates it with the region it appears in. +/// public class EncounterBuilderBlueprintData : EncounterBlueprintData { internal RegionData region; + /// + /// Initialises the basic data of this blueprint and the given region. + /// + /// Name of this blueprint. + /// The that this encounter appears in. public void SetBasic(string name, RegionData region) { this.region = region; @@ -13,10 +21,25 @@ public void SetBasic(string name, RegionData region) region.encounters ??= new(); region.encounters.Add(this); } + + /// + /// Returns the of this blueprint. + /// + /// The for this blueprint. + public RegionData Build() => region; } +/// +/// Utility class that adds extension methods for aiding in constructing encounters. +/// +[Obsolete("Not used by the API.")] public static class EncounterBuilder { + /// + /// Returns the of this builder blueprint. + /// + /// The to access. + /// The for this blueprint. public static RegionData Build(this EncounterBuilderBlueprintData blueprint) { return blueprint.region; diff --git a/InscryptionAPI/Encounters/EncounterExtensions.cs b/InscryptionAPI/Encounters/EncounterExtensions.cs index 99a1950e8..de682bba9 100644 --- a/InscryptionAPI/Encounters/EncounterExtensions.cs +++ b/InscryptionAPI/Encounters/EncounterExtensions.cs @@ -8,27 +8,59 @@ namespace InscryptionAPI.Encounters; +/// +/// Utility class that adds various extension methods to aid in easily creating new battle encounters and custom opponents. +/// [HarmonyPatch] public static class EncounterExtensions { #region Opponent Extensions + /// + /// Retrieves the that has the given ID. + /// + /// Collection of objects to search through. + /// The ID of the opponent. + /// The for this ID, or null if none exists. + /// + /// Intended for use with . + /// public static OpponentManager.FullOpponent OpponentById(this IEnumerable opponents, Opponent.Type id) { return opponents.FirstOrDefault(o => o.Id == id); } + /// + /// Sets the of this . + /// + /// The to access. + /// The subclass that will be used in-game against this opponent. + /// The same so a chain can continue. public static OpponentManager.FullOpponent SetOpponent(this OpponentManager.FullOpponent opp, Type opponentType) { opp.Opponent = opponentType; return opp; } + /// + /// Sets the for this . + /// + /// The to access. + /// The ID of the this opponent uses, if any. + /// The same so a chain can continue. public static OpponentManager.FullOpponent SetSequencer(this OpponentManager.FullOpponent opp, string sequenceId) { opp.SpecialSequencerId = sequenceId; return opp; } + /// + /// Registers then sets the for this . + /// + /// The to access. + /// The GUID of the mod adding the special sequencer. + /// The name of the this opponent uses + /// The subclass that implements the sequencer's logic. + /// The same so a chain can continue. public static OpponentManager.FullOpponent SetNewSequencer(this OpponentManager.FullOpponent opp, string pluginGuid, string sequencerName, Type sequencerType) { var newSequencer = SpecialSequenceManager.Add(pluginGuid, sequencerName, sequencerType); @@ -42,10 +74,12 @@ public static OpponentManager.FullOpponent SetNewSequencer(this OpponentManager. #region Setters /// /// Sets the difficulty range of this encounter.
- /// Difficulty is determined by the formula (6 * tier) + battle# + modifier. + /// Difficulty is determined by the formula: (6 * tier) + battle # + modifier ///
+ /// The to add this turn to. /// The minimum difficulty. /// The maximum difficulty. + /// The same so a chain can continue. public static T SetDifficulty(this T blueprint, int min, int max) where T : EncounterBlueprintData { blueprint.minDifficulty = min; @@ -57,7 +91,9 @@ public static T SetDifficulty(this T blueprint, int min, int max) where T : E /// Adds dominant tribes to this region.
/// The dominant tribes list determines the totems for this battle. /// + /// The to add this turn to. /// The tribes to add. + /// The same so a chain can continue. public static T AddDominantTribes(this T blueprint, params Tribe[] tribes) where T : EncounterBlueprintData { blueprint.dominantTribes ??= new(); @@ -68,6 +104,12 @@ public static T AddDominantTribes(this T blueprint, params Tribe[] tribes) wh return blueprint; } + /// + /// Sets whether this blueprint is region specific.
+ ///
+ /// The to add this turn to. + /// If this blueprint is specific to a region. + /// The same so a chain can continue. [Obsolete("regionSpecific is unused.")] public static T SetRegionSpecific(this T blueprint, bool enabled) where T : EncounterBlueprintData { @@ -79,7 +121,9 @@ public static T SetRegionSpecific(this T blueprint, bool enabled) where T : E /// Adds random replacement cards to this region.
/// A card from this list is selected whenever a card is randomly replaced by randomReplaceChance. /// + /// The to add this turn to. /// The cards to add. + /// The same so a chain can continue. public static T AddRandomReplacementCards(this T blueprint, params string[] cards) where T : EncounterBlueprintData { blueprint.randomReplacementCards ??= new(); @@ -98,13 +142,21 @@ public static T AddRandomReplacementCards(this T blueprint, params string[] c /// Adds redundant abilities to this region.
/// Redundant abilities will not be used on totems for this encounter. /// + /// The to add this turn to. /// The abilities to add. + /// The same so a chain can continue. public static T SetRedundantAbilities(this T blueprint, params Ability[] abilities) where T : EncounterBlueprintData { blueprint.redundantAbilities = abilities.ToList(); return blueprint; } + /// + /// Sets the list of cards that must be unlocked before this encounter can be used. + /// + /// The to add this turn to. + /// The internal names of the prerequisite cards. + /// The same so a chain can continue. public static T SetUnlockedCardPrerequisites(this T blueprint, params string[] cards) where T : EncounterBlueprintData { blueprint.unlockedCardPrerequisites ??= new(); @@ -117,6 +169,12 @@ public static T SetUnlockedCardPrerequisites(this T blueprint, params string[ return blueprint; } + /// + /// Sets this blueprints list of s. Vanilla mod blueprints are used to apply overclock in Act 3. + /// + /// The to add this turn to. + /// The s to assign to this blueprint. + /// The same so a chain can continue. public static T AddTurnMods(this T blueprint, params TurnModBlueprint[] turnMods) where T : EncounterBlueprintData { blueprint.turnMods = turnMods.ToList(); @@ -131,10 +189,10 @@ public static T AddTurnMods(this T blueprint, params TurnModBlueprint[] turnM /// /// Sets the minimum and maximum difficulty values for this CardBlueprint. /// - /// The CardBlueprint to access. + /// The to access. /// The minimum difficulty for this card to appear. /// The maximum difficulty for this card to appear at. - /// The same CardBlueprint so a chain can continue. + /// The same so a chain can continue. public static CardBlueprint SetDifficulty(this CardBlueprint card, int min, int max) { card.minDifficulty = min; @@ -143,13 +201,13 @@ public static CardBlueprint SetDifficulty(this CardBlueprint card, int min, int } /// - /// Sets whether what card the CardBlueprint will be replaced with if difficultyReplace == true, and what difficulty threshold it will be replaced. + /// Sets whether what card the CardBlueprint will be replaced with if difficultyReplace == true, and what difficulty threshold it will be replaced. /// - /// The CardBlueprint to access. + /// The to access. /// Whether this card will be replaced at certain difficulties. /// The name of the card that will replace this card. /// The minimum difficulty for the card to be replaced. - /// The same CardBlueprint so a chain can continue. + /// The same so a chain can continue. public static CardBlueprint SetReplacement(this CardBlueprint blueprint, string replacementName, int requiredDifficulty = 0, bool replaceWithDifficulty = true) { blueprint.difficultyReplace = replaceWithDifficulty; @@ -159,7 +217,7 @@ public static CardBlueprint SetReplacement(this CardBlueprint blueprint, string } /// - /// Sets the difficulties of each CardBlueprint in the list to the specified values. + /// Sets the difficulties of each in the list to the specified values. /// /// The list to access. /// The minimum difficulty. @@ -179,7 +237,7 @@ public static List SetTurnDifficulty(this List lis /// /// The list to access. /// How many times the list should be duplicated. - /// An array containing the newly duplicated lists. Use with EncounterBlueprintData.AddTurns(). + /// An array containing the newly duplicated lists. Use with . public static List[] DuplicateTurn(this List list, int amount) { List[] array = new List[1 + amount]; @@ -203,10 +261,11 @@ public static TurnBuilder CreateTurn(this T blueprint) where T : Encounter } /// - /// Adds a new turn to the EncounterBlueprintData using the specified CardBlueprints. + /// Adds a new turn to the using the specified s. /// - /// The CardBlurprints to add. If none are specified, creates an empty turn. - /// The same EncounterBlueprintData so a chain can continue. + /// The to add this turn to. + /// The blueprints to add. If none are specified, creates an empty turn. + /// The same so a chain can continue. public static T AddTurn(this T blueprint, params CardBlueprint[] cards) where T : EncounterBlueprintData { blueprint.AddTurn(cards?.ToList() ?? new()); @@ -214,10 +273,11 @@ public static T AddTurn(this T blueprint, params CardBlueprint[] cards) where } /// - /// Adds a new turn to the EncounterBlueprintData. + /// Adds a new turn to the . /// - /// The turn to add. If null, creates an empty turn. - /// The same EncounterBlueprintData so a chain can continue. + /// The to add this turn to. + /// The blueprints to add. If none are specified, creates an empty turn. + /// The same so a chain can continue. public static T AddTurn(this T blueprint, List turn = null) where T : EncounterBlueprintData { blueprint.turns ??= new(); @@ -226,10 +286,11 @@ public static T AddTurn(this T blueprint, List turn = null) wh } /// - /// Adds new turns to the EncounterBlueprintData using the specified CardBlueprint Lists. + /// Adds new turns to the using the specified CardBlueprint Lists. /// - /// The Lists of CardBlueprints to add to the EncounterBlueprintData. - /// The same EncounterBlueprintData so a chain can continue. + /// The to add this turn to. + /// Lists of blueprints to add to the . Each list represents a single turn. + /// The same so a chain can continue. public static T AddTurns(this T blueprint, params List[] turns) where T : EncounterBlueprintData { foreach (List turn in turns) @@ -238,6 +299,12 @@ public static T AddTurns(this T blueprint, params List[] turns return blueprint; } + /// + /// Adds new turns to the using the specified CardBlueprint Lists. + /// + /// The to add this turn to. + /// Lists of blueprints to add to the . Each list represents a single turn. + /// The same so a chain can continue. public static T AddTurns(this T blueprint, List> turns) where T : EncounterBlueprintData { blueprint.turns ??= new(); @@ -250,6 +317,9 @@ public static T AddTurns(this T blueprint, List> turns) w /// /// Duplicates the contents of the turn plan into itself the specified number of times. /// + /// The to add this turn to. + /// How many duplicates of this turn should be created. + /// A copy of this blueprint. public static T DuplicateTurns(this T blueprint, int amount) where T : EncounterBlueprintData { List> plan = new(); @@ -266,6 +336,10 @@ public static T DuplicateTurns(this T blueprint, int amount) where T : Encoun /// /// Sets the difficulty values of all CardBlueprints in the turn plan to the same values. /// + /// The to add this turn to. + /// The minimum difficulty for this blueprint to appear. + /// The maximum difficulty for this blueprint to appear at. + /// The same so a chain can continue. public static T SyncTurnDifficulties(this T blueprint, int minDifficulty, int maxDifficulty) where T : EncounterBlueprintData { foreach (List turn in blueprint.turns) @@ -296,7 +370,7 @@ private static IEnumerator CaptureLastKnownTriggeringNPC(IEnumerator sequence, C } /// - /// Gets information about the NPC that triggered the current battle + /// Gets information about the NPC that triggered the current battle. /// public static CachedGCBNPCDescriptor GetTriggeringNPC(this GBCEncounterManager mgr) { diff --git a/InscryptionAPI/Encounters/EncounterManager.cs b/InscryptionAPI/Encounters/EncounterManager.cs index e3659d54a..e8ed28e22 100644 --- a/InscryptionAPI/Encounters/EncounterManager.cs +++ b/InscryptionAPI/Encounters/EncounterManager.cs @@ -7,12 +7,18 @@ namespace InscryptionAPI.Encounters; +/// +/// Manager class that handles the creation and management of mod-added encounters. +/// public static class EncounterManager { /// /// All of the vanilla game's encounters. /// public static readonly ReadOnlyCollection BaseGameEncounters = new(Resources.LoadAll("Data")); + /// + /// All of the mod-added encounters. + /// public static readonly ObservableCollection NewEncounters = new(); /// diff --git a/InscryptionAPI/Encounters/ICustomExhaustSequence.cs b/InscryptionAPI/Encounters/ICustomExhaustSequence.cs index 4ddfb7c07..bae806161 100644 --- a/InscryptionAPI/Encounters/ICustomExhaustSequence.cs +++ b/InscryptionAPI/Encounters/ICustomExhaustSequence.cs @@ -11,11 +11,16 @@ namespace InscryptionAPI.Encounters; /// public interface ICustomExhaustSequence { - public bool RespondsToCustomExhaustSequence(CardDrawPiles drawPiles); + /// + /// If should be called. + /// + /// The CardDrawPiles instance for this scene. + /// True if this trigger should be run. + bool RespondsToCustomExhaustSequence(CardDrawPiles drawPiles); /// /// Executes the sequence that plays when the player exhausts their draw piles. /// /// The CardDrawPiles instance for this scene. /// An enumeration of Unity events. - public IEnumerator DoCustomExhaustSequence(CardDrawPiles drawPiles); + IEnumerator DoCustomExhaustSequence(CardDrawPiles drawPiles); } \ No newline at end of file diff --git a/InscryptionAPI/Encounters/ICustomNodeSequence.cs b/InscryptionAPI/Encounters/ICustomNodeSequence.cs index 2b62af325..cd5b37de3 100644 --- a/InscryptionAPI/Encounters/ICustomNodeSequence.cs +++ b/InscryptionAPI/Encounters/ICustomNodeSequence.cs @@ -12,5 +12,5 @@ public interface ICustomNodeSequence /// /// The node data object. /// An enumeration of Unity events. - public IEnumerator ExecuteCustomSequence(CustomNodeData nodeData); + IEnumerator ExecuteCustomSequence(CustomNodeData nodeData); } \ No newline at end of file diff --git a/InscryptionAPI/Encounters/NodeManager.cs b/InscryptionAPI/Encounters/NodeManager.cs index 128ce1661..e2d74cb30 100644 --- a/InscryptionAPI/Encounters/NodeManager.cs +++ b/InscryptionAPI/Encounters/NodeManager.cs @@ -6,12 +6,18 @@ namespace InscryptionAPI.Encounters; +/// +/// Old manager class for managing custom map nodes. Use NewNodeManager instead. +/// [HarmonyPatch] [Obsolete("NodeManager is deprecated, use NewNodeManager instead.")] public static class NodeManager { private static List AllNodes = new(); + /// + /// Flags for different types of generation. + /// [Flags] public enum NodePosition { @@ -51,15 +57,39 @@ public enum NodePosition PostBoss = 32 } - public class NodeInfo - { + /// + /// Represents a new node added by the API. + /// + [Obsolete("NodeManager is deprecated, use NewNodeManager instead.")] + public class NodeInfo { + /// + /// Animation frames for the node object on the map. If null or empty, the animation frames of the map object won't be affected. + /// public Texture2D[] animatedMapNode { get; set; } + /// + /// Flags that affect the way the node generates. + /// public NodePosition nodePosition { get; set; } + /// + /// Type for the node sequencer. If null, it will try to get the sequencer type from the sequencer prefab instead. + /// public Type sequencerType { get; set; } + /// + /// Type for the node data. + /// public Type nodeDataType { get; set; } + /// + /// Internal name of the node. + /// public string guid { get; internal set; } + /// + /// Guid of the mod this node came from. + /// public string ModGUID { get; internal set; } + /// + /// Creates a new node. + /// public CustomNodeData BuildNode() { CustomNodeData data = Activator.CreateInstance(this.nodeDataType) as CustomNodeData; diff --git a/InscryptionAPI/Encounters/OpponentManager.cs b/InscryptionAPI/Encounters/OpponentManager.cs index 1585d4545..0305f4da3 100644 --- a/InscryptionAPI/Encounters/OpponentManager.cs +++ b/InscryptionAPI/Encounters/OpponentManager.cs @@ -12,19 +12,52 @@ namespace InscryptionAPI.Encounters; +/// +/// Manager class for adding custom opponents that will appear in-game. +/// [HarmonyPatch] public static class OpponentManager { - public class FullOpponent - { + /// + /// A utility class that holds all of the required information about an opponent in order to be able to use it in-game. + /// + public class FullOpponent { + /// + /// The unique ID for this opponent. + /// public readonly Opponent.Type Id; + /// + /// The unique ID of the mask Leshy will use when this opponent is fought as a boss. + /// public LeshyAnimationController.Mask MaskType = MaskManager.NoMask; + /// + /// A subclass of that implements the logic for the opponent. + /// public Type Opponent; + /// + /// The ID of the subclass the implements additional logic for the opponent's battle. + /// public string SpecialSequencerId; + /// + /// The frames of the animation used for the opponent's dedicated node (ie, if it's a boss). + /// public List NodeAnimation = new(); + /// + /// Creates a new instance of with no node animation. + /// + /// The ID of this opponent. + /// The subclass that implements this opponent's primary logic. + /// The ID of the this opponent uses for supplemental battle logic. public FullOpponent(Opponent.Type id, Type opponent, string specialSequencerId) : this(id, opponent, specialSequencerId, null) { } + /// + /// Creates a new instance of . + /// + /// The ID of this opponent. + /// The subclass that implements this opponent's primary logic. + /// The ID of the this opponent uses for supplemental battle logic. + /// The frames of the animation used for the opponent's dedicated node (ie, if it's a boss). public FullOpponent(Opponent.Type id, Type opponent, string specialSequencerId, List nodeAnimation) { Id = id; @@ -37,6 +70,9 @@ public FullOpponent(Opponent.Type id, Type opponent, string specialSequencerId, } } + /// + /// All of the vanilla game's opponents. + /// public static readonly ReadOnlyCollection BaseGameOpponents = new(GenBaseGameOpponents()); internal static readonly ObservableCollection NewOpponents = new(); @@ -76,13 +112,35 @@ static OpponentManager() }; } + /// + /// The current processed list of all opponents in the game, including vanilla and mod-added opponents. + /// public static List AllOpponents { get; private set; } = BaseGameOpponents.ToList(); + /// + /// Creates a new opponent and registers it to be able to be fought in-game. + ///

+ /// Does not use node animation textures. + ///
+ /// The GUID of the mod adding the ability. + /// The internal name of the opponent. + /// The ID of the this opponent uses for supplemental battle logic. + /// A subclass of that implements the logic for the opponent. + /// An instance of containing all this opponent's data. public static FullOpponent Add(string guid, string opponentName, string sequencerID, Type opponentType) { return Add(guid, opponentName, sequencerID, opponentType, null); } + /// + /// Creates a new opponent and registers it to be able to be fought in-game. + /// + /// The GUID of the mod adding the ability. + /// The internal name of the opponent. + /// The ID of the this opponent uses for supplemental battle logic. + /// A subclass of that implements the logic for the opponent. + /// The frames of the animation used for the opponent's dedicated node (ie, if it's a boss). + /// An instance of containing all this opponent's data. public static FullOpponent Add(string guid, string opponentName, string sequencerID, Type opponentType, List nodeAnimation) { Opponent.Type opponentId = GuidManager.GetEnumValue(guid, opponentName); @@ -90,6 +148,10 @@ public static FullOpponent Add(string guid, string opponentName, string sequence NewOpponents.Add(opp); return opp; } + + /// + /// The list of opponents that will be fought in Act 1 in the current run. + /// public static List RunStateOpponents { get @@ -159,6 +221,9 @@ private static bool ReplaceSpawnOpponent(EncounterData encounterData, ref Oppone return false; } + /// + /// Reverse patch containing the original, unmodified code for . + /// [HarmonyReversePatch(HarmonyReversePatchType.Original)] [HarmonyPatch(typeof(BossBattleSequencer), nameof(BossBattleSequencer.GetSequencerIdForBoss))] [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/InscryptionAPI/Encounters/SpecialSequenceManager.cs b/InscryptionAPI/Encounters/SpecialSequenceManager.cs index a42ba5068..7e75f59c4 100644 --- a/InscryptionAPI/Encounters/SpecialSequenceManager.cs +++ b/InscryptionAPI/Encounters/SpecialSequenceManager.cs @@ -5,14 +5,31 @@ namespace InscryptionAPI.Encounters; +/// +/// Manager class that handles the creation and management of mod-added special battle sequencers. +/// public static class SpecialSequenceManager { + /// + /// A utility class that holds all of the required information about a special battle sequencer in order to be able to use it in-game. + /// public class FullSpecialSequencer { + /// + /// The unique ID of this sequencer. + /// public readonly string Id; + /// + /// A subclass of that implements the logic for the ability. + /// public Type SpecialSequencer { get; private set; } + /// + /// Creates a new instance of and registers its behaviour type with the . + /// + /// The unique ID of this sequencer. + /// A subclass of that implements the logic for the ability. public FullSpecialSequencer(string id, Type specialSequencer) { Id = id; @@ -22,9 +39,15 @@ public FullSpecialSequencer(string id, Type specialSequencer) } } + /// + /// All of the vanilla game's special battle sequencers. + /// public readonly static ReadOnlyCollection BaseGameSpecialSequencers = new(GenBaseGameSpecialSequencersList()); private readonly static ObservableCollection NewSpecialSequencers = new(); + /// + /// The current processed list of all special battle sequencers in the game, including vanilla and mod-added special battle sequencers. + /// public static List AllSpecialSequencers { get; private set; } = BaseGameSpecialSequencers.ToList(); static SpecialSequenceManager() @@ -46,6 +69,13 @@ private static List GenBaseGameSpecialSequencersList() return baseGame; } + /// + /// Creates a new special battle sequencer and registers it to be able to be added to opponents. + /// + /// The GUID of the mod adding the sequencer. + /// The internal name of the sequencer. + /// A subclass of that implements the logic for the sequencer. + /// An instance of containing all this sequencer's data. public static FullSpecialSequencer Add(string guid, string sequencerName, Type sequencer) { FullSpecialSequencer full = new("SpecialSequencer_" + GuidManager.GetFullyQualifiedName(guid, sequencerName), sequencer); diff --git a/InscryptionAPI/Encounters/TurnBuilder.cs b/InscryptionAPI/Encounters/TurnBuilder.cs index 7e08cb5cf..2828e681d 100644 --- a/InscryptionAPI/Encounters/TurnBuilder.cs +++ b/InscryptionAPI/Encounters/TurnBuilder.cs @@ -4,16 +4,27 @@ namespace InscryptionAPI.Encounters; +/// +/// Utility class for easily creating turns in an encounter blueprint. +/// +/// public class TurnBuilder where T : EncounterBlueprintData { internal T blueprint; internal List cards; + /// + /// Default constructor that populates cards with an empty list. + /// public TurnBuilder() { cards = new(); } + /// + /// Sets the that this builder is helping construct. + /// + /// public void SetBlueprint(T blueprint) { this.blueprint = blueprint; @@ -23,11 +34,16 @@ public void SetBlueprint(T blueprint) } +/// +/// Utility class that adds extensions to aid in the creation of encounter blueprint turns. +/// public static class TurnExtensions { /// /// Adds a card blueprint to this turn. /// + /// The type. + /// The to access. /// The default card. Can be null for no card. /// The integer probability of this card getting replaced by a card from the encounter's randomReplacementCards. /// The minimum difficulty for this card to appear. @@ -53,6 +69,12 @@ public static TurnBuilder AddCardBlueprint(this TurnBuilder turnBuilder return turnBuilder; } + /// + /// Finishes building the blueprint and returns it for use. + /// + /// The type. + /// The to access. + /// The being constructed by this builder. public static T Build(this TurnBuilder turnBuilder) where T : EncounterBlueprintData { return turnBuilder.blueprint; diff --git a/InscryptionAPI/Nodes/NewNodeManager.cs b/InscryptionAPI/Nodes/NewNodeManager.cs index f26c11d76..c256c1c39 100644 --- a/InscryptionAPI/Nodes/NewNodeManager.cs +++ b/InscryptionAPI/Nodes/NewNodeManager.cs @@ -187,7 +187,7 @@ public FullNode SetGenerationPrerequisites(List new /// /// Sets the force generation conditions for this node. /// - /// New force generation conditions for this node. + /// New force generation conditions for this node. /// This node, for method chaining purposes. public FullNode SetForceGenerationConditions(List newForceGenerationConditions) { @@ -373,18 +373,48 @@ internal static void DoMissingNodeSequence(this SpecialNodeHandler hand) } #region SelectionConditions +/// +/// SelectionCondition for a node that prevents it from appearing unless a certain number of the given challenge is present. +/// public class NumChallengesOfTypeActive : NodeData.SelectionCondition { + /// + /// The challenge ID that this condition will check for. + /// public AscensionChallenge challenge; + /// + /// The amount of this challenge that will be used in this condition's conditional. + /// public int numChallenges; + /// + /// If this condition should be satisified when the number of active challenges is greater than numChallenges. + ///
+ /// If false, this condition checks for less-than-or-equal-to instead. + ///
public bool greaterThanNumActive; + /// + /// Creates a new instance of this selection condition. + /// + /// The challenge ID that this condition will check for. + /// The amount of this challenge that will be used in this condition's conditional. + /// If this condition should check for greater-than. If false, check less-than instead. public NumChallengesOfTypeActive(AscensionChallenge challenge, int numChallenges, bool greaterThanNumActive) { this.challenge = challenge; this.numChallenges = numChallenges; this.greaterThanNumActive = greaterThanNumActive; } + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If greaterThanNumActive is true, this condition is satisfied when the number of active copies of challenge >= numChallenges + ///
+ /// If greaterThanNumActive is false, this condition is satisfied when the number of active copies of challenge <= numChallenges + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { if (greaterThanNumActive) @@ -393,27 +423,47 @@ public override bool Satisfied(int gridY, List previousNodes) return this.numChallenges <= AscensionSaveData.Data.GetNumChallengesOfTypeActive(challenge); } } +/// +/// SelectionCondition for a node that prevents it from appearing unless the given challenge is active. +/// public class ChallengeIsActive : NodeData.SelectionCondition { + /// + /// The challenge ID that this condition will check for. + /// public AscensionChallenge challenge; + /// + /// If this conditon requires challenge be excluded from the active list or not. + /// public bool exclude; + /// + /// Creates a new instance of this selection condition. + /// + /// The challenge ID that this condition will check for. + /// If the challenge needs to be active in the run or not. If true, the challenge cannot be active. public ChallengeIsActive(AscensionChallenge challenge, bool exclude) { this.challenge = challenge; this.exclude = exclude; } + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If exclude is true, this condition is satisfied if challenge is not active. + ///
+ /// If exclude is false, this condition is satisfied if challenge is active. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { bool flag = AscensionSaveData.Data.ChallengeIsActive(challenge); - if (!(flag && exclude)) - { - if (!exclude) - return !flag; - - return false; + if (exclude) { + return !flag; } - return true; + return flag; } } #endregion From a8a65e6fcb4c748e432e2da3b3fdcc01ac6a4572 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sat, 14 Nov 2026 22:24:50 -0800 Subject: [PATCH 44/74] Add XML, fix incorrect preexisting XML --- .../Items/ConsumableItemDataExtensions.cs | 204 ++++++++++++++---- 1 file changed, 161 insertions(+), 43 deletions(-) diff --git a/InscryptionAPI/Items/ConsumableItemDataExtensions.cs b/InscryptionAPI/Items/ConsumableItemDataExtensions.cs index 3fcae1f99..27bd6c290 100644 --- a/InscryptionAPI/Items/ConsumableItemDataExtensions.cs +++ b/InscryptionAPI/Items/ConsumableItemDataExtensions.cs @@ -4,6 +4,9 @@ namespace InscryptionAPI.Items.Extensions; +/// +/// Utiliy class that manages custom objects, and adds extensions for that purpose. +/// public static class ConsumableItemDataExtensions { // Needs to be defined first so the implicit static constructor works correctly @@ -14,26 +17,50 @@ private class ConsumableItemDataExt } private static readonly ConditionalWeakTable ExtensionProperties = new(); - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the powerlevel of this consumable item; determines the item's rarity when obtaining it from nodes. + /// + /// The to access. + /// The power level to set for this item. + /// The same so a chain can continue. + /// + /// Vanilla power level for items ranges from [0, 5]. + /// public static ConsumableItemData SetPowerLevel(this ConsumableItemData data, int powerLevel) { data.powerLevel = powerLevel; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the text shown when encountering this item for the first time. + /// + /// The to access. + /// The text to display. + /// The same so a chain can continue. public static ConsumableItemData SetLearnItemDescription(this ConsumableItemData data, string description) { data.description = description; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the metacategory that controls what rulebook this item's entry appears in. + /// + /// The to access. + /// The metacategory for the rulebook this item's entry can appear. + /// The same so a chain can continue. public static ConsumableItemData SetRulebookCategory(this ConsumableItemData data, AbilityMetaCategory rulebookCategory) { data.rulebookCategory = rulebookCategory; return data; } + /// + /// Adds additional metacategories so this item's entry can appear in multiple acts. + /// + /// The to access. + /// The metacategories for the rulebooks this item's entry can appear in. + /// The same so a chain can continue. public static ConsumableItemData AddExtraRulebookCategories(this ConsumableItemData data, params AbilityMetaCategory[] rulebookCategories) { ConsumableItemManager.FullConsumableItemData fullItem = data.GetFullConsumableItemData(); @@ -63,77 +90,136 @@ public static ConsumableItemManager.FullConsumableItemData GetFullConsumableItem return fullItem; } - /// The same ConsumableItemData so a chain can continue. + + /// + /// Sets the name of this item that appears in the rulebook. + /// + /// The to access. + /// The title of this item's rulebook entry. + /// The same so a chain can continue. public static ConsumableItemData SetRulebookName(this ConsumableItemData data, string rulebookName) { data.rulebookName = rulebookName; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the description for this item when it appears in the rulebook. + /// + /// The to access. + /// The text to display in the rulebook. + /// The same so a chain can continue. public static ConsumableItemData SetRulebookDescription(this ConsumableItemData data, string rulebookDescription) { data.rulebookDescription = rulebookDescription; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the Sprite used for this item's rulebook entry. Should be 100 x 150 px in size. + /// + /// The to access. + /// The Sprite to display on this item's rulebook entry. + /// The same so a chain can continue. public static ConsumableItemData SetRulebookSprite(this ConsumableItemData data, Sprite rulebookSprite) { data.rulebookSprite = rulebookSprite; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets whether or not this item should only appear in a specific region. + /// + /// The to access. + /// If this item only appears in a specific region. + /// The same so a chain can continue. + /// + /// By default, regionSpecific being true just removes the item from the pool of region-specific items. + /// public static ConsumableItemData SetRegionSpecific(this ConsumableItemData data, bool regionSpecific) { data.regionSpecific = regionSpecific; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets whether or not this item can appear in the pool of obtainable items at item choice nodes. + /// + /// The to access. + /// If true, this item can be obtained randomly at item choice nodes. + /// The same so a chain can continue. public static ConsumableItemData SetNotRandomlyGiven(this ConsumableItemData data, bool notRandomlyGiven) { data.notRandomlyGiven = notRandomlyGiven; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets this item's extended property ComponentType to allow the given component to be added to the item's in-game object. + /// + /// The to access. + /// The Type of the component this item should have. + /// The same so a chain can continue. public static ConsumableItemData SetComponentType(this ConsumableItemData data, Type type) { data.SetExtendedProperty("ComponentType", $"{type.FullName}, {type.Assembly.FullName}"); return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets whether or not this item can be activated outside of card battles. + /// + /// The to access. + /// If true, this item can be interacted with and used even outside of battle. + /// The same so a chain can continue. public static ConsumableItemData SetCanActivateOutsideBattles(this ConsumableItemData data, bool alwaysActivatable) { data.SetExtendedProperty("CanActivateOutsideBattles", alwaysActivatable); return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the ID of the prefab this item uses for its in-game model. + /// + /// The to access. + /// The ID of the prefab object to use for this item's model. + /// The same so a chain can continue. public static ConsumableItemData SetPrefabID(this ConsumableItemData data, string prefabID) { data.prefabId = prefabID; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the ID of the sound played when this item is picked up (chosen at a choice node or used). + /// + /// The to access. + /// The ID of the sound played when this item is picked up. + /// The same so a chain can continue. public static ConsumableItemData SetPickupSoundId(this ConsumableItemData data, string pickupSoundId) { data.pickupSoundId = pickupSoundId; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the ID of the sound played when this item is placed down (added to your inventory or has its usage cancelled). + /// + /// The to access. + /// The ID of the sound played when this item is placed down. + /// The same so a chain can continue. public static ConsumableItemData SetPlacedSoundId(this ConsumableItemData data, string placedSoundId) { data.placedSoundId = placedSoundId; return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the ID of the sound played when this item is hovered over with the mouse. + /// + /// The to access. + /// The ID of the sound played when this item is examined. + /// The same so a chain can continue. public static ConsumableItemData SetExamineSoundId(this ConsumableItemData data, string examineSoundId) { data.examineSoundId = examineSoundId; @@ -141,9 +227,10 @@ public static ConsumableItemData SetExamineSoundId(this ConsumableItemData data, } /// - /// Sets the item ready to be accessed in act 1 + /// Sets the item ready to be accessed in Act 1. /// - /// The same ConsumableItemData so a chain can continue. + /// The to access. + /// The same so a chain can continue. public static ConsumableItemData SetAct1(this ConsumableItemData data) { data.rulebookCategory = AbilityMetaCategory.Part1Rulebook; @@ -151,9 +238,10 @@ public static ConsumableItemData SetAct1(this ConsumableItemData data) } /// - /// Sets the item ready to be accessed in act 3 + /// Sets the item ready to be accessed in Act 3. /// - /// The same ConsumableItemData so a chain can continue. + /// The to access. + /// The same so a chain can continue. public static ConsumableItemData SetAct3(this ConsumableItemData data) { data.rulebookCategory = AbilityMetaCategory.Part3Rulebook; @@ -161,9 +249,10 @@ public static ConsumableItemData SetAct3(this ConsumableItemData data) } /// - /// Sets the item ready to be accessed in Ascension + /// Sets the item ready to be accessed in Ascension. /// - /// The same ConsumableItemData so a chain can continue. + /// The to access. + /// The same so a chain can continue. public static ConsumableItemData SetAscensionUnlocked(this ConsumableItemData data) { data.rulebookCategory = AbilityMetaCategory.AscensionUnlocked; @@ -171,42 +260,64 @@ public static ConsumableItemData SetAscensionUnlocked(this ConsumableItemData da } /// - /// Sets the card that is contained within a bottle + /// Sets the card that is contained within a bottle-type item (eg. Frozen Opposum). /// - /// The same ConsumableItemData so a chain can continue. + /// The to access. + /// The internal name of the card that will be contained in this item. + /// The same so a chain can continue. public static ConsumableItemData SetCardWithinBottle(this ConsumableItemData data, string cardName) { data.SetExtendedProperty("CardWithinBottle", cardName); return data; } - - /// The same ConsumableItemData so a chain can continue. + /// + /// Gets the card that is contained within a bottle-type item (eg. Frozen Opposum). + /// + /// The to access. + /// The internal name of the card contained in this bottle item, or null if this isn't a bottle item. public static string GetCardWithinBottle(this ConsumableItemData data) { return data.GetExtendedProperty("CardWithinBottle"); } - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the prefab model type for this item. Use if you don't have a custom prefab or want to use one of the API's default models. + /// + /// The to access. + /// The ID for the default model to use. + /// The same so a chain can continue. public static ConsumableItemData SetPrefabModelType(this ConsumableItemData data, ConsumableItemManager.ModelType modelType) { data.SetExtendedProperty("PrefabModelType", (int)modelType); return data; } - /// The same ConsumableItemData so a chain can continue. + /// + /// Gets the prefab model type for this item. + /// + /// The to access. + /// The ID of the model used, or 0 if a default model is not being used. public static ConsumableItemManager.ModelType GetPrefabModelType(this ConsumableItemData data) { int? i = data.GetExtendedPropertyAsInt("PrefabModelType"); return i.HasValue ? (ConsumableItemManager.ModelType)i : 0; } - /// Mod Prefix. + /// + /// Gets the component type for this item. + /// + /// The to access. + /// The component Type. public static Type GetComponentType(this ConsumableItemData data) { return Type.GetType(data.GetExtendedProperty("ComponentType")); } - /// Mod Prefix. + /// + /// Gets whether or not this item can be used outside card battles. + /// + /// The to access. + /// Whether or not this item can be used outside battles. Defaults to false if no value is present. public static bool CanActivateOutsideBattles(this ConsumableItemData data) { bool? extendedPropertyAsBool = data.GetExtendedPropertyAsBool("CanActivateOutsideBattles"); @@ -215,14 +326,23 @@ public static bool CanActivateOutsideBattles(this ConsumableItemData data) #region ModPrefixesAndTags - /// The same ConsumableItemData so a chain can continue. + /// + /// Sets the prefix of the mod adding this item. + /// + /// The to access. + /// + /// The same so a chain can continue. internal static ConsumableItemData SetModPrefix(this ConsumableItemData data, string modPrefix) { data.SetExtendedProperty("ModPrefix", modPrefix); return data; } - /// Mod Prefix. + /// + /// Gets the prefix of the mod that added this item. + /// + /// The to access. + /// The prefix of the mod that added this item. public static string GetModPrefix(this ConsumableItemData data) { return data.GetExtendedProperty("ModPrefix"); @@ -230,8 +350,6 @@ public static string GetModPrefix(this ConsumableItemData data) #endregion - - #region ExtendedProperties internal static Dictionary GetConsumableItemDataExtensionTable(this ConsumableItemData data) { @@ -239,12 +357,12 @@ internal static Dictionary GetConsumableItemDataExtensionTable(t } /// - /// Adds a custom property value to the ConsumableItemData. + /// Adds a custom property value to the . /// - /// Card to access. + /// The to access. /// The name of the property to set. /// The value of the property. - /// The same ConsumableItemData so a chain can continue. + /// The same so a chain can continue. public static ConsumableItemData SetExtendedProperty(this ConsumableItemData data, string propertyName, object value) { data.GetConsumableItemDataExtensionTable()[propertyName] = value?.ToString(); @@ -252,9 +370,9 @@ public static ConsumableItemData SetExtendedProperty(this ConsumableItemData dat } /// - /// Gets a custom property value from the ConsumableItemData + /// Gets a custom property value from the . /// - /// Card to access. + /// The to access. /// The name of the property to get the value of. /// . public static string GetExtendedProperty(this ConsumableItemData data, string propertyName) @@ -264,9 +382,9 @@ public static string GetExtendedProperty(this ConsumableItemData data, string pr } /// - /// Gets a custom property as an int (can by null) + /// Gets a custom property as an nullable int. /// - /// Card to access. + /// The to access. /// Property name to get value of. /// Returns the value of the property as an int or null if it didn't exist or couldn't be parsed as int. public static int? GetExtendedPropertyAsInt(this ConsumableItemData data, string propertyName) @@ -276,9 +394,9 @@ public static string GetExtendedProperty(this ConsumableItemData data, string pr } /// - /// Gets a custom property as a float (can by null) + /// Gets a custom property as a nullable float. /// - /// Card to access. + /// The to access. /// Property name to get value of. /// Returns the value of the property as a float or null if it didn't exist or couldn't be parsed as float. public static float? GetExtendedPropertyAsFloat(this ConsumableItemData data, string propertyName) @@ -288,9 +406,9 @@ public static string GetExtendedProperty(this ConsumableItemData data, string pr } /// - /// Gets a custom property as a boolean (can be null) + /// Gets a custom property as a nullable boolean. /// - /// Card to access. + /// The to access. /// Property name to get value of. /// Returns the value of the property as a boolean or null if it didn't exist or couldn't be parsed as boolean. public static bool? GetExtendedPropertyAsBool(this ConsumableItemData data, string propertyName) From b8962039b69648c3fb68bb0cc579ad28882cec13 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sat, 14 Nov 2026 22:25:11 -0800 Subject: [PATCH 45/74] Add missing XML, cref tags --- InscryptionAPI/Helpers/ResourcesManagerHelpers.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs b/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs index 4a2be3561..f0014957a 100644 --- a/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs +++ b/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs @@ -14,7 +14,7 @@ public static class ResourcesManagerHelpers { /// /// Removes a given amount of energy cells, which determines how much energy a player has available at the start of a turn. - /// Affected by 'ResourcesManager.preventNextEnergyLoss'. + /// Affected by value of . /// /// The current . /// How many energy cells to close. Gets capped to the current number of open energy cells. @@ -24,11 +24,11 @@ public static IEnumerator RemoveMaxEnergy(this ResourcesManager instance, int am } /// - /// A variant of RemoveMaxEnergy that can bypass ResourcesManager.PreventNextEnergyLoss. - /// Affected by 'ResourcesManager.preventNextEnergyLoss'. + /// A variant of RemoveMaxEnergy that can bypass . /// /// The current . /// How many energy cells to close. Gets capped to the current number of open energy cells. + /// If the the value of should be respected. public static IEnumerator RemoveMaxEnergy(this ResourcesManager instance, int amount, bool preventable) { if (preventable && instance.preventNextEnergyLoss) From 9c164414cadd2c4d97603bf8f4ee3030d1c25186 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sat, 14 Nov 2026 22:45:58 -0800 Subject: [PATCH 46/74] XML for files in Items folder --- InscryptionAPI/Items/ConsumableItemManager.cs | 99 ++++++++++++++++++- InscryptionAPI/Items/ConsumableItemPatches.cs | 16 ++- .../Items/ConsumableItemResource.cs | 8 +- 3 files changed, 115 insertions(+), 8 deletions(-) diff --git a/InscryptionAPI/Items/ConsumableItemManager.cs b/InscryptionAPI/Items/ConsumableItemManager.cs index 83bd5b16e..2c157c84e 100644 --- a/InscryptionAPI/Items/ConsumableItemManager.cs +++ b/InscryptionAPI/Items/ConsumableItemManager.cs @@ -10,22 +10,39 @@ namespace InscryptionAPI.Items; +/// +/// Manager class that handles the creation and management of mod-added consumable items. +/// public static class ConsumableItemManager { + /// + /// A utility class that holds all of the required information about an item in order to be able to use it in-game. + /// public class FullConsumableItemData { + /// + /// The description object for this item. + /// public ConsumableItemData itemData; /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. + /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. /// public Dictionary RulebookDescriptionRedirects = new(); + /// + /// Additional metacategories for this item if was not enough. + /// public List rulebookMetaCategories = new(); + + /// + /// Creates a new instance of . + /// + /// The description object for this item. public FullConsumableItemData(ConsumableItemData data) { this.itemData = data; @@ -39,12 +56,26 @@ internal enum ConsumableState All } - public enum ModelType - { + /// + /// The different types of default item models added by the API. + /// + public enum ModelType { + /// + /// A simple rune object. + /// BasicRune = 1, + /// + /// A simple rune object covered in veins. + /// BasicRuneWithVeins = 2, + /// + /// A simple rune object that floats. + /// HoveringRune = 3, - CardInABottle = 4, + /// + /// The vanilla card in a bottle model (eg., Squirrel in a Bottle). + /// + CardInABottle = 4 } private static Sprite cardinbottleSprite; @@ -55,10 +86,23 @@ public enum ModelType private static HashSet defaultModelTypes = new(); internal static readonly List allNewItems = new(); private static readonly List baseConsumableItemsDatas = new(); + /// + /// All mod-added items. + /// public static ReadOnlyCollection NewConsumableItemDatas = new(allNewItems); internal static readonly List allFullItemDatas = new(); + /// + /// Creates a new item with a custom prefab and registers it to be able to be used in-game. + /// + /// The GUID of the mod adding this item. + /// The name of this item as it appears in the rulebook. + /// The description of this item as it appears in the rulebook. + /// The icon to display on this item's rulebook entry. + /// A subclass of that implements the logic for the item. + /// The prefab object for this item's model. + /// An instance of containing all this item's data. public static ConsumableItemData New(string pluginGUID, string rulebookName, string rulebookDescription, Texture2D rulebookSprite, Type itemType, @@ -74,6 +118,16 @@ public static ConsumableItemData New(string pluginGUID, return New(pluginGUID, rulebookName, rulebookDescription, rulebookSprite, itemType, modelType); } + /// + /// Creates a new item with a custom prefab and registers it to be able to be used in-game. + /// + /// The GUID of the mod adding this item. + /// The name of this item as it appears in the rulebook. + /// The description of this item as it appears in the rulebook. + /// The icon to display on this item's rulebook entry. + /// A subclass of that implements the logic for the item. + /// A helper object for retrieving the model prefab resource. + /// An instance of containing all this item's data. public static ConsumableItemData New(string pluginGUID, string rulebookName, string rulebookDescription, Texture2D rulebookSprite, Type itemType, @@ -83,6 +137,16 @@ public static ConsumableItemData New(string pluginGUID, return New(pluginGUID, rulebookName, rulebookDescription, rulebookSprite, itemType, registerPrefab); } + /// + /// Creates a new item with a default model and registers it to be able to be used in-game. + /// + /// The GUID of the mod adding this item. + /// The name of this item as it appears in the rulebook. + /// The description of this item as it appears in the rulebook. + /// The icon to display on this item's rulebook entry. + /// A subclass of that implements the logic for the item. + /// The ID of the default model this item should use. + /// An instance of containing all this item's data. public static ConsumableItemData New(string pluginGUID, string rulebookName, string rulebookDescription, Texture2D rulebookSprite, Type itemType, @@ -104,6 +168,13 @@ public static ConsumableItemData New(string pluginGUID, return Add(pluginGUID, data); } + /// + /// Creates a new item that provides a card when used (eg., Squirrel in a Bottle). + /// + /// The GUID of the mod adding this item. + /// The internal name of the card contained in this item. + /// The icon texture to display on this item's rulebook entry. + /// An instance of containing all this item's data. public static ConsumableItemData NewCardInABottle(string pluginGUID, string cardName, Texture2D rulebookTexture = null) { CardInfo cardInfo = CardLoader.GetCardByName(cardName); @@ -116,6 +187,13 @@ public static ConsumableItemData NewCardInABottle(string pluginGUID, string card return NewCardInABottle(pluginGUID, cardInfo, rulebookTexture); } + /// + /// Creates a new item that provides a card when used (eg., Squirrel in a Bottle). + /// + /// The GUID of the mod adding this item. + /// The of the card contained in this item. + /// The icon texture to display on this item's rulebook entry. + /// An instance of containing all this item's data. public static ConsumableItemData NewCardInABottle(string pluginGUID, CardInfo cardInfo, Texture2D rulebookTexture = null) { if (cardInfo == null) @@ -149,6 +227,12 @@ public static ConsumableItemData NewCardInABottle(string pluginGUID, CardInfo ca return Add(pluginGUID, data); } + /// + /// Registers a custom item with the API. + /// + /// The GUID of the mod adding this item. + /// The to register. + /// The same so a chain can continue. public static ConsumableItemData Add(string pluginGUID, ConsumableItemData data) { string name = pluginGUID + "_" + data.rulebookName; @@ -161,6 +245,13 @@ public static ConsumableItemData Add(string pluginGUID, ConsumableItemData data) return data; } + /// + /// Registers a custom prefab with the API for ease of use. + /// + /// The GUID of the mod adding the prefab. + /// The internal name of the prefab. + /// A helper object containing data on the prefab resource. + /// The ID for the custom prefab. public static ModelType RegisterPrefab(string pluginGUID, string rulebookName, ConsumableItemResource resource) { ModelType type = GuidManager.GetEnumValue(pluginGUID, rulebookName); diff --git a/InscryptionAPI/Items/ConsumableItemPatches.cs b/InscryptionAPI/Items/ConsumableItemPatches.cs index 995fbcf54..572323f3a 100644 --- a/InscryptionAPI/Items/ConsumableItemPatches.cs +++ b/InscryptionAPI/Items/ConsumableItemPatches.cs @@ -10,6 +10,9 @@ namespace InscryptionAPI.Items; +/// +/// Class containing patches to make custom items work. +/// [HarmonyPatch] public static class ConsumableItemPatches { @@ -125,12 +128,12 @@ internal class ConsumableItemSlot_ConsumeItem internal static ItemData currentItemData = null; - public static IEnumerable TargetMethods() + private static IEnumerable TargetMethods() { yield return AccessTools.Method(ConsumableItemSlot_ConsumeItem_Class, "MoveNext"); } - public static IEnumerable Transpiler(IEnumerable instructions) + private static IEnumerable Transpiler(IEnumerable instructions) { // === We want to turn this @@ -160,7 +163,7 @@ public static IEnumerable Transpiler(IEnumerable ConstructItemPageData(IEnumerable + /// Modified version of specific to items that enables custom items to also appear in the rulebook. + /// + /// Current instance of the rulebook's utility class that stores page data. + /// Reference to the rulebook prefab object used for constructed pages. + /// Used to determine if an item's rulebook entry can appear in this act. + /// A list of all constructed rulebook pages. public static List ConstructItemPages(RuleBookInfo instance, PageRangeInfo pageRange, AbilityMetaCategory metaCategory) { List allConsumables = ItemsUtil.AllConsumables; diff --git a/InscryptionAPI/Items/ConsumableItemResource.cs b/InscryptionAPI/Items/ConsumableItemResource.cs index 14489c10c..028899e54 100644 --- a/InscryptionAPI/Items/ConsumableItemResource.cs +++ b/InscryptionAPI/Items/ConsumableItemResource.cs @@ -1,10 +1,16 @@ -using DiskCardGame; +using DiskCardGame; using InscryptionAPI.Helpers; using UnityEngine; namespace InscryptionAPI.Items; +/// +/// Subclass of specific to resources used as consumable item models. +/// public class ConsumableItemResource : ResourceLookup { + /// + /// Action used by the API when setting up custom item models. + /// public Action PreSetupCallback = null; } From 60a2b91ec62781095594ae61b81a87cccbe27379 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 12:17:11 -0800 Subject: [PATCH 47/74] Add XML for Localising files --- .../Localizing/LocalizationManager.cs | 116 ++++++++++++++++-- 1 file changed, 108 insertions(+), 8 deletions(-) diff --git a/InscryptionAPI/Localizing/LocalizationManager.cs b/InscryptionAPI/Localizing/LocalizationManager.cs index 3e61d3c12..4f3ac088e 100644 --- a/InscryptionAPI/Localizing/LocalizationManager.cs +++ b/InscryptionAPI/Localizing/LocalizationManager.cs @@ -6,20 +6,49 @@ namespace InscryptionAPI.Localizing; -public static partial class LocalizationManager -{ +/// +/// Manager class that handles the creation of custom language translations for the game. +/// +public static partial class LocalizationManager { + /// + /// A utility class that holds all of the required information about a language in order to use it in-game. + /// public class CustomLanguage { + /// + /// GUID of the mod adding this language. + /// public string PluginGUID; + /// + /// Name of this language. + /// public string LanguageName; + /// + /// + /// public string LanguageCode; // For translating + /// + /// The file path to the string table used to translate words to this language. + /// public string PathToStringTable; + /// + /// Unique ID for this language. + /// public Language Language; } + /// + /// A utility class that holds all of the required information about a translation in order to use it in-game. + /// public class CustomTranslation { + /// + /// GUID of the mod adding this language. + /// public string PluginGUID; + /// + /// The description object for this translation. + /// public Localization.Translation Translation; } @@ -30,23 +59,55 @@ private class CachedReplacement } /// - /// The list of Fonts used in Inscryption. + /// The list of Fonts used in Inscryption that have font replacements. /// - public enum FontReplacementType - { + public enum FontReplacementType { + /// + /// Standard font. Replaced with Dagger Square. + /// Liberation, + /// + /// Font used in Kaycee's Mod. Replaced with Chinese Pixel. + /// Marksman, + /// + /// Font used in Act 2. Replaced with JPScript. + /// Misc3D, + /// + /// Font used in Act 3. Replaced with JP Sans. + /// DaggerSquare, + /// + /// Leshy's speech font. Replaced with Vicious Hunger. + /// HeavyWeight } + /// + /// Array of all language names. + /// public static string[] AllLanguageNames = new string[] { }; + /// + /// Array of all language button texts (the text that appears when switching language). + /// public static string[] AllLanguageButtonText = new string[] { }; - public static List AllLanguages = new(); - public static List NewLanguages = new(); - public static List CustomTranslations = new(); + /// + /// All processed languages, including vanilla and mod-added. + /// + public static List AllLanguages => new(); + /// + /// All processed mod-added languages. + /// + public static List NewLanguages => new(); + /// + /// All processed mod-added translations. + /// + public static List CustomTranslations => new(); + /// + /// A hook for modders to add custom code to modify a language dynamically. + /// public static Action OnLanguageLoaded = null; private static List AlreadyLoadedLanguages = new(); @@ -86,6 +147,16 @@ static LocalizationManager() } } + /// + /// Adds and registers a new language with the API for use in-game. + /// + /// The GUID of the mod adding the language. + /// The name of the language. + /// The language code for the language (eg., "en" for English, "fr" for French). + /// The text to display when setting the game's language. + /// The path to the CSV file containing the language's translation data. + /// List of fonts to use for this language. + /// The unique ID for the created language. public static Language NewLanguage(string pluginGUID, string languageName, string code, string resetButtonText, string stringTablePath = null, List fontReplacements = null) { Language language = GuidManager.GetEnumValue(pluginGUID, languageName); @@ -113,6 +184,11 @@ public static Language NewLanguage(string pluginGUID, string languageName, strin return language; } + /// + /// Adds a new for the given language. + /// + /// The language to add font replacements to. + /// The description object for the font replacements, containing information on what fonts to replace and what font to replace them with. public static void AddFontReplacement(Language language, FontReplacement replacement) { if (FontReplacementData.instance == null) @@ -140,6 +216,13 @@ public static void AddFontReplacement(Language language, FontReplacement replace replacements.fontReplacements.Add(replacement); } + /// + /// + /// + /// + /// + /// + /// public static FontReplacement GetFontReplacementForFont(FontReplacementType type, Font font = null, TMP_FontAsset tmpFont = null) { FontReplacement replacement; @@ -282,6 +365,11 @@ public static CustomTranslation Translate(string pluginGUID, string id, string e return customTranslation; } + /// + /// Adds and registers a custom translation to be used in-game. + /// + /// Translation object to register. + /// The same . public static CustomTranslation Add(CustomTranslation translation) { CustomTranslations.Add(translation); @@ -292,6 +380,12 @@ public static CustomTranslation Add(CustomTranslation translation) return translation; } + /// + /// Retrieves a using the translation's English string or its ID. + /// + /// The English string for the translation. + /// The translation's ID. Used if the translation can't be found using its English string. + /// The found or null if it can't be found. public static CustomTranslation Get(string englishText, string id) { CustomTranslation translation = null; @@ -375,6 +469,9 @@ public static Language CodeToLanguage(string code) return Language.NUM_LANGUAGES; } + /// + /// Exports all localisations to a CSV spreadhseet in the API DLL's directory. + /// public static void ExportAllToCSV() { // Exports all localisation to a spreadsheet in the APIs directory @@ -412,6 +509,9 @@ public static void ExportAllToCSV() InscryptionAPIPlugin.Logger.LogInfo($"Exported .csv file to {path}"); } + /// + /// Obsolete; use instead. + /// [Obsolete("Use Translate() instead")] public static CustomTranslation New(string pluginGUID, string id, string englishString, string translatedString, Language language) { From 80e9f9027dd7c7adaf34793515290840a6393aad Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:04:56 -0800 Subject: [PATCH 48/74] Add XMl to Masks/ files --- InscryptionAPI/Masks/CustomMask.cs | 55 +++++++++++++++++-- InscryptionAPI/Masks/MaskBehaviour.cs | 66 ++++++++++++++++++++++- InscryptionAPI/Masks/MaskManager.cs | 77 ++++++++++++++++++++++++++- 3 files changed, 192 insertions(+), 6 deletions(-) diff --git a/InscryptionAPI/Masks/CustomMask.cs b/InscryptionAPI/Masks/CustomMask.cs index 6ee572410..00342e09f 100644 --- a/InscryptionAPI/Masks/CustomMask.cs +++ b/InscryptionAPI/Masks/CustomMask.cs @@ -1,18 +1,48 @@ -using DiskCardGame; +using DiskCardGame; using InscryptionAPI.Helpers; namespace InscryptionAPI.Masks; -public class CustomMask -{ +/// +/// Class for adding custom boss masks for Leshy to use in-game. +/// +public class CustomMask { + /// + /// The ID of this mask. + /// public readonly LeshyAnimationController.Mask ID; + /// + /// The internal name of this mask. + /// public readonly string Name; + /// + /// The GUID of the mod adding this mask. + /// public readonly string GUID; + /// + /// If this mask should override another mask using the same ID as this mask. + /// public readonly bool Override; + /// + /// The material overrides that will affect this mask's model materials. + /// public List MaterialOverrides { get; private set; } + /// + /// The ID of the model type this mask uses. + /// public MaskManager.ModelType ModelType { get; private set; } + /// + /// A subclass of that implements the logic for this mask. + /// public Type BehaviourType { get; private set; } = typeof(MaskBehaviour); + /// + /// Creates a new instance of . + /// + /// The GUID of the mod adding this mask. + /// The internal name of this mask. + /// The ID of this mask. + /// If this mask is meant to override masks using the same ID. public CustomMask(string GUID, string Name, LeshyAnimationController.Mask ID, bool isOverride) { this.GUID = GUID; @@ -21,6 +51,11 @@ public CustomMask(string GUID, string Name, LeshyAnimationController.Mask ID, bo this.Override = isOverride; } + /// + /// Adds a new to this mask to directly modify the material textures used for this mask. + /// + /// The to add. + /// The same so a chain can continue. public CustomMask AddMaterialOverride(MaterialOverride materialOverride) { if (MaterialOverrides == null) @@ -31,12 +66,22 @@ public CustomMask AddMaterialOverride(MaterialOverride materialOverride) return this; } + /// + /// Sets the model type ID for this mask. Use if you want to use one of the vanilla or API-added mask models. + /// + /// The ID of the mask model to use. + /// The same so a chain can continue. public CustomMask SetModelType(MaskManager.ModelType modelType) { ModelType = modelType; return this; } + /// + /// Sets the mask's . + /// + /// A subclass of that adds the mask's logic. + /// The same so a chain can continue. public CustomMask SetMaskBehaviour(Type type) { if (!type.IsSubclassOf(typeof(MaskBehaviour))) @@ -48,6 +93,10 @@ public CustomMask SetMaskBehaviour(Type type) return this; } + /// + /// Returns the internal name of this mask. + /// + /// The mask's internal name in format {GUID}_{Name}. public override string ToString() { return GUID + "_" + Name; diff --git a/InscryptionAPI/Masks/MaskBehaviour.cs b/InscryptionAPI/Masks/MaskBehaviour.cs index 38f9a072d..88b69886f 100644 --- a/InscryptionAPI/Masks/MaskBehaviour.cs +++ b/InscryptionAPI/Masks/MaskBehaviour.cs @@ -1,18 +1,32 @@ -using InscryptionAPI.Helpers; +using InscryptionAPI.Helpers; using UnityEngine; namespace InscryptionAPI.Masks; +/// +/// Class for implementinglogic for a custom mask and modifying its textures, emissions, etc.. +/// public class MaskBehaviour : MonoBehaviour { + /// + /// The tied to this behaviour. + /// protected CustomMask maskData = null; + /// + /// Initialises the behaviour using the given . + /// + /// The this behaviour will use. public virtual void Initialize(CustomMask mask) { maskData = mask; OverrideTexture(mask); } + /// + /// Overrides the mask model's materials, if any overrides are present. + /// + /// The to reference for material overrides. protected virtual void OverrideTexture(CustomMask mask) { if (mask.MaterialOverrides == null || mask.MaterialOverrides.Count == 0) @@ -89,51 +103,101 @@ protected virtual void OverrideTexture(CustomMask mask) renderer.materials = materials; } + /// + /// Overrides the given 's parallax value using data the height value from the override object. + /// + /// The containing the height value to override the material with. + /// The to override. protected virtual void OverrideHeightValue(MaterialOverride materialOverride, Material material) { material.SetFloat("_Parallax", materialOverride.Height.Value); } + /// + /// Overrides the given 's glossiness value using the smoothness value from the override object. + /// + /// The containing the smoothness value to override the material with. + /// The to override. protected virtual void OverrideSmoothnessValue(MaterialOverride materialOverride, Material material) { material.SetFloat("_Glossiness", materialOverride.Smoothness.Value); } + /// + /// Overrides the given 's metallic value using data from the override object. + /// + /// The containing the metallic value to override the material with. + /// The to override. protected virtual void OverrideMetallic(MaterialOverride materialOverride, Material material) { material.SetFloat("_Metallic", materialOverride.Metallic.Value); } + /// + /// Overrides the given 's bump map using the emission texture from the override object. + /// + /// The containing the emission texture to override the material with. + /// The to override. protected virtual void OverrideNormalMap(MaterialOverride materialOverride, Material material) { material.SetTexture("_BumpMap", materialOverride.Emission); } + /// + /// Overrides the given 's occlusion map value using the emission texture from the override object. + /// + /// The containing the emission texture to override the material with. + /// The to override. protected virtual void OverrideOcclusionMap(MaterialOverride materialOverride, Material material) { material.SetTexture("_OcclusionMap", materialOverride.Emission); } + /// + /// Overrides the given 's detail mask using the emission texture from the override object. + /// + /// The containing the emission texture to override the material with. + /// The to override. protected virtual void OverrideDetailMask(MaterialOverride materialOverride, Material material) { material.SetTexture("_DetailMask", materialOverride.Emission); } + /// + /// Overrides the given 's parallax map using the emission texture from the override object. + /// + /// The containing the emission texture to override the material with. + /// The to override. protected virtual void OverrideHeightMap(MaterialOverride materialOverride, Material material) { material.SetTexture("_ParallaxMap", materialOverride.Emission); } + /// + /// Overrides the given 's metallic map using the emission texture from the override object. + /// + /// The containing the emission texture to override the material with. + /// The to override. protected virtual void OverrideMetallicMap(MaterialOverride materialOverride, Material material) { material.SetTexture("_MetallicGlossMap", materialOverride.Emission); } + /// + /// Overrides the given 's emission map using the emission texture from the override object. + /// + /// The containing the emission texture to override the material with. + /// The to override. protected virtual void OverrideEmission(MaterialOverride materialOverride, Material material) { material.SetTexture("_EmissionMap", materialOverride.Emission); } + /// + /// Overrides the given 's main texture using the main texture from the override object. + /// + /// The containing the main texture to override the material with. + /// The to override. protected virtual void OverrideMainTexture(MaterialOverride materialOverride, Material material) { material.mainTexture = materialOverride.MainTexture; diff --git a/InscryptionAPI/Masks/MaskManager.cs b/InscryptionAPI/Masks/MaskManager.cs index d9700b660..f8f89267b 100644 --- a/InscryptionAPI/Masks/MaskManager.cs +++ b/InscryptionAPI/Masks/MaskManager.cs @@ -6,29 +6,77 @@ namespace InscryptionAPI.Masks; +/// +/// Manager class for managing custom masks added through the API. +/// public static class MaskManager { - public enum ModelType - { + /// + /// IDs of all mask models. + /// + public enum ModelType { + /// + /// Mask worn during the Prospector fight. + /// Prospector = 1, + /// + /// Mask worn during the Woodcarver node. + /// Woodcarver = 2, + /// + /// Mask worn during the Angler fight. + /// Angler = 3, + /// + /// Mask worn during the Trapper node and first phase of the Trapper-Trader fight. + /// Trapper = 4, + /// + /// Mask worn during the Trader node and the second phase of the Trapper-Trader fight. + /// Trader = 5, + /// + /// Mask worn during the Mycologist node. + /// Doctor = 6, + /// + /// API-added mask representing a flat nondescript face. + /// FlatMask = 101, + /// + /// API-added mask representing a nondescript sphere. + /// Sphere = 102, } + /// + /// ID for when Leshy should have no mask. + /// public static LeshyAnimationController.Mask NoMask = (LeshyAnimationController.Mask)(-1); private static Dictionary> MaskLookup = new(); + /// + /// Dictionary that maps new mask model IDs to their prefab object. + /// public static Dictionary TypeToPrefabLookup = new(); + /// + /// All processed vanilla masks. + /// public static List BaseMasks = GenerateBaseMasks(); + /// + /// All processed mod-added masks. + /// public static List CustomMasks = new List(); + /// + /// Registers a new mask prefab with the API for use when creating custom masks. + /// + /// The GUID of the mod adding the mask prefab. + /// The internal name of the mask prefab. + /// The object containing the data needed to find and load the mask prefab. + /// The ID of the newly registered prefab for use when creating masks. public static ModelType RegisterPrefab(string pluginGUID, string prefabName, ResourceLookup resource) { ModelType type = GuidManager.GetEnumValue(pluginGUID, prefabName); @@ -37,6 +85,13 @@ public static ModelType RegisterPrefab(string pluginGUID, string prefabName, Res return type; } + /// + /// Creates a simple flat mask with a texture on its front and adds it to the API. + /// + /// The GUID of the mod adding this mask. + /// The internal name of this mask. + /// The file path of the texture to display on front of this mask. + /// The object containing all the data of this mask. public static CustomMask Add(string guid, string name, string texturePath = null) { LeshyAnimationController.Mask maskType = GuidManager.GetEnumValue(guid, name); @@ -52,6 +107,14 @@ public static CustomMask Add(string guid, string name, string texturePath = null return mask; } + /// + /// Creates a simple flat mask with a texture on its front and adds it to the API as a random option that can appear when selecting masks with the same ID. + /// + /// The GUID of the mod adding this mask. + /// The internal name of this mask. + /// The ID of this mask. This mask will be added to the pool of masks with this same ID and may be randomly selected. + /// The file path of the texture to display on front of this mask. + /// The object containing all the data of this mask. public static CustomMask AddRandom(string guid, string name, LeshyAnimationController.Mask maskType, string texturePath = null) { CustomMask mask = AddCustomMask(guid, name, maskType, ModelType.FlatMask, false); @@ -65,6 +128,16 @@ public static CustomMask AddRandom(string guid, string name, LeshyAnimationContr return mask; } + /// + /// Adds a simple mask that overrides masks with the given ID. + ///
+ /// The mask will use the model type, which will display the given texture on its front. + ///
+ /// The GUID of the mod adding this mask. + /// The internal name of this mask. + /// The ID of masks to override with this mask. + /// The file path of the texture to display on front of this mask. + /// The object containing all the data of this mask. public static CustomMask Override(string guid, string name, LeshyAnimationController.Mask maskType, string texturePath = null) { CustomMask mask = AddCustomMask(guid, name, maskType, ModelType.FlatMask, true); From c0af91b4f7505e2a4245bfd169a1647db1749c81 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:16:59 -0800 Subject: [PATCH 49/74] Finish adding XML to Nodes/ files --- .../Nodes/CustomCardChoiceNodeSequencer.cs | 2 +- InscryptionAPI/Nodes/CustomSpecialNodeData.cs | 22 +++++++ InscryptionAPI/Nodes/SelectionConditions.cs | 61 +++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git a/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs b/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs index b85bbdfb8..0f73cbfad 100644 --- a/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs +++ b/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs @@ -36,7 +36,7 @@ public abstract class CustomCardChoiceNodeSequencer : CardChoicesSequencer, ICus /// public virtual Quaternion DeckPileRotationOffset => Quaternion.identity; /// - /// True if deck pile should inherit PositionOffset and RotationOffset together with DeckPilePositionOffset and DeckPileRotationOffset. Defaults to false. + /// True if deck pile should inherit PositionOffset and RotationOffset together with DeckPilePositionOffset and DeckPileRotationOffset. Defaults to false. /// public virtual bool DeckPileInheritsOffsets => false; /// diff --git a/InscryptionAPI/Nodes/CustomSpecialNodeData.cs b/InscryptionAPI/Nodes/CustomSpecialNodeData.cs index 8bc3f44fe..c4f866502 100644 --- a/InscryptionAPI/Nodes/CustomSpecialNodeData.cs +++ b/InscryptionAPI/Nodes/CustomSpecialNodeData.cs @@ -5,16 +5,26 @@ namespace InscryptionAPI.Nodes; +/// +/// Subclass of that allows for custom node data to be used in-game. +/// public class CustomSpecialNodeData : SpecialNodeData { internal static Texture2D mapeventmissing; + /// + /// Creates a new instance of from the given . + /// + /// The to use for this node data. public CustomSpecialNodeData(NewNodeManager.FullNode node) { name = node.name; guid = node.guid; } + /// + /// The resource path for this node data's node prefab object. + /// public override string PrefabPath { get @@ -106,11 +116,23 @@ public T Get(string key) return default; } + /// + /// List of conditions needed before this node can be generated on the game map. + /// public override List GenerationPrerequisiteConditions => Node?.generationPrerequisites ?? new(); + /// + /// List of conditions that force this node to be generated on the game map. + /// public override List ForceGenerationConditions => Node?.forceGenerationConditions ?? new(); private readonly Dictionary runtimeData = new(); + /// + /// Internal name of the node. + /// public readonly string name; + /// + /// GUID of the mod adding this node. + /// public readonly string guid; } \ No newline at end of file diff --git a/InscryptionAPI/Nodes/SelectionConditions.cs b/InscryptionAPI/Nodes/SelectionConditions.cs index 1523b1300..5bd5dc4ce 100644 --- a/InscryptionAPI/Nodes/SelectionConditions.cs +++ b/InscryptionAPI/Nodes/SelectionConditions.cs @@ -18,6 +18,14 @@ public Not(NodeData.SelectionCondition selectionCondition) condition = selectionCondition; } + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If condition is not satisfied, this returns true. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { return !condition.Satisfied(gridY, previousNodes); @@ -43,6 +51,14 @@ public And(NodeData.SelectionCondition selectionCondition1, NodeData.SelectionCo condition2 = selectionCondition2; } + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If condition2 and condition2 are both true, this also returns true. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { return condition1.Satisfied(gridY, previousNodes) && condition2.Satisfied(gridY, previousNodes); @@ -54,6 +70,14 @@ public override bool Satisfied(int gridY, List previousNodes) ///
public class True : NodeData.SelectionCondition { + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// Always returns true. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { return true; @@ -65,6 +89,14 @@ public override bool Satisfied(int gridY, List previousNodes) /// public class False : NodeData.SelectionCondition { + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// Always returns false. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { return false; @@ -93,6 +125,17 @@ public CustomPreviousNodesContent(string guid, string name, bool doesContain) this.doesContain = doesContain; } + + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If doesContain is true, return true if the previous nodes contain a node with the given name and guid. + ///

+ /// If doesContain is false, return true if the previous nodes do not contain a node with the given name and guide. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { return previousNodes.Exists((x) => x != null && x is CustomSpecialNodeData && (x as CustomSpecialNodeData).name == name && (x as CustomSpecialNodeData).guid == guid) == doesContain; @@ -122,6 +165,16 @@ public CustomPreviousRowContent(string guid, string name, bool doesContain) this.doesContain = doesContain; } + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If doesContain is true, return true if the previous node row contains a node with the given name and guid. + ///

+ /// If doesContain is false, return true if the previous node row does not contain a node with the given name and guide. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { return previousNodes.Exists((x) => x != null && x.gridY == gridY - 1 && x is CustomSpecialNodeData && (x as CustomSpecialNodeData).name == name && (x as CustomSpecialNodeData).guid == guid) == doesContain; @@ -144,6 +197,14 @@ public Func(Func, bool> del) func = del; } + /// + /// Determines if this condition is satisfied and this node can be generated. + ///

+ /// If func is null, return true. Otherwise, call func and return its value. + ///
+ /// The y-index of this node. Higher values represent further nodes on the map. + /// The nodes generated at the previous y-index. + /// True if this node condition is satisfied and the node can be generated and added to the map. public override bool Satisfied(int gridY, List previousNodes) { if (func == null) From 4f0a6c8a2a39b5776dc812830c130a733a2254a4 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:19:17 -0800 Subject: [PATCH 50/74] Change accessor --- InscryptionAPI/Pelts/Patches/CardLoader_Patches.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InscryptionAPI/Pelts/Patches/CardLoader_Patches.cs b/InscryptionAPI/Pelts/Patches/CardLoader_Patches.cs index 72496b071..431f687f9 100644 --- a/InscryptionAPI/Pelts/Patches/CardLoader_Patches.cs +++ b/InscryptionAPI/Pelts/Patches/CardLoader_Patches.cs @@ -7,9 +7,9 @@ namespace InscryptionAPI.Pelts.Patches; internal class CardLoader_PeltNames { /// - /// Adds new pelts to be used everywhere in the game + /// Adds new pelts to be used everywhere in the game. /// - public static void Postfix(ref string[] __result) + private static void Postfix(ref string[] __result) { __result = PeltManager.AllPelts().Select((a) => a.peltCardName).ToArray(); } From edb4509d741ba2ea69f0f3f69f49ac4c0ce66f85 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:33:44 -0800 Subject: [PATCH 51/74] Add XML for Pelts/ files --- .../Patches/BuyPeltsSequencer_Patches.cs | 10 +++ .../Patches/TradePeltsSequencer_Patches.cs | 7 ++ InscryptionAPI/Pelts/PeltExtensions.cs | 9 +- InscryptionAPI/Pelts/PeltManager.cs | 86 ++++++++++++++++++- 4 files changed, 107 insertions(+), 5 deletions(-) diff --git a/InscryptionAPI/Pelts/Patches/BuyPeltsSequencer_Patches.cs b/InscryptionAPI/Pelts/Patches/BuyPeltsSequencer_Patches.cs index 44f0ab761..e75b3dcd3 100644 --- a/InscryptionAPI/Pelts/Patches/BuyPeltsSequencer_Patches.cs +++ b/InscryptionAPI/Pelts/Patches/BuyPeltsSequencer_Patches.cs @@ -255,6 +255,9 @@ private static void AdjustPosition(int index, ref Vector3 vector) } } +/// +/// Patcher class for modifying the method. +/// [HarmonyPatch] public class BuyPeltsSequencer_GiveFreePeltSequence { @@ -283,5 +286,12 @@ private static IEnumerable Transpiler(IEnumerable + /// New method for determining what free pelt card is given. + ///
+ /// Defaults to Hare Pelt and its return value does not change unless this is patched. + /// + /// The current value of this method. + /// The card that the Trapper will give to the player for free. public static CardInfo ChangeFreeCard(CardInfo currentFreeCard) => CardLoader.GetCardByName("PeltHare"); } \ No newline at end of file diff --git a/InscryptionAPI/Pelts/Patches/TradePeltsSequencer_Patches.cs b/InscryptionAPI/Pelts/Patches/TradePeltsSequencer_Patches.cs index 363aa830d..3269d1e39 100644 --- a/InscryptionAPI/Pelts/Patches/TradePeltsSequencer_Patches.cs +++ b/InscryptionAPI/Pelts/Patches/TradePeltsSequencer_Patches.cs @@ -167,6 +167,9 @@ private static int abilityCount(int abilityCount, int tier) } } +/// +/// Patcher class for modifying . +/// [HarmonyPatch] public class TradePeltsSequencer_TradePelts { @@ -258,6 +261,10 @@ public static IEnumerator CentreCreateTradeCards(TradePeltsSequencer __instance, private static readonly string Current = "System.Object <>2__current"; private static readonly string GetTradeCardInfos = "System.Collections.Generic.List`1[DiskCardGame.CardInfo] GetTradeCardInfos(Int32, Boolean)"; } + +/// +/// Patcher clas for modifying . +/// [HarmonyPatch] public class TradePeltsSequencer_CreatePeltCards { diff --git a/InscryptionAPI/Pelts/PeltExtensions.cs b/InscryptionAPI/Pelts/PeltExtensions.cs index ba05d3daa..60ce31c2d 100644 --- a/InscryptionAPI/Pelts/PeltExtensions.cs +++ b/InscryptionAPI/Pelts/PeltExtensions.cs @@ -3,6 +3,9 @@ namespace InscryptionAPI.Pelts.Extensions; +/// +/// Utility class adding extensions to aid in creating new objects. +/// public static class PeltExtensions { /// @@ -61,7 +64,7 @@ public static PeltData SetBuyPriceModifiers(this PeltData peltData, int bossPric /// Sets the function used to determine how this pelt's price will increase across a run. /// /// The PeltData to access. - /// The Func used to calculate the price increase. + /// The Func used to calculate the price increase. /// The same PeltData so a chain can continue. public static PeltData SetBuyPriceAdjustment(this PeltData peltData, Func buyPriceAdjustment) { @@ -97,7 +100,7 @@ public static PeltData SetIsSoldByTrapper(this PeltData peltData, bool soldByTra /// Sets the number of card choices the Trader will present to the player in exchange for this pelt. /// /// The PeltData to access. - /// Whether the pelt should be sellable by the Trapper. + /// How many card choices the Trader should offer in exchange for this pelt. /// The same PeltData so a chain can continue. public static PeltData SetNumberOfTraderChoices(this PeltData peltData, int numOfChoices) { @@ -108,7 +111,7 @@ public static PeltData SetNumberOfTraderChoices(this PeltData peltData, int numO /// Sets the function used to determine what cards can be offered by the Trader in exchange for this pelt. /// /// The PeltData to access. - /// The Func that decides what cards can be offered. + /// The Func that decides what cards can be offered. /// The same PeltData so a chain can continue. public static PeltData SetCardChoices(this PeltData peltData, Func> getCardChoices) { diff --git a/InscryptionAPI/Pelts/PeltManager.cs b/InscryptionAPI/Pelts/PeltManager.cs index 76170d885..1a7640ccd 100644 --- a/InscryptionAPI/Pelts/PeltManager.cs +++ b/InscryptionAPI/Pelts/PeltManager.cs @@ -8,6 +8,9 @@ namespace InscryptionAPI.Pelts; +/// +/// Manager class for managing new pelt cards that can be bought and traded in Act 1. +/// public static class PeltManager { private class VanillaPeltData : PeltData @@ -15,26 +18,71 @@ private class VanillaPeltData : PeltData public override int BuyPrice => GetBasePeltData().Find((a) => a.Item1 == peltCardName).Item2; } + /// + /// Utility class containing all data about pelt cards needed for them to be used in-game at the Trapper and Trader. + /// public class PeltData { + /// + /// The GUID of the mod adding this pelt. + /// public string pluginGuid; + /// + /// The internal name of the actual pelt card that will be added to the player's deck and then traded away. + /// public string peltCardName; + /// + /// The internal name of the pelt's tier. + /// public string peltTierName = null; + /// + /// If the pelt card can be bought at the Trapper. + /// public bool isSoldByTrapper = true; + /// + /// Function for determining what cards the Trader will offer in exchange for this pelt. + /// public Func> CardChoices; + /// + /// Function for determining how much this pelt's price will change when buying it at the Trapper. + /// public Func BuyPriceAdjustment = (int basePrice) => basePrice + RunState.CurrentRegionTier; + /// + /// Action that's called to modify card choices offered by the Trader (eg., change stats, etc.). + /// public Action ModifyCardChoiceAtTrader = null; + /// + /// The minimum cost of this pelt when offered by the Trapper. + /// public int baseBuyPrice; + /// + /// The maximum cost of this pelt when offered by the Trapper. + /// public int maxBuyPrice; + /// + /// How many extra abilities should be added to card choices at the Trader. + /// public int extraAbilitiesToAdd; + /// + /// How many cards choices the Trader will present to the player for this pelt. + /// public int choicesOfferedByTrader = 8; + /// + /// How much the purchase price for this pelt should be reduced after beating the Trapper and Trader boss. + /// public int bossDefeatedPriceReduction = 2; + /// + /// The price multiplier when the Expensive Pelts challenge is active. Default is double price. + /// public int expensivePeltsPriceMultiplier = 2; + /// + /// The actual buy price for this pelt, implementing all multipliers, adjustments, and the set min and max price. + /// public virtual int BuyPrice { get @@ -135,6 +183,16 @@ public static PeltData New(string pluginGuid, CardInfo peltCardInfo, Func + /// Creates a new instance of CustomPeltData then adds it to the game. Requires all parameter arguments be filled. + /// + /// GUID of the mod adding this pelt. + /// The CardInfo for the actual pelt card. + /// The list of possible cards the Trader will offer for this pelt. + /// The starting price of this pelt when buying from the Trapper. + /// The number of extra sigils card choices will have when trading this pelt to the Trader. + /// How many cards to offer the player when trading the pelt. + /// The newly created CustomPeltData so a chain can continue. public static PeltData New(string pluginGuid, CardInfo peltCardInfo, int baseBuyPrice, int extraAbilitiesToAdd, int choicesOfferedByTrader, Func> getCardChoices) { if (getCardChoices == null) @@ -158,9 +216,9 @@ public static PeltData New(string pluginGuid, CardInfo peltCardInfo, int baseBuy } /// - /// Adds a CustomPeltData to the game, enabling it to be usable with the Trapper and Trader. + /// Adds a to the game, enabling it to be usable with the Trapper and Trader. /// - /// The CustomPeltData to add. + /// The to add. public static void Add(PeltData data) { if (data.peltCardName.IsNullOrWhiteSpace()) @@ -175,6 +233,10 @@ public static void Add(PeltData data) AllNewPelts.Add(data); } + /// + /// Determines what pelts can be bought at the Trapper. + /// + /// A list of all pelts that can be bought at the Trapper. public static List AllPeltsAvailableAtTrader() { List peltNames = new(); @@ -182,6 +244,11 @@ public static List AllPeltsAvailableAtTrader() return peltNames; } + /// + /// Gets the buy price of the pelt with the given name. + /// + /// The name of the pelt to search for. + /// The pelt's , or 1 if the pelt could not be found. public static int GetCostOfPelt(string peltName) { PeltData pelt = GetPelt(peltName); @@ -193,6 +260,11 @@ public static int GetCostOfPelt(string peltName) return pelt.BuyPrice; } + /// + /// Gets the with the given name. + /// + /// Name of the pelt to retrieve. + /// The with the given name, or null if it couldn't be found. public static PeltData GetPelt(string peltName) { return AllPelts().Find((a) => a.peltCardName == peltName); @@ -228,6 +300,11 @@ internal static void CreateDialogueEvents() } } + /// + /// Determines the tier name for a pelt from its internal card name. + /// + /// The internal name of the pelt card. + /// The tier name for the pelt derived from the card name. public static string GetTierNameFromPelt(string cardName) { string result = ""; @@ -244,6 +321,11 @@ public static string GetTierNameFromPelt(string cardName) return result; } + /// + /// Retrieves the tier name of the pelt. + /// + /// The to access. + /// The tier name of the pelt. If peltData has no defined tier name, will be called and used instead. public static string GetTierNameFromData(PeltData peltData) { return peltData.peltTierName ?? GetTierNameFromPelt(peltData.peltCardName); From d284a2f38f2cb7834d2314f75fc033864496f238 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:43:09 -0800 Subject: [PATCH 52/74] Add XML to PixelCard/ files --- InscryptionAPI/PixelCard/GBCPackManager.cs | 3 ++ .../PixelCard/PixelCardBehaviours.cs | 40 +++++++++++++++++++ InscryptionAPI/PixelCard/PixelCardManager.cs | 37 +++++++++++++++++ 3 files changed, 80 insertions(+) diff --git a/InscryptionAPI/PixelCard/GBCPackManager.cs b/InscryptionAPI/PixelCard/GBCPackManager.cs index 1bd4a287c..335634c5c 100644 --- a/InscryptionAPI/PixelCard/GBCPackManager.cs +++ b/InscryptionAPI/PixelCard/GBCPackManager.cs @@ -6,6 +6,9 @@ namespace InscryptionAPI.PixelCard; +/// +/// Manager class for defining and adding custom GBC card packs. +/// [HarmonyPatch] public static class GBCPackManager { diff --git a/InscryptionAPI/PixelCard/PixelCardBehaviours.cs b/InscryptionAPI/PixelCard/PixelCardBehaviours.cs index f09b6c4e2..c95508182 100644 --- a/InscryptionAPI/PixelCard/PixelCardBehaviours.cs +++ b/InscryptionAPI/PixelCard/PixelCardBehaviours.cs @@ -5,16 +5,44 @@ namespace InscryptionAPI.PixelCard; +/// +/// Subclass of that works in Act 2. +/// public class PixelAppearanceBehaviour : CardAppearanceBehaviour { + /// + /// How this appearance should be applied outside Act 2. + /// public override void ApplyAppearance() { } + /// + /// The sprite this appearance behaviour will apply in Act 2. + /// + /// public virtual Sprite PixelAppearance() { return null; } + /// + /// The sprite that will override the default portrait in Act 2. + /// + /// public virtual Sprite OverridePixelPortrait() { return null; } + /// + /// The sprite that will override the default card background in Act 2. + /// + /// public virtual Sprite OverrideBackground() { return null; } + /// + /// The sprite that will override the default card background in Act 2 when this card is in the queue. + /// + /// public virtual Sprite OverrideQueuedBackground() { return null; } + /// + /// Logic for this apperance behaviour when applying its appearance in Act 2. + /// public virtual void OnAppearanceApplied() { } } +/// +/// Class that adds a border to Act 2 cards when they're Gemified that updates as gems are added and removed. +/// public class PixelGemificationBorder : MonoBehaviour { private void Start() @@ -55,8 +83,20 @@ private void UpdateGemGlow() } } + /// + /// The this border is attached to. + /// public DiskCardGame.Card card; + /// + /// The for the lit orange gem. + /// public GameObject OrangeGemLit; + /// + /// The for the lit green gem. + /// public GameObject GreenGemLit; + /// + /// The for the lit blue gem. + /// public GameObject BlueGemLit; } \ No newline at end of file diff --git a/InscryptionAPI/PixelCard/PixelCardManager.cs b/InscryptionAPI/PixelCard/PixelCardManager.cs index e209745c5..a8da9ed22 100644 --- a/InscryptionAPI/PixelCard/PixelCardManager.cs +++ b/InscryptionAPI/PixelCard/PixelCardManager.cs @@ -9,18 +9,43 @@ namespace InscryptionAPI.PixelCard; +/// +/// Manager class for handling decals, custom appearances, and Gemified in Act 2. +/// [HarmonyPatch] public static class PixelCardManager // code courtesy of Nevernamed and James/kelly { + /// + /// Utility class containing all data needed to apply decals to Act 2 cards. + /// public class PixelDecalData { + /// + /// The GUID of the mod adding this decal. + /// public string PluginGUID; + /// + /// The name of the texture. + /// public string TextureName; + /// + /// The texture of the decal that will be added to cards. + /// public Texture2D DecalTexture; } + /// + /// All mod-added Act 2 decals. + /// public static readonly List CustomPixelDecals = new(); + /// + /// Creates and registers a new decal with the API for use in Act 2. + /// + /// The GUID of the mod adding the decal. + /// The name of the decal's texture. + /// The texture used for the decal. + /// The containing all data for the decal. public static PixelDecalData AddGBCDecal(string pluginGUID, string textureName, Texture2D texture) { PixelDecalData result = new() @@ -195,9 +220,21 @@ private static GameObject CreateDecal(in Transform cardElements, Sprite sprite, return decal; } + /// + /// Sprite for the Gemified decal used with . + /// public static Sprite PixelGemifiedDecal; + /// + /// Sprite for the lit orange gem used in . + /// public static Sprite PixelGemifiedOrangeLit; + /// + /// Sprite for the lit blue gem used in . + /// public static Sprite PixelGemifiedBlueLit; + /// + /// Sprite for the lit green gem used in . + /// public static Sprite PixelGemifiedGreenLit; private class DecalIdentifier : MonoBehaviour { } From c404bb82335bf962eea2632aa82fbb6d211e01d1 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 13:55:58 -0800 Subject: [PATCH 53/74] Add XML to Regions/ files, privatise transpiler in RegionManager --- InscryptionAPI/Regions/Part1RegionData.cs | 44 +++++++++++++++++++ InscryptionAPI/Regions/RegionManager.cs | 51 +++++++++++++++++++++-- 2 files changed, 92 insertions(+), 3 deletions(-) diff --git a/InscryptionAPI/Regions/Part1RegionData.cs b/InscryptionAPI/Regions/Part1RegionData.cs index 4cd5c8e28..9648879b6 100644 --- a/InscryptionAPI/Regions/Part1RegionData.cs +++ b/InscryptionAPI/Regions/Part1RegionData.cs @@ -4,24 +4,68 @@ namespace InscryptionAPI.Regions; +/// +/// Utility class containing all data needed to create a custom for use in Act 1. +/// public class Part1RegionData { + /// + /// The GUID of the mod adding this region. + /// public string GUID { get; private set; } + /// + /// The tier for this region. Determines when this region will appear during a run (0 - 3). + /// public int Tier { get => tier; private set => tier = value; } + /// + /// The description object for this region. + /// public RegionData Region { get => region; private set => region = value; } + /// + /// The minimum amount of Terrain created on the board at the start of battles in this region. + /// public int MinTerrain { get; set; } + /// + /// The maximum amount of Terrain cards created on the board at the start of battles in this region. + /// public int MaxTerrain { get; set; } + /// + /// If created Terrain can appear on the opponent's side of the board. + /// public bool AllowTerrainOnEnemySide { get; set; } + /// + /// If created Terrain can appear on the player's side of the board. + /// public bool AllowTerrainOnPlayerSide { get; set; } + /// + /// If Terrain cards should not have the Reach sigil by default. + /// public bool RemoveDefaultReachTerrain { get; set; } + /// + /// If Terrain cards should not be forced to have the Reach sigil. + /// public bool DoNotForceReachTerrain { get; set; } + /// + /// If created Terain cards can pull from the pool of locked (not yet encountered) cards. + /// public bool AllowLockedTerrainCards { get; set; } + /// + /// If created Terrain cards should pull from the pool of sacrificable cards. + /// public bool AllowSacrificableTerrainCards { get; set; } + /// + /// If this region can appear randomly during a run or should only appear at its given tier. + /// public bool CanAppearRandomly { get; set; } private int tier; private RegionData region; + /// + /// Creates a new instance of and registers it with the . + /// + /// The description object for the region. + /// The tier of the region. public Part1RegionData(RegionData region, int tier) { Assembly callingAssembly = Assembly.GetCallingAssembly(); diff --git a/InscryptionAPI/Regions/RegionManager.cs b/InscryptionAPI/Regions/RegionManager.cs index e7fde7bb1..a4388f098 100644 --- a/InscryptionAPI/Regions/RegionManager.cs +++ b/InscryptionAPI/Regions/RegionManager.cs @@ -10,9 +10,25 @@ namespace InscryptionAPI.Regions; +/// +/// Manager class for handling regions. +/// [HarmonyPatch] public static class RegionManager { + /// + /// All vanilla map regions, reordered to match the general order they're encounter during the story. + /// + /// + /// Order of regions in this collection: + ///
Forest + ///
Wetlands + ///
Alpine + ///
Midnight + ///
Midnight_Ascension + ///
Pirateville + ///
!TEST_PART3 + ///
public static readonly ReadOnlyCollection BaseGameRegions = new(ReorderBaseRegions()); /* Order of BaseGameRegions before reordering @@ -42,8 +58,14 @@ private static List GenerateBasePart1RegionData() { return data.Select(x => new Part1RegionData(x, 0)).ToList(); } + /// + /// All currently processed added by mods. + /// public static readonly ObservableCollection NewRegions = new(); - + + /// + /// A hook for modders to add custom code to modify the regions list dynamically. + /// public static event Func, List> ModifyRegionsList; internal static void ReplaceBlueprintInCore(EncounterBlueprintData newData) @@ -68,6 +90,9 @@ private static RegionData CloneRegion(this RegionData data) return retval; } + /// + /// Resynchronizes the regions list. + /// public static void SyncRegionList() { var regions = BaseGameRegions.Concat(NewRegions.Select(x => x.Region)).Select(x => x.CloneRegion()).ToList(); @@ -101,15 +126,35 @@ static RegionManager() }; } + /// + /// A copy of the current processed list of all regions in the game, including vanilla and mod-added regions. + /// public static List AllRegionsCopy { get; private set; } = BaseGameRegions.ToList(); + /// + /// Adds a new region to the API at the given tier. + /// + /// The region to add. + /// The tier of the region. public static void Add(RegionData newRegion, int tier) { if (!NewRegions.Select(x => x.Region).Contains(newRegion)) NewRegions.Add(new Part1RegionData(newRegion, tier)); } + + /// + /// Removes a region from the game based on its . Can only remove mod-added regions, not vanilla ones. + /// + /// The instance of the region to remove. public static void Remove(RegionData region) => NewRegions.Remove(NewRegions.Where(x => x.Region == region).First()); + /// + /// Creates a new region instance. + /// + /// The name of the region. + /// The region's tier. + /// If the region can appear randomly during a run. + /// The new region instance. public static RegionData New(string name, int tier, bool addToPool = true) { RegionData retval = ScriptableObject.CreateInstance(); @@ -280,9 +325,9 @@ private static bool ApplyTerrainCustomization(ref EncounterData.StartCondition _ } [HarmonyPatch(typeof(MapDataReader), "SpawnMapObjects", new Type[] { typeof(MapData), typeof(int), typeof(Vector2) })] - public class MapDataReader_SpawnMapObjects + private class MapDataReader_SpawnMapObjects { - public static IEnumerable Transpiler(IEnumerable instructions) + private static IEnumerable Transpiler(IEnumerable instructions) { // === We want to turn this From 354e52a4c0bb509a0d076e27fa0b8c09707692da Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:03:20 -0800 Subject: [PATCH 54/74] Add missing XML to ResourceBankManager, fix typos in existing XML --- .../ResourceBank/ResourceBankManager.cs | 71 +++++++++++++------ 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/InscryptionAPI/ResourceBank/ResourceBankManager.cs b/InscryptionAPI/ResourceBank/ResourceBankManager.cs index 5d6a526df..aa18489b0 100644 --- a/InscryptionAPI/ResourceBank/ResourceBankManager.cs +++ b/InscryptionAPI/ResourceBank/ResourceBankManager.cs @@ -4,17 +4,39 @@ namespace InscryptionAPI.Resource; -public static class ResourceBankManager -{ +/// +/// Manager class for adding new resources to the . +/// +public static class ResourceBankManager { + /// + /// Utility class containing all data need to add and use custom resources. + /// public class ResourceData { + /// + /// The GUID of the mod adding this resource. + /// public string PluginGUID; + /// + /// The description object for this resource. + /// public ResourceBank.Resource Resource; + /// + /// If this resource is overriding an existing resource. + /// public bool OverrideExistingResource; } private static readonly List CustomResources = new(); + /// + /// Adds a new resource to the API that can be retrieved from the . + /// + /// The GUID of the mod adding the resource. + /// The path the resource will be located at in the . + /// The that will be stored as a resource. + /// If the resource will override an existing resource asset. + /// The for the newly created resource. public static ResourceData Add(string pluginGUID, string path, UnityObject unityObject, bool overrideExistingAsset = false) { return Add(pluginGUID, new ResourceBank.Resource() @@ -24,6 +46,13 @@ public static ResourceData Add(string pluginGUID, string path, UnityObject unity }, overrideExistingAsset); } + /// + /// Adds a new resource to the API that can be retrieved from the . + /// + /// The GUID of the mod adding the resource. + /// The resource to add to the . + /// If the resource will override an existing resource asset. + /// The for the newly created resource, or null if resource is null. public static ResourceData Add(string pluginGUID, ResourceBank.Resource resource, bool overrideExistingAsset = false) { if (resource == null) @@ -49,61 +78,61 @@ public static ResourceData Add(string pluginGUID, ResourceBank.Resource resource } /// - /// Adds a custom GameObject resource located at the path Inscryption uses to retrieve Prefabs when instantiating weights for the scales. + /// Adds a custom resource located at the path Inscryption uses to retrieve Prefabs when instantiating weights for the scales. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank - /// The scales weight GameObject. + /// The name used to identify the resource. Used when retrieving it from the . + /// The scales weight . /// If we should override any existing asset that shares this resource's path. public static ResourceData AddScaleWeightPrefab(string pluginGUID, string resourceName, GameObject prefab, bool overrideExistingAsset = false) { return Add(pluginGUID, "Prefabs/Environment/ScaleWeights/" + resourceName, prefab, overrideExistingAsset); } /// - /// Adds a custom GameObject resource located at the path Inscryption uses to retrieve Prefabs when instantiating card battle idle events, eg, the spider. + /// Adds a custom resource located at the path Inscryption uses to retrieve Prefabs when instantiating card battle idle events, eg, the spider. /// /// - /// Note: Object must have a CardBattleIdleEvent component attached. + /// Note: Object must have a component attached. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank - /// The GameObject for the CardBattleIdleEvent. + /// The name used to identify the resource. Used when retrieving it from the . + /// The for the . /// If we should override any existing asset that shares this resource's path. public static ResourceData AddCardBattleIdleEvent(string pluginGUID, string resourceName, GameObject eventPrefab, bool overrideExistingAsset = false) { return Add(pluginGUID, "Prefabs/Environment/CardBattleIdleEvents/" + resourceName, eventPrefab, overrideExistingAsset); } /// - /// Adds a custom GameObject resource located at the path Inscryption uses to retrieve Prefabs when instantiating first person animations. + /// Adds a custom resource located at the path Inscryption uses to retrieve Prefabs when instantiating first person animations. /// /// - /// Note: The game checks the Prefab's children for the Animator and FirstPersonAnimatorObject. + /// Note: The game checks the Prefab's children for the and components. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank - /// The table effect GameObject. + /// The name used to identify the resource. Used when retrieving it from the . + /// The for the first person animation. /// If we should override any existing asset that shares this resource's path. public static ResourceData AddFirstPersonAnimation(string pluginGUID, string resourceName, GameObject animPrefab, bool overrideExistingAsset = false) { return Add(pluginGUID, "Prefabs/FirstPersonAnimations/" + resourceName, animPrefab, overrideExistingAsset); } /// - /// Adds a custom GameObject resource located at the path Inscryption uses to retrieve Prefabs when instantiating table effects, ie, during boss fights. + /// Adds a custom resource located at the path Inscryption uses to retrieve Prefabs when instantiating table effects, ie, during boss fights. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank - /// The table effect GameObject. + /// The name used to identify the resource. Used when retrieving it from the . + /// The for the table effect. /// If we should override any existing asset that shares this resource's path. public static ResourceData AddTableEffect(string pluginGUID, string resourceName, GameObject tableEffectPrefab, bool overrideExistingAsset = false) { return Add(pluginGUID, "Prefabs/Environment/TableEffects/" + resourceName, tableEffectPrefab, overrideExistingAsset); } /// - /// Adds a custom GameObject resource located at the path Inscryption uses to retrieve Prefabs when generating map scenery. + /// Adds a custom resource located at the path Inscryption uses to retrieve Prefabs when generating map scenery. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank - /// The map scenery GameObject. + /// The name used to identify the resource. Used when retrieving it from the . + /// The map scenery . /// If we should override any existing asset that shares this resource's path. public static ResourceData AddMapScenery(string pluginGUID, string resourceName, GameObject sceneryPrefab, bool overrideExistingAsset = false) { return Add(pluginGUID, SceneryData.PREFABS_ROOT + resourceName, sceneryPrefab, overrideExistingAsset); @@ -113,7 +142,7 @@ public static ResourceData AddMapScenery(string pluginGUID, string resourceName, /// Adds a custom Texture resource located at the path Inscryption uses to retrieve ability icons. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank + /// The name used to identify the resource. Used when retrieving it from the . /// The ability icon's texture. /// If we should override any existing asset that shares this resource's path. public static ResourceData AddAbilityIcon(string pluginGUID, string resourceName, Texture iconTexture, bool overrideExistingAsset = false) { @@ -124,7 +153,7 @@ public static ResourceData AddAbilityIcon(string pluginGUID, string resourceName /// Adds a custom Texture resource located at the path Inscryption uses to retrieve card decal textures. /// /// The GUID of the plugin adding the resource. - /// The name used to identify the resource. Used when retrieving it from the ResourceBank + /// The name used to identify the resource. Used when retrieving it from the . /// The decal texture. /// If we should override any existing asset that shares this resource's path. public static ResourceData AddDecal(string pluginGUID, string resourceName, Texture decalTexture, bool overrideExistingAsset = false) { From 1178ad16af3e8955dc397a3e96b0230f0238fe2f Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 15:18:55 -0800 Subject: [PATCH 55/74] Add XML to all Rulebook/ files whoever added so many near-identical rulebook redirect methods should be shot 57 times (it was me, i should be shot 57 times) --- InscryptionAPI/Boons/BoonManager.cs | 8 +- InscryptionAPI/Card/AbilityManager.cs | 8 +- InscryptionAPI/Card/SpecialStatIconManager.cs | 8 +- InscryptionAPI/Items/ConsumableItemManager.cs | 8 +- .../Rulebook/PageTextInteractable.cs | 22 + InscryptionAPI/Rulebook/RuleBookManager.cs | 172 +++++- .../Rulebook/RuleBookManagerPatches.cs | 6 + .../Rulebook/RuleBookRedirectExtensions.cs | 535 +++++++++++++++++- .../Slots/SlotModificationManager.cs | 8 +- 9 files changed, 725 insertions(+), 50 deletions(-) diff --git a/InscryptionAPI/Boons/BoonManager.cs b/InscryptionAPI/Boons/BoonManager.cs index cb182c1c8..9ff9e3511 100644 --- a/InscryptionAPI/Boons/BoonManager.cs +++ b/InscryptionAPI/Boons/BoonManager.cs @@ -47,10 +47,10 @@ public class FullBoon /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. - /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. - /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + ///
Key (string): the text that will be recoloured to indicate that it's clickable. + ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. + ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. + ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. ///
public Dictionary RulebookDescriptionRedirects = new(); } diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 988ea6221..0b25767a3 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -71,10 +71,10 @@ public class FullAbility /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. - /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. - /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + ///
Key (string): the text that will be recoloured to indicate that it's clickable. + ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. + ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. + ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. ///
public Dictionary RulebookDescriptionRedirects = new(); diff --git a/InscryptionAPI/Card/SpecialStatIconManager.cs b/InscryptionAPI/Card/SpecialStatIconManager.cs index 8e2fa1bca..3438356c1 100644 --- a/InscryptionAPI/Card/SpecialStatIconManager.cs +++ b/InscryptionAPI/Card/SpecialStatIconManager.cs @@ -49,10 +49,10 @@ public class FullStatIcon /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. - /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. - /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + ///
Key (string): the text that will be recoloured to indicate that it's clickable. + ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. + ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. + ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. ///
public Dictionary RulebookDescriptionRedirects = new(); diff --git a/InscryptionAPI/Items/ConsumableItemManager.cs b/InscryptionAPI/Items/ConsumableItemManager.cs index 2c157c84e..30cec6a3f 100644 --- a/InscryptionAPI/Items/ConsumableItemManager.cs +++ b/InscryptionAPI/Items/ConsumableItemManager.cs @@ -27,10 +27,10 @@ public class FullConsumableItemData /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. - /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. - /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + ///
Key (string): the text that will be recoloured to indicate that it's clickable. + ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. + ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. + ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. ///
public Dictionary RulebookDescriptionRedirects = new(); diff --git a/InscryptionAPI/Rulebook/PageTextInteractable.cs b/InscryptionAPI/Rulebook/PageTextInteractable.cs index c6b151552..36ef7d12d 100644 --- a/InscryptionAPI/Rulebook/PageTextInteractable.cs +++ b/InscryptionAPI/Rulebook/PageTextInteractable.cs @@ -2,11 +2,23 @@ namespace InscryptionAPI.RuleBook; +/// +/// Class for interacting with hyperlinked text in the rulebook. +/// public class PageTextInteractable : AlternateInputInteractable { + /// + /// The icon of the mouse cursor when hovering of this object. + /// public override CursorType CursorType => CursorType.Inspect; + /// + /// The page type and section this object will redirect to when clicked on. + /// public PageRangeType redirectType; + /// + /// The ID of the page this object will redirect to. + /// public string redirectId; /*public Vector3 relativeToRulebookPosition; @@ -35,12 +47,22 @@ public override void ManagedLateUpdate() y = rotatedY + cy; }*/ + /// + /// Sets the data for this interactable needed for it to work. + /// + /// The page type and section this object will redirect to when clicked on. + /// The ID of the page this object will redirect to. public void SetRedirect(PageRangeType rangeType, string pageId) { redirectType = rangeType; redirectId = pageId; } + /// + /// Logic for when this object is clicked on with the alternate select key (default right-click). + ///
+ /// Locates and then flips to the page defined by the redirectId. + ///
public override void OnAlternateSelectStarted() { RuleBookController.Instance.SetShown(true, redirectType != PageRangeType.Boons); diff --git a/InscryptionAPI/Rulebook/RuleBookManager.cs b/InscryptionAPI/Rulebook/RuleBookManager.cs index f253299f8..4d94e9114 100644 --- a/InscryptionAPI/Rulebook/RuleBookManager.cs +++ b/InscryptionAPI/Rulebook/RuleBookManager.cs @@ -7,15 +7,38 @@ namespace InscryptionAPI.RuleBook; - +/// +/// Manager class for adding hyperlinks to rulebook entries that redirect to other rulebook pages. +/// public static class RuleBookManager { + /// + /// Utility class containing all the data needed to define redirects. + /// public class RedirectInfo { + /// + /// The page type and rulebook section this hyperlink will redirect to. + /// + /// + /// If the hyperlink redirects to a custom section, use . + /// public PageRangeType redirectType; + /// + /// What colour hyperlinked text should be to indicate that it's interactable. + /// public Color redirectTextColour; + /// + /// The ID of the page the hyperlink redirects to. + /// public string redirectPageId; + /// + /// Creates a new instance of . + /// + /// + /// + /// public RedirectInfo(PageRangeType redirectType, Color redirectTextColour, string redirectPageId) { this.redirectType = redirectType; @@ -24,21 +47,29 @@ public RedirectInfo(PageRangeType redirectType, Color redirectTextColour, string } } /// - /// A custom class that associates a RuleBookPageInfo object with a Dictionary of RuleBookDescriptionRedirects. Use if + /// A custom class that associates a object with a Dictionary of s. Use if /// public class RuleBookPageInfoExt { + /// + /// The rulebook page that the redirects will be mapped to. + /// public RuleBookPageInfo parentPageInfo; /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. - /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. - /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + ///
Key (string): the text that will be recoloured to indicate that it's clickable. + ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. + ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. + ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. ///
public Dictionary RulebookDescriptionRedirects = new(); + /// + /// Creates + /// + /// + /// public RuleBookPageInfoExt(RuleBookPageInfo parentPageInfo, Dictionary redirects) { this.parentPageInfo = parentPageInfo; @@ -46,7 +77,13 @@ public RuleBookPageInfoExt(RuleBookPageInfo parentPageInfo, Dictionary + /// All currently processed pages with redirects. + /// public static readonly List ConstructedPagesWithRedirects = new(); + /// + /// All currently processed custom pages with redirects. + /// public static readonly List CustomRedirectPages = new(); internal static void AddRedirectPage(RuleBookPageInfo pageInfo, Dictionary redirects) @@ -54,6 +91,9 @@ internal static void AddRedirectPage(RuleBookPageInfo pageInfo, Dictionary + /// Utility class containing all the data needed for a custom rulebook section. + /// public class FullRuleBookRangeInfo { /// @@ -101,13 +141,51 @@ public class FullRuleBookRangeInfo /// public Func> CreatePagesFunc; + /// + /// Action that implements logic for constructing pages in this rulebook section. + /// public Action FillPageAction; + /// + /// The starting page number of this section in its header. + /// + /// + /// public int GetStartingNumber(List pages) => GetStartingNumberFunc(pages); + /// + /// Where in the rulebook this section should appear. + /// + /// An existing rulebook section to use as a positional reference. + /// All pages being added to this section. + /// The index of where in the rulebook this section is being inserted. public int GetInsertPosition(PageRangeInfo currentPageRange, List pages) => GetInsertPositionFunc(currentPageRange, pages); + /// + /// Method for creating the rulebook page objects used in this section. + /// + /// The instance. + /// The section object that will be used as a template when creating pages. + /// The metacategory indicating what game act this rulebook is for (Act 1, Act 3, Grimora, Magnificus). + /// public List CreatePages(RuleBookInfo instance, PageRangeInfo currentPageRange, AbilityMetaCategory metaCategory) => CreatePagesFunc(instance, currentPageRange, metaCategory); + /// + /// Method for filling in information on each rulebook page in this section. + /// + /// The current page being filled. + /// The ID of the page being filld. + /// Various objects used to fill this page. Varies depending on the page template used in public void FillRuleBookPage(RuleBookPage instance, string pageId, params object[] otherArgs) => FillPageAction(instance, pageId, otherArgs); + /// + /// Creates an instance of . + /// + /// The GUID of the mod adding this rulebook section. + /// The rulebook style this section will use. + /// The prefix used at the start of this section's header. If null, uses "with numeral "I". + /// The name of this rulebook section. + /// The function used to determine the initial number displayed in the page corner. If null, defaults to 1. + /// The function used to determine the index this section will be inserted into in the rulebook. + /// The function used to create the pages in this section. + /// The action used to fill each constructed page in this section. public FullRuleBookRangeInfo( string modGuid, PageRangeType type, string headerPrefix, string subsectionName, Func, int> getStartingNumberFunc, @@ -125,6 +203,10 @@ public FullRuleBookRangeInfo( this.FillPageAction = fillPageAct; } + /// + /// Creates a deep clone of this object. + /// + /// The newly created deep clone. public FullRuleBookRangeInfo Clone() { return new( @@ -139,7 +221,14 @@ public FullRuleBookRangeInfo Clone() internal readonly static ObservableCollection NewRuleBookInfos = new(); + /// + /// All currently process s, including vanilla and mod-added. + /// public static List AllRuleBookInfos { get; private set; } + + /// + /// A hook for modders to add custom code to modify the rulebook sections list dynamically. + /// public static event Func, List> ModifyRuleBookInfos; static RuleBookManager() @@ -150,6 +239,9 @@ static RuleBookManager() }; } + /// + /// Resynchronizes the custom rulebook sections list. + /// public static void SyncRuleBookList() { AllRuleBookInfos = NewRuleBookInfos.Select(x => x.Clone()).ToList(); @@ -157,17 +249,17 @@ public static void SyncRuleBookList() } /// - /// Creates a custom rulebook range. Simplified version of the full New() method that only requires the minimumrequired parameters. + /// Creates a custom rulebook range. Simplified version of the full New() method that only requires the minimum required parameters. /// - /// The GUID of the mod adding this FullRuleBookRangeInfo - /// The PageRangeType we want to inherit from. This will determine the style of pages. + /// The GUID of the mod adding this . + /// The we want to inherit from. This will determine the style of pages. /// The name of the rulebook subsection, eg. "Abilities" or "Boons". /// The Func to determine what index in the rulebook to insert a new section. - /// The Func that is called to create the RuleBookPage objects that will be used to fill the rulebook. + /// The Func that is called to create the objects that will be used to fill the rulebook. /// The first half of the header that will appear on rulebook pages. Leave null to use the default prefix. /// The Func to determine the first page number in this range. Leave null to use the default starting number (1). /// The Action to call when filling in the data for each rulebook page. - /// A new FullRuleBookRangeInfo containing the information to create a custom rulebook range. + /// A new containing the information to create a custom rulebook range. public static FullRuleBookRangeInfo New( string modGuid, PageRangeType pageType, @@ -220,47 +312,57 @@ public static FullRuleBookRangeInfo New( /// /// The FullRuleBookRangeInfo we want to modify. /// - /// The same FullRuleBookRangeInfo so a chain can continue. + /// The same so a chain can continue. public static FullRuleBookRangeInfo SetFillPage(this FullRuleBookRangeInfo info, Action action) { info.FillPageAction = action; return info; } /// - /// Sets the HeaderPrefix for the provided FullRuleBookRangeInfo. + /// Sets the header prefix for the given . /// - /// The FullRuleBookRangeInfo we want to modify. + /// The we want to modify. /// The string we want our header prefix to become. /// - /// If you only want to modify the subsection numeral, use SetPrefixSimple instead. + /// If you only want to modify the subsection numeral, use instead. /// - /// The same FullRuleBookRangeInfo so a chain can continue. + /// The same so a chain can continue. public static FullRuleBookRangeInfo SetHeaderPrefix(this FullRuleBookRangeInfo info, string headerPrefix) { info.HeaderPrefix = headerPrefix; return info; } /// - /// Sets the FullRuleBookRangeInfo's HeaderPrefix using the HeaderPrefixSimple method (see there more for information). + /// Sets the 's using . /// - /// The FullRuleBookRangeInfo we want to modify. - /// A string ideally representing a roman numeral, used for the subsection number. - /// The same FullRuleBookRangeInfo so a chain can continue. + /// The we want to modify. + /// A string representing a roman numeral, used for the subsection number. + /// The same so a chain can continue. public static FullRuleBookRangeInfo SetHeaderPrefixSimple(this FullRuleBookRangeInfo info, string romanNumeral) { info.HeaderPrefix = HeaderPrefixSimple(romanNumeral); return info; } /// - /// Creates a header prefix with the provided string using DEFAULT_HEADER_PREFIX as a template. + /// Creates a header prefix with the provided string using as a template. /// - /// A ideally representing a roman numeral for the subsection number. - /// A fully formatted header in the format of "APPENDIX XII, SUBSECTION {0}", where {0} is romanNumeral. + /// A representing a roman numeral for the subsection number. + /// A fully formatted header in the format of APPENDIX XII, SUBSECTION {0}, where {0} is romanNumeral. public static string HeaderPrefixSimple(string romanNumeral) => string.Format(DEFAULT_HEADER_PREFIX, romanNumeral); private const string DEFAULT_HEADER_PREFIX = "APPENDIX XII, SUBSECTION {0}"; + + /// + /// Helper string for formatting coloured text in HTML. + /// public const string HTML_REPLACE_STRING = "{1}"; + /// + /// Parses the colours of redirects for the given rulebook description and modifies said description to display coloured text. + /// + /// Dictionary of strings that will be made into hyperlinks that need to be recoloured. + /// The rulebook description whose text will be recoloured in preparation for hyperlinks being added. + /// The modified rulebook description with parsed colours. public static string ParseRedirectTextColours(Dictionary dictionary, string description) { string desc = description; @@ -293,10 +395,10 @@ public static string GetUnformattedPageId(string pageId) } /// - /// Opens the rulebook to the page with the given pageId. + /// Opens the rulebook to the page with the given pageId. /// - /// RuleBookController.Instance. - /// The value to compare each rulebook pages' id against. If this starts with "[API_" then it will check against a page's unformatted id. + /// . + /// The value to compare each rulebook pages' id against. If this starts with [API_ then it will check against a page's unformatted id. /// Whether to offset the camera view down when opening the rulebook. public static void OpenToCustomPage(this RuleBookController instance, string pageId, bool offsetView = false) { @@ -311,13 +413,31 @@ public static void OpenToCustomPage(this RuleBookController instance, string pag instance.StartCoroutine(instance.flipper.FlipToPage(pageIndex, 0.2f)); } + /// + /// If the given item should be added to the rulebook for the given game act. + /// + /// The to check. + /// The metacategory for the current act. + /// True if the item should be added to the rulebook. public static bool ItemShouldBeAdded(ConsumableItemData item, AbilityMetaCategory metaCategory) { return item.rulebookCategory == metaCategory || item.GetFullConsumableItemData()?.rulebookMetaCategories.Contains(metaCategory) == true; } + /// + /// If the given Boon should be added to the rulebook for the given game act. + /// + /// The Boon to check. + /// The metacategory for the current act. + /// True if the Boon should be added to the rulebook. public static bool BoonShouldBeAdded(FullBoon fullBoon, AbilityMetaCategory metaCategory) { return fullBoon?.boon?.icon != null && fullBoon.appearInRulebook && fullBoon.metaCategories.Contains(metaCategory); } + /// + /// If the given slot modification should be added to the rulebook for the given game act. + /// + /// The slot modification to check. + /// The metacategory for the current act. + /// True if the Boon should be added to the rulebook. public static bool SlotModShouldBeAdded(Info info, ModificationMetaCategory category) => info.RulebookName != null && info.MetaCategories.Contains(category); } \ No newline at end of file diff --git a/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs b/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs index 5f4272fcb..df7bac82c 100644 --- a/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs +++ b/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs @@ -13,9 +13,15 @@ namespace InscryptionAPI.RuleBook; +/// +/// Patcher class for making custom rulebook pages work. +/// [HarmonyPatch] public class RuleBookManagerPatches { + /// + /// THe prefix string for handling API-created pageIds. + /// public const string API_ID = "[API_"; [HarmonyPatch(typeof(RuleBookInfo), "ConstructPageData", new Type[] { typeof(AbilityMetaCategory) })] diff --git a/InscryptionAPI/Rulebook/RuleBookRedirectExtensions.cs b/InscryptionAPI/Rulebook/RuleBookRedirectExtensions.cs index d37eec8e4..19be365ff 100644 --- a/InscryptionAPI/Rulebook/RuleBookRedirectExtensions.cs +++ b/InscryptionAPI/Rulebook/RuleBookRedirectExtensions.cs @@ -8,40 +8,99 @@ namespace InscryptionAPI.RuleBook; +/// +/// Utility class that adds extensions to aid in adding rulebook redirects (hyperlinks) to supported game objects. +/// public static class RuleBookRedirectExtensions { #region AbilityInfo + /// + /// Creates a new hyperlink for the given ability to the page of another ability. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityManager.FullAbility SetAbilityRedirect(this AbilityManager.FullAbility fullAbility, string clickableText, Ability abilityRedirect, Color redirectColour) { fullAbility.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Abilities, redirectColour, abilityRedirect.ToString()); return fullAbility; } + /// + /// Creates a new hyperlink for the given ability to the page of a stat icon. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityManager.FullAbility SetStatIconRedirect(this AbilityManager.FullAbility fullAbility, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { fullAbility.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.StatIcons, redirectColour, statIconRedirect.ToString()); return fullAbility; } + /// + /// Creates a new hyperlink for the given ability to the page of a boon. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityManager.FullAbility SetBoonRedirect(this AbilityManager.FullAbility fullAbility, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { fullAbility.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Boons, redirectColour, boonRedirect.ToString()); return fullAbility; } + /// + /// Creates a new hyperlink for the given ability to the page of an item. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityManager.FullAbility SetItemRedirect(this AbilityManager.FullAbility fullAbility, string clickableText, string itemNameRedirect, Color redirectColour) { fullAbility.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, itemNameRedirect); return fullAbility; } + /// + /// Creates a new hyperlink for the given ability to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityManager.FullAbility SetUniqueRedirect(this AbilityManager.FullAbility fullAbility, string clickableText, string uniqueRedirect, Color redirectColour) { fullAbility.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Unique, redirectColour, uniqueRedirect); return fullAbility; } + /// + /// Creates a new hyperlink for the given ability to the page of a slot modification. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityManager.FullAbility SetSlotRedirect(this AbilityManager.FullAbility fullAbility, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { fullAbility.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, SlotModificationManager.SLOT_PAGEID + slotMod.ToString()); return fullAbility; } + /// + /// Creates a new hyperlink for the given ability to the page of another ability. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityInfo SetAbilityRedirect(this AbilityInfo info, string clickableText, Ability abilityRedirect, Color redirectColour) { AbilityManager.FullAbility full = AbilityManager.BaseGameAbilities.Concat(AbilityManager.NewAbilities).FirstOrDefault(x => x.Info.ability == info.ability); @@ -54,6 +113,14 @@ public static AbilityInfo SetAbilityRedirect(this AbilityInfo info, string click InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the AbilityInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given ability to the page of a stat icon. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityInfo SetStatIconRedirect(this AbilityInfo info, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { AbilityManager.FullAbility full = AbilityManager.BaseGameAbilities.Concat(AbilityManager.NewAbilities).FirstOrDefault(x => x.Info.ability == info.ability); @@ -66,6 +133,14 @@ public static AbilityInfo SetStatIconRedirect(this AbilityInfo info, string clic InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the AbilityInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given ability to the page of a boon. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityInfo SetBoonRedirect(this AbilityInfo info, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { AbilityManager.FullAbility full = AbilityManager.BaseGameAbilities.Concat(AbilityManager.NewAbilities).FirstOrDefault(x => x.Info.ability == info.ability); @@ -78,6 +153,14 @@ public static AbilityInfo SetBoonRedirect(this AbilityInfo info, string clickabl InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the AbilityInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given ability to the page of an item. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityInfo SetItemRedirect(this AbilityInfo info, string clickableText, string itemNameRedirect, Color redirectColour) { AbilityManager.FullAbility full = AbilityManager.BaseGameAbilities.Concat(AbilityManager.NewAbilities).FirstOrDefault(x => x.Info.ability == info.ability); @@ -90,6 +173,14 @@ public static AbilityInfo SetItemRedirect(this AbilityInfo info, string clickabl InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the AbilityInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given ability to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityInfo SetUniqueRedirect(this AbilityInfo info, string clickableText, string uniqueRedirect, Color redirectColour) { AbilityManager.FullAbility full = AbilityManager.BaseGameAbilities.Concat(AbilityManager.NewAbilities).FirstOrDefault(x => x.Info.ability == info.ability); @@ -102,6 +193,14 @@ public static AbilityInfo SetUniqueRedirect(this AbilityInfo info, string clicka InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the AbilityInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given ability to the page of a slot modification. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static AbilityInfo SetSlotRedirect(this AbilityInfo info, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { AbilityManager.FullAbility full = AbilityManager.BaseGameAbilities.Concat(AbilityManager.NewAbilities).FirstOrDefault(x => x.Info.ability == info.ability); @@ -117,37 +216,92 @@ public static AbilityInfo SetSlotRedirect(this AbilityInfo info, string clickabl #endregion #region StatIconInfo + /// + /// Creates a new hyperlink for the given stat icon to the page of an ability. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconManager.FullStatIcon SetAbilityRedirect(this StatIconManager.FullStatIcon fullIcon, string clickableText, Ability abilityRedirect, Color redirectColour) { fullIcon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Abilities, redirectColour, abilityRedirect.ToString()); return fullIcon; } + /// + /// Creates a new hyperlink for the given stat icon to the page of another stat icon. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconManager.FullStatIcon SetStatIconRedirect(this StatIconManager.FullStatIcon fullIcon, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { fullIcon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.StatIcons, redirectColour, statIconRedirect.ToString()); return fullIcon; } + /// + /// Creates a new hyperlink for the given stat icon to the page of a boon. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconManager.FullStatIcon SetBoonRedirect(this StatIconManager.FullStatIcon fullIcon, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { fullIcon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Boons, redirectColour, boonRedirect.ToString()); return fullIcon; } + /// + /// Creates a new hyperlink for the given stat icon to the page of an item. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconManager.FullStatIcon SetItemRedirect(this StatIconManager.FullStatIcon fullIcon, string clickableText, string itemNameRedirect, Color redirectColour) { fullIcon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, itemNameRedirect); return fullIcon; } + /// + /// Creates a new hyperlink for the given stat icon to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconManager.FullStatIcon SetUniqueRedirect(this StatIconManager.FullStatIcon fullIcon, string clickableText, string uniqueRedirect, Color redirectColour) { fullIcon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Unique, redirectColour, uniqueRedirect); return fullIcon; } + /// + /// Creates a new hyperlink for the given stat icon to the page of a slot modification. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconManager.FullStatIcon SetSlotRedirect(this StatIconManager.FullStatIcon fullIcon, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { fullIcon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, SlotModificationManager.SLOT_PAGEID + slotMod.ToString()); return fullIcon; } - + /// + /// Creates a new hyperlink for the given stat icon to the page of an ability. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconInfo SetAbilityRedirect(this StatIconInfo info, string clickableText, Ability abilityRedirect, Color redirectColour) { StatIconManager.FullStatIcon full = StatIconManager.AllStatIcons.Find(x => x.Id == info.iconType); @@ -160,6 +314,14 @@ public static StatIconInfo SetAbilityRedirect(this StatIconInfo info, string cli InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the StatIconInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given ability to the page of a stat icon. + /// + /// The to access. + /// The text in this ability's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconInfo SetStatIconRedirect(this StatIconInfo info, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { StatIconManager.FullStatIcon full = StatIconManager.AllStatIcons.Find(x => x.Id == info.iconType); @@ -172,6 +334,14 @@ public static StatIconInfo SetStatIconRedirect(this StatIconInfo info, string cl InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the StatIconInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given stat icon to the page of a boon. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconInfo SetBoonRedirect(this StatIconInfo info, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { StatIconManager.FullStatIcon full = StatIconManager.AllStatIcons.Find(x => x.Id == info.iconType); @@ -184,6 +354,14 @@ public static StatIconInfo SetBoonRedirect(this StatIconInfo info, string clicka InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the StatIconInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given stat icon to the page of an item. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconInfo SetItemRedirect(this StatIconInfo info, string clickableText, string itemNameRedirect, Color redirectColour) { StatIconManager.FullStatIcon full = StatIconManager.AllStatIcons.Find(x => x.Id == info.iconType); @@ -196,6 +374,14 @@ public static StatIconInfo SetItemRedirect(this StatIconInfo info, string clicka InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the StatIconInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given stat icon to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconInfo SetUniqueRedirect(this StatIconInfo info, string clickableText, string uniqueRedirect, Color redirectColour) { StatIconManager.FullStatIcon full = StatIconManager.AllStatIcons.Find(x => x.Id == info.iconType); @@ -208,6 +394,14 @@ public static StatIconInfo SetUniqueRedirect(this StatIconInfo info, string clic InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the StatIconInfo hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given stat icon to the page of a slot modification. + /// + /// The to access. + /// The text in this stat icon's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static StatIconInfo SetSlotRedirect(this StatIconInfo info, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { StatIconManager.FullStatIcon full = StatIconManager.AllStatIcons.Find(x => x.Id == info.iconType); @@ -223,37 +417,92 @@ public static StatIconInfo SetSlotRedirect(this StatIconInfo info, string clicka #endregion #region BoonData + /// + /// Creates a new hyperlink for the given boon to the page of an ability. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonManager.FullBoon SetAbilityRedirect(this BoonManager.FullBoon fullBoon, string clickableText, Ability abilityRedirect, Color redirectColour) { fullBoon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Abilities, redirectColour, abilityRedirect.ToString()); return fullBoon; } + /// + /// Creates a new hyperlink for the given boon to the page of a stat icon. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonManager.FullBoon SetStatIconRedirect(this BoonManager.FullBoon fullBoon, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { fullBoon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.StatIcons, redirectColour, statIconRedirect.ToString()); return fullBoon; } + /// + /// Creates a new hyperlink for the given boon to the page of another boon. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonManager.FullBoon SetBoonRedirect(this BoonManager.FullBoon fullBoon, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { fullBoon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Boons, redirectColour, boonRedirect.ToString()); return fullBoon; } + /// + /// Creates a new hyperlink for the given boon to the page of an item. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonManager.FullBoon SetItemRedirect(this BoonManager.FullBoon fullBoon, string clickableText, string itemNameRedirect, Color redirectColour) { fullBoon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, itemNameRedirect); return fullBoon; } + /// + /// Creates a new hyperlink for the given boon to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonManager.FullBoon SetUniqueRedirect(this BoonManager.FullBoon fullBoon, string clickableText, string uniqueRedirect, Color redirectColour) { fullBoon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Unique, redirectColour, uniqueRedirect); return fullBoon; } + /// + /// Creates a new hyperlink for the given boon to the page of a slot modification. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonManager.FullBoon SetSlotRedirect(this BoonManager.FullBoon fullBoon, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { fullBoon.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, SlotModificationManager.SLOT_PAGEID + slotMod.ToString()); return fullBoon; } - + /// + /// Creates a new hyperlink for the given boon to the page of an ability. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonData SetAbilityRedirect(this BoonData info, string clickableText, Ability abilityRedirect, Color redirectColour) { BoonManager.FullBoon full = BoonManager.AllFullBoons.Find(x => x.boon.type == info.type); @@ -266,6 +515,14 @@ public static BoonData SetAbilityRedirect(this BoonData info, string clickableTe InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the BoonData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given boon to the page of a stat icon. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonData SetStatIconRedirect(this BoonData info, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { BoonManager.FullBoon full = BoonManager.AllFullBoons.Find(x => x.boon.type == info.type); @@ -278,6 +535,14 @@ public static BoonData SetStatIconRedirect(this BoonData info, string clickableT InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the BoonData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given boon to the page of another boon. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonData SetBoonRedirect(this BoonData info, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { BoonManager.FullBoon full = BoonManager.AllFullBoons.Find(x => x.boon.type == info.type); @@ -290,6 +555,14 @@ public static BoonData SetBoonRedirect(this BoonData info, string clickableText, InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the BoonData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given boon to the page of an item. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonData SetItemRedirect(this BoonData info, string clickableText, string itemNameRedirect, Color redirectColour) { BoonManager.FullBoon full = BoonManager.AllFullBoons.Find(x => x.boon.type == info.type); @@ -302,6 +575,14 @@ public static BoonData SetItemRedirect(this BoonData info, string clickableText, InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the BoonData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given boon to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonData SetUniqueRedirect(this BoonData info, string clickableText, string uniqueRedirect, Color redirectColour) { BoonManager.FullBoon full = BoonManager.AllFullBoons.Find(x => x.boon.type == info.type); @@ -314,6 +595,14 @@ public static BoonData SetUniqueRedirect(this BoonData info, string clickableTex InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the BoonData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given boon to the page of a slot modification. + /// + /// The to access. + /// The text in this boon's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static BoonData SetSlotRedirect(this BoonData info, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { BoonManager.FullBoon full = BoonManager.AllFullBoons.Find(x => x.boon.type == info.type); @@ -329,37 +618,92 @@ public static BoonData SetSlotRedirect(this BoonData info, string clickableText, #endregion #region ConsumableItemData + /// + /// Creates a new hyperlink for the given item to the page of an ability. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemManager.FullConsumableItemData SetAbilityRedirect(this ConsumableItemManager.FullConsumableItemData fullItem, string clickableText, Ability abilityRedirect, Color redirectColour) { fullItem.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Abilities, redirectColour, abilityRedirect.ToString()); return fullItem; } + /// + /// Creates a new hyperlink for the given item to the page of a stat icon. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemManager.FullConsumableItemData SetStatIconRedirect(this ConsumableItemManager.FullConsumableItemData fullItem, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { fullItem.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.StatIcons, redirectColour, statIconRedirect.ToString()); return fullItem; } + /// + /// Creates a new hyperlink for the given item to the page of a boon. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemManager.FullConsumableItemData SetBoonRedirect(this ConsumableItemManager.FullConsumableItemData fullItem, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { fullItem.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Boons, redirectColour, boonRedirect.ToString()); return fullItem; } + /// + /// Creates a new hyperlink for the given item to the page of an item. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemManager.FullConsumableItemData SetItemRedirect(this ConsumableItemManager.FullConsumableItemData fullItem, string clickableText, string itemNameRedirect, Color redirectColour) { fullItem.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, itemNameRedirect); return fullItem; } + /// + /// Creates a new hyperlink for the given item to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemManager.FullConsumableItemData SetUniqueRedirect(this ConsumableItemManager.FullConsumableItemData fullItem, string clickableText, string uniqueRedirect, Color redirectColour) { fullItem.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Unique, redirectColour, uniqueRedirect); return fullItem; } + /// + /// Creates a new hyperlink for the given item to the page of a slot modification. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemManager.FullConsumableItemData SetSlotRedirect(this ConsumableItemManager.FullConsumableItemData fullItem, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { fullItem.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, SlotModificationManager.SLOT_PAGEID + slotMod.ToString()); return fullItem; } - + /// + /// Creates a new hyperlink for the given item to the page of an ability. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemData SetAbilityRedirect(this ConsumableItemData info, string clickableText, Ability abilityRedirect, Color redirectColour) { ConsumableItemManager.FullConsumableItemData full = ConsumableItemManager.allFullItemDatas.Find(x => x.itemData == info); @@ -372,6 +716,14 @@ public static ConsumableItemData SetAbilityRedirect(this ConsumableItemData info InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the ConsumableItemData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given item to the page of a stat icon. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemData SetStatIconRedirect(this ConsumableItemData info, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { ConsumableItemManager.FullConsumableItemData full = ConsumableItemManager.allFullItemDatas.Find(x => x.itemData == info); @@ -384,6 +736,14 @@ public static ConsumableItemData SetStatIconRedirect(this ConsumableItemData inf InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the ConsumableItemData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given item to the page of a boon. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemData SetBoonRedirect(this ConsumableItemData info, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { ConsumableItemManager.FullConsumableItemData full = ConsumableItemManager.allFullItemDatas.Find(x => x.itemData == info); @@ -396,6 +756,14 @@ public static ConsumableItemData SetBoonRedirect(this ConsumableItemData info, s InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the ConsumableItemData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given item to the page of an item. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemData SetItemRedirect(this ConsumableItemData info, string clickableText, string itemNameRedirect, Color redirectColour) { ConsumableItemManager.FullConsumableItemData full = ConsumableItemManager.allFullItemDatas.Find(x => x.itemData == info); @@ -408,6 +776,14 @@ public static ConsumableItemData SetItemRedirect(this ConsumableItemData info, s InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the ConsumableItemData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given item to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemData SetUniqueRedirect(this ConsumableItemData info, string clickableText, string uniqueRedirect, Color redirectColour) { ConsumableItemManager.FullConsumableItemData full = ConsumableItemManager.allFullItemDatas.Find(x => x.itemData == info); @@ -420,6 +796,14 @@ public static ConsumableItemData SetUniqueRedirect(this ConsumableItemData info, InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the ConsumableItemData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given item to the page of a slot modification. + /// + /// The to access. + /// The text in this item's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static ConsumableItemData SetSlotRedirect(this ConsumableItemData info, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { ConsumableItemManager.FullConsumableItemData full = ConsumableItemManager.allFullItemDatas.Find(x => x.itemData == info); @@ -435,37 +819,92 @@ public static ConsumableItemData SetSlotRedirect(this ConsumableItemData info, s #endregion #region SlotMod + /// + /// Creates a new hyperlink for the given slot modification to the page of an ability. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.Info SetAbilityRedirect(this SlotModificationManager.Info slotInfo, string clickableText, Ability abilityRedirect, Color redirectColour) { slotInfo.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Abilities, redirectColour, abilityRedirect.ToString()); return slotInfo; } + /// + /// Creates a new hyperlink for the given slot modification info to the page of a stat icon. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.Info SetStatIconRedirect(this SlotModificationManager.Info slotInfo, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { slotInfo.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.StatIcons, redirectColour, statIconRedirect.ToString()); return slotInfo; } + /// + /// Creates a new hyperlink for the given slot modification to the page of a boon. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.Info SetBoonRedirect(this SlotModificationManager.Info slotInfo, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { slotInfo.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Boons, redirectColour, boonRedirect.ToString()); return slotInfo; } + /// + /// Creates a new hyperlink for the given slot modification to the page of an item. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.Info SetItemRedirect(this SlotModificationManager.Info slotInfo, string clickableText, string itemNameRedirect, Color redirectColour) { slotInfo.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, itemNameRedirect); return slotInfo; } + /// + /// Creates a new hyperlink for the given slot modification to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.Info SetUniqueRedirect(this SlotModificationManager.Info slotInfo, string clickableText, string uniqueRedirect, Color redirectColour) { slotInfo.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Unique, redirectColour, uniqueRedirect); return slotInfo; } + /// + /// Creates a new hyperlink for the given slot modification to the page of another slot modification. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.Info SetSlotRedirect(this SlotModificationManager.Info slotInfo, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { slotInfo.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, SlotModificationManager.SLOT_PAGEID + slotMod.ToString()); return slotInfo; } - + /// + /// Creates a new hyperlink for the given slot modification to the page of an ability. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.ModificationType SetAbilityRedirect(this SlotModificationManager.ModificationType info, string clickableText, Ability abilityRedirect, Color redirectColour) { SlotModificationManager.Info full = SlotModificationManager.AllSlotModifications.InfoByID(info); @@ -478,6 +917,14 @@ public static SlotModificationManager.ModificationType SetAbilityRedirect(this S InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the SlotModificationManager.ModificationType hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given slot modification to the page of a stat icon. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.ModificationType SetStatIconRedirect(this SlotModificationManager.ModificationType info, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { SlotModificationManager.Info full = SlotModificationManager.AllSlotModifications.InfoByID(info); @@ -490,6 +937,14 @@ public static SlotModificationManager.ModificationType SetStatIconRedirect(this InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the SlotModificationManager.ModificationType hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given slot modification to the page of a boon. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.ModificationType SetBoonRedirect(this SlotModificationManager.ModificationType info, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { SlotModificationManager.Info full = SlotModificationManager.AllSlotModifications.InfoByID(info); @@ -502,6 +957,14 @@ public static SlotModificationManager.ModificationType SetBoonRedirect(this Slot InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the ConsumableItemData hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given slot modification to the page of an item. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.ModificationType SetItemRedirect(this SlotModificationManager.ModificationType info, string clickableText, string itemNameRedirect, Color redirectColour) { SlotModificationManager.Info full = SlotModificationManager.AllSlotModifications.InfoByID(info); @@ -514,6 +977,14 @@ public static SlotModificationManager.ModificationType SetItemRedirect(this Slot InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the SlotModificationManager.ModificationType hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given slot modification to the page of a custom rulebook section. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.ModificationType SetUniqueRedirect(this SlotModificationManager.ModificationType info, string clickableText, string uniqueRedirect, Color redirectColour) { SlotModificationManager.Info full = SlotModificationManager.AllSlotModifications.InfoByID(info); @@ -526,6 +997,14 @@ public static SlotModificationManager.ModificationType SetUniqueRedirect(this Sl InscryptionAPIPlugin.Logger.LogError($"Can't set rulebook redirect for {clickableText} because the SlotModificationManager.ModificationType hasn't been added to the API yet."); return info; } + /// + /// Creates a new hyperlink for the given slot modification to the page of another slot modification. + /// + /// The to access. + /// The text in this slot modification's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static SlotModificationManager.ModificationType SetSlotRedirect(this SlotModificationManager.ModificationType info, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { SlotModificationManager.Info full = SlotModificationManager.AllSlotModifications.InfoByID(info); @@ -541,6 +1020,14 @@ public static SlotModificationManager.ModificationType SetSlotRedirect(this Slot #endregion #region RuleBookPageInfo + /// + /// Creates a new hyperlink for the given page info to the page of an ability. + /// + /// The to access. + /// The text in this page info's rulebook description that should be made a hyperlink. + /// The ID of the ability this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static RuleBookPageInfo SetAbilityRedirect(this RuleBookPageInfo pageInfo, string clickableText, Ability abilityRedirect, Color redirectColour) { RuleBookPageInfoExt ext = CustomRedirectPages.Find(x => x.parentPageInfo == pageInfo); @@ -552,6 +1039,14 @@ public static RuleBookPageInfo SetAbilityRedirect(this RuleBookPageInfo pageInfo ext.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Abilities, redirectColour, abilityRedirect.ToString()); return pageInfo; } + /// + /// Creates a new hyperlink for the given page info to the page of a stat icon. + /// + /// The to access. + /// The text in this page info's rulebook description that should be made a hyperlink. + /// The ID of the stat icon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static RuleBookPageInfo SetStatIconRedirect(this RuleBookPageInfo pageInfo, string clickableText, SpecialStatIcon statIconRedirect, Color redirectColour) { RuleBookPageInfoExt ext = CustomRedirectPages.Find(x => x.parentPageInfo == pageInfo); @@ -563,6 +1058,14 @@ public static RuleBookPageInfo SetStatIconRedirect(this RuleBookPageInfo pageInf ext.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.StatIcons, redirectColour, statIconRedirect.ToString()); return pageInfo; } + /// + /// Creates a new hyperlink for the given page info to the page of a boon. + /// + /// The to access. + /// The text in this page info's rulebook description that should be made a hyperlink. + /// The ID of the boon this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static RuleBookPageInfo SetBoonRedirect(this RuleBookPageInfo pageInfo, string clickableText, BoonData.Type boonRedirect, Color redirectColour) { RuleBookPageInfoExt ext = CustomRedirectPages.Find(x => x.parentPageInfo == pageInfo); @@ -574,6 +1077,14 @@ public static RuleBookPageInfo SetBoonRedirect(this RuleBookPageInfo pageInfo, s ext.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Boons, redirectColour, boonRedirect.ToString()); return pageInfo; } + /// + /// Creates a new hyperlink for the given page info to the page of an item. + /// + /// The to access. + /// The text in this page info's rulebook description that should be made a hyperlink. + /// The name of the item this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static RuleBookPageInfo SetItemRedirect(this RuleBookPageInfo pageInfo, string clickableText, string itemNameRedirect, Color redirectColour) { RuleBookPageInfoExt ext = CustomRedirectPages.Find(x => x.parentPageInfo == pageInfo); @@ -585,6 +1096,14 @@ public static RuleBookPageInfo SetItemRedirect(this RuleBookPageInfo pageInfo, s ext.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Items, redirectColour, itemNameRedirect); return pageInfo; } + /// + /// Creates a new hyperlink for the given page info to the page of another custom rulebook section. + /// + /// The to access. + /// The text in this page info's rulebook description that should be made a hyperlink. + /// The page ID of the custom page this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static RuleBookPageInfo SetUniqueRedirect(this RuleBookPageInfo pageInfo, string clickableText, string uniqueRedirect, Color redirectColour) { RuleBookPageInfoExt ext = CustomRedirectPages.Find(x => x.parentPageInfo == pageInfo); @@ -596,6 +1115,14 @@ public static RuleBookPageInfo SetUniqueRedirect(this RuleBookPageInfo pageInfo, ext.RulebookDescriptionRedirects[clickableText] = new(PageRangeType.Unique, redirectColour, uniqueRedirect); return pageInfo; } + /// + /// Creates a new hyperlink for the given page info to the page of a slot modification. + /// + /// The to access. + /// The text in this page info's rulebook description that should be made a hyperlink. + /// The ID of the slot modification this hyperlink should redirect to. + /// The colour that hyperlinked text should be recoloured to indicate it can be clicked. + /// The same so a chain can continue. public static RuleBookPageInfo SetSlotRedirect(this RuleBookPageInfo pageInfo, string clickableText, SlotModificationManager.ModificationType slotMod, Color redirectColour) { RuleBookPageInfoExt ext = CustomRedirectPages.Find(x => x.parentPageInfo == pageInfo); diff --git a/InscryptionAPI/Slots/SlotModificationManager.cs b/InscryptionAPI/Slots/SlotModificationManager.cs index 5e93078ca..e802e22fb 100644 --- a/InscryptionAPI/Slots/SlotModificationManager.cs +++ b/InscryptionAPI/Slots/SlotModificationManager.cs @@ -94,10 +94,10 @@ public class Info /// /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - /// Key (string): the text that will be recoloured to indicate that it's clickable. - /// Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. - /// Tuple.Item2 (Color): the colour the Key text will be recoloured to. - /// Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + ///
Key (string): the text that will be recoloured to indicate that it's clickable. + ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. + ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. + ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. ///
public Dictionary RulebookDescriptionRedirects = new(); From e356887dc79e131154b66c6608f67a276251332a Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 15:56:24 -0800 Subject: [PATCH 56/74] Add XML to Saves/ files --- InscryptionAPI/Saves/ModdedSaveData.cs | 11 +++++++++++ InscryptionAPI/Saves/ModdedSaveManager.cs | 3 +++ InscryptionAPI/Saves/SaveFileExtensions.cs | 3 +++ 3 files changed, 17 insertions(+) diff --git a/InscryptionAPI/Saves/ModdedSaveData.cs b/InscryptionAPI/Saves/ModdedSaveData.cs index cdb3437f3..4c82f2ec9 100644 --- a/InscryptionAPI/Saves/ModdedSaveData.cs +++ b/InscryptionAPI/Saves/ModdedSaveData.cs @@ -1,5 +1,8 @@ namespace InscryptionAPI.Saves; +/// +/// Class representing modded game data. +/// public class ModdedSaveData { internal Dictionary> SaveData = new(); @@ -25,6 +28,14 @@ public T GetValueAsObject(string guid, string key) return (T)SaveData[guid][key]; } + /// + /// Attempts to locate the GUID and relevant string key from a save value in the modded save data. + /// + /// The prefix appended to the start of the save data's string. Not the GUID. + /// The ID of the key to find, converted to a string. + /// The located GUID or null if it couldn't be found. + /// The located string kwy or null if it couldn't be found. + /// True if the GUID and key could be found. False otherwise. public bool TryGetGuidAndKey(string prefix, string enumValue, out string guid, out string key) { foreach (KeyValuePair> pair in SaveData) diff --git a/InscryptionAPI/Saves/ModdedSaveManager.cs b/InscryptionAPI/Saves/ModdedSaveManager.cs index 2beb0b060..48c22c81a 100644 --- a/InscryptionAPI/Saves/ModdedSaveManager.cs +++ b/InscryptionAPI/Saves/ModdedSaveManager.cs @@ -3,6 +3,9 @@ namespace InscryptionAPI.Saves; +/// +/// Manager class for . +/// [HarmonyPatch] public static class ModdedSaveManager { diff --git a/InscryptionAPI/Saves/SaveFileExtensions.cs b/InscryptionAPI/Saves/SaveFileExtensions.cs index 302f1f8c4..e2cf8b0a6 100644 --- a/InscryptionAPI/Saves/SaveFileExtensions.cs +++ b/InscryptionAPI/Saves/SaveFileExtensions.cs @@ -4,6 +4,9 @@ namespace InscryptionAPI.Saves; +/// +/// Utility class adding extensions to help with manipulation. +/// public static class SaveFileExtensions { /// From b5c2c802bd874d8942ff35862843898ef2504d31 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 15:56:32 -0800 Subject: [PATCH 57/74] Add XML to Slots/ files --- .../Slots/SlotModificationExtensions.cs | 47 ++++++++++- .../SlotModificationGainAbilityBehaviour.cs | 17 ++++ .../Slots/SlotModificationInteractable.cs | 14 ++++ .../Slots/SlotModificationManager.cs | 80 +++++++++++++++---- 4 files changed, 140 insertions(+), 18 deletions(-) diff --git a/InscryptionAPI/Slots/SlotModificationExtensions.cs b/InscryptionAPI/Slots/SlotModificationExtensions.cs index 99a99a0cb..e681cad3e 100644 --- a/InscryptionAPI/Slots/SlotModificationExtensions.cs +++ b/InscryptionAPI/Slots/SlotModificationExtensions.cs @@ -11,11 +11,20 @@ namespace InscryptionAPI.Slots; -[HarmonyPatch] /// /// Contains extension methods to simplify slot modification management /// +[HarmonyPatch] public static class SlotModificationExtensions { + /// + /// Retrieves the of a slot modification using its ID. + /// + /// Collection of slot modification objects to search for. + /// The ID of the slot modification. + /// The corresponding with the given ID, or null if one couldn't be found. + /// + /// Intended for use with . + /// public static Info InfoByID(this IEnumerable modInfos, ModificationType mod) { return modInfos.FirstOrDefault(x => x.ModificationType == mod); @@ -24,10 +33,12 @@ public static Info InfoByID(this IEnumerable modInfos, ModificationType mo /// /// Sets the rulebook description for a slot modification. /// - /// The ModificationType to add a rulebook description for. - /// The rulebook description for the ModificationType. + /// The to add a rulebook description for. + /// The rulebook name for this slot modification. + /// The rulebook description for the . + /// The sprite for the rulebook page representing this slot modification. /// What Acts the rulebook entry should appear in. - /// The same ModificationType. + /// The same . public static ModificationType SetRulebook(this ModificationType mod, string rulebookName, string rulebookDescription, Texture2D rulebookSprite, params ModificationMetaCategory[] categories) { Info info = AllSlotModifications.InfoByID(mod); @@ -44,6 +55,12 @@ public static ModificationType SetRulebook(this ModificationType mod, string rul } return mod; } + /// + /// Sets the icon sprite to use in the Act 3 rulebook. + /// + /// The to access. + /// The texture to use. + /// The same so a chain can continue. public static ModificationType SetRulebookP03Sprite(this ModificationType mod, Texture2D spriteTexture) { Info info = AllSlotModifications.InfoByID(mod); @@ -53,6 +70,12 @@ public static ModificationType SetRulebookP03Sprite(this ModificationType mod, T } return mod; } + /// + /// Sets the icon sprite to use in the Grimora rulebook. + /// + /// The to access. + /// The texture to use. + /// The same so a chain can continue. public static ModificationType SetRulebookGrimoraSprite(this ModificationType mod, Texture2D spriteTexture) { Info info = AllSlotModifications.InfoByID(mod); @@ -62,6 +85,12 @@ public static ModificationType SetRulebookGrimoraSprite(this ModificationType mo } return mod; } + /// + /// Sets the icon sprite to use in the Magnificus rulebook. + /// + /// The to access. + /// The texture to use. + /// The same so a chain can continue. public static ModificationType SetRulebookMagnificusSprite(this ModificationType mod, Texture2D spriteTexture) { Info info = AllSlotModifications.InfoByID(mod); @@ -71,6 +100,16 @@ public static ModificationType SetRulebookMagnificusSprite(this ModificationType } return mod; } + /// + /// Sets the shared rulebook for this . This slot modification will use the rulebook name, description, and icon of the shared slot modification. + /// + /// The to access. + /// The whose rulebook page this slot modification will use. + /// The same so a chain can continue. + /// + /// Intended for use with slot modifications that are meant to be variations of the same core slot modification. + /// (eg., Burn 1, Burn 2, etc.) + /// public static ModificationType SetSharedRulebook(this ModificationType mod, ModificationType sharedRulebookType) { Info info = AllSlotModifications.InfoByID(mod); diff --git a/InscryptionAPI/Slots/SlotModificationGainAbilityBehaviour.cs b/InscryptionAPI/Slots/SlotModificationGainAbilityBehaviour.cs index 31bb3eabf..a8cd77616 100644 --- a/InscryptionAPI/Slots/SlotModificationGainAbilityBehaviour.cs +++ b/InscryptionAPI/Slots/SlotModificationGainAbilityBehaviour.cs @@ -9,6 +9,9 @@ namespace InscryptionAPI.Slots; /// public abstract class SlotModificationGainAbilityBehaviour : SlotModificationBehaviour { + /// + /// Ability cards placed in this slot will gain. + /// protected abstract Ability AbilityToGain { get; } private string TemporaryModId => $"SlotModification{AbilityToGain}{Slot.IsPlayerSlot}{Slot.Index}"; @@ -23,8 +26,16 @@ private CardModificationInfo GetSlotAbilityMod(PlayableCard card, bool create = return mod; } + /// + /// If this trigger should respond to other cards being assigned to card slots. + /// + /// Always returns true. public override bool RespondsToOtherCardAssignedToSlot(PlayableCard otherCard) => true; + /// + /// Logic for when a card is played on this slot. + /// + /// The card played on this slot. public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) { if (otherCard == null || otherCard.Slot == null) @@ -50,6 +61,9 @@ public override IEnumerator OnOtherCardAssignedToSlot(PlayableCard otherCard) yield return new WaitForSeconds(0.1f); } + /// + /// Removes the given ability from the occupying card when this slot modification is removed from the slot. + /// public override IEnumerator Cleanup(SlotModificationManager.ModificationType replacement) { if (Slot.Card != null) @@ -64,6 +78,9 @@ public override IEnumerator Cleanup(SlotModificationManager.ModificationType rep yield break; } + /// + /// Gives the ability to gain to the occupying card that this slot modification was just added to. + /// public override IEnumerator Setup() { if (Slot.Card != null) diff --git a/InscryptionAPI/Slots/SlotModificationInteractable.cs b/InscryptionAPI/Slots/SlotModificationInteractable.cs index 61a149d9d..83925dad5 100644 --- a/InscryptionAPI/Slots/SlotModificationInteractable.cs +++ b/InscryptionAPI/Slots/SlotModificationInteractable.cs @@ -8,9 +8,20 @@ namespace InscryptionAPI.Slots; public class SlotModificationInteractable : AlternateInputInteractable { private CardSlot slot; + /// + /// The mouse cursor icon that is used when hovering over this slot. + /// public override CursorType CursorType => CursorType.Inspect; + /// + /// The slot modification ID whose rulebook entry this interactable will point to. + /// public SlotModificationManager.ModificationType ModType { get; set; } + /// + /// Initialises this interactable's data. + /// + /// The slot modification ID whose rulebook entry this interactable will point to. + /// The this interactable is attached to. public void AssignSlotModification(SlotModificationManager.ModificationType modType, CardSlot cardSlot) { ModType = modType; @@ -18,6 +29,9 @@ public void AssignSlotModification(SlotModificationManager.ModificationType modT base.SetEnabled(true); } + /// + /// Opens the rulebook page for this interactable's . + /// public override void OnAlternateSelectStarted() { //InscryptionAPIPlugin.Logger.LogDebug($"Open to slot mod page: [{ModType}] on slot [{slot}]"); diff --git a/InscryptionAPI/Slots/SlotModificationManager.cs b/InscryptionAPI/Slots/SlotModificationManager.cs index e802e22fb..9a17bb756 100644 --- a/InscryptionAPI/Slots/SlotModificationManager.cs +++ b/InscryptionAPI/Slots/SlotModificationManager.cs @@ -22,6 +22,9 @@ public class SlotModificationManager : MonoBehaviour /// public enum ModificationType { + /// + /// Default state, represents a slot with no modification attached. + /// NoModification = 0 } @@ -69,6 +72,9 @@ public class Info /// The slot modification whose rulebook entry is also used by this slot modification. /// public ModificationType SharedRulebook { get; set; } = ModificationType.NoModification; + /// + /// The metacategories that determine what rulebooks this slot modiciation's rulebook entry should appear in, if any. + /// public List MetaCategories = new(); /// @@ -101,6 +107,19 @@ public class Info /// public Dictionary RulebookDescriptionRedirects = new(); + /// + /// Creates a new instance of . + /// + /// The name of the slot modification. + /// The GUID of the mod adding the slot modification. + /// + /// The sprites used for the slot modification in each region in Act 2. + /// The ID of the slot modification. + /// A subclass of that implements the logic for the slot modification. + /// The name of the slot modification in the rulebook. + /// The description of the slot modification in the rulebook. + /// The sprite of the slot modification in the rulebook. + /// The metacategories for what game acts this slot modification's rulebook entry should appear in. public Info(string name, string modGuid, Dictionary texture, Dictionary pixelSprites, @@ -119,6 +138,11 @@ public Info(string name, string modGuid, this.RulebookSprite = rulebookSprite; this.MetaCategories = categories; } + + /// + /// Creates a deep clone of this object. + /// + /// The newly created deep clone. public Info Clone() { return new( @@ -150,8 +174,17 @@ public Info Clone() new("NoModification", InscryptionAPIPlugin.ModGUID, null, null, ModificationType.NoModification, null, null, new()) };*/ + /// + /// The current processed list of all objects in the game, including vanilla and mod-added slot modifications. + /// public static List AllModificationInfos { get; private set; } = new(); + /// + /// The current processed list of all slot modifications in the game, including vanilla and mod-added slot modification. + /// public static List AllModificationTypes { get; private set; } = new(); + /// + /// A hook for modders to add custom code to modify the slot modification list dynamically. + /// public static event Func, List> ModifySlotModificationList; @@ -163,6 +196,9 @@ static SlotModificationManager() }; } + /// + /// Resynchronizes the slot modification list. + /// public static void SyncSlotModificationList() { AllModificationInfos = AllSlotModifications.Select(x => x.Clone()).ToList(); @@ -193,11 +229,11 @@ private static Color ParseHtml(string html) /// /// Creates a new card slot modification. /// - /// Unique ID for the mod creating the slot modification - /// Reference name for the slot modification - /// The class that controls the behavior for the new slot - /// The 3D scene slot texture (154x226) - /// The 2D scene slot texture + /// Unique ID for the mod creating the slot modification. + /// Reference name for the slot modification. + /// The class that controls the behavior for the new slot. + /// The 3D scene slot texture (154x226). + /// The 2D scene slot textures. /// Unique identifier for the modification type; used to set the slot modification in the future public static ModificationType New(string modGuid, string modificationName, Type behaviour, Dictionary slotTexture, Dictionary pixelBoardSlotSprites) { @@ -212,11 +248,11 @@ public static ModificationType New(string modGuid, string modificationName, Type /// /// Creates a new card slot modification. /// - /// Unique ID for the mod creating the slot modification - /// Reference name for the slot modification - /// The class that controls the behavior for the new slot - /// The 3D scene slot texture (154x226) - /// The 2D scene slot texture + /// Unique ID for the mod creating the slot modification. + /// Reference name for the slot modification. + /// The class that controls the behavior for the new slot. + /// The 3D scene slot texture (154x226). + /// The 2D scene slot textures. /// Unique identifier for the modification type; used to set the slot modification in the future public static ModificationType New(string modGuid, string modificationName, Type behaviour, Texture2D slotTexture, Dictionary pixelBoardSlotSprites) { @@ -357,11 +393,12 @@ private static PixelBoardSpriteSetter.BoardThemeSpriteSet GetSpriteSetFromTextur /// /// Converts a sheet of act 2 slot textures into a full collection of sprite sets. READ THE DOCUMENTATION. /// - /// + /// Spritesheet of pixel board slot textures. /// This expects a texture with 8 slot textures in it, arranged in either 2 or 4 rows of 5. Each slot texture is 44x58. /// The first/bottom-most row contains all of the the normal slot sprites and the second row contains all of the hover sprites. /// If you want the opponent sprites to be different, you have to provide 4 rows; the third row contains normal opponent slot sprites and the fourth row contains hovered opponent slot sprites. /// Each row must go in this order from left to right: Nature, Undead, Tech, Wizard, Finale. + /// public static Dictionary BuildAct2SpriteSetFromSpriteSheetTexture(Texture2D texture) { Dictionary retval = new(); @@ -377,9 +414,9 @@ private static PixelBoardSpriteSetter.BoardThemeSpriteSet GetSpriteSetFromTextur } /// - /// Converts a single act 2 slot texture into a full collection of sprite sets by repeatedly recoloring the texture + /// Converts a single act 2 slot texture into a full collection of sprite sets by repeatedly recoloring the texture. /// - /// + /// Spritesheet of pixel board slot textures. public static Dictionary BuildAct2SpriteSetFromTexture(Texture2D texture) { Dictionary retval = new(); @@ -455,13 +492,25 @@ public static void ResetDefaultSlotTexture(CardTemple temple) /// /// Used to determine what Acts a modification's rulebook entry should appear in. - /// Values correspond to specific AbilityMetaCategory values. + /// Values of each enum correspond to specific values, allowing one-way conversion. /// public enum ModificationMetaCategory { + /// + /// Should appear in Act 1's rulebook. + /// Part1Rulebook = 0, + /// + /// Should appear in Act 3's rulebook. + /// Part3Rulebook = 2, + /// + /// Should appear in Grimora's rulebook. + /// GrimoraRulebook = 5, + /// + /// Should appear in Magnificus's rulebook. + /// MagnificusRulebook = 6 } @@ -561,6 +610,9 @@ private static void AddSlotModificationsToRuleBook(AbilityMetaCategory metaCateg } } + /// + /// Prefix header of page ids for slot modiciations. + /// public const string SLOT_PAGEID = "SlotModification_"; private static Vector3 PART_3_SCALE = new(0.7f, 0.7f, 1f); From c808b7739dec1e0f42404476c739bad81b55e37b Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 20:39:29 -0800 Subject: [PATCH 58/74] Add XML to SoundManager --- InscryptionAPI/Sound/SoundManager.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/InscryptionAPI/Sound/SoundManager.cs b/InscryptionAPI/Sound/SoundManager.cs index 0da122b4b..fc9975bfb 100644 --- a/InscryptionAPI/Sound/SoundManager.cs +++ b/InscryptionAPI/Sound/SoundManager.cs @@ -10,6 +10,27 @@ namespace InscryptionAPI.Sound; /// public static class SoundManager { + /// + /// Maps file name extensions to their associated . + /// + /// + /// .mp3 + /// MPEG + /// + /// .wav + /// WAV + /// + /// .ogg + /// OGGVORBIS + /// + /// .aiff + /// AIFF + /// + /// .aif + /// AIFF + /// + /// + /// public static Dictionary AudioTypes = new Dictionary() { { ".mp3", AudioType.MPEG }, From 1e5921442f514a5be035ada1fd22eaa5e73e8f47 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 20:52:09 -0800 Subject: [PATCH 59/74] Update XML for rulebook redirects, add missing XML description --- InscryptionAPI/Boons/BoonManager.cs | 6 +----- InscryptionAPI/Card/AbilityManager.cs | 6 +----- InscryptionAPI/Card/SpecialStatIconManager.cs | 6 +----- InscryptionAPI/Items/ConsumableItemManager.cs | 6 +----- InscryptionAPI/Rulebook/RuleBookManager.cs | 13 +++++-------- InscryptionAPI/Slots/SlotModificationManager.cs | 6 +----- 6 files changed, 10 insertions(+), 33 deletions(-) diff --git a/InscryptionAPI/Boons/BoonManager.cs b/InscryptionAPI/Boons/BoonManager.cs index 9ff9e3511..25ae960fe 100644 --- a/InscryptionAPI/Boons/BoonManager.cs +++ b/InscryptionAPI/Boons/BoonManager.cs @@ -46,11 +46,7 @@ public class FullBoon public List metaCategories = new(); /// - /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - ///
Key (string): the text that will be recoloured to indicate that it's clickable. - ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. - ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. - ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + /// Tracks all rulebook redirects that this boon's description will have. ///
public Dictionary RulebookDescriptionRedirects = new(); } diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index 0b25767a3..d6f66b86e 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -70,11 +70,7 @@ public class FullAbility public string BaseRulebookDescription { get; internal set; } /// - /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - ///
Key (string): the text that will be recoloured to indicate that it's clickable. - ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. - ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. - ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + /// Tracks all rulebook redirects that this ability's description will have. ///
public Dictionary RulebookDescriptionRedirects = new(); diff --git a/InscryptionAPI/Card/SpecialStatIconManager.cs b/InscryptionAPI/Card/SpecialStatIconManager.cs index 3438356c1..5ea542b17 100644 --- a/InscryptionAPI/Card/SpecialStatIconManager.cs +++ b/InscryptionAPI/Card/SpecialStatIconManager.cs @@ -48,11 +48,7 @@ public class FullStatIcon public readonly Type VariableStatBehavior; /// - /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - ///
Key (string): the text that will be recoloured to indicate that it's clickable. - ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. - ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. - ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + /// Tracks all rulebook redirects that this stat icon's description will have. ///
public Dictionary RulebookDescriptionRedirects = new(); diff --git a/InscryptionAPI/Items/ConsumableItemManager.cs b/InscryptionAPI/Items/ConsumableItemManager.cs index 30cec6a3f..9a2948d04 100644 --- a/InscryptionAPI/Items/ConsumableItemManager.cs +++ b/InscryptionAPI/Items/ConsumableItemManager.cs @@ -26,11 +26,7 @@ public class FullConsumableItemData public ConsumableItemData itemData; /// - /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - ///
Key (string): the text that will be recoloured to indicate that it's clickable. - ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. - ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. - ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + /// Tracks all rulebook redirects that this item's description will have. ///
public Dictionary RulebookDescriptionRedirects = new(); diff --git a/InscryptionAPI/Rulebook/RuleBookManager.cs b/InscryptionAPI/Rulebook/RuleBookManager.cs index 4d94e9114..7f7a62c79 100644 --- a/InscryptionAPI/Rulebook/RuleBookManager.cs +++ b/InscryptionAPI/Rulebook/RuleBookManager.cs @@ -30,6 +30,7 @@ public class RedirectInfo public Color redirectTextColour; /// /// The ID of the page the hyperlink redirects to. + /// Eg., for ability redirects this will be the ability's id as a string. /// public string redirectPageId; @@ -57,19 +58,15 @@ public class RuleBookPageInfoExt public RuleBookPageInfo parentPageInfo; /// - /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - ///
Key (string): the text that will be recoloured to indicate that it's clickable. - ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use if you want to redirect to a custom rulebook page using its pageId. - ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. - ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + /// Tracks all rulebook redirects that this custom rulebook page's description will have. ///
public Dictionary RulebookDescriptionRedirects = new(); /// - /// Creates + /// Creates a new instance of . /// - /// - /// + /// The that this instance will use as a prent reference. + /// All redirects for this rulebook page, mapped to the text that will be hyperlinked. public RuleBookPageInfoExt(RuleBookPageInfo parentPageInfo, Dictionary redirects) { this.parentPageInfo = parentPageInfo; diff --git a/InscryptionAPI/Slots/SlotModificationManager.cs b/InscryptionAPI/Slots/SlotModificationManager.cs index 9a17bb756..17b09100c 100644 --- a/InscryptionAPI/Slots/SlotModificationManager.cs +++ b/InscryptionAPI/Slots/SlotModificationManager.cs @@ -99,11 +99,7 @@ public class Info public Type SlotBehaviour { get; internal set; } /// - /// Tracks all rulebook redirects that this ability's description will have. Explanation of the variables is as follows: - ///
Key (string): the text that will be recoloured to indicate that it's clickable. - ///
Tuple.Item1 (PageRangeType): the type of page the redirect will go to. Use PageRangeType.Unique if you want to redirect to a custom rulebook page using its pageId. - ///
Tuple.Item2 (Color): the colour the Key text will be recoloured to. - ///
Tuple.Item3 (string): the id that the API will match against to find the redirect page. Eg, for ability redirects this will be the Ability id as a string. + /// Tracks all rulebook redirects that this slot modification's description will have. ///
public Dictionary RulebookDescriptionRedirects = new(); From 14a4b55cd031464062218b6e044c3c07cf397171 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 21:03:51 -0800 Subject: [PATCH 60/74] Change to use table --- InscryptionAPI/Dialogue/DialogueManager.cs | 62 +++++++++++++++------- 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/InscryptionAPI/Dialogue/DialogueManager.cs b/InscryptionAPI/Dialogue/DialogueManager.cs index d4354998c..8647e290c 100644 --- a/InscryptionAPI/Dialogue/DialogueManager.cs +++ b/InscryptionAPI/Dialogue/DialogueManager.cs @@ -82,30 +82,54 @@ public static Dialogue Add(string pluginGUID, DialogueEvent dialogueEvent) return dialogue; } + /// + /// + /// Bblue + /// bBbright blue + /// bGbright gold + /// blGrbright lime green + /// bRbright red + /// brnObrown orange + /// bSGglow seafoam green (default Act 1 emission colour) + /// dBdark blue + /// dlGrdark lime green + /// dSGdark seafoam green + /// Ggold + /// g1bright lime green + /// g2gold + /// g3blue + /// gray40% grey + /// lGrlime green + /// Oorange + /// + /// + private static int iff; + /// /// Adds a new colour code that can be used in dialogue events to colour text. ///

/// Colour codes are in the following format:
/// [c:{code}]{dialogue}[c:] - ///

- /// Vanilla codes are: - ///
dB - dark blue - ///
g2 - gold - ///
G - gold - ///
bG - bright gold - ///
bB - bright blue - ///
g3 - blue - ///
B - blue - ///
brnO - brown orange - ///
O - orange - ///
bR - bright red - ///
dlGr - dark lime green - ///
lGr - lime green - ///
g1 - bright lime green - ///
blGr - bright lime green - ///
dSG - dark seafoam green - ///
bSG - glow seafom green - ///
gray - 40% gray
+ /// + /// Vanilla colour codes are: + /// Bblue + /// bBbright blue + /// bGbright gold + /// blGrbright lime green + /// bRbright red + /// brnObrown orange + /// bSGglow seafoam green (default Act 1 emission colour) + /// dBdark blue + /// dlGrdark lime green + /// dSGdark seafoam green + /// Ggold + /// g1bright lime green + /// g2gold + /// g3blue + /// gray40% grey + /// lGrlime green + /// Oorange + /// ///
/// The GUID of the mod adding this colour. /// The dialogue code for using this colour in text. From 7dc71d1868c71b8e9d73d7cb8ffda829b736ddd3 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Sun, 15 Nov 2026 22:37:04 -0800 Subject: [PATCH 61/74] Add XML to TalkingCards/ files and subfolders' files --- .../Create/DialogueEventStrings.cs | 27 ++++++- .../TalkingCards/Create/FaceData.cs | 78 +++++++++++++++++-- .../TalkingCards/Create/TalkingCardCreator.cs | 7 ++ .../TalkingCards/Create/VoiceManager.cs | 2 +- .../TalkingCards/CustomPaperTalkingCard.cs | 57 ++++++++++++-- .../TalkingCards/Helpers/AssetHelpers.cs | 50 ++++++++++++ .../TalkingCards/Helpers/CardHelpers.cs | 2 +- .../TalkingCards/Helpers/StringExtensions.cs | 4 + .../TalkingCards/TalkingCardManager.cs | 11 ++- 9 files changed, 219 insertions(+), 19 deletions(-) diff --git a/InscryptionAPI/TalkingCards/Create/DialogueEventStrings.cs b/InscryptionAPI/TalkingCards/Create/DialogueEventStrings.cs index 7e33d67e8..6e4f4013f 100644 --- a/InscryptionAPI/TalkingCards/Create/DialogueEventStrings.cs +++ b/InscryptionAPI/TalkingCards/Create/DialogueEventStrings.cs @@ -4,13 +4,31 @@ namespace InscryptionAPI.TalkingCards.Create; +/// +/// Utility class for creating dialogue events used for creating dialogue events using exclusively strings and arrays. +/// +/// Intended for use with JSONLoader. [Serializable] -public class DialogueEventStrings -{ +public class DialogueEventStrings { + /// + /// Name of this dialogue event. + /// public string eventName { get; set; } + /// + /// Main lines for the dialogue event. + /// public string[] mainLines { get; set; } + /// + /// Groups of lines that play when the dialogue event is replayed. + /// public string[][] repeatLines { get; set; } + /// + /// Creates a new instance of . + /// + /// Name of this dialogue event. + /// Main lines for the dialogue event. + /// Groups of lines that play when the dialogue event is replayed. public DialogueEventStrings(string eventName, string[] mainLines, string[][] repeatLines) { this.eventName = eventName; @@ -18,6 +36,11 @@ public DialogueEventStrings(string eventName, string[] mainLines, string[][] rep this.repeatLines = repeatLines; } + /// + /// Calls using this object's data. + /// + /// The name of the card this dialogue event is tied to. Used for the event's internal name. + /// The created . public DialogueEvent CreateEvent(string cardName) => DialogueManager.GenerateEvent( InscryptionAPIPlugin.ModGUID, $"{cardName}_{eventName}", diff --git a/InscryptionAPI/TalkingCards/Create/FaceData.cs b/InscryptionAPI/TalkingCards/Create/FaceData.cs index b328a15d0..254001ce0 100644 --- a/InscryptionAPI/TalkingCards/Create/FaceData.cs +++ b/InscryptionAPI/TalkingCards/Create/FaceData.cs @@ -20,6 +20,9 @@ public class FaceData /// Your talking card's emotions. /// public List Emotions { get; } + /// + /// The for the neutral emotion expression. + /// public EmotionData Neutral => Emotions.Find(x => x.Emotion == Emotion.Neutral); /// @@ -27,6 +30,12 @@ public class FaceData /// public FaceInfo? FaceInfo { get; set; } + /// + /// Creates a new instance of . + /// + /// The internal name of the talking card this data is for. + /// All emotions the talking card can express. + /// The description object for the talking card's animated face. public FaceData(string cardName, List emotions, FaceInfo? faceInfo) { CardName = cardName; @@ -47,7 +56,7 @@ public class FaceInfo * However, camelCase looks better in JSON files, so I'm gonna make this compromise. :'3 */ /// - /// How often your character should blink. + /// How often your character should blink, measured in seconds. /// public float? blinkRate { get; set; } @@ -66,6 +75,13 @@ public class FaceInfo /// public string? customVoice { get; set; } + /// + /// Creates a new instance of . + /// + /// How many seconds must pass between each blink. + /// The ID of the voice this talking card should use. Represents an audio file. + /// How much the talking card's voice should be pitched up or down. + /// The ID of the custom voice this talking card should use, if any. public FaceInfo(float? blinkRate = null, string? voiceId = null, float? voiceSoundPitch = null, string? customVoice = null) { this.blinkRate = blinkRate; @@ -125,6 +141,14 @@ public class EmotionData /// public FaceAnim Emission { get; } + /// + /// Creates a new instance of . + /// + /// The emotion this data is used for. + /// The face sprite this emotion will use. + /// The eye sprites this emotion will use. + /// The mouth sprites this emotion will use. + /// The emission sprites this emotion will use. public EmotionData(Emotion emotion, Sprite face, FaceAnim eyes, FaceAnim mouth, FaceAnim emission) { Emotion = emotion; @@ -136,6 +160,14 @@ public EmotionData(Emotion emotion, Sprite face, FaceAnim eyes, FaceAnim mouth, #region Constructors + /// + /// Creates a new instance of . + /// + /// The emotion this data is used for. + /// File path for the face sprite for this emotion. + /// of file paths for the open and closed eye sprites for this emotion. + /// of file paths for the open and closed mouth sprites for this emotion. + /// of file paths for the open and closed eye emission sprites for this emotion. public EmotionData(Emotion emotion, string? face, (string? open, string? closed)? eyes, (string? open, string? closed)? mouth, (string? open, string? closed)? emission) { Emotion = emotion; @@ -156,7 +188,15 @@ public EmotionData(Emotion emotion, string? face, (string? open, string? closed) : GeneratePortrait.EmptyPortraitTuple; } - + /// + /// Creates a new instance of . + /// + /// The emotion this data is used for. + /// File path for the face sprite for this emotion. + /// of file paths for the open and closed eye sprites for this emotion. + /// of file paths for the open and closed mouth sprites for this emotion. + /// of file paths for the open and closed eye emission sprites for this emotion. + /// Intended for use with JSONLoader, please use the other constructors if using C#. public EmotionData(string? emotion, string? face, (string? open, string? closed)? eyes, (string? open, string? closed)? mouth, (string? open, string? closed)? emission) { Emotion = AssetHelpers.ParseAsEnumValue(emotion?.SentenceCase()); @@ -193,6 +233,10 @@ public EmotionData(string? emotion, string? face, (string? open, string? closed) eyesClosedEmission = Emission.Closed }; + /// + /// Implicit operator to convert a of a and sprite into an instance of . + /// + /// of a and sprite. public static implicit operator EmotionData((Emotion emotion, Sprite sprite) x) => new( x.emotion, @@ -206,26 +250,48 @@ public static implicit operator EmotionData((Emotion emotion, Sprite sprite) x) /// /// A container for sprites for a part of a talking card's face. /// -public class FaceAnim -{ +public class FaceAnim { + /// + /// Sprite for when this the face is 'open' (ie., eyes and mouth). + /// public Sprite Open { get; } + /// + /// Sprite for when this the face is 'close' (ie., eyes and mouth). + /// public Sprite Closed { get; } + /// + /// Creates a new instance of . + /// + /// The sprite for the open sprite. If invalid, creates an empty portrait. + /// The sprite for the closed sprite. If invalid, creates an empty portrait. public FaceAnim(Sprite? open, Sprite? closed) { Open = open?.PivotBottom() ?? GeneratePortrait.EmptyPortrait; Closed = closed?.PivotBottom() ?? GeneratePortrait.EmptyPortrait; } + /// + /// Creates a new instance of . + /// + /// The file path for the sprite. If invalid, creates an empty portrait. + /// The file path for the sprite. If invalid, creates an empty portrait. public FaceAnim(string? open, string? closed) { Open = AssetHelpers.MakeSprite(open) ?? GeneratePortrait.EmptyPortrait; Closed = AssetHelpers.MakeSprite(closed) ?? GeneratePortrait.EmptyPortrait; } - public static implicit operator Sprite(FaceAnim x) - => x.Closed; + /// + /// Implicit operator to convert this to a sprite. Converts it to its sprite. + /// + /// The being converted. + public static implicit operator Sprite(FaceAnim x) => x.Closed; + /// + /// Implicit operator to convert a of two sprite representing the open and closed parts of this respectively. + /// + /// of two sprite representing the open and closed parts of this respectively. public static implicit operator FaceAnim((Sprite? open, Sprite? closed) x) => new FaceAnim(x.open, x.closed); } \ No newline at end of file diff --git a/InscryptionAPI/TalkingCards/Create/TalkingCardCreator.cs b/InscryptionAPI/TalkingCards/Create/TalkingCardCreator.cs index 2e5a89f83..9d8e40314 100644 --- a/InscryptionAPI/TalkingCards/Create/TalkingCardCreator.cs +++ b/InscryptionAPI/TalkingCards/Create/TalkingCardCreator.cs @@ -10,6 +10,9 @@ namespace InscryptionAPI.TalkingCards.Create; +/// +/// Class for creating talking cards' animated portraits and special abilities. +/// public static class TalkingCardCreator { internal static List AllDialogueAdded => DialogueDummy.AllDialogueAdded; @@ -115,6 +118,10 @@ private static void RecursiveSetLayer(GameObject obj, string layerName) #endregion #region Dialogue + /// + /// Adds the dialogue event ID to the cache of . + /// + /// public static void AddToDialogueCache(string? id) { if (id == null) return; diff --git a/InscryptionAPI/TalkingCards/Create/VoiceManager.cs b/InscryptionAPI/TalkingCards/Create/VoiceManager.cs index a800e0d3b..5269a317a 100644 --- a/InscryptionAPI/TalkingCards/Create/VoiceManager.cs +++ b/InscryptionAPI/TalkingCards/Create/VoiceManager.cs @@ -20,7 +20,7 @@ internal static class VoiceManager private static bool IsInvalidVoiceId(string? id) => id == null || ValidVoiceIds.Contains(id); - public static bool Add(string? soundPath, string? id) + internal static bool Add(string? soundPath, string? id) { if (string.IsNullOrWhiteSpace(soundPath)) return false; diff --git a/InscryptionAPI/TalkingCards/CustomPaperTalkingCard.cs b/InscryptionAPI/TalkingCards/CustomPaperTalkingCard.cs index 2e5aa6c20..af1b78f33 100644 --- a/InscryptionAPI/TalkingCards/CustomPaperTalkingCard.cs +++ b/InscryptionAPI/TalkingCards/CustomPaperTalkingCard.cs @@ -8,34 +8,79 @@ namespace InscryptionAPI.TalkingCards; /// /// An abstract class for the creation of talking cards through the API. -/// It inherits from PaperTalkingCard and implements ITalkingCard. +/// It inherits from and implements . /// -public abstract class CustomPaperTalkingCard : PaperTalkingCard, ITalkingCard -{ +public abstract class CustomPaperTalkingCard : PaperTalkingCard, ITalkingCard { + /// + /// ID of the speaker used to determine the voice used when this card talks. + /// public override DialogueEvent.Speaker SpeakerType => DialogueEvent.Speaker.Stoat; + /// + /// Internal name of the actual talking card. + /// public abstract string CardName { get; } + /// + /// List of emotions this card can express. + /// public abstract List Emotions { get; } + /// + /// Description object for the talking card's portrait. + /// public abstract FaceInfo FaceInfo { get; } + /// + /// ID of the special ability used to mark the talking card as a talking card. + /// public abstract SpecialTriggeredAbility DialogueAbility { get; } + /// + /// ID of the to play when the dialogue event for fails to play. + /// public override string OnDrawnFallbackDialogueId => OnDrawnDialogueId; + + /// + /// The base with a frame delay before being called to fix some problems. + /// public override IEnumerator OnShownForCardSelect(bool forPositiveEffect) { yield return new WaitForEndOfFrame(); yield return base.OnShownForCardSelect(forPositiveEffect); - yield break; } } -public abstract class CustomDiskTalkingCard : DiskTalkingCard, ITalkingCard -{ +/// +/// An abstract class for the creation of Act 3 talking cards through the API. +/// It inherits from and implements . +/// +public abstract class CustomDiskTalkingCard : DiskTalkingCard, ITalkingCard { + /// + /// ID of the speaker used to determine the voice used when this card talks. + /// public override DialogueEvent.Speaker SpeakerType => DialogueEvent.Speaker.Stoat; + /// + /// Internal name of the actual talking card. + /// public abstract string CardName { get; } + /// + /// List of emotions this card can express. + /// public abstract List Emotions { get; } + /// + /// Description object for the talking card's portrait. + /// public abstract FaceInfo FaceInfo { get; } + /// + /// ID of the special ability used to mark the talking card as a talking card. + /// public abstract SpecialTriggeredAbility DialogueAbility { get; } + /// + /// ID of the to play when the dialogue event for fails to play. + /// public override string OnDrawnFallbackDialogueId => OnDrawnDialogueId; + + /// + /// The base with a frame delay before being called to fix some problems. + /// public override IEnumerator OnShownForCardSelect(bool forPositiveEffect) { yield return new WaitForEndOfFrame(); diff --git a/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs b/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs index 85d90587a..fcbe526c8 100644 --- a/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs +++ b/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs @@ -5,6 +5,9 @@ #nullable enable namespace InscryptionAPI.TalkingCards.Helpers; +/// +/// Class of helper methods for the creation of custom talking cards. +/// public static class AssetHelpers { private static readonly Dictionary TextureCache = new() @@ -12,9 +15,20 @@ public static class AssetHelpers { "_", EmptyAndTransparent() } }; + /// + /// x-y coordinates of the centre-bottom pivot on the talking card portrait's sprite. + /// public static readonly Vector2 PIVOT_BOTTOM = new Vector2(0.5f, 0f); + /// + /// x-y coordinates of the centre pivot on the talking card portrait's sprite. + /// public static readonly Vector2 PIVOT_CENTER = new Vector2(0.5f, 0.5f); + /// + /// Locates the file name with the given file path. + /// + /// The file path. + /// The name of the file at the given path, or null if one could not be found. public static string? GetFile(string file) => Directory.GetFiles(Paths.PluginPath, file, SearchOption.AllDirectories).FirstOrDefault(); public static Texture2D? MakeTexture(string? path) @@ -34,6 +48,11 @@ public static class AssetHelpers return tex; } + /// + /// Creates a new using the given array of bytes representing resource data. + /// + /// Resource bytes. + /// The created texture. public static Texture2D MakeTexture(byte[] data) { Texture2D tex = new Texture2D(1, 1); @@ -42,17 +61,32 @@ public static Texture2D MakeTexture(byte[] data) return tex; } + /// + /// Makes a sprite from the texture file at the given path. + /// + /// The file path for the texture file. + /// The created sprite or null if the path is invalid. public static Sprite? MakeSprite(string? path) { Texture2D? tex = MakeTexture(path); return tex == null ? null : MakeSprite(tex); } + /// + /// Makes a sprite using the given array of bytes representing resource data. + /// + /// Resource bytes. + /// The created sprite. public static Sprite MakeSprite(byte[] data) { return MakeSprite(MakeTexture(data)); } + /// + /// Converts the given texture to a sprite using as the pivot. + /// + /// The texture to convert. + /// The created sprite. public static Sprite MakeSprite(Texture2D tex) { Rect texRect = new Rect(0, 0, tex.width, tex.height); @@ -60,6 +94,11 @@ public static Sprite MakeSprite(Texture2D tex) return Sprite.Create(tex, texRect, pivot); } + /// + /// Creates two sprites from the two given file paths then returns them as a . + /// + /// of file paths. + /// A tuple of sprites. If either path is null or invalid, that sprite will also be null. public static (Sprite?, Sprite?) MakeSpriteTuple((string? a, string? b)? tuple) { Sprite? a = MakeSprite(tuple?.a); @@ -67,6 +106,12 @@ public static (Sprite?, Sprite?) MakeSpriteTuple((string? a, string? b)? tuple) return (a, b); } + /// + /// Attempts to parse the given string as an enum value of type . + /// + /// The enum type. + /// The value of the enum type. + /// The parsed enum value, or null if it couldn't be parsed. public static T? ParseAsEnumValue(string? str) where T : Enum { if (str == null) return default(T); @@ -75,6 +120,11 @@ public static (Sprite?, Sprite?) MakeSpriteTuple((string? a, string? b)? tuple) return x != null ? (T?)x : default(T); } + /// + /// Creates a using a string representing its hexadecimal code. + /// + /// The hexadecimal code of the colour to create, represented as a string. + /// The Color with the given hex code. If the hex code is less than 5 character, returns white. public static Color32 HexToColor(string hex) { Queue chars = new Queue(hex.Trim()); diff --git a/InscryptionAPI/TalkingCards/Helpers/CardHelpers.cs b/InscryptionAPI/TalkingCards/Helpers/CardHelpers.cs index b7916fb56..9cd4bc8c8 100644 --- a/InscryptionAPI/TalkingCards/Helpers/CardHelpers.cs +++ b/InscryptionAPI/TalkingCards/Helpers/CardHelpers.cs @@ -6,7 +6,7 @@ namespace InscryptionAPI.TalkingCards.Helpers; internal class CardHelpers { - public static CardInfo? Get(string name) + internal static CardInfo? Get(string name) { CardManager.SyncCardList(); CardInfo? card; diff --git a/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs b/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs index 3c7b83f60..01ad690dd 100644 --- a/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs +++ b/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs @@ -1,5 +1,9 @@ #nullable enable namespace InscryptionAPI.TalkingCards.Helpers; + +/// +/// Utility class adding new extensions to the object. +/// public static class StringExtensions { public static string SentenceCase(this string key) diff --git a/InscryptionAPI/TalkingCards/TalkingCardManager.cs b/InscryptionAPI/TalkingCards/TalkingCardManager.cs index f7306e1a7..e769d4b4b 100644 --- a/InscryptionAPI/TalkingCards/TalkingCardManager.cs +++ b/InscryptionAPI/TalkingCards/TalkingCardManager.cs @@ -6,17 +6,22 @@ #nullable enable namespace InscryptionAPI.TalkingCards; -public static class TalkingCardManager -{ +/// +/// Manager clas for adding talking cards through the API. +/// +public static class TalkingCardManager { // Add a talking card created through this API. // I'm using an interface so that it can all be kept in the same class. c: + /// + /// Sprite representing an empty card portrait. + /// public static Sprite EmptyPortrait => GeneratePortrait.EmptyPortrait; /// /// Creates a talking card through this API. /// - /// A type that implements the ITalkingCard interface. + /// A type that implements the interface. public static void New() where T : ITalkingCard, new() { ITalkingCard x = new T(); From 3987c4ab144926842fac48654faff580c62c1197 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 11:59:28 -0800 Subject: [PATCH 62/74] Add XML to Totems/ files --- .../Totems/CustomIconTotemTopPiece.cs | 15 +- InscryptionAPI/Totems/TotemManager.cs | 407 +++++++++--------- 2 files changed, 221 insertions(+), 201 deletions(-) diff --git a/InscryptionAPI/Totems/CustomIconTotemTopPiece.cs b/InscryptionAPI/Totems/CustomIconTotemTopPiece.cs index 6667b66d8..aa37b9233 100644 --- a/InscryptionAPI/Totems/CustomIconTotemTopPiece.cs +++ b/InscryptionAPI/Totems/CustomIconTotemTopPiece.cs @@ -1,14 +1,23 @@ -using DiskCardGame; +using DiskCardGame; using InscryptionAPI.Card; using InscryptionAPI.Helpers.Extensions; using UnityEngine; namespace InscryptionAPI.Totems; -public class CustomIconTotemTopPiece : CompositeTotemPiece -{ +/// +/// Subclass of with extended functionalities for creating totem tops using simple texture icons. +/// +public class CustomIconTotemTopPiece : CompositeTotemPiece { + /// + /// The name for the game object that contains the icon renderer. + /// protected virtual string IconGameObjectName => "Icon"; + /// + /// Sets the icon and tribe data for this totem top piece. + /// + /// The data needed for this totem top to function. Must be convertable to a . public override void SetData(ItemData data) { base.SetData(data); diff --git a/InscryptionAPI/Totems/TotemManager.cs b/InscryptionAPI/Totems/TotemManager.cs index 9a2469c9d..0c3984577 100644 --- a/InscryptionAPI/Totems/TotemManager.cs +++ b/InscryptionAPI/Totems/TotemManager.cs @@ -9,208 +9,45 @@ namespace InscryptionAPI.Totems; -public static class TotemManager -{ - internal enum TotemTopState - { +/// +/// Manager class for adding custom totem pieces through the API. +/// +public static class TotemManager { + internal enum TotemTopState { Vanilla, CustomTribes, AllTribes } - #region Patches - [HarmonyPatch(typeof(BuildTotemSequencer), "GenerateTotemChoices", new Type[] { typeof(BuildTotemNodeData), typeof(int) })] - private class ItemsUtil_AllConsumables - { - public static IEnumerable Transpiler(IEnumerable instructions) - { - if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.Vanilla) - return instructions; - - // === We want to turn this - - // List list = new() - // { - // Tribe.Bird, - // Tribe.Canine, - // Tribe.Hooved, - // Tribe.Insect, - // Tribe.Reptile - // }; - - // === Into this - - // List list = new() - // { - // Tribe.Bird, - // Tribe.Canine, - // Tribe.Hooved, - // Tribe.Insect, - // Tribe.Reptile - // }; - // ItemsUtil_AllConsumables.AddCustomTribesToList(list); - - // === - - - List codes = new List(instructions); - for (int i = 0; i < codes.Count; i++) - { - if (codes[i].opcode == OpCodes.Newobj) - { - // Make a new list - for (int j = i + 1; i < codes.Count; j++) - { - if (codes[j].opcode == OpCodes.Stloc_0) - { - MethodInfo customMethod = AccessTools.Method(typeof(ItemsUtil_AllConsumables), nameof(AddCustomTribesToList), new Type[] { typeof(List) }); - - // Stored the list - codes.Insert(j + 1, new CodeInstruction(OpCodes.Ldloc_0)); - codes.Insert(j + 2, new CodeInstruction(OpCodes.Call, customMethod)); - return codes; - } - } - } - } - - return codes; - } - - - public static void AddCustomTribesToList(List list) - { - list.AddRange(TribeManager.NewTribes.Where(x => x.tribeChoice).Select(x => x.tribe)); - InscryptionAPIPlugin.Logger.LogDebug($"Total Tribes: {list.Count}"); - - List cardsWithTribes = CardManager.AllCardsCopy.FindAll(x => x.tribes.Count > 0); - list.RemoveAll(x => !cardsWithTribes.Exists(ci => ci.IsOfTribe(x))); - - InscryptionAPIPlugin.Logger.LogDebug($"Tribes with 1 Card: {list.Count}"); - } - } - - [HarmonyPatch(typeof(ResourceBank), "Awake", new Type[] { })] - private class ResourceBank_Awake - { - private static void Postfix(ResourceBank __instance) - { - // The resource bank has been cleared. refill it - if (ResourceBank.Get(CustomTotemTopResourcePath) == null) - Initialize(); - } - } - - [HarmonyPatch(typeof(Totem), "GetTopPiecePrefab", new Type[] { typeof(TotemTopData) })] - private class Totem_GetTopPiecePrefab - { - private static bool Prefix(TotemTopData data, ref GameObject __result) - { - if (TribeManager.IsCustomTribe(data.prerequisites.tribe)) - { - CustomTotemTop customTribeTotem = totemTops.Find((a) => a.Tribe == data.prerequisites.tribe); - - // use the custom Totem top if it exists; otherwise use the default - __result = customTribeTotem?.Prefab ?? defaultTotemTop.Prefab; - return false; - } - else if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.AllTribes) - { - __result = defaultTotemTop.Prefab; - return false; - } - - return true; - } - } - - [HarmonyPatch(typeof(Totem), "SetData", new Type[] { typeof(ItemData) })] - private class Totem_SetData - { - private static void Postfix(Totem __instance, ItemData data) - { - __instance.topPieceParent.GetComponentInChildren().SetData(__instance.TotemItemData.top); - } - } - - [HarmonyPatch(typeof(TotemTopData), "PrefabId", MethodType.Getter)] - private class TotemTopData_PrefabId - { - private static bool Prefix(TotemTopData __instance, ref string __result) - { - // Custom totem tops will always use the fallback UNLESS there is an override - if (TribeManager.IsCustomTribe(__instance.prerequisites.tribe)) - { - CustomTotemTop customTribeTotem = totemTops.Find((a) => a.Tribe == __instance.prerequisites.tribe); - if (customTribeTotem == null) - { - __result = CustomTotemTopID; - return false; - } - } - else if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.AllTribes) - { - // All non-custom tribes will use the fallback model - __result = CustomTotemTopID; - return false; - } - - return true; - } - } - /// - /// If someone added a mod with sigils then removed the mod. They have learned the ability but it no longer exists. - /// This breaks the new totem sequence because it's not checking if the ability info exists. - /// So check that the ability info exists + /// Utility class containing all data needed for custom totem tops to be used in-game. /// - [HarmonyPatch] - private class FixMissingAbilityInfo - { - public static IEnumerable TargetMethods() - { - var innerClass = Type.GetType("DiskCardGame.BuildTotemSequencer+<>c, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); - yield return AccessTools.Method(innerClass, "b__26_0"); - } - - public static bool Prefix(Ability x, ref bool __result) - { - if (!RunState.Run.totemBottoms.Contains(x)) - { - AbilityInfo abilityInfo = AbilitiesUtil.GetInfo(x); - __result = abilityInfo != null && !abilityInfo.metaCategories.Contains(AbilityMetaCategory.Part1Modular); - - } - else - { - __result = true; - } - - return false; - } + public class CustomTotemTop { + /// + /// Internal name of the totem top. + /// + public string Name; + /// + /// GUID of the mod adding the totem top. + /// + public string GUID; + /// + /// Subclass of implementing the logic for the totem top. + /// + public Type Type = typeof(CustomIconTotemTopPiece); + /// + /// The model prefab object for the totem top. + /// + public GameObject Prefab; + /// + /// ID of the tribe the totem top belongs to. + /// + public Tribe Tribe; } /// - /// If someone added a mod with sigils then removed the mod. They have learned the ability but it no longer exists. - /// This breaks the new totem sequence because it's not checking if the ability info exists. - /// So check that the ability info exists + /// Obsolete, use instead. /// - [HarmonyPatch] - private class FixMissingAbilityInfo2 - { - // think this could be simplified but I ain't touching it - public static IEnumerable TargetMethods() - { - var innerClass = Type.GetType("DiskCardGame.BuildTotemSequencer+<>c__DisplayClass26_0, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); - yield return AccessTools.Method(innerClass, "b__1"); - } - - private static bool Prefix(Ability x) - { - return AbilitiesUtil.GetInfo(x) != null; - } - } - #endregion [Obsolete("Deprecated. Use NewTopPiece instead.")] public static CustomTotemTop NewTopPiece(string name, string guid, Tribe tribe, GameObject prefab = null) @@ -230,6 +67,15 @@ public static CustomTotemTop NewTopPiece(string name, string guid, Tribe tribe, }); } + /// + /// Creates a new totem top and registers it for use in-game. + /// + /// Subclass of implementing the logic for the totem top. + /// Internal name of the totem top. + /// GUID of the mod adding the totem top. + /// ID of the tribe the totem top affects. + /// Model prefab object for the totem top. + /// An instance of describing the new totem top. public static CustomTotemTop NewTopPiece(string name, string guid, Tribe tribe, GameObject prefab) where T : CompositeTotemPiece { if (prefab == null) @@ -270,6 +116,9 @@ private static CustomTotemTop Add(CustomTotemTop totem) /// public static CustomTotemTop DefaultTotemTop => defaultTotemTop; + /// + /// Obsolete, use instead. + /// [Obsolete("Obsolete. Use SetDefaultTotemTop instead to ensure the totem top is set up correctly.")] public static void SetDefaultTotemTop(GameObject gameObject) { @@ -280,6 +129,11 @@ public static void SetDefaultTotemTop(GameObject gameObject) GameObject.DontDestroyOnLoad(gameObject); } + /// + /// Sets up the default totem top. + /// + /// Subclass of implementing the logic for the totem top. + /// Model prefab object for the totem top. public static void SetDefaultTotemTop(GameObject gameObject) where T : CompositeTotemPiece { if (defaultTotemTop == null) @@ -357,12 +211,169 @@ private static void SetupTotemTopPrefab(GameObject prefab, Type scriptType) UnityObject.DontDestroyOnLoad(prefab); } - public class CustomTotemTop - { - public string Name; - public string GUID; - public Type Type = typeof(CustomIconTotemTopPiece); - public GameObject Prefab; - public Tribe Tribe; + #region Patches + [HarmonyPatch(typeof(BuildTotemSequencer), "GenerateTotemChoices", new Type[] { typeof(BuildTotemNodeData), typeof(int) })] + private class ItemsUtil_AllConsumables { + public static IEnumerable Transpiler(IEnumerable instructions) { + if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.Vanilla) + return instructions; + + // === We want to turn this + + // List list = new() + // { + // Tribe.Bird, + // Tribe.Canine, + // Tribe.Hooved, + // Tribe.Insect, + // Tribe.Reptile + // }; + + // === Into this + + // List list = new() + // { + // Tribe.Bird, + // Tribe.Canine, + // Tribe.Hooved, + // Tribe.Insect, + // Tribe.Reptile + // }; + // ItemsUtil_AllConsumables.AddCustomTribesToList(list); + + // === + + + List codes = new List(instructions); + for (int i = 0; i < codes.Count; i++) { + if (codes[i].opcode == OpCodes.Newobj) { + // Make a new list + for (int j = i + 1; i < codes.Count; j++) { + if (codes[j].opcode == OpCodes.Stloc_0) { + MethodInfo customMethod = AccessTools.Method(typeof(ItemsUtil_AllConsumables), nameof(AddCustomTribesToList), new Type[] { typeof(List) }); + + // Stored the list + codes.Insert(j + 1, new CodeInstruction(OpCodes.Ldloc_0)); + codes.Insert(j + 2, new CodeInstruction(OpCodes.Call, customMethod)); + return codes; + } + } + } + } + + return codes; + } + + + public static void AddCustomTribesToList(List list) { + list.AddRange(TribeManager.NewTribes.Where(x => x.tribeChoice).Select(x => x.tribe)); + InscryptionAPIPlugin.Logger.LogDebug($"Total Tribes: {list.Count}"); + + List cardsWithTribes = CardManager.AllCardsCopy.FindAll(x => x.tribes.Count > 0); + list.RemoveAll(x => !cardsWithTribes.Exists(ci => ci.IsOfTribe(x))); + + InscryptionAPIPlugin.Logger.LogDebug($"Tribes with 1 Card: {list.Count}"); + } + } + + [HarmonyPatch(typeof(ResourceBank), "Awake", new Type[] { })] + private class ResourceBank_Awake { + private static void Postfix(ResourceBank __instance) { + // The resource bank has been cleared. refill it + if (ResourceBank.Get(CustomTotemTopResourcePath) == null) + Initialize(); + } + } + + [HarmonyPatch(typeof(Totem), "GetTopPiecePrefab", new Type[] { typeof(TotemTopData) })] + private class Totem_GetTopPiecePrefab { + private static bool Prefix(TotemTopData data, ref GameObject __result) { + if (TribeManager.IsCustomTribe(data.prerequisites.tribe)) { + CustomTotemTop customTribeTotem = totemTops.Find((a) => a.Tribe == data.prerequisites.tribe); + + // use the custom Totem top if it exists; otherwise use the default + __result = customTribeTotem?.Prefab ?? defaultTotemTop.Prefab; + return false; + } + else if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.AllTribes) { + __result = defaultTotemTop.Prefab; + return false; + } + + return true; + } } + + [HarmonyPatch(typeof(Totem), "SetData", new Type[] { typeof(ItemData) })] + private class Totem_SetData { + private static void Postfix(Totem __instance, ItemData data) { + __instance.topPieceParent.GetComponentInChildren().SetData(__instance.TotemItemData.top); + } + } + + [HarmonyPatch(typeof(TotemTopData), "PrefabId", MethodType.Getter)] + private class TotemTopData_PrefabId { + private static bool Prefix(TotemTopData __instance, ref string __result) { + // Custom totem tops will always use the fallback UNLESS there is an override + if (TribeManager.IsCustomTribe(__instance.prerequisites.tribe)) { + CustomTotemTop customTribeTotem = totemTops.Find((a) => a.Tribe == __instance.prerequisites.tribe); + if (customTribeTotem == null) { + __result = CustomTotemTopID; + return false; + } + } + else if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.AllTribes) { + // All non-custom tribes will use the fallback model + __result = CustomTotemTopID; + return false; + } + + return true; + } + } + + /// + /// If someone added a mod with sigils then removed the mod. They have learned the ability but it no longer exists. + /// This breaks the new totem sequence because it's not checking if the ability info exists. + /// So check that the ability info exists + /// + [HarmonyPatch] + private class FixMissingAbilityInfo { + public static IEnumerable TargetMethods() { + var innerClass = Type.GetType("DiskCardGame.BuildTotemSequencer+<>c, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); + yield return AccessTools.Method(innerClass, "b__26_0"); + } + + public static bool Prefix(Ability x, ref bool __result) { + if (!RunState.Run.totemBottoms.Contains(x)) { + AbilityInfo abilityInfo = AbilitiesUtil.GetInfo(x); + __result = abilityInfo != null && !abilityInfo.metaCategories.Contains(AbilityMetaCategory.Part1Modular); + + } + else { + __result = true; + } + + return false; + } + } + + /// + /// If someone added a mod with sigils then removed the mod. They have learned the ability but it no longer exists. + /// This breaks the new totem sequence because it's not checking if the ability info exists. + /// So check that the ability info exists + /// + [HarmonyPatch] + private class FixMissingAbilityInfo2 { + // think this could be simplified but I ain't touching it + public static IEnumerable TargetMethods() { + var innerClass = Type.GetType("DiskCardGame.BuildTotemSequencer+<>c__DisplayClass26_0, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"); + yield return AccessTools.Method(innerClass, "b__1"); + } + + private static bool Prefix(Ability x) { + return AbilitiesUtil.GetInfo(x) != null; + } + } + #endregion } From 17671078a1074f7e4619ab71bfd2040ab4ee9a2a Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:03:16 -0800 Subject: [PATCH 63/74] Fix XML, add missing XML --- .../Triggers/CustomTriggerFinder.cs | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/InscryptionAPI/Triggers/CustomTriggerFinder.cs b/InscryptionAPI/Triggers/CustomTriggerFinder.cs index 916b86bee..272bd8e41 100644 --- a/InscryptionAPI/Triggers/CustomTriggerFinder.cs +++ b/InscryptionAPI/Triggers/CustomTriggerFinder.cs @@ -17,7 +17,6 @@ public static class CustomTriggerFinder /// /// The receiver that is triggering. /// The trigger coroutine called by that receiver. - /// . public static IEnumerator CustomTriggerSequence(this TriggerReceiver receiver, IEnumerator triggerCoroutine) { GlobalTriggerHandler self = GlobalTriggerHandler.Instance; @@ -63,7 +62,7 @@ public static IEnumerator TriggerAll(bool triggerFacedown, Func resp } /// - /// Triggers the triggers of type T on a card trigger handler. + /// Triggers the triggers of type on a card trigger handler. /// /// The trigger type to search for. /// The card trigger handler to search for triggers. @@ -84,7 +83,7 @@ public static IEnumerator Trigger(this CardTriggerHandler handler, Func - /// Triggers the triggers of type T on a card. + /// Triggers the triggers of type on a card. /// /// The trigger type to search for. /// The card trigger handler to search for triggers. @@ -98,7 +97,7 @@ public static IEnumerator Trigger(this PlayableCard card, Func respo } /// - /// Triggers the triggers of type T on all cards on board. + /// Triggers the triggers of type on all cards on board. /// /// The trigger type to search for. /// True if this should also trigger cards that are facedown, false otherwise. @@ -119,7 +118,7 @@ public static IEnumerator TriggerOnBoard(bool triggerFacedown, Func } /// - /// Triggers the triggers of type T on all cards in hand. + /// Triggers the triggers of type on all cards in hand. /// /// The trigger type to search for. /// Check function that needs to return true for a trigger to get triggered. @@ -359,11 +358,12 @@ public static List Call(this CardTriggerHandler self, Func - /// Finds all trigger recievers, on the board and in the hand + /// Finds all trigger recievers, on the board and in the hand. /// + /// Whether to include triggers on face down cards. /// Card to exclude from the hand search. - /// The trigger type to search for - /// All trigger recievers of type T. + /// The trigger type to search for. + /// All trigger recievers of type . public static IEnumerable FindGlobalTriggers(bool findFacedown, PlayableCard excluding = null) { IEnumerable result = Enumerable.Empty(); @@ -381,10 +381,10 @@ public static IEnumerable FindGlobalTriggers(bool findFacedown, PlayableCa } /// - /// Finds all trigger recievers, on the board and in the hand + /// Finds all trigger recievers, on the board and in the hand. /// /// Card to exclude from the hand search. - /// The trigger type to search for + /// The trigger type to search for. /// All trigger recievers of type T. public static IEnumerable FindGlobalTriggers(PlayableCard excluding = null) { @@ -392,10 +392,10 @@ public static IEnumerable FindGlobalTriggers(PlayableCard excluding = null } /// - /// Find all trigger recievers in the hand + /// Find all trigger recievers in the hand. /// - /// The trigger type to search for - /// All trigger recievers of type T in the hand. + /// The trigger type to search for. + /// All trigger recievers of type in the hand. public static IEnumerable FindTriggersInHand() { List handCache = new(PlayerHand.Instance.CardsInHand); @@ -403,20 +403,20 @@ public static IEnumerable FindTriggersInHand() } /// - /// Find all trigger recievers in the hand + /// Find all trigger recievers in the hand. /// - /// The trigger type to search for - /// All trigger recievers of type T in the hand. + /// The trigger type to search for. + /// All trigger recievers of type in the hand. public static IEnumerable FindTriggersOnBoard() { return FindTriggersOnBoard(true); } /// - /// Find all trigger recievers in the hand + /// Find all trigger recievers in the hand. /// - /// The trigger type to search for - /// All trigger recievers of type T in the hand. + /// The trigger type to search for. + /// All trigger recievers of type in the hand. public static IEnumerable FindTriggersOnBoard(bool findFacedown) { List cardsOnBoardCache = new(BoardManager.Instance.CardsOnBoard); @@ -431,11 +431,11 @@ public static IEnumerable FindTriggersOnBoard(bool findFacedown) } /// - /// Find all trigger recievers in the hand + /// Find all trigger recievers in the hand. /// /// Card to exclude from the search. - /// The trigger type to search for - /// All trigger recievers of type T in the hand. + /// The trigger type to search for. + /// All trigger recievers of type in the hand. public static IEnumerable FindTriggersInHandExcluding(PlayableCard card) { List handCache = new(PlayerHand.Instance.CardsInHand); @@ -443,11 +443,11 @@ public static IEnumerable FindTriggersInHandExcluding(PlayableCard card) } /// - /// Finds all trigger recievers on a card + /// Finds all trigger recievers on a card. /// /// The card to search. - /// The type of reciever to search for - /// All trigger recievers of type T on the card. + /// The type of reciever to search for. + /// All trigger recievers of type on the card. public static IEnumerable FindTriggersOnCard(this PlayableCard card) { foreach (var recv in card.TriggerHandler.GetAllReceivers().OfType()) @@ -457,11 +457,11 @@ public static IEnumerable FindTriggersOnCard(this PlayableCard card) } /// - /// Finds all trigger recievers on a card + /// Finds all trigger recievers on a card. /// /// The card to search. - /// The type of reciever to search for - /// All trigger recievers of type T on the card. + /// The type of reciever to search for. + /// All trigger recievers of type on the card. public static IEnumerable FindTriggersOnCard(this CardTriggerHandler card) { foreach (var recv in card.GetAllReceivers().OfType()) @@ -471,10 +471,10 @@ public static IEnumerable FindTriggersOnCard(this CardTriggerHandler card) } /// - /// Finds all trigger recievers on a cards in the opponent's queue + /// Finds all trigger recievers on a cards in the opponent's queue. /// - /// The type of reciever to search for - /// All trigger recievers of type T in the opponent's queue. + /// The type of reciever to search for. + /// All trigger recievers of type in the opponent's queue. public static IEnumerable FindTriggersInQueue() => TurnManager.Instance?.Opponent?.Queue.Where(card => card.TryGetComponent(out T _)).Select(card => card.GetComponent()) ?? new T[] { }; } From ddf7eeb0ea794d4d6508da59b922597e135133ef Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:19:39 -0800 Subject: [PATCH 64/74] Add XML to Triggers/ files --- .../Triggers/DoCombatPhasePatches.cs | 16 +++- InscryptionAPI/Triggers/Interfaces.cs | 90 +++++++++++++++++-- .../Triggers/SlotAttackSlotPatches.cs | 25 +++++- InscryptionAPI/Triggers/TakeDamagePatches.cs | 7 +- 4 files changed, 127 insertions(+), 11 deletions(-) diff --git a/InscryptionAPI/Triggers/DoCombatPhasePatches.cs b/InscryptionAPI/Triggers/DoCombatPhasePatches.cs index 2f44d0518..408fe9a11 100644 --- a/InscryptionAPI/Triggers/DoCombatPhasePatches.cs +++ b/InscryptionAPI/Triggers/DoCombatPhasePatches.cs @@ -8,7 +8,9 @@ namespace InscryptionAPI.Triggers; -// Patches to DoCombatPhase that add negative damage support and modifying attack slots support +/// +/// Patches to that add negative damage support and modifying attack slots support. +/// [HarmonyPatch] public static class DoCombatPhasePatches { @@ -19,6 +21,13 @@ public static class DoCombatPhasePatches private const string name_CombatCurrent = "System.Object <>2__current"; // make this public for modders wanting to modify it + /// + /// Modifies how direct damage is calculated to allow for negative damage values to work correctly. + /// + /// instance. + /// If the player is attacking. + /// The for the opponent, if any. + /// If the player attacked with a Squirrel card. public static IEnumerator NegativeDamageSupport(CombatPhaseManager __instance, bool playerIsAttacker, SpecialBattleSequencer specialSequencer, bool attackedWithSquirrel) { // we want to implement logic for if damage is less than 0 (damage dealt to self) @@ -63,6 +72,11 @@ public static IEnumerator NegativeDamageSupport(CombatPhaseManager __instance, b } } + /// + /// Inserts call to custom trigger . + /// + /// If the player is attacking. + /// List of slots whose occupying cards will be attacking this turn. public static List ModifyAttackingSlots(bool playerIsAttacker) { List originalSlots = BoardManager.Instance.GetSlotsCopy(playerIsAttacker); diff --git a/InscryptionAPI/Triggers/Interfaces.cs b/InscryptionAPI/Triggers/Interfaces.cs index 1da3d5898..1d78647cc 100644 --- a/InscryptionAPI/Triggers/Interfaces.cs +++ b/InscryptionAPI/Triggers/Interfaces.cs @@ -751,8 +751,23 @@ public interface IModifyDirectDamage /// True if this should modify the amount of damage taken when directly attacked. public bool RespondsToModifyDirectDamage(CardSlot target, int damage, PlayableCard attacker, int originalDamage); + /// + /// Modifies the damage value of a direct attack. + /// + /// The being struck directly. + /// The current damage value. + /// The currently attacking. + /// The original damage value before any modifications were made. + /// The new direct damage value. Overrides the current one stored in . public int OnModifyDirectDamage(CardSlot target, int damage, PlayableCard attacker, int originalDamage); + /// + /// Gets the priority for this trigger. Triggers with a higher priority will trigger first. + /// + /// The card slot targeted for the attack. + /// The current amount of damage to be delt. + /// The attacking card. + /// The trigger priority for this ability. public int TriggerPriority(CardSlot target, int damage, PlayableCard attacker); } @@ -804,27 +819,92 @@ public interface IOnCardDealtDamageDirectly /// /// Trigger that is called after a shielded card was attacked and lost a shield. /// +/// +/// Called after . +/// public interface IShieldPreventedDamage { + /// + /// If this trigger should activate when a shield blocks damage. + /// + /// The whose shield blocked damage. + /// The damage that the would have ordinarily done. + /// The that attacked . + /// True if this trigger should be activated. public bool RespondsToShieldPreventedDamage(PlayableCard target, int damage, PlayableCard attacker); + + /// + /// The logic for when this trigger is called and activated. + /// + /// The whose shield blocked damage. + /// The damage that the would have ordinarily done. + /// The that attacked . public IEnumerator OnShieldPreventedDamage(PlayableCard target, int damage, PlayableCard attacker); + + /// + /// Gets the priority for this trigger. Triggers with a higher priority will trigger first. + /// + /// The whose shield blocked damage. + /// The damage that the would have ordinarily done. + /// The that attacked . + /// The trigger priority for this ability. public int ShieldPreventedDamagePriority(PlayableCard target, int damage, PlayableCard attacker); } /// /// Variant of IShieldPreventDamage that triggers for cards in the hand. /// -public interface IShieldPreventedDamageInHand -{ +public interface IShieldPreventedDamageInHand { + /// + /// If this trigger should activate when a shield blocks damage. + /// + /// The whose shield blocked damage. + /// The damage that the would have ordinarily done. + /// The that attacked . + /// True if this trigger should be activated. public bool RespondsToShieldPreventedDamageInHand(PlayableCard target, int damage, PlayableCard attacker); + + /// + /// The logic for when this trigger is called and activated. + /// + /// The whose shield blocked damage. + /// The damage that the would have ordinarily done. + /// The that attacked . public IEnumerator OnShieldPreventedDamageInHand(PlayableCard target, int damage, PlayableCard attacker); + + /// + /// Gets the priority for this trigger. Triggers with a higher priority will trigger first. + /// + /// The whose shield blocked damage. + /// The damage that the would have ordinarily done. + /// The that attacked . + /// The trigger priority for this ability. public int ShieldPreventedDamageInHandPriority(PlayableCard target, int damage, PlayableCard attacker); } /// -/// Expanded version of CardGettingAttacked trigger, executed after it, that includes the attacker as an argument +/// Expanded version of CardGettingAttacked trigger, executed after it, that includes the attacker as an argument. /// -public interface IPostCardGettingAttacked -{ +public interface IPostCardGettingAttacked { + /// + /// If this trigger should activate when a card gets attacked. + /// + /// The being targeted for attack. + /// The that's attacking . + /// True if this trigger should be activated. public bool RespondsToPostCardGettingAttacked(PlayableCard target, PlayableCard attacker); + + /// + /// The logic for when this trigger is called and activated. + /// + /// The being targeted for attack. + /// The that's attacking . + /// True if this trigger should be activated. public IEnumerator OnPostCardGettingAttacked(PlayableCard target, PlayableCard attacker); + + /// + /// Gets the priority for this trigger. Triggers with a higher priority will trigger first. + /// + /// The being targeted for attack. + /// The that's attacking . + /// The trigger priority for this ability. public int PostCardGettingAttackedPriority(PlayableCard target, PlayableCard attacker); } diff --git a/InscryptionAPI/Triggers/SlotAttackSlotPatches.cs b/InscryptionAPI/Triggers/SlotAttackSlotPatches.cs index d162fe6d3..d17f3be6e 100644 --- a/InscryptionAPI/Triggers/SlotAttackSlotPatches.cs +++ b/InscryptionAPI/Triggers/SlotAttackSlotPatches.cs @@ -8,8 +8,11 @@ namespace InscryptionAPI.Triggers; -// Inserts a null check for opposingSlot.Card after CardGettingAttacked is triggered -// Tweaks the direct damage logic to subtract from DamageDealtThisPhase if the opposing and attacking are on the same side +/// +/// Inserts a null check for opposingSlot.Card after is triggered. +///
+/// Tweaks the direct damage logic to subtract from if the opposing and attacking are on the same side. +///
[HarmonyPatch] public static class SlotAttackSlotPatches { @@ -25,6 +28,13 @@ public static class SlotAttackSlotPatches private static readonly MethodInfo method_GetCard = AccessTools.PropertyGetter(typeof(CardSlot), nameof(CardSlot.Card)); + /// + /// Improved logic for calculating that adds hooks for modifying it. + /// Also adds functionality negative damage values to work. + /// + /// The of the attacking card. + /// The of the opposing card being attack. + /// How much damage to increment by. public static int DamageToDealThisPhase(CardSlot attackingSlot, CardSlot opposingSlot) { int originalDamage = attackingSlot.Card.Attack; @@ -63,7 +73,11 @@ public static int DamageToDealThisPhase(CardSlot attackingSlot, CardSlot opposin return damage; } - // Trigger both the vanilla trigger and the new trigger + /// + /// Trigger both the vanilla trigger and the new trigger. + /// + /// The attacking card. + /// The of the opposing card being attack. public static IEnumerator TriggerOnDirectDamageTriggers(PlayableCard attacker, CardSlot opposingSlot) { int damage = CustomFields.Get(attacker, modifiedAttackCustomField); @@ -78,6 +92,11 @@ public static IEnumerator TriggerOnDirectDamageTriggers(PlayableCard attacker, C yield return CustomTriggerFinder.TriggerAll(false, x => x.RespondsToCardDealtDamageDirectly(attacker, opposingSlot, damage), x => x.OnCardDealtDamageDirectly(attacker, opposingSlot, damage)); } + /// + /// Trigger both the vanilla trigger and the new trigger. + /// + /// The attacking card. + /// The opposing card being attacked. public static IEnumerator TriggerCardGettingAttackedTriggers(PlayableCard attacker, PlayableCard opposingCard) { yield return Singleton.Instance.TriggerCardsOnBoard(Trigger.CardGettingAttacked, false, opposingCard); diff --git a/InscryptionAPI/Triggers/TakeDamagePatches.cs b/InscryptionAPI/Triggers/TakeDamagePatches.cs index 21a1e7b3b..d9602cb60 100644 --- a/InscryptionAPI/Triggers/TakeDamagePatches.cs +++ b/InscryptionAPI/Triggers/TakeDamagePatches.cs @@ -7,10 +7,13 @@ namespace InscryptionAPI.Triggers; -// Patches to TakeDamage that add some more triggers and multi-shield support +/// +/// Patches to TakeDamage that add some more triggers and multi-shield support. +/// [HarmonyPatch] -public static class TakeDamagePatches +internal static class TakeDamagePatches { + // potential trigger for handling the hammer item. /*[HarmonyPostfix, HarmonyPatch(typeof(HammerItem), nameof(HammerItem.OnValidTargetSelected))] public static IEnumerator AddTakeDamageHammerTrigger(IEnumerator enumerator, HammerItem __instance, CardSlot targetSlot, GameObject firstPersonItem) { From 0366957f65cc3aa517ecbef5296864e75773b61b Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:46:13 -0800 Subject: [PATCH 65/74] Change XML to use paramrefs and crefs where c tags are used instead --- .../Ascension/AscensionChallengePaginator.cs | 2 +- InscryptionAPI/Card/AbilityExtensions.cs | 29 ++++---- InscryptionAPI/Card/AbilityManager.cs | 2 +- InscryptionAPI/Card/CardExtensions.cs | 72 +++++++++---------- InscryptionAPI/Card/CardExtensionsCosts.cs | 2 +- InscryptionAPI/Card/CardExtensionsHelpers.cs | 24 +++---- InscryptionAPI/Card/CardExtensionsSetters.cs | 6 +- .../Card/CardModificationInfoExtensions.cs | 4 +- .../Card/CardModificationInfoManager.cs | 4 +- InscryptionAPI/Card/CostProperties.cs | 6 +- InscryptionAPI/Card/DamageShieldBehaviour.cs | 2 +- InscryptionAPI/Card/DeathCardManager.cs | 2 +- InscryptionAPI/Card/ShieldManager.cs | 2 +- InscryptionAPI/Card/TribeManager.cs | 2 +- InscryptionAPI/Costs/CardCostManager.cs | 20 +++--- InscryptionAPI/Dialogue/CustomLine.cs | 2 +- InscryptionAPI/Encounters/CustomNodeData.cs | 2 +- .../Encounters/EncounterExtensions.cs | 4 +- InscryptionAPI/Encounters/EncounterManager.cs | 8 +-- InscryptionAPI/Encounters/TurnBuilder.cs | 6 +- .../Helpers/Extensions/CardSlotExtensions.cs | 2 +- .../Items/ConsumableItemDataExtensions.cs | 2 +- .../Nodes/CustomCardChoiceNodeSequencer.cs | 2 +- InscryptionAPI/Nodes/NewNodeManager.cs | 12 ++-- InscryptionAPI/Nodes/SelectionConditions.cs | 16 ++--- InscryptionAPI/Pelts/PeltManager.cs | 6 +- InscryptionAPI/Regions/RegionExtensions.cs | 10 +-- .../ResourceBank/ResourceBankManager.cs | 2 +- .../Rulebook/PageTextInteractable.cs | 2 +- InscryptionAPI/Rulebook/RuleBookManager.cs | 2 +- .../Rulebook/RuleBookManagerPatches.cs | 2 +- .../Slots/SlotModificationManager.cs | 8 +-- InscryptionAPI/Sound/SoundManager.cs | 8 +-- 33 files changed, 140 insertions(+), 135 deletions(-) diff --git a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs index 1866bdba1..209cbf0df 100644 --- a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs +++ b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs @@ -311,7 +311,7 @@ public void OnEnable() } /// - /// Creates the leftArrow and rightArrow UI elements for the challenge screen. + /// Creates the and UI elements for the challenge screen. /// Positioning is determined by the positions of the challenge icons. /// By default, the API tries to place the arrows on the left and right sides of the screen. /// If there isn't enough space due to screen resolution (or if the user has toggled the config option), the arrows are placed at the top of the screen instead. diff --git a/InscryptionAPI/Card/AbilityExtensions.cs b/InscryptionAPI/Card/AbilityExtensions.cs index 9de75cb47..761715d8f 100644 --- a/InscryptionAPI/Card/AbilityExtensions.cs +++ b/InscryptionAPI/Card/AbilityExtensions.cs @@ -147,7 +147,7 @@ public static AbilityInfo AddMetaCategories(this AbilityInfo info, params Abilit } /// - /// Helper method: automatically adds the Part1Modular and Part1Rulebook metacategories to the ability. + /// Helper method: automatically adds the and metacategories to the ability. /// /// The instance of . /// The same so a chain can continue. @@ -157,14 +157,14 @@ public static AbilityInfo SetDefaultPart1Ability(this AbilityInfo info) } /// - /// Helper method: automatically adds the custom metacategory Part2Modular to the ability. + /// Helper method: automatically adds the custom metacategory to the ability. /// /// The instance of . /// The same so a chain can continue. public static AbilityInfo SetDefaultPart2Ability(this AbilityInfo info) => info.AddMetaCategories(Part2Modular); /// - /// Helper method: automatically adds the Part3Modular, Part3BuildACard, and Part3Rulebook metacategories to the ability. + /// Helper method: automatically adds the , , and metacategories to the ability. /// /// The instance of . /// The same so a chain can continue. @@ -196,7 +196,7 @@ public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo /// Sets the text displayed when this ability is marked as learned. /// /// The instance of . - /// The text to display, represented by DialogueEvent.Line's. + /// The text to display, represented by objects. /// The same so a chain can continue. public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo, params DialogueEvent.Line[] lines) { @@ -207,10 +207,10 @@ public static AbilityInfo SetAbilityLearnedDialogue(this AbilityInfo abilityInfo } /// - /// Sets the text displayed whenever OnAbilityTriggered is called by this ability in Act 2. + /// Sets the text displayed whenever is called by this ability in Act 2. /// /// The instance of . - /// The text to display when OnAbilityTriggered is called. + /// The text to display when is called. /// The same so a chain can continue. public static AbilityInfo SetGBCTriggerText(this AbilityInfo abilityInfo, string triggerText) { @@ -218,10 +218,10 @@ public static AbilityInfo SetGBCTriggerText(this AbilityInfo abilityInfo, string return abilityInfo; } /// - /// Sets the text displayed whenever OnAbilityTriggered is called by this ability in Act 2. + /// Sets the text displayed whenever is called by this ability in Act 2. /// /// The instance of . - /// The text to display when OnAbilityTriggered is called. + /// The text to display when is called. /// The same so a chain can continue. public static FullAbility SetGBCTriggerText(this FullAbility fullAbility, string triggerText) { fullAbility.Info.triggerText = triggerText; @@ -625,12 +625,15 @@ public static StatIconInfo SetRulebookInfo(this StatIconInfo info, string rulebo return info; } /// - /// Sets the stat icon's appliesToAttack and appliesToHealth fields. Note these fields don't make the stat icon affect the stat; you still need to implement that logic. + /// Sets the stat icon's and fields. /// /// The instance of /// If the stat icon should cover a card's Power. /// If the stat icon should cover a card's Health. /// The same so a chain can continue. + /// + /// Note these fields don't make the stat icon affect the stat; you still need to implement that logic. + /// public static StatIconInfo SetAppliesToStats(this StatIconInfo info, bool appliesToAttack, bool appliesToHealth) { info.appliesToAttack = appliesToAttack; info.appliesToHealth = appliesToHealth; @@ -676,7 +679,7 @@ public static StatIconInfo AddMetaCategories(this StatIconInfo info, params Abil } /// - /// Helper method: automatically adds the Part1Rulebook metacategory to the stat icon. + /// Helper method: automatically adds the metacategory to the stat icon. /// /// The instance of . /// The same stati icon so a chain can continue. @@ -685,7 +688,7 @@ public static StatIconInfo SetDefaultPart1Ability(this StatIconInfo info) { } /// - /// Helper method: automatically adds the Part3Rulebook metacategory to the stat icon. + /// Helper method: automatically adds the metacategory to the stat icon. /// /// The instance of . /// The same so a chain can continue. @@ -747,7 +750,7 @@ public static AbilityInfo SetHideSingleStacks(this AbilityInfo abilityInfo, bool /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. /// /// Ability to access. - /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. + /// Whether single stacks of this ability will be hidden when added to . public static bool GetHideSingleStacks(this Ability ability) { return AllAbilityInfos.AbilityByID(ability).GetHideSingleStacks(); @@ -756,7 +759,7 @@ public static bool GetHideSingleStacks(this Ability ability) /// Gets the value of HideSingleStacks. Returns false if HideSingleStacks has not been set. /// /// The instance of . - /// Whether single stacks of this ability will be hidden when added to hiddenAbilities. + /// Whether single stacks of this ability will be hidden when added to . public static bool GetHideSingleStacks(this AbilityInfo abilityInfo) { return abilityInfo.GetExtendedPropertyAsBool("HideSingleStacks") ?? false; diff --git a/InscryptionAPI/Card/AbilityManager.cs b/InscryptionAPI/Card/AbilityManager.cs index d6f66b86e..84e16debb 100644 --- a/InscryptionAPI/Card/AbilityManager.cs +++ b/InscryptionAPI/Card/AbilityManager.cs @@ -201,7 +201,7 @@ public FullAbility Clone() public static event Func, List> ModifyAbilityList; /// - /// Custom AbilityMetaCategory enum for marking an ability as modular in Part 2. + /// Custom enum for marking an ability as modular in Part 2. /// public static AbilityMetaCategory Part2Modular => GuidManager.GetEnumValue(InscryptionAPIPlugin.ModGUID, "Part2Modular"); // [ModifyAbilityList](xref:InscryptionAPI.AbilityManager.ModifyAbilityList) diff --git a/InscryptionAPI/Card/CardExtensions.cs b/InscryptionAPI/Card/CardExtensions.cs index 2232cc4eb..b397d1d2e 100644 --- a/InscryptionAPI/Card/CardExtensions.cs +++ b/InscryptionAPI/Card/CardExtensions.cs @@ -27,9 +27,9 @@ private static Sprite GetPortrait(Texture2D portrait, TextureHelper.SpriteType s /// /// Adds any number of abilities to the card. Abilities can be added multiple times. /// - /// CardInfo to access. + /// to access. /// The abilities to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddAbilities(this CardInfo info, params Ability[] abilities) { info.abilities ??= new(); @@ -40,9 +40,9 @@ public static CardInfo AddAbilities(this CardInfo info, params Ability[] abiliti /// /// Adds any number of appearance behaviors to the card. Duplicate appearance behaviors are ignored. /// - /// CardInfo to access. + /// to access. /// The appearances to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddAppearances(this CardInfo info, params CardAppearanceBehaviour.Appearance[] appearances) { info.appearanceBehaviour ??= new(); @@ -55,9 +55,9 @@ public static CardInfo AddAppearances(this CardInfo info, params CardAppearanceB /// /// Adds any number of decals to the card. Duplicate decals are ignored. /// - /// CardInfo to access. + /// to access. /// The decals to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddDecal(this CardInfo info, params Texture[] decals) { info.decals ??= new(); @@ -71,9 +71,9 @@ public static CardInfo AddDecal(this CardInfo info, params Texture[] decals) /// /// Adds any number of decals to the card. Duplicate decals are ignored. /// - /// CardInfo to access. + /// to access. /// The paths to the .png files containing the decals (relative to the Plugins directory). - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddDecal(this CardInfo info, params string[] decals) { return decals == null @@ -85,9 +85,9 @@ public static CardInfo AddDecal(this CardInfo info, params string[] decals) /// /// Adds any number of metacategories to the card. Duplicate metacategories are ignored. /// - /// CardInfo to access. + /// to access. /// The categories to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddMetaCategories(this CardInfo info, params CardMetaCategory[] categories) { info.metaCategories ??= new(); @@ -100,9 +100,9 @@ public static CardInfo AddMetaCategories(this CardInfo info, params CardMetaCate /// /// Adds any number of special abilities to the card. Duplicate special abilities are ignored. /// - /// CardInfo to access. + /// to access. /// The abilities to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddSpecialAbilities(this CardInfo info, params SpecialTriggeredAbility[] abilities) { info.specialAbilities ??= new(); @@ -115,9 +115,9 @@ public static CardInfo AddSpecialAbilities(this CardInfo info, params SpecialTri /// /// Adds any number of traits to the card. Duplicate traits are ignored. /// - /// CardInfo to access. + /// to access. /// The traits to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddTraits(this CardInfo info, params Trait[] traits) { info.traits ??= new(); @@ -130,9 +130,9 @@ public static CardInfo AddTraits(this CardInfo info, params Trait[] traits) /// /// Adds any number of tribes to the card. Duplicate tribes are ignored. /// - /// CardInfo to access. + /// to access. /// The tribes to add. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo AddTribes(this CardInfo info, params Tribe[] tribes) { info.tribes ??= new(); @@ -184,9 +184,9 @@ public static CardInfo RemoveAbilitiesSingle(this CardInfo info, params Ability[ /// /// Removes any number of special abilities from the card. /// - /// CardInfo to access. + /// to access. /// The special abilities to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveSpecialAbilities(this CardInfo info, params SpecialTriggeredAbility[] abilities) { if (info.specialAbilities?.Count > 0) @@ -202,9 +202,9 @@ public static CardInfo RemoveSpecialAbilities(this CardInfo info, params Special /// /// Removes any number of special abilities from the card. Will remove one instance of each passed ability; multiple instances can be passed. /// - /// CardInfo to access. + /// to access. /// The special abilities to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveSpecialAbilitiesSingle(this CardInfo info, params SpecialTriggeredAbility[] abilities) { if (info.specialAbilities?.Count > 0) @@ -220,9 +220,9 @@ public static CardInfo RemoveSpecialAbilitiesSingle(this CardInfo info, params S /// /// Removes any number of appearance behaviors from the card. /// - /// CardInfo to access. + /// to access. /// The appearances to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveAppearances(this CardInfo info, params CardAppearanceBehaviour.Appearance[] appearances) { if (info.appearanceBehaviour?.Count > 0) @@ -238,9 +238,9 @@ public static CardInfo RemoveAppearances(this CardInfo info, params CardAppearan /// /// Removes any number of appearance behaviors from the card. Will remove one instance of each passed appearance; multiple instances can be passed. /// - /// CardInfo to access. + /// to access. /// The appearances to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveAppearancesSingle(this CardInfo info, params CardAppearanceBehaviour.Appearance[] appearances) { if (info.appearanceBehaviour?.Count > 0) @@ -256,9 +256,9 @@ public static CardInfo RemoveAppearancesSingle(this CardInfo info, params CardAp /// /// Removes any number of decals from the card. /// - /// CardInfo to access. + /// to access. /// The decals to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveDecals(this CardInfo info, params Texture[] decals) { if (info.decals?.Count > 0) @@ -274,9 +274,9 @@ public static CardInfo RemoveDecals(this CardInfo info, params Texture[] decals) /// /// Removes any number of decals behaviors from the card. Will remove one instance of each passed decals; multiple instances can be passed. /// - /// CardInfo to access. + /// to access. /// The decals to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveDecalsSingle(this CardInfo info, params Texture[] decals) { if (info.decals?.Count > 0) @@ -292,9 +292,9 @@ public static CardInfo RemoveDecalsSingle(this CardInfo info, params Texture[] d /// /// Removes any number of metacategories from the card. /// - /// CardInfo to access. + /// to access. /// The categories to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveMetaCategories(this CardInfo info, params CardMetaCategory[] categories) { if (info.metaCategories?.Count > 0) @@ -310,9 +310,9 @@ public static CardInfo RemoveMetaCategories(this CardInfo info, params CardMetaC /// /// Removes any number of metacategories behaviors from the card. Will remove one instance of each passed appearance; multiple instances can be passed. /// - /// CardInfo to access. + /// to access. /// The categories to remove. - /// The same CardInfo so a chain can continue. + /// The same so a chain can continue. public static CardInfo RemoveMetaCategoriesSingle(this CardInfo info, params CardMetaCategory[] categories) { if (info.metaCategories?.Count > 0) @@ -392,7 +392,7 @@ public static CardInfo RemoveCardMetaCategories(this CardInfo info, params CardM /// /// Gets the GUID of the mod that created this card. /// - /// CardInfo to access. + /// to access. /// The GUID of the mod that created this card or null if it wasn't found/is from the base game. public static string GetModTag(this CardInfo info) => info.GetExtendedProperty("CallStackModGUID"); @@ -402,16 +402,16 @@ public static CardInfo RemoveCardMetaCategories(this CardInfo info, params CardM /// /// Gets the card name prefix for this card. /// - /// CardInfo to access. + /// to access. /// The mod prefix for this card, or null if it wasn't found/is from the base game. public static string GetModPrefix(this CardInfo info) => info.GetExtendedProperty("ModPrefix"); /// /// Checks whether the card's mod prefix is equal to the given string. /// - /// CardInfo to access. + /// to access. /// The prefix to check for. - /// True if the CardInfo's mod prefix equals prefixToMatch. + /// True if the 's mod prefix equals prefixToMatch. public static bool ModPrefixIs(this CardInfo info, string prefixToMatch) => info.GetExtendedProperty("ModPrefix") == prefixToMatch; #endregion diff --git a/InscryptionAPI/Card/CardExtensionsCosts.cs b/InscryptionAPI/Card/CardExtensionsCosts.cs index 91d4eae77..b5fcc28b2 100644 --- a/InscryptionAPI/Card/CardExtensionsCosts.cs +++ b/InscryptionAPI/Card/CardExtensionsCosts.cs @@ -107,7 +107,7 @@ public static List GemsCost(this PlayableCard card) } /// - /// Checks if the given is gemified in either its or TemporaryMods. + /// Checks if the given is gemified in either its or . /// /// True if this card is gemified. public static bool IsGemified(this PlayableCard card) => card.Info.Gemified || card.TemporaryMods.Exists((CardModificationInfo x) => x.gemify); diff --git a/InscryptionAPI/Card/CardExtensionsHelpers.cs b/InscryptionAPI/Card/CardExtensionsHelpers.cs index 00f37ef76..9adf882d7 100644 --- a/InscryptionAPI/Card/CardExtensionsHelpers.cs +++ b/InscryptionAPI/Card/CardExtensionsHelpers.cs @@ -342,7 +342,7 @@ public static bool OtherCardIsOnSameSide(this PlayableCard playableCard, Playabl /// /// Retrieve a list of all abilities that exist on the . /// - /// This will retrieve all Abilities from both TemporaryMods and from the underlying object. + /// This will retrieve all Abilities from both and from the underlying object. /// /// The to access. /// A list of Abilities from the and underlying object. @@ -351,10 +351,10 @@ public static List AllAbilities(this PlayableCard playableCard) return playableCard.GetAbilitiesFromAllMods().Concat(playableCard.Info.Abilities).ToList(); } /// - /// A variant of that can account for negated abilities in the 's TemporaryMods. + /// A variant of that can account for negated abilities in this card's . /// /// The to access. - /// Whether or not to check TemporaryMods for negated abilities. + /// Whether or not to check for negated abilities. /// A list of Abilities from the and underlying object public static List AllAbilities(this PlayableCard playableCard, bool accountForNegation) { @@ -375,7 +375,7 @@ public static List AllAbilities(this PlayableCard playableCard, bool ac /// /// Retrieve a list of all CardModificationInfos that exist on the . /// - /// This will retrieve all mods from TemporaryMods and the underlying CardInfo.Mods. + /// This will retrieve all mods from and the underlying . /// /// The to access. /// A list of s from the and underlying object. @@ -387,7 +387,7 @@ public static List AllCardModificationInfos(this PlayableC /// /// Removes the provided CardModificationInfo from the . /// - /// Searches both its TemporaryMods list and its CardInfo.Mods list. + /// Searches both its list and its CardInfo.Mods list. /// /// The to access. /// The object to remove. @@ -420,7 +420,7 @@ public static bool RemoveCardModificationInfo(this PlayableCard playableCard, Ca /// /// Retrieve a list of all special triggered abilities that exist on the . /// - /// This will retrieve all SpecialTriggeredAbility from both TemporaryMods and from the underlying object. + /// This will retrieve all SpecialTriggeredAbility from both and from the underlying object. /// /// The to access. /// A list of SpecialTriggeredAbility from the and underlying object. @@ -430,7 +430,7 @@ public static List AllSpecialAbilities(this PlayableCar } /// - /// Retrieve a list of Ability that exist in TemporaryMods and the underlying CardInfo.Mods lists. + /// Retrieve a list of Ability that exist in and the underlying CardInfo.Mods lists. /// /// The to access. /// A list of Ability from the and underlying object. @@ -460,7 +460,7 @@ public static List GetAbilitiesFromAllMods(this PlayableCard playableCa /// /// to access. /// The Traits to check for. - /// Returns true if playableCard has all of the specified Traits. + /// Returns true if has all of the specified Traits. public static bool HasAllTraits(this PlayableCard playableCard, params Trait[] traits) => playableCard.Info.HasAllTraits(traits); /// @@ -468,7 +468,7 @@ public static List GetAbilitiesFromAllMods(this PlayableCard playableCa /// /// to access. /// The Traits to check for. - /// Returns true if playableCard has none of the specified Traits. + /// Returns true if has none of the specified Traits. public static bool LacksAllTraits(this PlayableCard playableCard, params Trait[] traits) => playableCard.Info.LacksAllTraits(traits); /// @@ -841,11 +841,11 @@ public static int GetTotalShields(this PlayableCard card) } /// - /// Retrieves the current value of a 's NumShield. + /// Retrieves the current value of the shield behaviour's . /// /// The to access. /// The to access. - /// The current value of the 's NumShield. + /// The current value of the shield behaviour's . public static int GetShieldCount(this PlayableCard card) where T : DamageShieldBehaviour { T comp = card.GetComponent(); @@ -944,7 +944,7 @@ public static IEnumerator SpawnInHand(this CardInfo cardInfo, List based off the object. /// /// to create the blueprint with. - /// The CardBlueprint object that can be used when creating . + /// The object that can be used when creating . public static EncounterBlueprintData.CardBlueprint CreateBlueprint(this CardInfo cardInfo) { return new EncounterBlueprintData.CardBlueprint diff --git a/InscryptionAPI/Card/CardExtensionsSetters.cs b/InscryptionAPI/Card/CardExtensionsSetters.cs index 608589d1f..b2c2bf8e4 100644 --- a/InscryptionAPI/Card/CardExtensionsSetters.cs +++ b/InscryptionAPI/Card/CardExtensionsSetters.cs @@ -182,7 +182,7 @@ public static CardInfo SetGemify(this CardInfo info, bool gemify = true) #region MetaCategories /// /// Sets the card to behave as a "normal" card in Part 1. - /// The CardTemple is Nature and it will appear in choice nodes and trader nodes. + /// The is Nature and it will appear in choice nodes and trader nodes. /// /// to access. /// The same so a chain can continue. @@ -199,7 +199,7 @@ public static CardInfo SetDefaultPart1Card(this CardInfo info) /// /// Sets the card to behave as a "normal" card in Part 3. - /// The CardTemple is Tech and it will appear in choice nodes and as a potential random card from GiftBot. + /// The is Tech and it will appear in choice nodes and as a potential random card from GiftBot. /// /// to access. /// The same so a chain can continue. @@ -647,7 +647,7 @@ public static CardInfo SetGemsCost(this CardInfo info, params GemType[] gemsCost #region Bools /// - /// Sets the card's onePerDeck field, which controls whether the player can own multiple copies of it in their deck. + /// Sets the card's field, which controls whether the player can own multiple copies of it in their deck. /// /// The same so a chain can continue. public static CardInfo SetOnePerDeck(this CardInfo info, bool onePerDeck = true) diff --git a/InscryptionAPI/Card/CardModificationInfoExtensions.cs b/InscryptionAPI/Card/CardModificationInfoExtensions.cs index 46f7f5bdd..1a625d448 100644 --- a/InscryptionAPI/Card/CardModificationInfoExtensions.cs +++ b/InscryptionAPI/Card/CardModificationInfoExtensions.cs @@ -196,7 +196,7 @@ public static CardModificationInfo SetDeathCardPortrait(this CardModificationInf #region Singleton ID /// - /// Removes the custom properties field from a 's singletonId. + /// Removes the custom properties field from the 's . /// /// The object whose properties we want to clear. /// The same so a chain can continue. @@ -209,7 +209,7 @@ public static CardModificationInfo ClearCustomPropertiesId(this CardModification return mod; } /// - /// Removes the custom costs ID field from a 's singletonId. + /// Removes the custom costs ID field from the 's . /// /// The object whose custom costs ID we want to clear. /// The same so a chain can continue. diff --git a/InscryptionAPI/Card/CardModificationInfoManager.cs b/InscryptionAPI/Card/CardModificationInfoManager.cs index 6c791ca1d..720b23444 100644 --- a/InscryptionAPI/Card/CardModificationInfoManager.cs +++ b/InscryptionAPI/Card/CardModificationInfoManager.cs @@ -209,11 +209,11 @@ public static string GetCustomCostsIdString(string singletonId) } /// - /// Retrieves the property name and associated value from the provided properties string. + /// Retrieves the property name and associated value from the string. /// /// A string representing all properties. /// The property name to search for. - /// A string containing the key and the value separated by a comma like so: 'key,value' + /// A string containing the key and the value separated by a comma like so: key,value public static string GetIdKeyPair(string properties, string key) { string retval = properties.Substring(properties.IndexOf(key + ",")); diff --git a/InscryptionAPI/Card/CostProperties.cs b/InscryptionAPI/Card/CostProperties.cs index eee2f4bfd..52fa0bfc3 100644 --- a/InscryptionAPI/Card/CostProperties.cs +++ b/InscryptionAPI/Card/CostProperties.cs @@ -62,10 +62,10 @@ private bool DidCostsChangeThisFrame() /// /// Determines if a card's list of Gem costs has been updated. /// - /// GemType. + /// . /// First list of gems. /// Second list of gems. - /// True if a does not equal b + /// True if does not equal . public bool GemsChanged(List a, List b) { if (a.Count != b.Count) @@ -116,7 +116,7 @@ public bool GemsChanged(List a, List b) public static List OriginalGemsCost(CardInfo __instance) { return null; } /// - /// Improved version of that accounts for addGemCost and . + /// Improved version of that accounts for and . /// /// For consistency's sake, it's recommended you use this method over in most cases. /// diff --git a/InscryptionAPI/Card/DamageShieldBehaviour.cs b/InscryptionAPI/Card/DamageShieldBehaviour.cs index 8ae03b80b..46db34336 100644 --- a/InscryptionAPI/Card/DamageShieldBehaviour.cs +++ b/InscryptionAPI/Card/DamageShieldBehaviour.cs @@ -54,7 +54,7 @@ public virtual void Start() } /// - /// Method for adding more shield count to this ability. Resets the loseShields Status boolean if the net shields are > 0. + /// Method for adding more shield count to this ability. Resets the if the net shields are > 0. /// /// How many more shields this ability should give. /// Whether or not to update the card's render. diff --git a/InscryptionAPI/Card/DeathCardManager.cs b/InscryptionAPI/Card/DeathCardManager.cs index 56d02e9c8..ecc601ddb 100644 --- a/InscryptionAPI/Card/DeathCardManager.cs +++ b/InscryptionAPI/Card/DeathCardManager.cs @@ -25,7 +25,7 @@ public static class DeathCardManager /// Adds a death card to the list of default death cards available at the start of each run. /// /// The containing the death card data. - /// If true, will add deathCardMod to the list of ascension death cards rather than the default (Part 1) pool. + /// If true, will add to the list of ascension death cards rather than the default (Part 1) pool. public static void AddDefaultDeathCard(CardModificationInfo deathCardMod, bool addToAscension = false) { if (addToAscension) diff --git a/InscryptionAPI/Card/ShieldManager.cs b/InscryptionAPI/Card/ShieldManager.cs index aee63373a..f4df7cf25 100644 --- a/InscryptionAPI/Card/ShieldManager.cs +++ b/InscryptionAPI/Card/ShieldManager.cs @@ -58,7 +58,7 @@ public static IEnumerator TriggerBreakShield(PlayableCard target, int damage, Pl } /// /// The method used for when a shielded card is damaged. Includes extra parameters for modders looking to modify this further. - /// This method is only called when damage > 0 and the target has a shield. + /// This method is only called when > 0 and the target has a shield. /// /// Card getting attacked. /// Damage being dealt. diff --git a/InscryptionAPI/Card/TribeManager.cs b/InscryptionAPI/Card/TribeManager.cs index 9322c1d00..7913f573f 100644 --- a/InscryptionAPI/Card/TribeManager.cs +++ b/InscryptionAPI/Card/TribeManager.cs @@ -104,7 +104,7 @@ public static Tribe Add(string guid, string name, string pathToTribeIcon = null, /// Determines if the given was added by a mod. /// /// The to check. - /// True if tribe is not from the base game. + /// True if is not from the base game. public static bool IsCustomTribe(Tribe tribe) => tribeTypes.Contains(tribe); /// diff --git a/InscryptionAPI/Costs/CardCostManager.cs b/InscryptionAPI/Costs/CardCostManager.cs index fbab5b029..e8b05fa21 100644 --- a/InscryptionAPI/Costs/CardCostManager.cs +++ b/InscryptionAPI/Costs/CardCostManager.cs @@ -54,7 +54,7 @@ public class FullCardCost /// /// Retrieves the correct texture corresponding to CardInfo's cost. Used in the 3D Acts (Act 1, Act 3, etc.). /// Parameters: - /// int: how much of the custom cost the CardInfo/PlayableCard needs to be played. + /// int: how much of the custom cost the /PlayableCard needs to be played. /// CardInfo: the base CardInfo of the current card. /// PlayableCard: the PlayableCard possessing the base CardInfo. Can be null. /// Returns: @@ -64,7 +64,7 @@ public class FullCardCost /// /// Retrieves the correct texture corresponding to CardInfo's cost. Used in Act 2. /// Parameters: - /// int: how much of the custom cost the CardInfo/PlayableCard needs to be played. + /// int: how much of the custom cost the /PlayableCard needs to be played. /// CardInfo: the base CardInfo of the current card. /// PlayableCard: the PlayableCard possessing the base CardInfo. Can be null. /// Returns: @@ -119,8 +119,8 @@ public Texture2D CostTexture(int amount, CardInfo cardInfo, PlayableCard playabl return GetCostTexture(amount, cardInfo, playableCard); } - /// The cost value of the CardInfo being checked. - /// The CardInfo being checked. + /// The cost value of the being checked. + /// The being checked. /// The PlayableCard associated with the card. Can be null. /// The texture for this cost based on the amount. Used in Act 2. public Texture2D PixelCostTexture(int amount, CardInfo cardInfo, PlayableCard playableCard) @@ -139,8 +139,8 @@ public int CostTier(int amount) return GetCostTier(amount); } - /// The cost value of the CardInfo being checked. - /// The CardInfo being checked. + /// The cost value of the being checked. + /// The being checked. /// The list of other cards in the player's hand. /// Whether or not the provided card can be played by turn 2. public bool CanBePlayedByTurn2WithHand(int amount, CardInfo card, List hand) @@ -806,7 +806,7 @@ private static IEnumerator CustomCostChoiceChosen(IEnumerator enumerator, CardSi /// For use in the Act 1 card cost choice node. /// /// The random seed for the current run. - /// The CardInfo of a valid Energy card, or null if none exists. + /// The of a valid Energy card, or null if none exists. public static CardInfo GetRandomChoosableEnergyCard(int randomSeed) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll(x => x.energyCost > 0); @@ -818,7 +818,7 @@ public static CardInfo GetRandomChoosableEnergyCard(int randomSeed) /// /// The random seed for the current run. /// The gem colour valid cards must have to be valid. - /// The CardInfo of a valid Gems card, or null if none exists. + /// The of a valid Gems card, or null if none exists. public static CardInfo GetRandomChoosableMoxCard(int randomSeed, GemType gem) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature).FindAll(x => x.gemsCost.Count > 0 && x.gemsCost.Contains(gem)); @@ -831,7 +831,7 @@ public static CardInfo GetRandomChoosableMoxCard(int randomSeed, GemType gem) /// /// The random seed for the current run. /// The List of custom costs to check for a random card for. - /// The CardInfo of a valid custom cost card, or null if none exists. + /// The of a valid custom cost card, or null if none exists. public static CardInfo GetRandomChoosableCustomCostCard(int randomSeed, List customCosts) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature) @@ -849,7 +849,7 @@ public static CardInfo GetRandomChoosableCustomCostCard(int randomSeed, ListThe random seed for the current run. /// The custom cost valid cards will have. /// The collection of cost amounts to search for. - /// The CardInfo of a valid card, or null if none exists. + /// The of a valid card, or null if none exists. public static CardInfo GetRandomChoosableCustomCostCardWithAmounts(int randomSeed, FullCardCost customCost, params int[] costAmounts) { List list = CardLoader.GetUnlockedCards(CardMetaCategory.ChoiceNode, CardTemple.Nature) diff --git a/InscryptionAPI/Dialogue/CustomLine.cs b/InscryptionAPI/Dialogue/CustomLine.cs index 1f277acac..368044772 100644 --- a/InscryptionAPI/Dialogue/CustomLine.cs +++ b/InscryptionAPI/Dialogue/CustomLine.cs @@ -80,7 +80,7 @@ public static implicit operator CustomLine(string str) /// public string specialInstruction = default; /// - /// The story condition that must be met if storyConditionMustBemet is true. + /// The story condition that must be met if is true. /// public StoryEvent storyCondition = StoryEvent.BasicTutorialCompleted; /// diff --git a/InscryptionAPI/Encounters/CustomNodeData.cs b/InscryptionAPI/Encounters/CustomNodeData.cs index 7aefe38d8..a46277971 100644 --- a/InscryptionAPI/Encounters/CustomNodeData.cs +++ b/InscryptionAPI/Encounters/CustomNodeData.cs @@ -32,7 +32,7 @@ public class CustomNodeData : SpecialNodeData public override List ForceGenerationConditions => forceGenerationConditions; /// - /// Default constructor that populates connectedNodes with an empty list. + /// Default constructor that populates with an empty list. /// public CustomNodeData() { diff --git a/InscryptionAPI/Encounters/EncounterExtensions.cs b/InscryptionAPI/Encounters/EncounterExtensions.cs index de682bba9..477a420ae 100644 --- a/InscryptionAPI/Encounters/EncounterExtensions.cs +++ b/InscryptionAPI/Encounters/EncounterExtensions.cs @@ -119,7 +119,7 @@ public static T SetRegionSpecific(this T blueprint, bool enabled) where T : E /// /// Adds random replacement cards to this region.
- /// A card from this list is selected whenever a card is randomly replaced by randomReplaceChance. + /// A card from this list is selected whenever a card is randomly replaced. ///
/// The to add this turn to. /// The cards to add. @@ -201,7 +201,7 @@ public static CardBlueprint SetDifficulty(this CardBlueprint card, int min, int } /// - /// Sets whether what card the CardBlueprint will be replaced with if difficultyReplace == true, and what difficulty threshold it will be replaced. + /// Sets whether what card the CardBlueprint will be replaced with if == true, and what difficulty threshold it will be replaced. /// /// The to access. /// Whether this card will be replaced at certain difficulties. diff --git a/InscryptionAPI/Encounters/EncounterManager.cs b/InscryptionAPI/Encounters/EncounterManager.cs index e8ed28e22..262c4f058 100644 --- a/InscryptionAPI/Encounters/EncounterManager.cs +++ b/InscryptionAPI/Encounters/EncounterManager.cs @@ -114,16 +114,16 @@ public static EncounterBlueprintData New(string name, bool addToPool = true) } /// - /// Creates a new CardBlueprint. + /// Creates a new . /// /// The internal name of the card to use. - /// The integer probability of this card getting replaced by a card from the encounter's randomReplacementCards. + /// The integer probability of this card getting replaced by a card from . /// Whether to replace this card when a certain difficulty threshold is met. - /// The difficulty threshold for the replacement card to be used instead. + /// The difficulty threshold for the card to be used instead. /// The name of the replacement card for the difficulty replacement. /// The minimum difficulty for this card to appear. /// The maximum difficulty for this card to appear. - /// The newly created CardBlueprint. + /// The newly created . public static CardBlueprint NewCardBlueprint(string cardName, int randomReplaceChance = 0, bool difficultyReplace = false, int difficultyReplaceReq = 0, string replacement = null, int minDifficulty = 1, int maxDifficulty = 20) diff --git a/InscryptionAPI/Encounters/TurnBuilder.cs b/InscryptionAPI/Encounters/TurnBuilder.cs index 2828e681d..61bcf5d35 100644 --- a/InscryptionAPI/Encounters/TurnBuilder.cs +++ b/InscryptionAPI/Encounters/TurnBuilder.cs @@ -14,7 +14,7 @@ public class TurnBuilder where T : EncounterBlueprintData internal List cards; /// - /// Default constructor that populates cards with an empty list. + /// Default constructor that populates with an empty list. /// public TurnBuilder() { @@ -45,11 +45,11 @@ public static class TurnExtensions /// The type. /// The to access. /// The default card. Can be null for no card. - /// The integer probability of this card getting replaced by a card from the encounter's randomReplacementCards. + /// The integer probability of this card getting replaced by a card from . /// The minimum difficulty for this card to appear. /// The maximum difficulty for this card to appear. /// Whether to replace this card when a certain difficulty threshold is met. - /// The difficulty threshold for the replacement card to be used instead. + /// The difficulty threshold for the card to be used instead. /// The replacement card for the difficulty replacement. public static TurnBuilder AddCardBlueprint(this TurnBuilder turnBuilder, string card, int randomReplaceChance = 0, int minDifficulty = 1, int maxDifficulty = 20, diff --git a/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs b/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs index 98621e1de..6b79d10fc 100644 --- a/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs +++ b/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs @@ -34,7 +34,7 @@ public static bool HasCard(this CardSlot cardSlot, string cardName) /// Create a card in a specific slot from the CardSlot object. A much more robust way that's the same as `yield return BoardManager.Instance.CreateCardInSlot()`. ///
/// The slot to spawn in. - /// The CardInfo object to spawn in said slot. + /// The object to spawn in said slot. /// Time to transition the card to the slot. The longer the time, the longer it will take to be placed at the slot. /// Whether or not to activate these triggers, in order: cards on board OtherCardAssignedToSlot, this card ResolveOnBoard, cards on board OtherCardResolve. /// The enumeration of the card being placed in the slot. diff --git a/InscryptionAPI/Items/ConsumableItemDataExtensions.cs b/InscryptionAPI/Items/ConsumableItemDataExtensions.cs index 27bd6c290..d9a8e6e4e 100644 --- a/InscryptionAPI/Items/ConsumableItemDataExtensions.cs +++ b/InscryptionAPI/Items/ConsumableItemDataExtensions.cs @@ -134,7 +134,7 @@ public static ConsumableItemData SetRulebookSprite(this ConsumableItemData data, /// If this item only appears in a specific region. /// The same so a chain can continue. /// - /// By default, regionSpecific being true just removes the item from the pool of region-specific items. + /// By default, being true just removes the item from the pool of region-specific items. /// public static ConsumableItemData SetRegionSpecific(this ConsumableItemData data, bool regionSpecific) { diff --git a/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs b/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs index 0f73cbfad..b3422726c 100644 --- a/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs +++ b/InscryptionAPI/Nodes/CustomCardChoiceNodeSequencer.cs @@ -36,7 +36,7 @@ public abstract class CustomCardChoiceNodeSequencer : CardChoicesSequencer, ICus /// public virtual Quaternion DeckPileRotationOffset => Quaternion.identity; /// - /// True if deck pile should inherit PositionOffset and RotationOffset together with DeckPilePositionOffset and DeckPileRotationOffset. Defaults to false. + /// True if deck pile should inherit and together with and . Defaults to false. /// public virtual bool DeckPileInheritsOffsets => false; /// diff --git a/InscryptionAPI/Nodes/NewNodeManager.cs b/InscryptionAPI/Nodes/NewNodeManager.cs index c256c1c39..4805355b5 100644 --- a/InscryptionAPI/Nodes/NewNodeManager.cs +++ b/InscryptionAPI/Nodes/NewNodeManager.cs @@ -387,7 +387,7 @@ public class NumChallengesOfTypeActive : NodeData.SelectionCondition /// public int numChallenges; /// - /// If this condition should be satisified when the number of active challenges is greater than numChallenges. + /// If this condition should be satisified when the number of active challenges is greater than . ///
/// If false, this condition checks for less-than-or-equal-to instead. ///
@@ -408,9 +408,9 @@ public NumChallengesOfTypeActive(AscensionChallenge challenge, int numChallenges /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If greaterThanNumActive is true, this condition is satisfied when the number of active copies of challenge >= numChallenges + /// If is true, this condition is satisfied when the number of active copies of >= ///
- /// If greaterThanNumActive is false, this condition is satisfied when the number of active copies of challenge <= numChallenges + /// If is false, this condition is satisfied when the number of active copies of <= ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. @@ -433,7 +433,7 @@ public class ChallengeIsActive : NodeData.SelectionCondition /// public AscensionChallenge challenge; /// - /// If this conditon requires challenge be excluded from the active list or not. + /// If this conditon requires be excluded from the active list or not. /// public bool exclude; @@ -450,9 +450,9 @@ public ChallengeIsActive(AscensionChallenge challenge, bool exclude) /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If exclude is true, this condition is satisfied if challenge is not active. + /// If is true, this condition is satisfied if is not active. ///
- /// If exclude is false, this condition is satisfied if challenge is active. + /// If is false, this condition is satisfied if is active. ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. diff --git a/InscryptionAPI/Nodes/SelectionConditions.cs b/InscryptionAPI/Nodes/SelectionConditions.cs index 5bd5dc4ce..5cd00671f 100644 --- a/InscryptionAPI/Nodes/SelectionConditions.cs +++ b/InscryptionAPI/Nodes/SelectionConditions.cs @@ -21,7 +21,7 @@ public Not(NodeData.SelectionCondition selectionCondition) /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If condition is not satisfied, this returns true. + /// If is not satisfied, this returns true. ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. @@ -54,7 +54,7 @@ public And(NodeData.SelectionCondition selectionCondition1, NodeData.SelectionCo /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If condition2 and condition2 are both true, this also returns true. + /// If and are both true, this also returns true. ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. @@ -129,9 +129,9 @@ public CustomPreviousNodesContent(string guid, string name, bool doesContain) /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If doesContain is true, return true if the previous nodes contain a node with the given name and guid. + /// If is true, return true if the previous nodes contain a node with the given and . ///

- /// If doesContain is false, return true if the previous nodes do not contain a node with the given name and guide. + /// If is false, return true if the previous nodes do not contain a node with the given and . ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. @@ -152,7 +152,7 @@ public class CustomPreviousRowContent : NodeData.SelectionCondition private bool doesContain; /// - /// Creates an "CustomPreviousRowContent" selection condition and sets its target guid, name and required value. + /// Creates a selection condition and sets its target guid, name and required value. /// /// The mod guid of the node this selection condition will be looking for. /// The name of the node this selection condition will be looking for. @@ -168,9 +168,9 @@ public CustomPreviousRowContent(string guid, string name, bool doesContain) /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If doesContain is true, return true if the previous node row contains a node with the given name and guid. + /// If is true, return true if the previous node row contains a node with the given and . ///

- /// If doesContain is false, return true if the previous node row does not contain a node with the given name and guide. + /// If is false, return true if the previous node row does not contain a node with the given and guide. ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. @@ -200,7 +200,7 @@ public Func(Func, bool> del) /// /// Determines if this condition is satisfied and this node can be generated. ///

- /// If func is null, return true. Otherwise, call func and return its value. + /// If is null, return true. Otherwise, call and return its value. ///
/// The y-index of this node. Higher values represent further nodes on the map. /// The nodes generated at the previous y-index. diff --git a/InscryptionAPI/Pelts/PeltManager.cs b/InscryptionAPI/Pelts/PeltManager.cs index 1a7640ccd..5ed5bc0ea 100644 --- a/InscryptionAPI/Pelts/PeltManager.cs +++ b/InscryptionAPI/Pelts/PeltManager.cs @@ -172,7 +172,7 @@ private static List CreateBasePelts() /// Creates a new instance of CustomPeltData then adds it to the game. /// /// GUID of the mod adding this pelt. - /// The CardInfo for the actual pelt card. + /// The for the actual pelt card. /// The list of possible cards the Trader will offer for this pelt. /// The starting price of this pelt when buying from the Trapper. /// The number of extra sigils card choices will have when trading this pelt to the Trader. @@ -187,7 +187,7 @@ public static PeltData New(string pluginGuid, CardInfo peltCardInfo, Func /// GUID of the mod adding this pelt. - /// The CardInfo for the actual pelt card. + /// The for the actual pelt card. /// The list of possible cards the Trader will offer for this pelt. /// The starting price of this pelt when buying from the Trapper. /// The number of extra sigils card choices will have when trading this pelt to the Trader. @@ -325,7 +325,7 @@ public static string GetTierNameFromPelt(string cardName) /// Retrieves the tier name of the pelt. /// /// The to access. - /// The tier name of the pelt. If peltData has no defined tier name, will be called and used instead. + /// The tier name of the pelt. If has no defined tier name, will be called and used instead. public static string GetTierNameFromData(PeltData peltData) { return peltData.peltTierName ?? GetTierNameFromPelt(peltData.peltCardName); diff --git a/InscryptionAPI/Regions/RegionExtensions.cs b/InscryptionAPI/Regions/RegionExtensions.cs index db19960ea..627c25b13 100644 --- a/InscryptionAPI/Regions/RegionExtensions.cs +++ b/InscryptionAPI/Regions/RegionExtensions.cs @@ -36,9 +36,10 @@ public static RegionData SetName(this RegionData region, string name) /// /// Adds terrain cards to this region.
- /// Terrain cards require the Terrain trait to appear.
+ /// Terrain cards require the trait to appear.
/// Every region must have at least one valid terrain card. ///
+ /// The to access. /// The terrain cards to add. public static RegionData AddTerrainCards(this RegionData region, params string[] cards) { @@ -55,10 +56,11 @@ public static RegionData AddTerrainCards(this RegionData region, params string[] } /// - /// Adds likely cards to this region.
- /// Likely cards require the ChoiceNode metacategory to appear.
+ /// Adds cards that are more likely to appear in this region's choice nodes.
+ /// Likely cards still require the metacategory.
/// One of three normal card choices is guaranteed to contain a card from the region's likely cards. ///
+ /// The to access. /// The likely cards to add. public static RegionData AddLikelyCards(this RegionData region, params string[] cards) { @@ -76,7 +78,7 @@ public static RegionData AddLikelyCards(this RegionData region, params string[] /// /// Adds consumables to this region.
- /// This only applies to consumables that are regionSpecific. Adding non-region-specific consumables will increase the probability of the consumable appearing. + /// This only applies to consumables that are . Adding non-region-specific consumables will increase the probability of the consumable appearing. ///
/// . public static RegionData AddConsumableItems(this RegionData region, params string[] consumables) diff --git a/InscryptionAPI/ResourceBank/ResourceBankManager.cs b/InscryptionAPI/ResourceBank/ResourceBankManager.cs index aa18489b0..bbc37eee2 100644 --- a/InscryptionAPI/ResourceBank/ResourceBankManager.cs +++ b/InscryptionAPI/ResourceBank/ResourceBankManager.cs @@ -52,7 +52,7 @@ public static ResourceData Add(string pluginGUID, string path, UnityObject unity /// The GUID of the mod adding the resource. /// The resource to add to the . /// If the resource will override an existing resource asset. - /// The for the newly created resource, or null if resource is null. + /// The for the newly created resource, or null if is null. public static ResourceData Add(string pluginGUID, ResourceBank.Resource resource, bool overrideExistingAsset = false) { if (resource == null) diff --git a/InscryptionAPI/Rulebook/PageTextInteractable.cs b/InscryptionAPI/Rulebook/PageTextInteractable.cs index 36ef7d12d..d773022a3 100644 --- a/InscryptionAPI/Rulebook/PageTextInteractable.cs +++ b/InscryptionAPI/Rulebook/PageTextInteractable.cs @@ -61,7 +61,7 @@ public void SetRedirect(PageRangeType rangeType, string pageId) /// /// Logic for when this object is clicked on with the alternate select key (default right-click). ///
- /// Locates and then flips to the page defined by the redirectId. + /// Locates and then flips to the page defined by . ///
public override void OnAlternateSelectStarted() { diff --git a/InscryptionAPI/Rulebook/RuleBookManager.cs b/InscryptionAPI/Rulebook/RuleBookManager.cs index 7f7a62c79..01aa638f4 100644 --- a/InscryptionAPI/Rulebook/RuleBookManager.cs +++ b/InscryptionAPI/Rulebook/RuleBookManager.cs @@ -392,7 +392,7 @@ public static string GetUnformattedPageId(string pageId) } /// - /// Opens the rulebook to the page with the given pageId. + /// Opens the rulebook to the page with the given . /// /// . /// The value to compare each rulebook pages' id against. If this starts with [API_ then it will check against a page's unformatted id. diff --git a/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs b/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs index df7bac82c..041b2a74c 100644 --- a/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs +++ b/InscryptionAPI/Rulebook/RuleBookManagerPatches.cs @@ -20,7 +20,7 @@ namespace InscryptionAPI.RuleBook; public class RuleBookManagerPatches { /// - /// THe prefix string for handling API-created pageIds. + /// The prefix string for handling API-created page IDs. /// public const string API_ID = "[API_"; diff --git a/InscryptionAPI/Slots/SlotModificationManager.cs b/InscryptionAPI/Slots/SlotModificationManager.cs index 17b09100c..7db86557a 100644 --- a/InscryptionAPI/Slots/SlotModificationManager.cs +++ b/InscryptionAPI/Slots/SlotModificationManager.cs @@ -441,9 +441,9 @@ private static PixelBoardSpriteSetter.BoardThemeSpriteSet GetSpriteSetFromTextur /// Indicator for which scene/scrybe this should apply to /// Texture for each player slot. Null textures will be replaced with the game's default. /// Texture for each opponent slot. Null textures will be replaced with the game's default. - /// This does not work for Act 2. The base game uses the CardBattleNPC to + /// This does not work for Act 2. The base game uses the to /// set default textures. It's possible that a future API update would allow for custom Act 2 - /// NPCs, so this will deliberately not touch Act 2 + /// NPCs, so this will deliberately not touch Act 2. public static void OverrideDefaultSlotTexture(CardTemple temple, Texture playerSlot, Texture opponentSlot) { OverrideDefaultSlotTexture( @@ -459,9 +459,9 @@ public static void OverrideDefaultSlotTexture(CardTemple temple, Texture playerS /// Indicator for which scene/scrybe this should apply to /// Textures for each player slot. Null textures will be replaced with the game's default. /// Textures for each opponent slot. Null textures will be replaced with the game's default. - /// This does not work for Act 2. The base game uses the CardBattleNPC to + /// This does not work for Act 2. The base game uses the to /// set default textures. It's possible that a future API update would allow for custom Act 2 - /// NPCs, so this will deliberately not touch Act 2 + /// NPCs, so this will deliberately not touch Act 2. public static void OverrideDefaultSlotTexture(CardTemple temple, List playerSlots, List opponentSlots) { if (playerSlots != null && playerSlots.Any(t => t != null)) diff --git a/InscryptionAPI/Sound/SoundManager.cs b/InscryptionAPI/Sound/SoundManager.cs index fc9975bfb..4435eadf2 100644 --- a/InscryptionAPI/Sound/SoundManager.cs +++ b/InscryptionAPI/Sound/SoundManager.cs @@ -60,10 +60,10 @@ private static void ErrorLog(string message) => InscryptionAPIPlugin.Logger.LogError($"SoundManager: {message}"); /// - /// A helper method for converting an audio file into an Unity AudioClip. + /// A helper method for converting an audio file into an Unity . /// /// The path to your audio file. - /// The audio file converted into an AudioClip object. + /// The audio file converted into an object. public static AudioClip LoadAudioClip(string path) { return LoadAudioClip(string.Empty, path); @@ -76,11 +76,11 @@ internal static AudioClip LoadAudioClip(GramophoneManager.TrackInfo trackInfo) } /// - /// A helper method for converting an audio file into an Unity AudioClip. + /// A helper method for converting an audio file into an Unity . /// /// Your plugin's GUID. /// The path to your audio file. - /// The audio file converted into an AudioClip object. + /// The audio file converted into an object. public static AudioClip LoadAudioClip(string guid, string path) { if (!Path.IsPathRooted(path)) From 91f1419431c56bae57f20942fa6fb5216bf42d93 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:09:17 -0800 Subject: [PATCH 66/74] Add XML to RegionExtensions --- InscryptionAPI/Regions/RegionExtensions.cs | 160 +++++++++++++++++++-- 1 file changed, 150 insertions(+), 10 deletions(-) diff --git a/InscryptionAPI/Regions/RegionExtensions.cs b/InscryptionAPI/Regions/RegionExtensions.cs index 627c25b13..e2d524a40 100644 --- a/InscryptionAPI/Regions/RegionExtensions.cs +++ b/InscryptionAPI/Regions/RegionExtensions.cs @@ -7,14 +7,17 @@ namespace InscryptionAPI.Regions; +/// +/// Utility class that adds extensions to aid in creating and modifying . +/// public static class RegionExtensions { /// /// If the created region will be added to the pool of regions that can appear in a run. /// - /// The RegionData for the region we are modifying. + /// The for the region we are modifying. /// If the created region will be added to the pool of regions that can appear in a run. - /// The same RegionData so a chain can continue. + /// The same so a chain can continue. public static RegionData SetCanAppearRandomly(this RegionData data, bool canAppear) { Part1RegionData region = RegionManager.NewRegions.FirstOrDefault(x => x.Region == data); if (region != null) { @@ -26,8 +29,20 @@ public static RegionData SetCanAppearRandomly(this RegionData data, bool canAppe return data; } + /// + /// Retrieves the with the given name. + /// + /// Collection of objects to search for. + /// Region name to look for. + /// The with the given name, or null if one couldn't be found. public static RegionData RegionByName(this IEnumerable regions, string name) => regions.FirstOrDefault(x => x.name == name); + /// + /// Sets the given 's internal name. + /// + /// The to access. + /// The name of the region. + /// The same so a chain can continue. public static RegionData SetName(this RegionData region, string name) { region.name = name; @@ -41,6 +56,7 @@ public static RegionData SetName(this RegionData region, string name) /// /// The to access. /// The terrain cards to add. + /// The same so a chain can continue. public static RegionData AddTerrainCards(this RegionData region, params string[] cards) { region.terrainCards = region.terrainCards ?? new(); @@ -62,6 +78,7 @@ public static RegionData AddTerrainCards(this RegionData region, params string[] /// /// The to access. /// The likely cards to add. + /// The same so a chain can continue. public static RegionData AddLikelyCards(this RegionData region, params string[] cards) { region.likelyCards = region.likelyCards ?? new(); @@ -78,9 +95,12 @@ public static RegionData AddLikelyCards(this RegionData region, params string[] /// /// Adds consumables to this region.
- /// This only applies to consumables that are . Adding non-region-specific consumables will increase the probability of the consumable appearing. + /// This only applies to consumables that are . + /// Adding non-region-specific consumables will increase the probability of the consumable appearing. ///
- /// . + /// The to access. + /// Names of items to appear in this region. + /// The same so a chain can continue. public static RegionData AddConsumableItems(this RegionData region, params string[] consumables) { region.consumableItems = region.consumableItems ?? new(); @@ -91,6 +111,14 @@ public static RegionData AddConsumableItems(this RegionData region, params strin return region; } + /// + /// Adds consumables to this region.
+ /// This only applies to consumables that are . + /// Adding non-region-specific consumables will increase the probability of the consumable appearing. + ///
+ /// The to access. + /// Names of items to appear in this region. + /// The same so a chain can continue. public static RegionData AddConsumableItems(this RegionData region, params ConsumableItemData[] consumables) { region.consumableItems = region.consumableItems ?? new(); @@ -106,7 +134,9 @@ public static RegionData AddConsumableItems(this RegionData region, params Consu /// One of three normal card choices is guaranteed to contain a card from the region's dominant tribes.
/// Every region must have at least one dominant tribe. /// + /// The to access. /// The tribes to add. + /// The same so a chain can continue. public static RegionData AddDominantTribes(this RegionData region, params Tribe[] tribes) { region.dominantTribes = region.dominantTribes ?? new(); @@ -117,12 +147,24 @@ public static RegionData AddDominantTribes(this RegionData region, params Tribe[ return region; } + /// + /// Sets this region's board lighting colour. + /// + /// The to access. + /// The colour to set the board lighting to. + /// The same so a chain can continue. public static RegionData SetBoardColor(this RegionData region, Color color) { region.boardLightColor = color; return region; } + /// + /// Sets this region's card lighting colour. + /// + /// The to access. + /// The colour to set the card lighting to. + /// The same so a chain can continue. public static RegionData SetCardsColor(this RegionData region, Color color) { region.cardsLightColor = color; @@ -133,7 +175,9 @@ public static RegionData SetCardsColor(this RegionData region, Color color) /// Creates a new encounter for this region and returns the builder.
/// Every region with battles needs at least one encounter. /// + /// The to access. /// The name for the encounter. + /// The created encounter data. public static EncounterBuilderBlueprintData CreateEncounter(this RegionData region, string name = null) { EncounterBuilderBlueprintData blueprint = ScriptableObject.CreateInstance(); @@ -145,7 +189,9 @@ public static EncounterBuilderBlueprintData CreateEncounter(this RegionData regi /// Adds normal (card battle node) encounters to this region.
/// Every region with battles needs at least one encounter. /// + /// The to access. /// The encounters to add. + /// The same so a chain can continue. public static RegionData AddEncounters(this RegionData region, params EncounterBlueprintData[] encounters) { region.encounters = region.encounters ?? new(); @@ -169,9 +215,12 @@ public static RegionData AddEncounters(this RegionData region, params EncounterB } /// - /// Sets the boss prep encounter condition for this region. If this condition is not met, the 'boss prep encounter' will not appear. + /// Sets the boss prep encounter condition for this region. + /// If this condition is not met, the 'boss prep encounter' will not appear. /// + /// The to access. /// The condition that needs to be fulfilled. + /// The same so a chain can continue. public static RegionData SetBossPrepCondition(this RegionData region, StoryEventCondition condition) { region.bossPrepCondition = condition; @@ -179,15 +228,24 @@ public static RegionData SetBossPrepCondition(this RegionData region, StoryEvent } /// - /// Sets the boss prep encounter for this region. The boss prep encounter is the final battle node in the region, before the boss. + /// Sets the boss prep encounter for this region. + /// The boss prep encounter is the final battle node in the region, before the boss. /// + /// The to access. /// The encounter to set. + /// The same so a chain can continue. public static RegionData SetBossPrepEncounter(this RegionData region, EncounterBlueprintData encounter) { region.bossPrepEncounter = encounter; return region; } + /// + /// Adds bosses that can appear in this region. + /// + /// The to access. + /// The IDs for all bosses that can appear in this region. + /// The same so a chain can continue. public static RegionData AddBosses(this RegionData region, params Opponent.Type[] bosses) { region.bosses = region.bosses ?? new(); @@ -201,41 +259,83 @@ public static RegionData AddBosses(this RegionData region, params Opponent.Type[ return region; } + /// + /// Sets whether or not dust particles should appear on the map while in this region. + /// + /// The to access. + /// If dust particles should appear while in this region. + /// The same so a chain can continue. public static RegionData SetDustParticlesEnabled(this RegionData region, bool enabled) { region.dustParticlesDisabled = !enabled; return region; } + /// + /// Sets whether or not fog should appear on the map while in this region. + /// + /// The to access. + /// If fog should appear while in this region. + /// The same so a chain can continue. public static RegionData SetFogEnabled(this RegionData region, bool enabled) { region.fogEnabled = enabled; return region; } + /// + /// Sets the fog's alpha value. + /// + /// The to access. + /// How opaque/transparent the fog should be. Value ranges from [0.0, 1.0] + /// The same so a chain can continue. public static RegionData SetFogAlpha(this RegionData region, float alpha) { region.fogAlpha = alpha; return region; } + /// + /// Sets the emission texture for this region's map object. + /// + /// The to access. + /// The to use for the map emission. + /// The same so a chain can continue. public static RegionData SetMapEmission(this RegionData region, Texture texture) { region.mapEmission = texture; return region; } + /// + /// Sets the emission texture for this region's map object. + /// + /// The to access. + /// The to use for the map emission. + /// The same so a chain can continue. public static RegionData SetMapEmission(this RegionData region, Texture2D texture) { region.mapEmission = texture; return region; } + /// + /// Sets the map emission's colour. + /// + /// The to access. + /// The colour to use for the map emission. + /// The same so a chain can continue. public static RegionData SetMapEmissionColor(this RegionData region, Color color) { region.mapEmissionColor = color; return region; } + /// + /// Sets if this region should have no ambience. + /// + /// The to access. + /// If the ambient music should be replaced with silence. + /// The same so a chain can continue. public static RegionData SetSilenceCabinAmbience(this RegionData region, bool enabled) { region.silenceCabinAmbience = enabled; @@ -245,13 +345,21 @@ public static RegionData SetSilenceCabinAmbience(this RegionData region, bool en /// /// Sets the music loop ID for this region. /// + /// The to access. /// The music ID to use. + /// The same so a chain can continue. public static RegionData SetAmbientLoopId(this RegionData region, string id) { region.ambientLoopId = id; return region; } + /// + /// Sets the data used for this region's map's filler scenery objects. + /// + /// The to access. + /// The data for determining what objects are used to fill the map's filler scenery. + /// The same so a chain can continue. public static RegionData AddFillerScenery(this RegionData region, params FillerSceneryEntry[] fillerScenery) { region.fillerScenery = region.fillerScenery ?? new(); @@ -262,6 +370,12 @@ public static RegionData AddFillerScenery(this RegionData region, params FillerS return region; } + /// + /// Sets the data used for this region's map's scarce scenery objects. + /// + /// The to access. + /// The data for determining what objects are used to fill the map's scarce scenery. + /// The same so a chain can continue. public static RegionData AddScarceScenery(this RegionData region, params ScarceSceneryEntry[] scarceScenery) { region.scarceScenery = region.scarceScenery ?? new(); @@ -272,18 +386,36 @@ public static RegionData AddScarceScenery(this RegionData region, params ScarceS return region; } + /// + /// Sets the data used for how map fog should appear in this region. + /// + /// The to access. + /// The description object that controls how the fog appears. + /// The same so a chain can continue. public static RegionData SetFogProfile(this RegionData region, VolumetricFogProfile fogProfile) { region.fogProfile = fogProfile; return region; } + /// + /// Sets the albedo texture for this region's map. + /// + /// The to access. + /// The texture used for the map's albedo.. + /// The same so a chain can continue. public static RegionData SetMapAlbedo(this RegionData region, Texture mapAlbedo) { region.mapAlbedo = mapAlbedo; return region; } + /// + /// Sets the prefab objects for this particles on this region's map. + /// + /// The to access. + /// The objects used for the particles on the map. + /// The same so a chain can continue. public static RegionData SetMapParticlesPrefabs(this RegionData region, params GameObject[] particles) { region.mapParticlesPrefabs = region.mapParticlesPrefabs ?? new(); @@ -294,10 +426,18 @@ public static RegionData SetMapParticlesPrefabs(this RegionData region, params G return region; } - public static RegionData Build(this RegionData region, bool ignoreTerrainWarning = false, bool ignoreTribesWarning = false, - bool ignoreEncountersWarning = false, bool ignoreBossesWarning = false) - { - + /// + /// Validates the region and outputs console warnings if it's missing any important data. + /// + /// The to access. + /// Whether or not the API should output a console warning when this region has no terrain cards. + /// Whether or not the API should output a console warning when this region has no dominant tribes. + /// Whether or not the API should output a console warning when this region has no encounters. + /// Whether or not the API should output a console warning when this region has no bosses. + /// The same so a chain can continue. + public static RegionData Build(this RegionData region, + bool ignoreTerrainWarning = false, bool ignoreTribesWarning = false, + bool ignoreEncountersWarning = false, bool ignoreBossesWarning = false) { if (!ignoreTerrainWarning && (region.terrainCards == null || region.terrainCards.Count == 0)) InscryptionAPIPlugin.Logger.LogWarning($"Region {region.name} does not have any terrain cards!"); if (!ignoreTribesWarning && (region.dominantTribes == null || region.dominantTribes.Count == 0)) From b2630192959f9ee23dd057dc5f1534b42dd37c0d Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:19:24 -0800 Subject: [PATCH 67/74] Add missing XML to RulebookRedirectPatches --- InscryptionAPI/Rulebook/RulebookRedirectPatches.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/InscryptionAPI/Rulebook/RulebookRedirectPatches.cs b/InscryptionAPI/Rulebook/RulebookRedirectPatches.cs index 0c5b9862b..73195e3b8 100644 --- a/InscryptionAPI/Rulebook/RulebookRedirectPatches.cs +++ b/InscryptionAPI/Rulebook/RulebookRedirectPatches.cs @@ -19,6 +19,9 @@ namespace InscryptionAPI.RuleBook; // we want modders to be able to set multiple redirects that can go to different types of pages // eg: abilities, stat icons, boons, items +/// +/// Patches to make rulebook hyperlinks/redirects work. +/// [HarmonyPatch] public static class RulebookRedirectPatches { @@ -48,6 +51,9 @@ private static IEnumerator ResetTrueTopIndex(IEnumerator enumerator, int pageInd rulebookShowFlipIndex = -1; } + /// + /// The current page index, accounting for the fact alters the index by 3. + /// public static int rulebookShowFlipIndex = -1; [HarmonyPrefix, HarmonyPatch(typeof(RulebookPageFlipper), nameof(RulebookPageFlipper.RenderPages))] From 8c8709b59593d923b1e97ee1aa6c57606ced6997 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:22:23 -0800 Subject: [PATCH 68/74] Add missing XML to AssetHelpers --- InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs b/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs index fcbe526c8..b9af01ae2 100644 --- a/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs +++ b/InscryptionAPI/TalkingCards/Helpers/AssetHelpers.cs @@ -31,6 +31,11 @@ public static class AssetHelpers /// The name of the file at the given path, or null if one could not be found. public static string? GetFile(string file) => Directory.GetFiles(Paths.PluginPath, file, SearchOption.AllDirectories).FirstOrDefault(); + /// + /// Creates a texture from the file located at the given file path and adds it to the . + /// + /// Path to the texture file. + /// The created texture or null if the path/file is invalid. public static Texture2D? MakeTexture(string? path) { if (path == null || path.IsWhiteSpace()) return null; From 9326cff17001885ea27d7e6ea324cab79ef81355 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:24:11 -0800 Subject: [PATCH 69/74] Add missing XML to StringExtensions --- .../TalkingCards/Helpers/StringExtensions.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs b/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs index 01ad690dd..13dae3ba1 100644 --- a/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs +++ b/InscryptionAPI/TalkingCards/Helpers/StringExtensions.cs @@ -6,6 +6,11 @@ namespace InscryptionAPI.TalkingCards.Helpers; /// public static class StringExtensions { + /// + /// Converts the given string to sentence case (first character upper-case, everything else lower-case. + /// + /// The string to convert. + /// The converted string. public static string SentenceCase(this string key) { if (string.IsNullOrWhiteSpace(key)) return string.Empty; @@ -16,6 +21,11 @@ public static string SentenceCase(this string key) /* I know about string.IsNullOrWhiteSpace(). * I'm defining my own becaue of nullability. */ + /// + /// Variant of that accounts for nullability. + /// + /// The string to check. + /// True if is empty or made entirely of whitespace character. public static bool IsWhiteSpace(this string str) => str.Length == 0 || str.All(char.IsWhiteSpace); } From 2a1d4ecc2640b9632d6dd1cabeb044c29d426fb6 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:26:20 -0800 Subject: [PATCH 70/74] Fix malformed tags, add missing XML param tag --- InscryptionAPI/Helpers/Extensions/ListExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/InscryptionAPI/Helpers/Extensions/ListExtensions.cs b/InscryptionAPI/Helpers/Extensions/ListExtensions.cs index 58810bf54..6a8736dad 100644 --- a/InscryptionAPI/Helpers/Extensions/ListExtensions.cs +++ b/InscryptionAPI/Helpers/Extensions/ListExtensions.cs @@ -39,7 +39,7 @@ public static T PopLast(this List list) /// The Item in which we want to repeat. /// The amount of times we want to repeat it. /// The type of we are operating on, for example where T is would result in the Type being . - /// A new of the item specified by repeated for the amount of times specified by the parameter. + /// A new of the item specified by repeated for the amount of times specified by the parameter. public static List Repeat(this T toRepeat, int times) { List repeated = new(); @@ -68,8 +68,9 @@ public static T GetRandom(this List list) /// /// A function used to get a Seeded Random item from the . /// - /// The we are using to get a Seeded Random Item from. /// The type of we are operating on, for example where T is would result in the Type being . + /// The we are using to get a Seeded Random Item from. + /// Seed to use in the random generator. /// A Seeded Random element from the passed using public static T GetSeededRandom(this List list, int seed) { From 637bc02bb523d8881d5be03c95d6f6d1138f860b Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:46:51 -0800 Subject: [PATCH 71/74] Add missing XML for RuleBookRedirectManager --- .../Rulebook/RuleBookRedirectManager.cs | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/InscryptionAPI/Rulebook/RuleBookRedirectManager.cs b/InscryptionAPI/Rulebook/RuleBookRedirectManager.cs index cbcf22016..f2181b4ae 100644 --- a/InscryptionAPI/Rulebook/RuleBookRedirectManager.cs +++ b/InscryptionAPI/Rulebook/RuleBookRedirectManager.cs @@ -14,20 +14,52 @@ namespace InscryptionAPI.RuleBook; /// public class RuleBookRedirectManager : Singleton { + /// + /// All created objects. + /// public readonly List createdInteractableObjects = new(); + /// + /// All currently active objects. + /// public readonly List currentActiveInteractables = new(); + /// + /// Index for the current rulebook page that is open. + /// public int currentActivePageIndex = -1; + /// + /// xyz-coordinate for the top-left corner of the page object. + /// public Vector3 currentPageTopLeft; + /// + /// xyz-coordinate of the top-left corner of where the description text starts on the page object. + /// public Vector3 descriptionTopLeft; + /// + /// x-y values for the width and length of the current page object. + /// public float[] currentPageLengths; + /// + /// x-y values for the width and length of the description text's bounding box. + /// public float[] descriptionLengths; //public float currentPageRotation = 0f; + /// + /// that renders the rulebook object. Retrieved from the controller's rig parent. + /// public Camera RuleBookCamera; + /// + /// that renders UI elements. + /// public Camera PixelCamera; + /// + /// for the current top page object.
+ /// For Acts 1, Magnificus, and Grimora, this will be the object for .
+ /// For Act 1, this will be the object of the tablet itself (since it has no pages). + ///
public Transform currentTopPage; private void Start() @@ -36,12 +68,24 @@ private void Start() PixelCamera = ViewManager.Instance.pixelCamera; } + /// + /// Clears the list of active interactables, updates the list of created interactbles to remove destroyed objects, then deactivates all created interactables. + /// public void ClearActiveInteractables() { currentActiveInteractables.Clear(); createdInteractableObjects.RemoveAll(x => x == null); createdInteractableObjects.ForEach(x => x.SetActive(false)); } + + /// + /// Updates the list of active interactables for the current opened page.
+ /// Creates new interactables if there aren't enough for the current page. + /// Attempts to reuse preexisting interactables to avoid creating excess objects. + ///
+ /// The object for the description text. + /// The object for the current page object. + /// List of rulebook redirects for the current page. public void UpdateActiveInteractables(TextMeshPro description, GameObject currentPageObj, Dictionary redirects) { //InscryptionAPIPlugin.Logger.LogDebug($"[UpdateActiveInteractables]"); From 6ac597cd3e843b74810cee0237f8978aeb180c59 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 14:04:35 -0800 Subject: [PATCH 72/74] Add missing XML to GeneratePortrait --- .../Animation/GeneratePortrait.cs | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/InscryptionAPI/TalkingCards/Animation/GeneratePortrait.cs b/InscryptionAPI/TalkingCards/Animation/GeneratePortrait.cs index bdf295e19..f7ca818b6 100644 --- a/InscryptionAPI/TalkingCards/Animation/GeneratePortrait.cs +++ b/InscryptionAPI/TalkingCards/Animation/GeneratePortrait.cs @@ -9,6 +9,9 @@ namespace InscryptionAPI.TalkingCards.Animation; +/// +/// Helper class for creating talking card portraits. +/// public static class GeneratePortrait { internal static AssetBundle? PortraitBundle; @@ -16,17 +19,34 @@ public static class GeneratePortrait private static Transform? APIPortraits; #region FaceInfoDefault + /// + /// Default voice ID. + /// public const string VoiceId = "female1_voice"; + /// + /// Default blink rate. + /// public const float BlinkRate = 1.5f; + /// + /// Default voice pitch. + /// public const float VoicePitch = 1f; #endregion + /// + /// ID for a dummy talking card special ability. + /// public static SpecialTriggeredAbility DialogueDummy = CreateDummyAbility(); #region Sprites - public static readonly Sprite EmptyPortrait - = AssetHelpers.MakeSprite(AssetHelpers.EmptyAndTransparent()); - + /// + /// Sprite for an empty card portrait. + /// + public static readonly Sprite EmptyPortrait = AssetHelpers.MakeSprite(AssetHelpers.EmptyAndTransparent()); + + /// + /// Tuple containing two empty card portrait sprites. + /// public static readonly (Sprite, Sprite) EmptyPortraitTuple = (EmptyPortrait, EmptyPortrait); #endregion From 7aa4b0b32bbb8601341e4f7f7aed2091450555ee Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 14:11:49 -0800 Subject: [PATCH 73/74] Remove test field --- InscryptionAPI/Dialogue/DialogueManager.cs | 23 ---------------------- 1 file changed, 23 deletions(-) diff --git a/InscryptionAPI/Dialogue/DialogueManager.cs b/InscryptionAPI/Dialogue/DialogueManager.cs index 8647e290c..724e05375 100644 --- a/InscryptionAPI/Dialogue/DialogueManager.cs +++ b/InscryptionAPI/Dialogue/DialogueManager.cs @@ -82,29 +82,6 @@ public static Dialogue Add(string pluginGUID, DialogueEvent dialogueEvent) return dialogue; } - /// - /// - /// Bblue - /// bBbright blue - /// bGbright gold - /// blGrbright lime green - /// bRbright red - /// brnObrown orange - /// bSGglow seafoam green (default Act 1 emission colour) - /// dBdark blue - /// dlGrdark lime green - /// dSGdark seafoam green - /// Ggold - /// g1bright lime green - /// g2gold - /// g3blue - /// gray40% grey - /// lGrlime green - /// Oorange - /// - /// - private static int iff; - /// /// Adds a new colour code that can be used in dialogue events to colour text. ///

From 462c3d7b99cf54a5fac83770bba6a5f5c34ca811 Mon Sep 17 00:00:00 2001 From: WhistleWind <69230920+HumabHatterZed@users.noreply.github.com> Date: Mon, 16 Nov 2026 14:25:12 -0800 Subject: [PATCH 74/74] Update BaseGameRegions XML --- InscryptionAPI/Regions/RegionManager.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/InscryptionAPI/Regions/RegionManager.cs b/InscryptionAPI/Regions/RegionManager.cs index a4388f098..6cdf99a6d 100644 --- a/InscryptionAPI/Regions/RegionManager.cs +++ b/InscryptionAPI/Regions/RegionManager.cs @@ -20,14 +20,16 @@ public static class RegionManager /// All vanilla map regions, reordered to match the general order they're encounter during the story. ///
/// - /// Order of regions in this collection: - ///
Forest - ///
Wetlands - ///
Alpine - ///
Midnight - ///
Midnight_Ascension - ///
Pirateville - ///
!TEST_PART3 + /// + /// Order of regions in : + /// 0Forest + /// 1Wetlands + /// 2Alpine + /// 3Midnight + /// 4Midnight_Ascension + /// 5Pirateville + /// 6!TEST_PART3 + /// ///
public static readonly ReadOnlyCollection BaseGameRegions = new(ReorderBaseRegions());