GetCards(this BoardManager manager, PredicateManager instance to access.
/// The predicate to filter on each slot.
/// The list of player slots with no cards.
- public static List GetPlayerOpenSlots(
- this BoardManager manager,
- Predicate filterOnPredicate = null
- ) => manager.PlayerSlotsCopy.SelectOpenSlots(filterOnPredicate).ToList();
+ public static List GetPlayerOpenSlots(this BoardManager manager, Predicate filterOnPredicate = null) => manager.PlayerSlotsCopy.SelectOpenSlots(filterOnPredicate).ToList();
///
/// Retrieve all opponent slots that are not occupied by a card.
@@ -66,10 +55,7 @@ public static List GetPlayerOpenSlots(
/// Manager instance to access.
/// The predicate to filter on each slot.
/// The list of opponent slots with no cards.
- public static List GetOpponentOpenSlots(
- this BoardManager manager,
- Predicate filterOnPredicate = null
- ) => manager.OpponentSlotsCopy.SelectOpenSlots(filterOnPredicate).ToList();
+ public static List GetOpponentOpenSlots(this BoardManager manager, Predicate filterOnPredicate = null) => manager.OpponentSlotsCopy.SelectOpenSlots(filterOnPredicate).ToList();
///
/// Retrieve all slots on the player or opponent's side of the board that are not occupied by a card.
@@ -78,11 +64,7 @@ public static List GetOpponentOpenSlots(
/// Whether to retrieve player slots.
/// The predicate to filter on each slot.
/// The list of relevant card slots with no cards.
- public static List GetOpenSlots(
- this BoardManager manager,
- bool getPlayerSlots,
- Predicate filterOnPredicate = null
- ) => manager.GetSlotsCopy(getPlayerSlots).SelectOpenSlots(filterOnPredicate).ToList();
+ public static List GetOpenSlots(this BoardManager manager, bool getPlayerSlots, Predicate filterOnPredicate = null) => manager.GetSlotsCopy(getPlayerSlots).SelectOpenSlots(filterOnPredicate).ToList();
///
/// Retrieve all slots on the board that are not occupied by a card.
@@ -90,20 +72,15 @@ public static List GetOpenSlots(
/// Manager instance to access.
/// The predicate to filter on each slot.
/// The list of relevant card slots with no cards.
- public static List GetOpenSlots(
- this BoardManager manager,
- Predicate filterOnPredicate = null
- ) => manager.AllSlotsCopy.SelectOpenSlots(filterOnPredicate).ToList();
+ public static List GetOpenSlots(this BoardManager manager, Predicate filterOnPredicate = null) => manager.AllSlotsCopy.SelectOpenSlots(filterOnPredicate).ToList();
///
/// Retrieve a copy of the board slots for the player or opponent's side of the board.
///
/// Manager instance to access.
/// Whether to retrieve PlayerSlotsCopy or OpponentSlotsCopy.
- /// The predicate to filter on each slot.
/// The list corresponding to the player or opponent's side of the board.
- public static List GetSlotsCopy(this BoardManager manager, bool getPlayerSlotsCopy)
- => getPlayerSlotsCopy ? manager.PlayerSlotsCopy : manager.OpponentSlotsCopy;
+ public static List GetSlotsCopy(this BoardManager manager, bool getPlayerSlotsCopy) => getPlayerSlotsCopy ? manager.PlayerSlotsCopy : manager.OpponentSlotsCopy;
///
/// Retrieve all player or opponent card slots on the board.
@@ -112,9 +89,5 @@ public static List GetSlotsCopy(this BoardManager manager, bool getPla
/// Whether to retrieve player card slots.
/// The predicate to filter on each card slot.
/// The list of relevant card slots on the board.
- public static List GetCardSlots(
- this BoardManager manager,
- bool getPlayerCards,
- Predicate filterOnPredicate = null
- ) => manager.GetSlotsCopy(getPlayerCards).FindAll(filterOnPredicate);
+ public static List GetCardSlots(this BoardManager manager, bool getPlayerCards, Predicate filterOnPredicate = null) => manager.GetSlotsCopy(getPlayerCards).FindAll(filterOnPredicate);
}
\ No newline at end of file
diff --git a/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs b/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs
index 3f9996b9..832fb8ba 100644
--- a/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs
+++ b/InscryptionAPI/Helpers/Extensions/CardSlotExtensions.cs
@@ -3,6 +3,9 @@
namespace InscryptionAPI.Helpers.Extensions;
+///
+/// An extensions class for the Card Slot.
+///
public static class CardSlotExtensions
{
///
@@ -35,12 +38,7 @@ public static bool HasCard(this CardSlot cardSlot, string cardName)
/// 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.
- public static IEnumerator CreateCardInSlot(
- this CardSlot slotToSpawnIn,
- CardInfo cardInfo,
- float transitionLength = 0.1f,
- bool resolveTriggers = true
- )
+ public static IEnumerator CreateCardInSlot(this CardSlot slotToSpawnIn, CardInfo cardInfo, float transitionLength = 0.1f, bool resolveTriggers = true)
{
yield return BoardManager.Instance.CreateCardInSlot(cardInfo, slotToSpawnIn, transitionLength, resolveTriggers);
}
@@ -54,13 +52,7 @@ public static IEnumerator CreateCardInSlot(
/// An action to do after the assignment has completed.
/// Whether or not to activate the 'Trigger.OtherCardAssignedToSlot' for the cards on board.
/// The enumeration of the card being placed in the slot.
- public static IEnumerator AssignCardToSlot(
- this CardSlot slotToSpawnIn,
- PlayableCard playableCard,
- float transitionDuration = 0.1f,
- Action tweenCompleteCallback = null,
- bool resolveTriggers = true
- )
+ public static IEnumerator AssignCardToSlot(this CardSlot slotToSpawnIn, PlayableCard playableCard, float transitionDuration = 0.1f, Action tweenCompleteCallback = null, bool resolveTriggers = true)
{
yield return BoardManager.Instance.AssignCardToSlot(playableCard, slotToSpawnIn, transitionDuration, tweenCompleteCallback, resolveTriggers);
}
@@ -74,13 +66,7 @@ public static IEnumerator AssignCardToSlot(
/// An action to do after the assignment has completed, but before 'ResolveOnBoard' triggers.
/// 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.
- public static IEnumerator ResolveCardOnBoard(
- this CardSlot slotToSpawnIn,
- PlayableCard playableCard,
- float tweenLength = 0.1f,
- Action landOnBoardCallback = null,
- bool resolveTriggers = true
- )
+ public static IEnumerator ResolveCardOnBoard(this CardSlot slotToSpawnIn, PlayableCard playableCard, float tweenLength = 0.1f, Action landOnBoardCallback = null, bool resolveTriggers = true)
{
yield return BoardManager.Instance.ResolveCardOnBoard(playableCard, slotToSpawnIn, tweenLength, landOnBoardCallback, resolveTriggers);
}
@@ -128,9 +114,7 @@ public static CardSlot GetAdjacent(this CardSlot cardSlot, bool adjacentOnLeft)
/// An IEnumerable of PlayableCard from the CardSlots sequence.
public static IEnumerable SelectCards(this IEnumerable slots, Predicate filterOnPredicate = null)
{
- return slots
- .Where(slot => slot.Card && (filterOnPredicate == null || filterOnPredicate.Invoke(slot.Card)))
- .Select(slot => slot.Card);
+ return slots.Where(slot => slot.Card && (filterOnPredicate == null || filterOnPredicate.Invoke(slot.Card))).Select(slot => slot.Card);
}
///
diff --git a/InscryptionAPI/Helpers/Extensions/GameObjectExtensions.cs b/InscryptionAPI/Helpers/Extensions/GameObjectExtensions.cs
index be1629b4..af5eb9c6 100644
--- a/InscryptionAPI/Helpers/Extensions/GameObjectExtensions.cs
+++ b/InscryptionAPI/Helpers/Extensions/GameObjectExtensions.cs
@@ -2,8 +2,17 @@
namespace InscryptionAPI.Helpers.Extensions;
+///
+/// An Extensions Class for the
+///
public static class GameObjectExtensions
{
+ ///
+ /// Finds the Children of a Given
+ ///
+ /// The we want to find the children of.
+ /// The name of the child we are looking for within the children.
+ /// A with the name being looked for.
public static GameObject FindChild(this GameObject parent, string name)
{
if (parent.name == name)
diff --git a/InscryptionAPI/Helpers/Extensions/ListExtensions.cs b/InscryptionAPI/Helpers/Extensions/ListExtensions.cs
index f6195781..58810bf5 100644
--- a/InscryptionAPI/Helpers/Extensions/ListExtensions.cs
+++ b/InscryptionAPI/Helpers/Extensions/ListExtensions.cs
@@ -2,8 +2,17 @@
namespace InscryptionAPI.Helpers.Extensions;
+///
+/// An Extensions Class for the .
+///
public static class ListExtensions
{
+ ///
+ /// Removes the First element of the passed .
+ ///
+ /// The in which we want to remove the First item of.
+ /// The type of we are operating on, for example where T is would result in the Type being .
+ /// Returns the First item of after removing it from the .
public static T PopFirst(this List list)
{
T t = list[0];
@@ -11,6 +20,12 @@ public static T PopFirst(this List list)
return t;
}
+ ///
+ /// Removes the Last element of the passed .
+ ///
+ /// The in which we want to remove the Last item of.
+ /// The type of we are operating on, for example where T is would result in the Type being .
+ /// Returns the Last item of after removing it from the .
public static T PopLast(this List list)
{
T t = list[list.Count - 1];
@@ -18,6 +33,13 @@ public static T PopLast(this List list)
return t;
}
+ ///
+ /// Repeatedly adds the specified item to a X times.
+ ///
+ /// 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.
public static List Repeat(this T toRepeat, int times)
{
List repeated = new();
@@ -31,12 +53,24 @@ public static List Repeat(this T toRepeat, int times)
return repeated;
}
+ ///
+ /// A function used to get a Random item from the .
+ ///
+ /// The we are using to get a Random Item from.
+ /// The type of we are operating on, for example where T is would result in the Type being .
+ /// A Random element from the passed using
public static T GetRandom(this List list)
{
int index = UnityEngine.Random.Range(0, list.Count);
return list[index];
}
+ ///
+ /// 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 .
+ /// A Seeded Random element from the passed using
public static T GetSeededRandom(this List list, int seed)
{
int index = SeededRandom.Range(0, list.Count, seed);
diff --git a/InscryptionAPI/Helpers/MaterialOverride.cs b/InscryptionAPI/Helpers/MaterialOverride.cs
index 4ad0696d..434984c9 100644
--- a/InscryptionAPI/Helpers/MaterialOverride.cs
+++ b/InscryptionAPI/Helpers/MaterialOverride.cs
@@ -2,79 +2,200 @@
namespace InscryptionAPI.Helpers;
+///
+/// A Helper Object for Materials on an Object.
+///
public class MaterialOverride
{
+ ///
+ /// The Main Texture as a .
+ ///
public Texture2D MainTexture = null;
+ ///
+ /// Whether the Main Texture should be Overwritten or not.
+ ///
public bool OverrideMainTexture = false;
-
+ ///
+ /// The Emission Texture as a .
+ ///
public Texture2D Emission = null;
+ ///
+ /// Whether the Emission Texture should be Overwritten or not.
+ ///
public bool OverrideEmission = false;
-
+ ///
+ /// The Normal Map as a .
+ ///
public Texture2D NormalMap = null;
+ ///
+ /// Whether the Normal Map should be Overwritten or not.
+ ///
public bool OverrideNormalMap = false;
-
+ ///
+ /// The Height Map as a .
+ ///
public Texture2D HeightMap = null;
+ ///
+ /// Whether the Height Map should be Overwritten or not.
+ ///
public bool OverrideHeightMap = false;
-
+ ///
+ /// The Metallic Map as a .
+ ///
public Texture2D MetallicMap = null;
+ ///
+ /// Whether the Metallic Map should be Overwritten or not.
+ ///
public bool OverrideMetallicMap = false;
-
+ ///
+ /// The Occlusion Map as a .
+ ///
public Texture2D OcclusionMap = null;
+ ///
+ /// Whether the Occlusion Map should be Overwritten or not.
+ ///
public bool OverrideOcclusionMap = false;
-
+ ///
+ /// The Detail Mask as a .
+ ///
public Texture2D DetailMask = null;
+ ///
+ /// Whether the Detail Mask should be Overwritten or not.
+ ///
public bool OverrideDetailMask = false;
-
+ ///
+ /// The Metallic Surface Property. How Metallic should the Material be?
+ ///
public float? Metallic = null;
+ ///
+ /// Whether the Metallic Value should be Overwritten or not.
+ ///
+ public bool OverrideMetallic = false;
+ ///
+ /// The Surface Smoothness Property. How Smooth should the Material be?
+ ///
public float? Smoothness = null;
+ ///
+ /// Whether the Smoothness Value should be Overwritten or not.
+ ///
+ public bool OverrideSmoothness = false;
+ ///
+ /// The Displacement Height Property. How displaced should the Material be compared to the Model it is applied to?
+ ///
public float? Height = null;
-
+ ///
+ /// Whether the Height Value should be Overwritten or not.
+ ///
+ public bool OverrideHeight = false;
+
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeMainTexture(Texture2D tex)
{
MainTexture = tex;
OverrideMainTexture = true;
return this;
}
-
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeEmission(Texture2D tex)
{
Emission = tex;
OverrideEmission = true;
return this;
}
-
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeNormalMap(Texture2D tex)
{
NormalMap = tex;
OverrideNormalMap = true;
return this;
}
-
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeHeightMap(Texture2D tex)
{
HeightMap = tex;
OverrideHeightMap = true;
return this;
}
-
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeMetallicMap(Texture2D tex)
{
MetallicMap = tex;
OverrideMetallicMap = true;
return this;
}
-
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeOcclusionMap(Texture2D tex)
{
OcclusionMap = tex;
OverrideOcclusionMap = true;
return this;
}
-
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
public MaterialOverride ChangeDetailMask(Texture2D tex)
{
DetailMask = tex;
OverrideMainTexture = true;
return this;
}
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
+ public MaterialOverride ChangeMetallic(float metallic)
+ {
+ Metallic = metallic;
+ OverrideMetallic = true;
+ return this;
+ }
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
+ public MaterialOverride ChangeSmoothness(float smoothness)
+ {
+ Smoothness = smoothness;
+ OverrideSmoothness = true;
+ return this;
+ }
+ ///
+ /// A function for changing the of a .
+ ///
+ /// The in which to use to replace .
+ /// An Overwritten and set to true.
+ public MaterialOverride ChangeHeight(float height)
+ {
+ Height = height;
+ OverrideHeight = true;
+ return this;
+ }
}
diff --git a/InscryptionAPI/Helpers/ResourceLookup.cs b/InscryptionAPI/Helpers/ResourceLookup.cs
index d7422530..65da8c8d 100644
--- a/InscryptionAPI/Helpers/ResourceLookup.cs
+++ b/InscryptionAPI/Helpers/ResourceLookup.cs
@@ -1,17 +1,31 @@
-using InscryptionAPI.Helpers;
-using UnityEngine;
+using UnityEngine;
-namespace InscryptionAPI.Items;
+namespace InscryptionAPI.Helpers;
///
-/// Define how an asset should be retrieved so we can fetch it at any time.
+/// A Helper Object for ResourceLookup.
///
+/// Define how an asset should be retrieved so we can fetch it at any time.
public class ResourceLookup : ICloneable
{
+ ///
+ /// The Path to the Resource.
+ ///
public string ResourcePath { get; private set; }
+ ///
+ /// The Resources BankID.
+ ///
public string ResourceBankID { get; private set; }
+ ///
+ /// The Prefab associated with the Lookup.
+ ///
public GameObject Prefab { get; private set; }
+ ///
+ /// Gets a Prefab from the passed Path and Prefab Name.
+ ///
+ /// The Path to the in which to search for the Prefab.
+ /// The Name of the Prefab we are searching for in the .
public void FromAssetBundle(string assetBundlePath, string assetBundlePrefabName)
{
if (AssetBundleHelper.TryGet(assetBundlePath, assetBundlePrefabName, out GameObject go))
@@ -19,7 +33,11 @@ public void FromAssetBundle(string assetBundlePath, string assetBundlePrefabName
Prefab = go;
}
}
-
+ ///
+ /// Gets a Prefab from the passed and Prefab Name.
+ ///
+ /// The in which to search for the Prefab.
+ /// The Name of the Prefab we are searching for in the .
public void FromAssetBundle(AssetBundle assetBundle, string assetBundlePrefabName)
{
if (AssetBundleHelper.TryGet(assetBundle, assetBundlePrefabName, out GameObject go))
@@ -27,7 +45,12 @@ public void FromAssetBundle(AssetBundle assetBundle, string assetBundlePrefabNam
Prefab = go;
}
}
-
+ ///
+ /// Gets a Prefab from the passed DLL based Path and Prefab Name.
+ ///
+ /// The Path to the Asset Bundle within the DLL Assembly.
+ /// The Name of the Prefab we are searching for in the .
+ ///
public void FromAssetBundleInAssembly(string assetBundlePath, string assetBundlePrefabName)
{
byte[] resourceBytes = TextureHelper.GetResourceBytes(assetBundlePath, typeof(T).Assembly);
@@ -36,22 +59,37 @@ public void FromAssetBundleInAssembly(string assetBundlePath, string assetBun
Prefab = go;
}
}
-
+
+ ///
+ /// Sets the to the ResourcePath passed in.
+ ///
+ /// The Path to the Resource.
public void FromResources(string resourcePath)
{
this.ResourcePath = resourcePath;
}
-
+ ///
+ /// Sets the to the ResourceBankID passed in.
+ ///
+ /// The ResourceBankID.
public void FromResourceBank(string resourceBankID)
{
this.ResourceBankID = resourceBankID;
}
-
+ ///
+ /// Sets the to the Prefab passed in.
+ ///
+ /// The Prefab itself.
public void FromPrefab(GameObject prefab)
{
this.Prefab = prefab;
}
+ ///
+ /// Gets the UnityObject Representative of the Prefab.
+ ///
+ /// A representative of the Prefab.
+ /// A if successful, a Null if we failed to get the Type from the Prefab, and a Default(T) if the ResourceLookup failed.
public virtual T Get() where T : UnityObject
{
if (!string.IsNullOrEmpty(ResourcePath))
@@ -83,14 +121,22 @@ public virtual T Get() where T : UnityObject
return default(T);
}
+ ///
+ /// Turns the ResourceLookup Object into a String.
+ ///
+ /// A String of the ResourceLookup Object.
public override string ToString()
{
return $"ResourceLookup(ResourcePath:{ResourcePath}, ResourceBankID:{ResourceBankID}, Prefab:{Prefab})";
}
+ ///
+ /// Clones the Object into a Shallow Copy of the current ResourceLookup.
+ ///
+ /// A Cloned Object representing the ResourceLookup.
public object Clone()
{
- ResourceLookup cardInfo = (ResourceLookup)base.MemberwiseClone();
- return cardInfo;
+ ResourceLookup resourceLookup = (ResourceLookup)base.MemberwiseClone();
+ return resourceLookup;
}
}
\ No newline at end of file
diff --git a/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs b/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs
index c872e039..4a2be356 100644
--- a/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs
+++ b/InscryptionAPI/Helpers/ResourcesManagerHelpers.cs
@@ -7,13 +7,16 @@
namespace InscryptionAPI.Helpers;
+///
+/// A Helper Set related to the .
+///
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'.
///
- /// The ResourcesManager Instance.
+ /// The current .
/// How many energy cells to close. Gets capped to the current number of open energy cells.
public static IEnumerator RemoveMaxEnergy(this ResourcesManager instance, int amount)
{
@@ -24,7 +27,7 @@ public static IEnumerator RemoveMaxEnergy(this ResourcesManager instance, int am
/// A variant of RemoveMaxEnergy that can bypass ResourcesManager.PreventNextEnergyLoss.
/// Affected by 'ResourcesManager.preventNextEnergyLoss'.
///
- /// The ResourcesManager Instance.
+ /// The current .
/// How many energy cells to close. Gets capped to the current number of open energy cells.
public static IEnumerator RemoveMaxEnergy(this ResourcesManager instance, int amount, bool preventable)
{
@@ -44,6 +47,12 @@ public static IEnumerator RemoveMaxEnergy(this ResourcesManager instance, int am
yield return instance.ShowRemoveMaxEnergy(numToClose);
}
+ ///
+ /// A used to show removal of Max Energy.
+ ///
+ /// The current .
+ /// The amount of lost Max Energy.
+ /// The Depleted Energy Counter from removing the specified amount of max energy.
public static IEnumerator ShowRemoveMaxEnergy(this ResourcesManager instance, int amount)
{
PixelResourcesManager pixelManager = instance as PixelResourcesManager;
@@ -64,6 +73,13 @@ public static IEnumerator ShowRemoveMaxEnergy(this ResourcesManager instance, in
yield return new WaitForSeconds(0.05f);
}
}
+
+ ///
+ /// Gets the Amount of Gems of the passed .
+ ///
+ /// The current .
+ /// The we want to get the count of.
+ /// The Count of Gems associated with the passed .
public static int GemsOfType(this ResourcesManager instance, GemType gem)
{
return instance.gems.Count(x => x == gem);
@@ -82,6 +98,13 @@ public static int GemCount(bool playerGems, GemType gemToCheck)
else
return OpponentGemsManager.Instance.GemsOfType(gemToCheck);
}
+
+ ///
+ /// A bool used to determine whether the Owner has Gems of the specified 's.
+ ///
+ /// Whether the Check should be based on the Opponent or Player.
+ /// The 's in which to check if the Opponent has.
+ /// The result of if the Check is for the Player, otherwise the result of .
public static bool OwnerHasGems(bool playerGems, params GemType[] gems)
{
if (playerGems)
@@ -89,6 +112,12 @@ public static bool OwnerHasGems(bool playerGems, params GemType[] gems)
else
return OpponentHasGems(gems);
}
+
+ ///
+ /// A bool used to determine whether the Opponent has Gems of the specified 's.
+ ///
+ /// The 's in which to check if the Opponent has.
+ /// A true if the Opponent has all specified 's, a false if not.
public static bool OpponentHasGems(params GemType[] gems)
{
if (OpponentGemsManager.Instance == null)
@@ -101,6 +130,12 @@ public static bool OpponentHasGems(params GemType[] gems)
}
return true;
}
+
+ ///
+ /// A bool used to determine whether the Player has Gems of the specified 's.
+ ///
+ /// The 's in which to check if the Player has.
+ /// A true if the Player has all specified 's, a false if not.
public static bool PlayerHasGems(params GemType[] gems)
{
foreach (GemType gem in gems)
@@ -112,11 +147,21 @@ public static bool PlayerHasGems(params GemType[] gems)
}
}
+///
+/// A Patch Class used to Get the Empty Battery Sprite in the GBC section.
+///
[HarmonyPatch(typeof(PixelResourcesManager), nameof(PixelResourcesManager.Start))]
public static class GetEmptyBatterySprite
{
+ ///
+ /// The Empty Battery Sprite.
+ ///
public static Sprite emptyBatterySprite = null;
+ ///
+ /// A function used to Get and set the .
+ ///
+ /// The Instance of the Object, in this case .
[HarmonyPostfix]
private static void GetSprite(PixelResourcesManager __instance)
{
diff --git a/InscryptionAPI/Helpers/TextureHelper.cs b/InscryptionAPI/Helpers/TextureHelper.cs
index 742e1e45..383bd1fc 100644
--- a/InscryptionAPI/Helpers/TextureHelper.cs
+++ b/InscryptionAPI/Helpers/TextureHelper.cs
@@ -1,3 +1,4 @@
+using System.Collections.ObjectModel;
using BepInEx;
using DiskCardGame;
using HarmonyLib;
@@ -7,13 +8,14 @@
namespace InscryptionAPI.Helpers;
///
-/// This class contains a number of helper methods for managing textures.
+/// A Helper Set related to the and .
///
+/// This class contains a number of helper methods for managing textures.
[HarmonyPatch]
public static class TextureHelper
{
///
- /// Thie is used to indicate what type of sprite you wish to create so that the appropriate size and pivot point can be determined.
+ /// This is used to indicate what type of sprite you wish to create so that the appropriate size and pivot point can be determined.
///
public enum SpriteType : int
{
@@ -21,76 +23,74 @@ public enum SpriteType : int
/// A card's portrait art in Act 1 or Act 3.
///
CardPortrait = 0,
-
///
/// A card's portrait art in Act 2.
///
PixelPortrait = 1,
-
///
/// An ability icon (sigil) in Act 2.
///
PixelAbilityIcon = 2,
-
///
/// A special stat icon in Act 2.
///
PixelStatIcon = 3,
-
///
/// A challenge skull displayed on the challenge UI during the setup of a Kaycee's Mod run.
///
ChallengeIcon = 4,
-
///
/// The texture that displays the card's cost in Act 1.
///
CostDecal = 5,
-
///
/// The large decal used to display multiple/hybrid card costs in Act 1.
///
OversizedCostDecal = 6,
-
///
/// The decal used to display card costs in Act 2, on the top-left of the card.
///
Act2CostDecalLeft = 7,
-
///
/// The decal used to display card costs in Act 2, on the top-right of the card.
///
Act2CostDecalRight = 8,
-
///
/// The starter deck icon displayed on the challenge UI during the setup on a Kaycee's Mod run.
///
StarterDeckIcon = 9,
-
///
/// The decal used by the API in Act 2, comprising the entire card's dimensions.
///
PixelDecal = 10,
-
///
/// An activated ability icon (sigil) in Act 2.
///
PixelActivatedAbilityIcon = 11,
-
///
/// The texture for a button in Act 2 (same kind of button used for the hammer and activated sigils).
///
PixelStandardButton = 12,
-
+ ///
+ /// The texture for the Act 2 cost when it's on the Left.
+ ///
Act2CostVanillaLeft = 13,
-
+ ///
+ /// The texture for a Act 2 cost when it's on the right.
+ ///
Act2CostVanillaRight = 14
};
-
+ ///
+ /// The Default Pivot to use across most Sprites.
+ ///
private static Vector2 DEFAULT_PIVOT = new(0.5f, 0.5f);
-
+ ///
+ /// A Dictionary of , representing an Emission Mapping.
+ ///
private static readonly Dictionary emissionMap = new();
-
+ ///
+ /// A Dictionary of , used to define the Rectangular Area for a given Sprite Type.
+ ///
private static readonly Dictionary SPRITE_RECTS = new()
{
{ SpriteType.CardPortrait, new Rect(0f, 0f, 114f, 94f) },
@@ -106,10 +106,12 @@ public enum SpriteType : int
{ SpriteType.PixelDecal, new Rect(0f, 0f, 42f, 56f) },
{ SpriteType.PixelActivatedAbilityIcon, new Rect(0f, 0f, 22f, 10f) },
{ SpriteType.PixelStandardButton, new Rect(0f, 0f, 26f, 17f) },
- { SpriteType.Act2CostVanillaLeft, new Rect(0f, 0f, 48f, 28f) }, // vanilla costs should have a creme border on the left and right so we don't need padding
+ { SpriteType.Act2CostVanillaLeft, new Rect(0f, 0f, 48f, 28f) },
{ SpriteType.Act2CostVanillaRight, new Rect(0f, 0f, 48f, 28f) }
};
-
+ ///
+ /// A Dictionary of , used to define the Pivot Point for a given Sprite Type.
+ ///
private static readonly Dictionary SPRITE_PIVOTS = new()
{
{ SpriteType.CardPortrait, DEFAULT_PIVOT },
@@ -251,6 +253,11 @@ public static void RegisterEmissionForSprite(this Sprite regularSprite, Sprite e
emissionMap[regularSprite] = emissionSprite;
}
+ ///
+ /// A Function used to Get the Emission from the Card Portrait at first through the , and if that fails, from the .
+ ///
+ /// The Card Portrait .
+ /// An Emission associated with the passed Card Portrait
public static Sprite GetEmissionSprite(this Sprite sprite)
{
if (sprite == null)
@@ -259,7 +266,6 @@ public static Sprite GetEmissionSprite(this Sprite sprite)
if (emissionMap.TryGetValue(sprite, out Sprite emission))
return emission;
-
string text = sprite.name + "_emission";
emission = ResourceBank.Get("Art/Cards/Portraits/" + text);
if (emission != null)
@@ -314,6 +320,12 @@ public static void TryReuseEmission(CardInfo info, Sprite alternatePortrait)
emissionMap[alternatePortrait] = emissionMap[info.portraitTex];
}
+ ///
+ /// A patch to to allow for usage of Custom Emissions instead.
+ ///
+ /// The Card Portrait .
+ /// The returned result in this case the Emission associated with the Card Portrait within , if not found it lets vanilla handle it normally.
+ /// A false if the contains an Emission correlated with the Card Portrait , otherwise false to let the game handle it.
[HarmonyPatch(typeof(CardDisplayer3D), nameof(CardDisplayer3D.GetEmissivePortrait))]
[HarmonyPrefix]
private static bool GetCustomEmission(Sprite mainPortrait, ref Sprite __result)
@@ -329,9 +341,9 @@ private static bool GetCustomEmission(Sprite mainPortrait, ref Sprite __result)
///
/// Reads the contents of an image file in an assembly and returns it as a byte array.
///
- /// The name of the art file stored as a resource in the assembly.
+ /// The name of the art file stored as a resource in the assembly.
/// The assembly to pull the art from.
- /// The contents of the file in pathCardArt as a byte array.
+ /// The contents of the file in filename as a byte array.
public static byte[] GetResourceBytes(string filename, Assembly target)
{
string lowerKey = $".{filename.ToLowerInvariant()}";
@@ -353,14 +365,6 @@ public static byte[] GetResourceBytes(string filename, Assembly target)
///
/// Combines multiple textures into one, using a tiled approach.
///
- ///
- /// This helper has a very specific purpose. The pixels in baseTexture will be iteratively replaced with the pixels
- /// in the pieces array. The X position for the i-th texture will be
- /// xOffset + xStep * i. The Y position for the i-th texture will be
- /// yOffset + yStep * (pieces.Count - i - 1).
- ///
- /// **Note**: baseTexture will be modified in-place!
- ///
/// The individual textures to combine into the base texture.
/// The background texture for the combined texture.
/// Used to set the position for individual textures.
@@ -368,6 +372,14 @@ public static byte[] GetResourceBytes(string filename, Assembly target)
/// Used to set the position for individual textures.
/// Used to set the position for individual textures.
/// The modified texture (the same Texture references as baseTexture).
+ ///
+ /// This helper has a very specific purpose. The pixels in will be iteratively replaced with the pixels
+ /// in the array. The X position for the i-th texture will be
+ /// + * i. The Y position for the i-th texture will be
+ /// + * (.Count - i - 1).
+ ///
+ /// Note: will be modified in-place!
+ ///
public static Texture2D CombineTextures(List pieces, Texture2D baseTexture, int xStep = 0, int yStep = 0, int xOffset = 0, int yOffset = 0)
{
if (pieces != null)
@@ -386,42 +398,118 @@ public static Texture2D CombineTextures(List pieces, Texture2D baseTe
/// Creates an identical copy of a given texture
///
/// The texture to copy.
+ /// This code originates from
public static Texture2D DuplicateTexture(Texture2D texture)
{
- // https://support.unity.com/hc/en-us/articles/206486626-How-can-I-get-pixels-from-unreadable-textures-
- // Create a temporary RenderTexture of the same size as the texture
-
- RenderTexture tmp = RenderTexture.GetTemporary(
- texture.width,
- texture.height,
- 0,
- RenderTextureFormat.Default,
- RenderTextureReadWrite.Linear);
-
-
- // Blit the pixels on texture to the RenderTexture
+ RenderTexture tmp = RenderTexture.GetTemporary(texture.width, texture.height, 0, RenderTextureFormat.Default, RenderTextureReadWrite.Linear);
Graphics.Blit(texture, tmp);
-
- // Backup the currently set RenderTexture
RenderTexture previous = RenderTexture.active;
-
- // Set the current RenderTexture to the temporary one we created
RenderTexture.active = tmp;
-
- // Create a new readable Texture2D to copy the pixels to it
-
Texture2D myTexture2D = new(texture.width, texture.height);
-
- // Copy the pixels from the RenderTexture to the new Texture
myTexture2D.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);
myTexture2D.Apply();
-
- // Reset the active RenderTexture
RenderTexture.active = previous;
-
- // Release the temporary RenderTexture
RenderTexture.ReleaseTemporary(tmp);
-
return myTexture2D;
}
-}
+
+ #region CustomAppearences
+
+ ///
+ /// All Base Game Custom Appearance Items, these are handled by mods themselves, not by us.
+ ///
+ internal static Dictionary BaseGameCustomAppearances = new Dictionary();
+ ///
+ /// All Base Game Custom Appearance Items, these are handled by mods themselves, not by us. This version is exposed publicly.
+ ///
+ public static ReadOnlyCollection> BaseGameCustomAppearancesPublic => new ReadOnlyCollection>(BaseGameCustomAppearances.ToList());
+ ///
+ /// All Modded Custom Appearance Items, these are handled by mods themselves, not by us.
+ ///
+ internal static Dictionary ModdedCustomAppearancesDictionary = new Dictionary();
+ ///
+ /// All Modded Custom Appearance Items, these are handled by mods themselves, not by us. This version is exposed publicly.
+ ///
+ public static ReadOnlyCollection> ModdedCustomAppearancesDictionaryPublic => new ReadOnlyCollection>(ModdedCustomAppearancesDictionary.ToList());
+ ///
+ /// All Custom Appearance Items, these are handled by mods themselves, not by us. This version is exposed publicly.
+ ///
+ public static ReadOnlyCollection> CombinedCustomAppearancesDictionaryPublic => new ReadOnlyCollection>(BaseGameCustomAppearancesPublic.Concat(ModdedCustomAppearancesDictionary).ToList());
+
+ ///
+ /// Initializes the Base Game Custom Appearances List
+ ///
+ internal static void InstantiateBaseGameCustomAppearances()
+ {
+ BaseGameCustomAppearances.Add("CardDecal_Blood1", GetImageAsTexture("decal_blood_1.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Blood2", GetImageAsTexture("decal_blood_2.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Blood3", GetImageAsTexture("decal_blood_3.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Blood4", GetImageAsTexture("decal_blood_4.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Child", GetImageAsTexture("decal_child.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Fungus", GetImageAsTexture("decal_fungus.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Smoke", GetImageAsTexture("decal_smoke.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_SmokeAbilityHole", GetImageAsTexture("decal_smoke_abilityhole.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Snelk1", GetImageAsTexture("decal_snelk_1.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Snelk2", GetImageAsTexture("decal_snelk_2.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Snelk3", GetImageAsTexture("decal_snelk_3.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Snelk4", GetImageAsTexture("decal_snelk_4.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Snelk5", GetImageAsTexture("decal_snelk_5.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Snelk6", GetImageAsTexture("decal_snelk_6.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_SnelkMain", GetImageAsTexture("decal_snelk_main.png", InscryptionAPIPlugin.APIAssembly));
+ BaseGameCustomAppearances.Add("CardDecal_Stitches", GetImageAsTexture("decal_stitches.png", InscryptionAPIPlugin.APIAssembly));
+ }
+
+ ///
+ /// Utilize this function to add your Custom Appearance Into the Public Dictionaries.
+ ///
+ ///
+ /// The GUID representing the mod in which the Appearance Came from.
+ /// A tuple representing the Appearence we want to add to the Dictionary.
+ /// We error if any of the passed in fields are Null, and for strings if they are Whitespace as well.
+ public static void AddCustomAppearanceToDictionary(string type, string GUID, (string name, Texture2D texture2D)[] appearancesToAdd)
+ {
+ foreach ((string name, Texture2D texture2D) in appearancesToAdd)
+ {
+ if (texture2D != null && (!name.IsNullOrWhiteSpace() && !type.IsNullOrWhiteSpace() && !GUID.IsNullOrWhiteSpace()))
+ {
+ ModdedCustomAppearancesDictionary.Add(type + "_" + GUID + "_" + name, texture2D);
+ }
+ else
+ {
+ InscryptionAPIPlugin.Logger.LogError($"Failed to add KVP {type + "_" + GUID + "_" + name} to dictionary.");
+ if (texture2D == null)
+ {
+ InscryptionAPIPlugin.Logger.LogError($"Texture2D associated with {type + "_" + GUID + "_" + name} was null.");
+ InscryptionAPIPlugin.Logger.LogError($"Ensure you are passing a non-null Texture2D.");
+ }
+ if (name.IsNullOrWhiteSpace())
+ {
+ InscryptionAPIPlugin.Logger.LogError($"Name ({name}) associated with {type + "_" + GUID + "_" + name} was null.");
+ InscryptionAPIPlugin.Logger.LogError($"Ensure you are passing a non-null or empty name.");
+ }
+ if (type.IsNullOrWhiteSpace())
+ {
+ InscryptionAPIPlugin.Logger.LogError($"Type ({type}) associated with {type + "_" + GUID + "_" + name} was null.");
+ InscryptionAPIPlugin.Logger.LogError($"Ensure you are passing a non-null or empty type.");
+ }
+ if (GUID.IsNullOrWhiteSpace())
+ {
+ InscryptionAPIPlugin.Logger.LogError($"GUID ({GUID}) associated with {type + "_" + GUID + "_" + name} was null.");
+ InscryptionAPIPlugin.Logger.LogError($"Ensure you are passing a non-null or empty GUID.");
+ }
+ }
+ }
+ }
+
+ ///
+ /// A function that gets a Dictionary of all Custom Appearances associated with the passed in Type.
+ ///
+ /// A unique identifier in which you want to get a list of textures that are instantiated with. For example CardDecal for a Card's Decal.
+ /// The results of with the check of x.Key.StartsWith(type). We return in the form of a new containing KVPs from .
+ public static Dictionary GetCustomAppearanceTypeFromDictionary(string type)
+ {
+ return CombinedCustomAppearancesDictionaryPublic.Where(x => x.Key.StartsWith(type)).ToDictionary(x => x.Key, x => x.Value);
+ }
+
+ #endregion
+}
\ No newline at end of file
diff --git a/InscryptionAPI/Helpers/TranspilerHelpers.cs b/InscryptionAPI/Helpers/TranspilerHelpers.cs
index 10a1f563..cf0b1b05 100644
--- a/InscryptionAPI/Helpers/TranspilerHelpers.cs
+++ b/InscryptionAPI/Helpers/TranspilerHelpers.cs
@@ -2,9 +2,17 @@
namespace InscryptionAPI.Helpers;
+///
+/// A Helper Set related to the Transpiler.
+///
public static class TranspilerHelpers
{
- public static void LogCodeInscryptions(this List codes, string prefix = null)
+ ///
+ /// A function used to log OpCode Intructions.
+ ///
+ /// The List of OpCodes to Log.
+ /// An Optional Prefix to help indicate where the Logs Originate, or what the OpCodes relate to.
+ public static void LogCodeInstructions(this List codes, string prefix = null)
{
string p = prefix ?? "";
for (int i = 0; i < codes.Count; i++)
diff --git a/InscryptionAPI/InscryptionAPI.csproj b/InscryptionAPI/InscryptionAPI.csproj
index 27de0776..e543a49e 100644
--- a/InscryptionAPI/InscryptionAPI.csproj
+++ b/InscryptionAPI/InscryptionAPI.csproj
@@ -1,33 +1,68 @@
-
- netframework4.7.2
+ netframework4.7.2
+ win-x64;win-x86;win-arm64;linux-x64;linux-arm;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64
+ InscryptionAPI
+ The Core API for the game Inscryption.
+ 2.24.2
+ Cyantist, IngoH, WhistleWind, Chaosyr and Contibutors
+ true
+ Latest
+ InscryptionAPI
+ full
+ $(NoWarn);AD0001;CS0612;CS8604;CS0252;CS0618;Harmony003;Publicizer001
enable
disable
false
- latest
- true
- full
+ true
+ false
+ false
+ true
false
true
- 2.24.1
-
-
-
- $(NoWarn);AD0001;CS0612;CS8604;CS0252;CS0618;Harmony003;Publicizer001
-
-
-
-
-
TalkingCardGenericPrefab
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -40,4 +75,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "../InscryptionCommunityPatch/InscryptionCommunityPatch.csproj"
+
+ Thunderstore-Package-Elements
+ plugins
+ ..\CHANGELOG.md
+ ..\README.md
+ ..\LICENSE.md
+ Release
+
+ API
+ 2.24.2
+ https://github.com/InscryptionModding/InscryptionAPI/
+ The de-facto standard core API for all Inscryption mods. This lets you create new cards, abilities, challenges, map nodes, starter decks, and more.
+ BepInEx-BepInExPack_Inscryption-5.4.2306;BepInEx-MonoMod_Loader_Inscryption-1.0.0
+
diff --git a/InscryptionAPI/InscryptionAPIPlugin.cs b/InscryptionAPI/InscryptionAPIPlugin.cs
index fc46d62d..cfb540b3 100644
--- a/InscryptionAPI/InscryptionAPIPlugin.cs
+++ b/InscryptionAPI/InscryptionAPIPlugin.cs
@@ -18,6 +18,9 @@
using InscryptionAPI.Totems;
using System.Reflection;
using System.Runtime.CompilerServices;
+using InscryptionAPI.Guid;
+using InscryptionAPI.Helpers;
+using Sirenix.Utilities;
[assembly: InternalsVisibleTo("Assembly-CSharp")]
[assembly: InternalsVisibleTo("Assembly-CSharp.APIPatcher.mm")]
@@ -25,29 +28,69 @@
namespace InscryptionAPI;
+///
+/// The Entry Point to the Inscryption API.
+///
[BepInPlugin(ModGUID, ModName, ModVer)]
[HarmonyPatch]
public class InscryptionAPIPlugin : BaseUnityPlugin
{
+ ///
+ /// The GUID for the Inscryption API, if you depend on this API you'll want to load after it in Awake() or, anywhere before Start().
+ ///
public const string ModGUID = "cyantist.inscryption.api";
- public const string ModName = "InscryptionAPI";
- public const string ModVer = "2.24.1";
+ ///
+ /// This is the Inscryption API's Internal Name, prefer identifying this API with the GUID.
+ ///
+ internal const string ModName = "InscryptionAPI";
+ ///
+ /// This is the Version of the Inscryption API you are using.
+ ///
+ internal const string ModVer = "2.24.2";
+ ///
+ /// The Inscryption API's Location as a Directory.
+ ///
public static string Directory = "";
+ ///
+ /// The API's Assembly for Internal Reference.
+ ///
internal static Assembly APIAssembly { get; private set; } = null;
+ ///
+ /// The Configuration for Overriding the Arrows within Kaycee's Mod Menu's.
+ ///
internal static ConfigEntry configOverrideArrows;
- internal static ConfigEntry configRandomChoiceOrder;
+ ///
+ /// The Configuration for determining whether the Order of Costs in a Cost Choice Node should be Randomized.
+ ///
+ internal static ConfigEntry configRandomCostChoiceOrder;
+ ///
+ /// The Configuration for determining whether the Boss Scenery of Act 1/KCM should be hidden.
+ ///
internal static ConfigEntry configHideAct1BossScenery;
- internal static ConfigEntry configCustomTotemTopTypes;
- internal static ConfigEntry configCustomItemTypes;
+ ///
+ /// This Configuration is used for determining what Totem Top Model should be used in game.
+ ///
+ internal static ConfigEntry configCustomTotemTopModelSelection;
+ ///
+ /// This Configuration is used for determining what Item Model should be used in game.
+ ///
+ internal static ConfigEntry configCustomItemModelSelection;
+ ///
+ /// This Configuration is used for determining whether we should Log Debugging for the TraderCostTier Bug.
+ ///
+ internal static ConfigEntry configEnableTraderCostTierBugDebugLogging;
+ ///
+ /// Prevents API 1.0.0 Versions from Loaing.
+ ///
static InscryptionAPIPlugin()
{
AppDomain.CurrentDomain.AssemblyResolve += static (_, e) =>
{
- if (e.Name.StartsWith("API, Version=1"))
+ if (e.Name.StartsWith("API, Version=1") || e.Name.StartsWith("Cardloader, Version=1"))
{
return APIAssembly ??= typeof(InscryptionAPIPlugin).Assembly;
}
@@ -55,29 +98,52 @@ static InscryptionAPIPlugin()
};
}
+ ///
+ /// Our API's Internal Logger.
+ ///
new internal static ManualLogSource Logger;
-
+ ///
+ /// Our API's Internal Harmony Instance.
+ ///
private readonly Harmony HarmonyInstance = new(ModGUID);
+ ///
+ /// An event of resembling the Scriptable Object Loader Load call.
+ ///
public static event Action ScriptableObjectLoaderLoad;
+ ///
+ /// A simple internal function that invokes our previously typified Action for Loading the ScriptableObjectLoader.
+ ///
+ /// The Type in which to pass to the ScriptableObjectLoader.
internal static void InvokeSOLEvent(Type type)
{
ScriptableObjectLoaderLoad?.Invoke(type);
}
+ ///
+ /// The following runs when the API is enabled by Unity.
+ ///
private void OnEnable()
{
Logger = base.Logger;
Directory = Path.GetDirectoryName(Info.Location);
+ if (TextureHelper.BaseGameCustomAppearancesPublic.IsNullOrEmpty())
+ TextureHelper.InstantiateBaseGameCustomAppearances();
HarmonyInstance.PatchAll(InscryptionAPIPlugin.APIAssembly);
}
+ ///
+ /// The following runs when the API is diabled by Unity.
+ ///
private void OnDisable()
{
HarmonyInstance.UnpatchSelf();
}
+ ///
+ /// The following is used to Resync the API's many lists, e.g. , , , , , , ,
+ ///
internal static void ResyncAll()
{
CardManager.SyncCardList();
@@ -90,6 +156,9 @@ internal static void ResyncAll()
RuleBookManager.SyncRuleBookList();
}
+ ///
+ /// A function we use to check when a plugin is using an Outdated version of the API, if they do we log them with a Warning about it.
+ ///
internal static void CheckForOutdatedPlugins()
{
string outdatedPlugins = "";
@@ -109,16 +178,23 @@ internal static void CheckForOutdatedPlugins()
+ outdatedPlugins + "\nThese mods may not work correctly. If problems arise, please update or disable them!");
}
+ ///
+ /// This is our API's Initializer, we primarily use it to set the internal APIAssembly and create the Configurations to the Configuration File.
+ ///
private void Awake()
{
APIAssembly ??= typeof(InscryptionAPIPlugin).Assembly;
- configCustomTotemTopTypes = Config.Bind("Totems", "Top Types", TotemManager.TotemTopState.CustomTribes, "If Vanilla, don't change totem tops; if CustomTribes, added custom tribes will use custom totem tops; if AllTribes then all totem tops will use a custom top.");
- configCustomItemTypes = Config.Bind("Items", "Types", ConsumableItemManager.ConsumableState.Custom, "If Vanilla, only vanilla items will be used; if Custom, added custom items will use custom models; if All then all items will use a custom model.");
+ configCustomTotemTopModelSelection = Config.Bind("Totems", "Top Types", TotemManager.TotemTopState.CustomTribes, "If Vanilla, don't change totem tops; if CustomTribes, added custom tribes will use custom totem tops; if AllTribes then all totem tops will use a custom top.");
+ configCustomItemModelSelection = Config.Bind("Items", "Types", ConsumableItemManager.ConsumableState.Custom, "If Vanilla, only vanilla items will be used; if Custom, added custom items will use custom models; if All then all items will use a custom model.");
configOverrideArrows = Config.Bind("Menus", "Override Arrows", false, "When true, forces the challenge screen arrows to appear at the top of the screen instead of the sides.");
- configRandomChoiceOrder = Config.Bind("Miscellaneous", "Randomise Cost Choice Order", false, "When true, randomises the order card cost choices are presented in Act 1.");
+ configRandomCostChoiceOrder = Config.Bind("Miscellaneous", "Randomise Cost Choice Order", false, "When true, randomises the order card cost choices are presented in Act 1.");
configHideAct1BossScenery = Config.Bind("Optimization", "Hide Act 1 Scenery", false, "When true bosses will not spawn their scenery. (eg: Prospector's trees) This can improve performance on low-end machines.");
+ configEnableTraderCostTierBugDebugLogging = Config.Bind("Zebugging", "Enable Logging for Info related to the GenerateTradeCardsWithCostTier method", false, "May be of use for debugging issues related to 'GenerateTradeCardsWithCostTier', by how much no clue. Set this to True to enable the Logging.");
}
+ ///
+ /// This is the API's second phase of Initialization, ran after all Awake() calls complete. If you need something both after Awake() and before Start() refer to JSONLoader3's Phase System.
+ ///
private void Start()
{
CheckForOutdatedPlugins();
@@ -129,13 +205,273 @@ private void Start()
CardManager.AuditCardList();
PixelCardManager.Initialise();
PeltManager.CreateDialogueEvents();
- //if (!DialogueManager.CustomDialogue.Exists(x => x.DialogueEvent.id == "Hint_NotEnoughSameColourGemsHint"))
- //{
-
- //}
Logger.LogDebug($"Inserted {DialogueManager.CustomDialogue.Count} dialogue event(s)!");
+ DebugLoggingForGenerateTradeCardsWithCostTier();
+ }
+
+ ///
+ /// A Function in which Logs some Debug related to 'GenerateTradeCardsWithCostTier'. There is more related Logging, this is just the Start of it.
+ ///
+ private void DebugLoggingForGenerateTradeCardsWithCostTier()
+ {
+ foreach (CardInfo info in CardLoader.LearnedCards)
+ {
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ if (info == null)
+ {
+ Logger.LogError("CardLoader.LearnedCards contains a null CardInfo.");
+ continue;
+ }
+
+ Logger.LogDebug($"===== CardInfo: {info.displayedName ?? info.name ?? "null"} =====");
+
+ Logger.LogDebug($"name: {info.name ?? "null"}");
+ Logger.LogDebug($"displayedName: {info.displayedName ?? "null"}");
+ Logger.LogDebug($"displayedNameLocId: {info.displayedNameLocId}");
+ Logger.LogDebug($"description: {info.description ?? "null"}");
+
+ Logger.LogDebug($"baseAttack: {info.baseAttack}");
+ Logger.LogDebug($"baseHealth: {info.baseHealth}");
+
+ Logger.LogDebug($"cost: {info.cost}");
+ Logger.LogDebug($"bonesCost: {info.bonesCost}");
+ Logger.LogDebug($"energyCost: {info.energyCost}");
+ Logger.LogDebug($"gemsCost: {string.Join(", ", info.gemsCost?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+
+ Logger.LogDebug($"cardComplexity: {info.cardComplexity}");
+ Logger.LogDebug($"temple: {info.temple}");
+ Logger.LogDebug($"onePerDeck: {info.onePerDeck}");
+ Logger.LogDebug($"hideAttackAndHealth: {info.hideAttackAndHealth}");
+
+ Logger.LogDebug($"metaCategories: {string.Join(", ", info.metaCategories?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+ Logger.LogDebug($"tribes: {string.Join(", ", info.tribes?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+ Logger.LogDebug($"traits: {string.Join(", ", info.traits?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+
+ Logger.LogDebug($"abilities: {string.Join(", ", info.abilities?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+ Logger.LogDebug($"ascensionAbilities: {string.Join(", ", info.ascensionAbilities?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+ Logger.LogDebug($"specialAbilities: {string.Join(", ", info.specialAbilities?.Select(x => GetGuidAndKey(x)) ?? Enumerable.Empty())}");
+
+ LogAbilityInfos(info, "abilities", info.abilities);
+ LogAbilityInfos(info, "ascensionAbilities", info.ascensionAbilities);
+
+ Logger.LogDebug($"evolveParams: {GetEvolveParams(info.evolveParams)}");
+ Logger.LogDebug($"defaultEvolutionName: {info.defaultEvolutionName ?? "null"}");
+
+ Logger.LogDebug($"tailParams: {GetTailParams(info.tailParams)}");
+ Logger.LogDebug($"iceCubeParams: {GetIceCubeParams(info.iceCubeParams)}");
+
+ Logger.LogDebug($"flipPortraitForStrafe: {info.flipPortraitForStrafe}");
+
+ Logger.LogDebug($"specialStatIcon: {info.specialStatIcon}");
+ Logger.LogDebug($"boon: {info.boon}");
+
+ Logger.LogDebug($"mods: {info.mods?.Count ?? 0}");
+ Logger.LogDebug($"temporaryDecals: {info.temporaryDecals?.Count ?? 0}");
+ Logger.LogDebug($"get_decals: {info.get_decals?.Count ?? 0}");
+
+ Logger.LogDebug($"Calculated Attack: {info.Attack}");
+ Logger.LogDebug($"Calculated Health: {info.Health}");
+ Logger.LogDebug($"Calculated BloodCost: {info.BloodCost}");
+ Logger.LogDebug($"Calculated BonesCost: {info.BonesCost}");
+ Logger.LogDebug($"Calculated EnergyCost: {info.EnergyCost}");
+ Logger.LogDebug($"Calculated Gemified: {info.Gemified}");
+ Logger.LogDebug($"Calculated CostTier: {info.CostTier}");
+ Logger.LogDebug($"Calculated Sacrificable: {info.Sacrificable}");
+ Logger.LogDebug($"Calculated PowerLevel: {info.PowerLevel}");
+ Logger.LogDebug($"Calculated NumAbilities: {info.NumAbilities}");
+
+ Logger.LogDebug($"===== End CardInfo: {info.displayedName ?? info.name ?? "null"} =====");
+ }
+ }
+ LogTradeCardAbilityInfoIssues();
+ }
+
+ ///
+ /// Gets a GUID and Key associated with a Type of Enum from the passed in Enum Value.
+ ///
+ /// The Enum we want to get the String Name of.
+ /// The Enum Type.
+ /// A String representing the Enum either via the GUID system or the Enum System.
+ private string GetGuidAndKey(T value) where T : System.Enum
+ {
+ if (GuidManager.TryGetGuidAndKeyEnumValue(value, out string guid, out string key))
+ return $"{guid}_{key}";
+
+ return value.ToString();
+ }
+
+ ///
+ /// Gets the String Name and DisplayName from a CardInfo.
+ ///
+ /// The Card we want to get the DisplayName of.
+ /// The Card Name and DisplayName of the passed in Card as a String.
+ private string GetCardName(CardInfo card)
+ {
+ if (card == null)
+ return "null";
+
+ return $"{card.name} ({card.DisplayedNameEnglish})";
+ }
+
+ ///
+ /// Gets the String version of the .
+ ///
+ /// The we want to turn into a String.
+ /// The in the form of a String.
+ private string GetEvolveParams(EvolveParams evolveParams)
+ {
+ if (evolveParams == null)
+ return "null";
+
+ return $"turnsToEvolve={evolveParams.turnsToEvolve}, evolution={GetCardName(evolveParams.evolution)}";
+ }
+
+ ///
+ /// Gets the String version of the .
+ ///
+ /// The we want to turn into a String.
+ /// The in the form of a String.
+ private string GetTailParams(TailParams tailParams)
+ {
+ if (tailParams == null)
+ return "null";
+
+ return $"tail={GetCardName(tailParams.tail)}, tailLostPortrait={(tailParams.tailLostPortrait != null ? tailParams.tailLostPortrait.name : "null")}";
+ }
+
+ ///
+ /// Gets the String version of the .
+ ///
+ /// The we want to turn into a String.
+ /// The in the form of a String.
+ private string GetIceCubeParams(IceCubeParams iceCubeParams)
+ {
+ if (iceCubeParams == null)
+ return "null";
+
+ return $"creatureWithin={GetCardName(iceCubeParams.creatureWithin)}";
+ }
+
+ ///
+ /// A function that allows us to Log Ability Infos.
+ ///
+ /// The Card in which bears the AbilityInfos.
+ /// The Source of the AbilityInfos.
+ /// The List of Abilities in which we want to Log.
+ private void LogAbilityInfos(CardInfo card, string source, IEnumerable abilities)
+ {
+ if (abilities == null)
+ {
+ Logger.LogDebug($"{source} AbilityInfo validation: null");
+ return;
+ }
+
+ foreach (Ability ability in abilities)
+ {
+ AbilityInfo abilityInfo = AbilitiesUtil.GetInfo(ability);
+ string abilityId = GetGuidAndKey(ability);
+
+ if (abilityInfo == null)
+ {
+ Logger.LogError($"MISSING AbilityInfo | " + $"card={GetCardName(card)} | " + $"source={source} | " + $"ability={abilityId} | " + $"rawValue={(int)ability}");
+ continue;
+ }
+
+ Logger.LogDebug($"AbilityInfo | " + $"card={GetCardName(card)} | " + $"source={source} | " + $"ability={abilityId} | " + $"rawValue={(int)ability} | " + $"opponentUsable={abilityInfo.opponentUsable} | " + $"passive={abilityInfo.passive} | " + $"activated={abilityInfo.activated} | " + $"powerLevel={abilityInfo.powerLevel} | " + $"canStack={abilityInfo.canStack} | " + $"conduit={abilityInfo.conduit} | " + $"conduitCell={abilityInfo.conduitCell} | " + $"keywordAbility={abilityInfo.keywordAbility} | " + $"rulebookName={abilityInfo.rulebookName ?? "null"}");
+ }
+ }
+
+ ///
+ /// A function we can run at Startup to try and Validate any Trade Issues that may arise from 'GenerateTradeCardsWithCostTier'. Logging is enabled via 'configEnableTraderCostTierBugDebugLogging'.
+ ///
+ private void LogTradeCardAbilityInfoIssues()
+ {
+ List learnedCards = CardLoader.LearnedCards;
+
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ Logger.LogDebug($"Learned card count: {learnedCards.Count}");
+ }
+
+ foreach (CardInfo card in learnedCards)
+ {
+ if (card.temple != CardTemple.Nature)
+ continue;
+
+ int costTier;
+
+ try
+ {
+ costTier = card.CostTier;
+ }
+ catch (Exception ex)
+ {
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ Logger.LogError($"Could not calculate CostTier | " + $"card={GetCardName(card)} | " + $"exception={ex}");
+ }
+ continue;
+ }
+
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ Logger.LogDebug($"Trade candidate | " + $"card={GetCardName(card)} | " + $"tier={costTier} | " + $"bloodCost={card.BloodCost} | " + $"bonesCost={card.BonesCost} | " + $"energyCost={card.EnergyCost} | " + $"abilitiesNull={card.abilities == null}");
+ }
+
+ if (card.abilities == null)
+ {
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ Logger.LogError($"NULL abilities list | " + $"card={GetCardName(card)} | " + $"tier={costTier}");
+ }
+ continue;
+ }
+
+ if (card.abilities.Count == 0)
+ {
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ Logger.LogDebug($"Trade candidate has no abilities | " + $"card={GetCardName(card)} | " + $"tier={costTier}");
+ }
+ continue;
+ }
+
+ foreach (Ability ability in card.abilities)
+ {
+ if (configEnableTraderCostTierBugDebugLogging.Value)
+ {
+ string abilityId = GetGuidAndKey(ability);
+ AbilityInfo abilityInfo;
+
+ try
+ {
+ abilityInfo = AbilitiesUtil.GetInfo(ability);
+ }
+ catch (Exception ex)
+ {
+ Logger.LogError($"AbilitiesUtil.GetInfo threw | " + $"card={GetCardName(card)} | " + $"tier={costTier} | " + $"ability={abilityId} | " + $"rawValue={(int)ability} | " +
+ $"exception={ex}");
+ continue;
+ }
+
+ if (abilityInfo == null)
+ {
+ Logger.LogError($"TRADE CRASH CANDIDATE: Missing AbilityInfo | " + $"card={GetCardName(card)} | " + $"tier={costTier} | " + $"ability={abilityId} | " +
+ $"rawValue={(int)ability} | " + $"reason=AbilitiesUtil.GetInfo returned null; " + $"vanilla code will dereference .opponentUsable");
+ continue;
+ }
+
+ Logger.LogDebug($"Trade ability OK | " + $"card={GetCardName(card)} | " + $"tier={costTier} | " + $"ability={abilityId} | " + $"rawValue={(int)ability} | " +
+ $"opponentUsable={abilityInfo.opponentUsable}");
+ }
+ }
+ }
}
+ ///
+ /// This patches the Kaycee's Mod Menu to resync all Cards and Abilities when entering the run itself before Kaycee's mod transitions you into the run itself..
+ ///
[HarmonyPatch(typeof(AscensionMenuScreens), nameof(AscensionMenuScreens.TransitionToGame))]
[HarmonyPrefix]
private static void SyncCardsAndAbilitiesWhenTransitioningToAscensionGame()
@@ -143,6 +479,9 @@ private static void SyncCardsAndAbilitiesWhenTransitioningToAscensionGame()
ResyncAll();
}
+ ///
+ /// This patches the Main Menu to resync all Cards and Abilities when entering any part of the base game, before the Menu handles the transition.
+ ///
[HarmonyPatch(typeof(MenuController), nameof(MenuController.TransitionToGame))]
[HarmonyPrefix]
private static void SyncCardsAndAbilitiesWhenTransitioningToGame()
diff --git a/InscryptionAPI/Items/ConsumableItemManager.cs b/InscryptionAPI/Items/ConsumableItemManager.cs
index a54a17bb..83bd5b16 100644
--- a/InscryptionAPI/Items/ConsumableItemManager.cs
+++ b/InscryptionAPI/Items/ConsumableItemManager.cs
@@ -10,7 +10,6 @@
namespace InscryptionAPI.Items;
-
public static class ConsumableItemManager
{
public class FullConsumableItemData
@@ -238,7 +237,7 @@ internal static void Initialize()
if (!allFullItemDatas.Exists(x => x.itemData == itemData))
allFullItemDatas.Add(new(itemData));
}
- if (InscryptionAPIPlugin.configCustomItemTypes.Value == ConsumableState.Vanilla)
+ if (InscryptionAPIPlugin.configCustomItemModelSelection.Value == ConsumableState.Vanilla)
{
// Don't change any items!
return;
@@ -258,7 +257,7 @@ internal static void Initialize()
}
// Override vanilla items
- if (InscryptionAPIPlugin.configCustomItemTypes.Value == ConsumableState.All)
+ if (InscryptionAPIPlugin.configCustomItemModelSelection.Value == ConsumableState.All)
{
// Change all base items to use the fallback model!
foreach (ConsumableItemData data in baseConsumableItemsDatas)
diff --git a/InscryptionAPI/Items/ConsumableItemResource.cs b/InscryptionAPI/Items/ConsumableItemResource.cs
index 56f58bfa..14489c10 100644
--- a/InscryptionAPI/Items/ConsumableItemResource.cs
+++ b/InscryptionAPI/Items/ConsumableItemResource.cs
@@ -1,4 +1,5 @@
using DiskCardGame;
+using InscryptionAPI.Helpers;
using UnityEngine;
namespace InscryptionAPI.Items;
diff --git a/InscryptionAPI/Localizing/LocalizationManager.cs b/InscryptionAPI/Localizing/LocalizationManager.cs
index 269104ad..3e61d3c1 100644
--- a/InscryptionAPI/Localizing/LocalizationManager.cs
+++ b/InscryptionAPI/Localizing/LocalizationManager.cs
@@ -50,7 +50,6 @@ public enum FontReplacementType
public static Action OnLanguageLoaded = null;
private static List AlreadyLoadedLanguages = new();
- private static bool FontReplacementDataInitialized = false;
private static List TemporaryFontReplacements = new();
static LocalizationManager()
diff --git a/InscryptionAPI/Masks/MaskBehaviour.cs b/InscryptionAPI/Masks/MaskBehaviour.cs
index ce8fe5db..38f9a072 100644
--- a/InscryptionAPI/Masks/MaskBehaviour.cs
+++ b/InscryptionAPI/Masks/MaskBehaviour.cs
@@ -101,7 +101,6 @@ protected virtual void OverrideSmoothnessValue(MaterialOverride materialOverride
protected virtual void OverrideMetallic(MaterialOverride materialOverride, Material material)
{
-
material.SetFloat("_Metallic", materialOverride.Metallic.Value);
}
diff --git a/InscryptionAPI/Masks/MaskManager.cs b/InscryptionAPI/Masks/MaskManager.cs
index 285d344b..d9700b66 100644
--- a/InscryptionAPI/Masks/MaskManager.cs
+++ b/InscryptionAPI/Masks/MaskManager.cs
@@ -83,7 +83,7 @@ public static CustomMask Override(string guid, string name, LeshyAnimationContro
///
/// GUID of your mod.
/// Name of the mask.
- /// The mask we want to add so we cna tell leshy to put on that specific mask.
+ /// The mask we want to add so we can tell leshy to put on that specific mask.
/// The model the mask will use.
/// .
/// .
diff --git a/InscryptionAPI/Masks/Patches.cs b/InscryptionAPI/Masks/Patches.cs
index bb419dc1..82087a8f 100644
--- a/InscryptionAPI/Masks/Patches.cs
+++ b/InscryptionAPI/Masks/Patches.cs
@@ -1,5 +1,6 @@
using DiskCardGame;
using HarmonyLib;
+using InscryptionAPI.Helpers;
using InscryptionAPI.Items;
using UnityEngine;
diff --git a/InscryptionAPI/PixelCard/PixelCardBehaviours.cs b/InscryptionAPI/PixelCard/PixelCardBehaviours.cs
index ad8a5856..f09b6c4e 100644
--- a/InscryptionAPI/PixelCard/PixelCardBehaviours.cs
+++ b/InscryptionAPI/PixelCard/PixelCardBehaviours.cs
@@ -11,6 +11,7 @@ public override void ApplyAppearance() { }
public virtual Sprite PixelAppearance() { return null; }
public virtual Sprite OverridePixelPortrait() { return null; }
public virtual Sprite OverrideBackground() { return null; }
+ public virtual Sprite OverrideQueuedBackground() { return null; }
public virtual void OnAppearanceApplied() { }
}
diff --git a/InscryptionAPI/PixelCard/PixelCardManager.cs b/InscryptionAPI/PixelCard/PixelCardManager.cs
index dc40ce00..e209745c 100644
--- a/InscryptionAPI/PixelCard/PixelCardManager.cs
+++ b/InscryptionAPI/PixelCard/PixelCardManager.cs
@@ -91,8 +91,9 @@ private static void DecalPatches(PixelCardDisplayer __instance, PlayableCard pla
private static void AddDecalToCard(in PixelCardDisplayer instance, PlayableCard playableCard)
{
- Transform cardElements = instance?.gameObject?.transform?.Find("CardElements");
- if (cardElements == null)
+ Transform cardElements = instance?.cardElements?.transform;
+ Transform queuedCardElements = instance?.queuedCardElements?.transform;
+ if (cardElements == null || queuedCardElements == null)
return;
List existingDecals = new();
@@ -139,6 +140,15 @@ private static void AddDecalToCard(in PixelCardDisplayer instance, PlayableCard
Sprite overridePortrait = pixelBehav.OverridePixelPortrait();
if (overridePortrait != null)
instance.SetPortrait(overridePortrait);
+ // override queued background
+ Sprite overrideQueuedBackground = pixelBehav.OverrideQueuedBackground();
+ if (overrideQueuedBackground != null)
+ {
+ Transform queuedBackground = queuedCardElements.Find("QueuedBackground");
+ SpriteRenderer component = queuedBackground?.GetComponent();
+ if (component != null)
+ component.sprite = overrideQueuedBackground;
+ }
}
UnityObject.Destroy(behav);
}
diff --git a/InscryptionAPI/TS-Build.bat b/InscryptionAPI/TS-Build.bat
new file mode 100644
index 00000000..a4e1ba62
--- /dev/null
+++ b/InscryptionAPI/TS-Build.bat
@@ -0,0 +1,360 @@
+@echo off
+SETLOCAL ENABLEDELAYEDEXPANSION
+
+REM -------------------------------
+REM THIS SCRIPT IS PROVIDED BY CHAOSYR
+REM THIS IS LICENSED UNDER SML-1.0.0
+REM IT CAN BE FOUND HERE: https://stoatgames.icu/license-repository/licenses/sml-1-0-0/#content
+REM IF YOU REUSE THIS FOR YOUR PROJECT, THIS COMMENT BLOCK MUST REMAIN IN TACT FOR LEGAL REASONS!!
+REM -------------------------------
+
+REM -------------------------------
+REM Config
+REM -------------------------------
+set "PrimaryCSProj=%~dp0InscryptionAPI.CSProj"
+
+if not exist "%PrimaryCSProj%" (
+ echo ERROR: Project file not found: "%PrimaryCSProj%"
+ exit /b 1
+)
+
+REM -------------------------------
+REM Read Secondary CSProj's
+REM -------------------------------
+set "SCPRJs="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "SCPRJs=!SCPRJs! %%B"
+)
+set "SCPRJs=!SCPRJs:~1!"
+
+REM -------------------------------
+REM Read TargetFrameworks
+REM -------------------------------
+set "TFs="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "TFs=!TFs! %%B"
+)
+set "TFs=!TFs:~1!"
+
+REM -------------------------------
+REM Read RuntimeIdentifiers
+REM -------------------------------
+set "RIDs="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "RIDs=!RIDs! %%B"
+)
+set "RIDs=!RIDs:~1!"
+
+REM -------------------------------
+REM Read Copy Locations
+REM -------------------------------
+set "CLs="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "CLs=!CLs! %%B"
+)
+set "CLs=!CLs:~1!"
+
+REM -------------------------------
+REM Read Dependency Locations
+REM -------------------------------
+set "DPLs="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "DPLs=!DPLs! %%B"
+)
+set "DPLs=!DPLs:~1!"
+
+REM -------------------------------
+REM Read Build Locations
+REM -------------------------------
+set "BPLs="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "BPLs=!BPLs! %%B"
+)
+set "BPLs=!BPLs:~1!"
+
+REM -------------------------------
+REM Read Markdown File Locations
+REM -------------------------------
+set "CHANGELOG="
+set "README="
+set "LICENSE="
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "CHANGELOG=!line!"
+)
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "README=!line!"
+)
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "LICENSE=!line!"
+)
+
+REM -------------------------------
+REM Read Release Mode
+REM -------------------------------
+
+set "RELEASEMODE="
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "RELEASEMODE=!line!"
+)
+
+if "!RELEASEMODE!"=="" set "RELEASEMODE=Debug"
+
+if /I "!RELEASEMODE!"=="Release" (
+ set "OUTPUT_DIR=%~dp0GITHUB RELEASE"
+) else (
+ if /I "!RELEASEMODE!"=="Debug" (
+ set "OUTPUT_DIR=%~dp0GITHUB PRERELEASE"
+ ) else (
+ set "RELEASEMODE=Debug"
+ set "OUTPUT_DIR=%~dp0GITHUB PRERELEASE"
+ )
+)
+
+REM Normalize full path
+for %%I in ("%OUTPUT_DIR%") do set "OUTPUT_DIR=%%~fI"
+
+REM -------------------------------
+REM Clean output root safely
+REM -------------------------------
+if exist "%OUTPUT_DIR%" rd /s /q "%OUTPUT_DIR%"
+mkdir "%OUTPUT_DIR%"
+
+mkdir "%OUTPUT_DIR%\NET"
+
+set "TMP_ROOT=%OUTPUT_DIR%\_tmp"
+mkdir "%TMP_ROOT%"
+
+set "MANIFEST_ROOT=%OUTPUT_DIR%\_manifest"
+mkdir "%MANIFEST_ROOT%"
+
+REM -------------------------------
+REM Tell User the Settings
+REM -------------------------------
+
+if "!TFs!"=="~1" set "TFs=net6.0"
+if "!RIDs!"=="~1" set "RIDs=win-x64"
+if "!CLs!"=="~1" set "CLs=Thunderstore-Package-Elements"
+if "!DPLs!"=="~1" set "DPLs=exclude"
+if "!BPLs!"=="~1" set "BPLs=root"
+
+echo CONFIGURATION
+echo SecondaryCSProjs: !SCPRJs!
+echo TargetFrameworks: !TFs!
+echo RuntimeIdentifiers: !RIDs!
+echo CopyLocations: !CLs!
+echo DependencyLocations: !DPLs!
+echo CHANGELOGCopyLocation: !CHANGELOG!
+echo READMECopyLocation: !README!
+echo LICENSECopyLocation: !LICENSE!
+echo BuildOutputLocations: !BPLs!
+echo ReleaseMode: !RELEASEMODE!
+
+REM -------------------------------
+REM Fetch Manifest Properties
+REM -------------------------------
+set "NAME="
+set "VERSION="
+set "WEBSITEURL="
+set "DESCRIPTION="
+set "DEPENDENCIES="
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "NAME=!line!"
+)
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "VERSION=!line!"
+)
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "WEBSITEURL=!line!"
+)
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "DESCRIPTION=!line!"
+)
+
+for /f "usebackq tokens=*" %%A in (`type "%PrimaryCSProj%" ^| findstr ""`) do (
+ set "line=%%A"
+ set "line=!line:=!"
+ set "line=!line:=!"
+ set "line=!line:;= !"
+ for %%B in (!line!) do set "DEPENDENCIES=!DEPENDENCIES! %%B"
+)
+set "DEPENDENCIES=!DEPENDENCIES:~1!"
+
+if "!DEPENDENCIES!"=="~1" set "DEPENDENCIES="
+
+set "DEPENDENCYCOUNT=0"
+
+for %%D in (!DEPENDENCIES!) do (
+ set /a DEPENDENCYCOUNT+=1
+)
+
+echo MANIFEST PROPERTIES
+echo NAME: !NAME!
+echo VERSION: !VERSION!
+echo WEBSITEURL: !WEBSITEURL!
+echo DESCRIPTION: !DESCRIPTION!
+echo DEPENDENCIES: !DEPENDENCIES!
+echo DEPENDENCYCOUNT: !DEPENDENCYCOUNT!
+
+REM -------------------------------
+REM Build Manifest File
+REM -------------------------------
+
+set "OUT=%MANIFEST_ROOT%\manifest.json"
+
+(
+ echo {
+ echo "name": "!NAME!",
+ echo "version_number": "!VERSION!",
+ echo "website_url": "!WEBSITEURL!",
+ echo "description": "!DESCRIPTION!",
+ echo "dependencies": [
+) > "!OUT!"
+
+if "!DEPENDENCYCOUNT!"=="0" (
+ echo No Dependencies Skipping
+) else (
+ set "INDEX=0"
+
+ for %%D in (!DEPENDENCIES!) do (
+ set /a INDEX+=1
+
+ if "!INDEX!"=="!DEPENDENCYCOUNT!" (
+ echo "%%D"
+ ) else (
+ echo "%%D",
+ )
+ ) >> "!OUT!"
+)
+
+(
+ echo ]
+ echo }
+) >> "!OUT!"
+
+REM -------------------------------
+REM Build Loop
+REM -------------------------------
+for %%F in (!TFs!) do (
+ for %%R in (!RIDs!) do (
+
+ set "TF_NAME=%%F"
+ set "RID_FLAT=%%R"
+ set "OUT=!TMP_ROOT!\!TF_NAME!-!RID_FLAT!"
+
+ if exist "!OUT!" rd /s /q "!OUT!"
+ mkdir "!OUT!"
+ if "!BPLs!" == "root" (
+ echo Told to Export to root Location we are not making any Directories. Skipping.
+ ) else (
+ for %%B in (!BPLs!) do (
+ mkdir "!OUT!\%%B"
+ )
+ )
+
+ if "!BPLs!"=="root" (
+ echo Publishing NET: %%F / %%R
+ dotnet publish "%PrimaryCSProj%" -c "!RELEASEMODE!" -f "%%F" -r "%%R" -o "!OUT!" || echo Failed %%F/%%R
+ for %%P in (!SCPRJs!) do (
+ echo Publishing NET: %%P
+ dotnet publish %%P -c "!RELEASEMODE!" -f "%%F" -r "%%R" -o "!OUT!" || echo Failed %%F/%%R
+ )
+ ) else (
+ for %%B in (!BPLs!) do (
+ echo Publishing NET: %%F / %%R
+ dotnet publish "%PrimaryCSProj%" -c "!RELEASEMODE!" -f "%%F" -r "%%R" -o "!OUT!\%%B" || echo Failed %%F/%%R
+ for %%P in (!SCPRJs!) do (
+ echo Publishing NET: %%P
+ dotnet publish %%P -c "!RELEASEMODE!" -f "%%F" -r "%%R" -o "!OUT!\%%B" || echo Failed %%F/%%R
+ )
+ )
+ )
+ copy /Y "%~dp0!CHANGELOG!" "!OUT!"
+ copy /Y "%~dp0!README!" "!OUT!"
+ copy /Y "%~dp0!LICENSE!" "!OUT!"
+ copy /Y "%MANIFEST_ROOT%\manifest.json" "!OUT!"
+ if "!DPLs!"=="exclude" (
+ echo Told to Exclude on Dependency Locations as the field became a Empty field. Skipping.
+ ) else (
+ mkdir "!OUT!\plugins"
+ mkdir "!OUT!\plugins\Dependencies"
+ for %%L in (!DPLs!) do (
+ xcopy /E /I /Y "%%L" "!OUT!\plugins\Dependencies"
+ )
+ )
+ for %%L in (!CLs!) do (
+ xcopy /E /I /Y "%%L" "!OUT!"
+ )
+ set "ZIP_OUT=%OUTPUT_DIR%\NET\!TF_NAME!-!RID_FLAT!-!RELEASEMODE!.zip"
+
+ powershell -NoProfile -Command ^ "Compress-Archive -Path '!OUT!\*' -DestinationPath '!ZIP_OUT!' -Force"
+
+ rd /s /q "!OUT!"
+ )
+)
+
+REM -------------------------------
+REM Remove temp root completely
+REM -------------------------------
+rd /s /q "%TMP_ROOT%"
+rd /s /q "%MANIFEST_ROOT%"
+
+echo.
+echo Build completed! Artifacts in:
+echo %OUTPUT_DIR%
+
+ENDLOCAL
\ No newline at end of file
diff --git a/InscryptionAPI/Thunderstore-Package-Elements/!!INSTALLATION!!.md b/InscryptionAPI/Thunderstore-Package-Elements/!!INSTALLATION!!.md
new file mode 100644
index 00000000..7e84e697
--- /dev/null
+++ b/InscryptionAPI/Thunderstore-Package-Elements/!!INSTALLATION!!.md
@@ -0,0 +1,92 @@
+## Getting Started: Installation
+___
+To begin, we'll go over how to install BepInEx, the framework all Inscryption mods use. This is a necessary step to playing modded Inscryption, so be sure to follow this carefully.
+
+**FOR LINUX AND STEAMDECK:** Ensure that the game is set to run using `Proton` in he game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`.
+
+### Installing with a Mod Manager
+1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/).
+2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page.
+3. Run the game via the mod manager.
+
+If you have issues with Mod Managers head to one of these discords;
+
+* **Thunderstore Support Discord:** [Here](https://discord.gg/Fbz54kQAxg)
+* **R2ModMan Support Discord:** [Here](https://discord.gg/R85wjqa4WN)
+* **Gale Mod Manager Support Discord:** [Here](https://discord.gg/sfuWXRfeTt)
+
+### Installing Manually
+1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!**
+2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\Program Files (x86)\Steam\steamapps\common\Inscryption`).
+3. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading.
+4. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder.
+5. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them).
+6. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder.
+7. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder.
+8. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded.
+9. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX;
+ ```
+ BepInEx // These go within the BepInEx root folder
+ |-- config
+ |-- patchers
+ |-- plugins
+ |-- monomod
+ |-- core
+ plugins // Files within go into the created plugin subfolder that was created for the mod
+ |-- Art
+ |-- Scripts
+ |-- MyMod.dll
+ manifest.json // Ignorable, but if kept, goes in plugin subfolder
+ README.md // Ignorable, but if kept, goes in plugin subfolder
+ CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder
+ icon.png // Ignorable, but if kept, goes in plugin subfolder
+ ```
+10. Run the game once more and everything should be correct and working.
+
+### Installing Manually (XBOX Game-Pass)
+1. Install [BepInEx](https://thunderstore.io/package/download/BepInEx/BepInExPack_Inscryption/5.4.2305/) by pressing `Manual Download` and extract the contents into a folder. **Do not extract into the game folder!**
+2. Move the contents of the `BepInExPack_Inscryption` folder into the game folder (where the game executable is; usually found here: `C:\XboxGames\Inscryption\Content`).
+3. Install the following package: [XboxSilencio](https://thunderstore.io/c/inscryption/p/CORE_API_TEAM/GamepassSilencio/), this is a package which aims to solve frictions with XBOX Gamepass specific installations, such as HueyFS related errors.
+4. Run the game. If everything was done correctly, you will see the BepInEx console appear on your desktop. Close the game after it finishes loading.
+5. Install [MonoModLoader](https://inscryption.thunderstore.io/package/BepInEx/MonoMod_Loader_Inscryption/) and extract the contents into a folder.
+6. Move the contents of the `patchers` folder into `BepInEx/patchers` (If any of the mentioned BepInEx folders don't exist, just create them).
+7. Install [Inscryption API](https://inscryption.thunderstore.io/package/API_dev/API/) and extract the contents into a folder.
+8. Move the contents of the `plugins` folder into `BepInEx/plugins` and the contents of the `monomod` folder into the `BepInEx/monomod` folder.
+9. Run the game again. If everything runs correctly, a message will appear in the console telling you that the API was loaded.
+10. For any additional mods create a new subfolder, it can be called anything and extract the zips archive into it and if there is a `BepInEx` folder within the zip instead drop the contents of that folder into the `BepInEx` root for the modding instance. EX;
+ ```
+ BepInEx // These go within the BepInEx root folder
+ |-- config
+ |-- patchers
+ |-- plugins
+ |-- monomod
+ |-- core
+ plugins // Files within go into the created plugin subfolder that was created for the mod
+ |-- Art
+ |-- Scripts
+ |-- MyMod.dll
+ manifest.json // Ignorable, but if kept, goes in plugin subfolder
+ README.md // Ignorable, but if kept, goes in plugin subfolder
+ CHANGELOG.md // Ignorable, but if kept, goes in plugin subfolder
+ icon.png // Ignorable, but if kept, goes in plugin subfolder
+ ```
+11. Run the game once more and everything should be correct and working.
+
+### Installing on the Steam Deck
+1. Download [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/) on the Steam Deck's Desktop Mode and open it from its download using its `AppImage` file.
+2. Download the mods you plan on using and their dependencies.
+3. Go to the setting of the profile you are using for the mods and click `Browse Profile Folder`.
+4. Copy the BepInEx folder, then go to Steam and open Inscryption's Properties menu
+5. Go to `Installed Files` click `Browse` to open the folder containing Inscryption's local files; paste the BepInEx folder there.
+6. Enter Gaming Mode and check 'Force the use of a specific Steam Play compatibility tool' in the Properties menu under `Compatibility`.
+7. Go to the launch parameters and enter `WINEDLLOVERRIDES="winhttp.dll=n,b" %command%`.
+8. Open Inscryption. If everything was done correctly, you should see a console appear on your screen.
+
+### Mac & Linux
+1. Follow the steps here first:
+2. Next do steps 4-10 of the Manual Installation
+3. Your game should be setup for inscryption modding now
+
+If you have any issues with Mac/Linux, Steam Deck, or Manual head over to the discord for this game:
+
+* **Inscryption Modding Discord:** [Here](https://discord.gg/ZQPvfKEpwM)
\ No newline at end of file
diff --git a/InscryptionAPI/Thunderstore-Package-Elements/icon.png b/InscryptionAPI/Thunderstore-Package-Elements/icon.png
new file mode 100644
index 00000000..06e4d5ea
Binary files /dev/null and b/InscryptionAPI/Thunderstore-Package-Elements/icon.png differ
diff --git a/InscryptionAPI/Totems/TotemManager.cs b/InscryptionAPI/Totems/TotemManager.cs
index 12693a05..9a2469c9 100644
--- a/InscryptionAPI/Totems/TotemManager.cs
+++ b/InscryptionAPI/Totems/TotemManager.cs
@@ -24,7 +24,7 @@ private class ItemsUtil_AllConsumables
{
public static IEnumerable Transpiler(IEnumerable instructions)
{
- if (InscryptionAPIPlugin.configCustomTotemTopTypes.Value == TotemTopState.Vanilla)
+ if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.Vanilla)
return instructions;
// === We want to turn this
@@ -114,7 +114,7 @@ private static bool Prefix(TotemTopData data, ref GameObject __result)
__result = customTribeTotem?.Prefab ?? defaultTotemTop.Prefab;
return false;
}
- else if (InscryptionAPIPlugin.configCustomTotemTopTypes.Value == TotemTopState.AllTribes)
+ else if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.AllTribes)
{
__result = defaultTotemTop.Prefab;
return false;
@@ -148,7 +148,7 @@ private static bool Prefix(TotemTopData __instance, ref string __result)
return false;
}
}
- else if (InscryptionAPIPlugin.configCustomTotemTopTypes.Value == TotemTopState.AllTribes)
+ else if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.AllTribes)
{
// All non-custom tribes will use the fallback model
__result = CustomTotemTopID;
@@ -308,7 +308,7 @@ private static void InitializeDefaultTotemTop()
private static void Initialize()
{
// Don't change any totems!
- if (InscryptionAPIPlugin.configCustomTotemTopTypes.Value == TotemTopState.Vanilla)
+ if (InscryptionAPIPlugin.configCustomTotemTopModelSelection.Value == TotemTopState.Vanilla)
return;
if (defaultTotemTop == null)
diff --git a/InscryptionCommunityPatch/Card/ActivatedAbilityHandler3D.cs b/InscryptionCommunityPatch/Card/ActivatedAbilityHandler3D.cs
index 71126799..8ba48712 100644
--- a/InscryptionCommunityPatch/Card/ActivatedAbilityHandler3D.cs
+++ b/InscryptionCommunityPatch/Card/ActivatedAbilityHandler3D.cs
@@ -3,17 +3,34 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Fixes the Activated Ability handler in 3D Environments.
+///
public class ActivatedAbilityHandler3D : ManagedBehaviour
{
+ ///
+ /// The current Icon Group of .
+ ///
public List currentIconGroup;
+ ///
+ /// The current Interactable Group of .
+ ///
public List interactables = new();
+ ///
+ /// A function used to add an Interactable to .
+ ///
+ /// The Interactable that we want to add.
public void AddInteractable(ActivatedAbilityIconInteractable interactable)
{
interactables.Add(interactable);
}
+ ///
+ /// Updates the List of to the passed in List.
+ ///
+ /// The list of Interactable used to replace the current list.
public void UpdateInteractableList(List controllerActiveIcons)
{
interactables.Clear();
@@ -40,7 +57,7 @@ public void UpdateInteractableList(List controllerActiv
}
});
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"[Handler3D] Updated interactable list: [{interactables.Join(interactable => $"GO [{interactable.gameObject}] Ability [{interactable.Ability}]")}]");
}
diff --git a/InscryptionCommunityPatch/Card/ActivatedAbilityIconFix.cs b/InscryptionCommunityPatch/Card/ActivatedAbilityIconFix.cs
index c6289e4f..df4d2558 100644
--- a/InscryptionCommunityPatch/Card/ActivatedAbilityIconFix.cs
+++ b/InscryptionCommunityPatch/Card/ActivatedAbilityIconFix.cs
@@ -4,13 +4,20 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Fixes related to Activated Ability Icons.
+///
[HarmonyPatch]
public static class ActivatedAbilityIconFix
{
- public static bool HasActivatedAbility(this PlayableCard card)
+ ///
+ /// A bool determining whether or not a card has an Activated Ability.
+ ///
+ /// The in which we want to see if it has a Activated Ability or not.
+ /// True if the card has an Activated Ability, false otherwise.
+ private static bool HasActivatedAbility(this PlayableCard card)
{
- return card.Info.Abilities.Exists(elem => AbilitiesUtil.GetInfo(elem).activated)
- || card.temporaryMods.Exists(elem => elem.abilities.Exists(elem2 => AbilitiesUtil.GetInfo(elem2).activated));
+ return card.Info.Abilities.Exists(elem => AbilitiesUtil.GetInfo(elem).activated) || card.temporaryMods.Exists(elem => elem.abilities.Exists(elem2 => AbilitiesUtil.GetInfo(elem2).activated));
}
@@ -30,7 +37,7 @@ private static void FixActivatedAbilitiesOnAnyChange(ref PlayableCard __instance
if (abilityHandler3D.SafeIsUnityNull())
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"[PlayableCard.OnStatsChanged] Adding activated ability handler to card [{__instance.Info.displayedName}]");
abilityHandler3D = __instance.gameObject.AddComponent();
@@ -38,7 +45,7 @@ private static void FixActivatedAbilitiesOnAnyChange(ref PlayableCard __instance
if (!abilityHandler3D.SafeIsUnityNull() && __instance.AbilityIcons.abilityIcons != null)
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"[PlayableCard.OnStatsChanged] -> Resetting icon list for [{__instance.Info.displayedName}]");
abilityHandler3D.UpdateInteractableList(__instance.AbilityIcons.abilityIcons);
diff --git a/InscryptionCommunityPatch/Card/ActivatedAbilityIconInteractable.cs b/InscryptionCommunityPatch/Card/ActivatedAbilityIconInteractable.cs
index ae6961bd..c803add9 100644
--- a/InscryptionCommunityPatch/Card/ActivatedAbilityIconInteractable.cs
+++ b/InscryptionCommunityPatch/Card/ActivatedAbilityIconInteractable.cs
@@ -3,12 +3,24 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Fixes related to how Activated Ability Interactable's are rendered on cards.
+///
public class ActivatedAbilityIconInteractable : MainInputInteractable
{
private Material _renderMaterial;
- private Color _originalColor;
- private readonly Color _enterColor = new(.7f, .7f, .7f, .7f);
- private readonly Color _selectedColor = new(.4f, .4f, .4f, .4f);
+ ///
+ /// The Original Interactable Color.
+ ///
+ public Color _originalColor;
+ ///
+ /// The Color used when the region is entered: ARGB: 178, 178, 178, 178
+ ///
+ public readonly Color _enterColor = new(.7f, .7f, .7f, .7f);
+ ///
+ /// The Color used when the region is selected: ARGB: 102, 102, 102, 102
+ ///
+ public readonly Color _selectedColor = new(.4f, .4f, .4f, .4f);
private PlayableCard _playableCard;
@@ -27,13 +39,23 @@ private void Start()
private bool IsValidPlayableCard => _playableCard && _playableCard.OnBoard && !_playableCard.OpponentCard;
+ ///
+ /// Whether or not an Ability has been assigned, this is done by checking if the Ability is greater than .
+ ///
public bool AbilityAssigned => Ability > Ability.None;
+ ///
+ /// The Ability associated with the Activated Ability.
+ ///
public Ability Ability { get; private set; }
+ ///
+ /// Assigns our new interactable to the passed in Ability.
+ ///
+ /// The ability we want to update the Interactable of.
public void AssignAbility(Ability ability)
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"Icon was previously {Ability} - asking to change to a {ability}");
Ability = ability;
_renderMaterial = GetComponent().material;
@@ -55,15 +77,30 @@ private void OnButtonPressed()
}
}
+ ///
+ /// Set's the color of the Rendering Material related to the Activated Ability.
+ ///
+ ///
public void SetColor(Color color) => _renderMaterial.color = color;
+ ///
+ /// Set's the color to using when the cursor enters the region.
+ ///
public override void OnCursorEnter() => SetColor(_enterColor);
-
+ ///
+ /// Set's the color to using when the cursor exits the region.
+ ///
public override void OnCursorExit() => SetColor(_originalColor);
-
+ ///
+ /// Set's the color to using when the cursor selects the region.
+ ///
public override void OnCursorSelectStart() => SetColor(_selectedColor);
-
+ ///
+ /// Set's the color to using when the cursor unselects the region.
+ ///
public override void OnCursorSelectEnd() => SetColor(_originalColor);
-
+ ///
+ /// Set's the color to using when the cursor drags the region.
+ ///
public override void OnCursorDrag() => SetColor(_originalColor);
}
\ No newline at end of file
diff --git a/InscryptionCommunityPatch/Card/AdditionalIcons.cs b/InscryptionCommunityPatch/Card/AdditionalIcons.cs
index a80c0507..e480e769 100644
--- a/InscryptionCommunityPatch/Card/AdditionalIcons.cs
+++ b/InscryptionCommunityPatch/Card/AdditionalIcons.cs
@@ -5,8 +5,11 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Modifies how cards are rendered so up to 8 sigils can be displayed on a card.
+///
[HarmonyPatch]
-internal class RenderAdditionalSigils // Modifies how cards are rendered so up to 8 sigils can be displayed on a card
+internal class RenderAdditionalSigils
{
private static Vector3 LocalScaleBase3D => SaveManager.SaveFile.IsPart1 ? new(0.2175f, 0.145f, 1f) : new(0.3f, 0.3f, 0.75f);
@@ -21,6 +24,7 @@ private static GameObject NewIconGroup(CardAbilityIcons controller, Transform pa
return newIconGroup;
}
+
private static List NewIcons(GameObject newIconGroup, int slotNum, float act1ScaleMult = 1f)
{
List icons = new();
@@ -75,6 +79,7 @@ private static void AddQuadrupleIconSlotToCard(CardAbilityIcons controller, Tran
icons[2].localPosition = new Vector3(-0.12f, -0.077f, 0f);
icons[3].localPosition = new Vector3(0.12f, -0.077f, 0f);
}
+
private static void AddQuintupleIconSlotToCard(CardAbilityIcons controller, Transform abilityIconParent)
{
GameObject iconGroup5 = NewIconGroup(controller, abilityIconParent, 5);
@@ -98,6 +103,7 @@ private static void AddQuintupleIconSlotToCard(CardAbilityIcons controller, Tran
icons[4].localPosition = new Vector3(0f, -0.125f, 0f);
}
}
+
private static void AddSextupleIconSlotToCard(CardAbilityIcons controller, Transform abilityIconParent)
{
GameObject iconGroup6 = NewIconGroup(controller, abilityIconParent, 6);
@@ -116,6 +122,7 @@ private static void AddSextupleIconSlotToCard(CardAbilityIcons controller, Trans
icons[5].localPosition = new Vector3(0.14f, -0.125f, 0f);
}
}
+
private static void AddSeptupleIconSlotToCard(CardAbilityIcons controller, Transform abilityIconParent)
{
GameObject iconGroup7 = NewIconGroup(controller, abilityIconParent, 7);
@@ -139,6 +146,7 @@ private static void AddSeptupleIconSlotToCard(CardAbilityIcons controller, Trans
icons[6].localPosition = new Vector3(0.28f, -0.125f, 0f);
}
}
+
private static void AddOctupleIconSlotToCard(CardAbilityIcons controller, Transform abilityIconParent)
{
GameObject iconGroup8 = NewIconGroup(controller, abilityIconParent, 8);
@@ -201,6 +209,7 @@ private static GameObject NewPixelIconGroup(PixelCardAbilityIcons controller, Tr
return newIconGroup;
}
+
private static List NewPixelIcons(GameObject newIconGroup, string newIconName, float scaleMult = 1f)
{
List icons = new();
@@ -235,6 +244,7 @@ private static void AddTriplePixelicon(PixelCardAbilityIcons controller, Transfo
icons[1].localPosition = new Vector3(0f, 0f, 0f);
icons[2].localPosition = new Vector3(0.12f, 0f, 0f);
}
+
private static void AddQuadruplePixelIcon(PixelCardAbilityIcons controller, Transform pixelParent)
{
GameObject pixelIconGroup4 = NewPixelIconGroup(controller, pixelParent, 4);
@@ -249,6 +259,7 @@ private static void AddQuadruplePixelIcon(PixelCardAbilityIcons controller, Tran
icons[2].localPosition = new Vector3(-0.08f, -0.06f, 0f);
icons[3].localPosition = new Vector3(0.07f, -0.06f, 0f);
}
+
private static void AddQuintuplePixelIcon(PixelCardAbilityIcons controller, Transform pixelParent)
{
GameObject pixelIconGroup5 = NewPixelIconGroup(controller, pixelParent, 5);
@@ -265,6 +276,7 @@ private static void AddQuintuplePixelIcon(PixelCardAbilityIcons controller, Tran
icons[3].localPosition = new Vector3(-0.08f, -0.06f, 0f);
icons[4].localPosition = new Vector3(0.07f, -0.06f, 0f);
}
+
private static void AddSextuplePixelIcon(PixelCardAbilityIcons controller, Transform pixelParent)
{
GameObject pixelIconGroup6 = NewPixelIconGroup(controller, pixelParent, 6);
@@ -277,6 +289,7 @@ private static void AddSextuplePixelIcon(PixelCardAbilityIcons controller, Trans
icons[4].localPosition = new Vector3(0f, -0.04f, 0f);
icons[5].localPosition = new Vector3(0.12f, -0.04f, 0f);
}
+
private static void AddSeptuplePixelIcon(PixelCardAbilityIcons controller, Transform pixelParent)
{
GameObject pixelIconGroup7 = NewPixelIconGroup(controller, pixelParent, 7);
@@ -297,6 +310,7 @@ private static void AddSeptuplePixelIcon(PixelCardAbilityIcons controller, Trans
icons[5].localPosition = new Vector3(0f, -0.04f, 0f);
icons[6].localPosition = new Vector3(0.08f, -0.04f, 0f);
}
+
private static void AddOctuplePixelIcon(PixelCardAbilityIcons controller, Transform pixelParent)
{
GameObject pixelIconGroup8 = NewPixelIconGroup(controller, pixelParent, 8);
diff --git a/InscryptionCommunityPatch/Card/ArtPatches.cs b/InscryptionCommunityPatch/Card/ArtPatches.cs
index ec5a0482..d11e63b4 100644
--- a/InscryptionCommunityPatch/Card/ArtPatches.cs
+++ b/InscryptionCommunityPatch/Card/ArtPatches.cs
@@ -4,8 +4,14 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Patches in our custom Icons for Sigils, and Cards that are missing Icons.
+///
internal static class CommunityArtPatches
{
+ ///
+ /// The 3D Act Icons to Patch in.
+ ///
internal static readonly List regularIconsToPatch = new()
{
Ability.ActivatedDealDamage,
@@ -29,6 +35,9 @@ internal static class CommunityArtPatches
Ability.SquirrelStrafe
};
+ ///
+ /// The 2D Act Art Icons to Patch in.
+ ///
internal static readonly List gbcIconsToPatch = new()
{
Ability.ConduitSpawnGems,
@@ -62,6 +71,10 @@ internal static class CommunityArtPatches
Ability.SquirrelOrbit,
Ability.DrawVesselOnHit
};
+
+ ///
+ /// The 3D Act Card's to Patch the Artwork of.
+ ///
internal static readonly List regularCardsToPatch = new()
{
"Ant",
@@ -83,6 +96,9 @@ internal static class CommunityArtPatches
"Tail_Insect",
};
+ ///
+ /// Handles Patching in the Community Patches artwork.
+ ///
internal static void PatchCommunityArt()
{
System.Reflection.Assembly ass = typeof(CommunityArtPatches).Assembly;
@@ -95,7 +111,7 @@ internal static void PatchCommunityArt()
foreach (string name in regularCardsToPatch)
CardManager.BaseGameCards.CardByName(name).SetPixelPortrait(TextureHelper.GetImageAsTexture($"{name}_pixel.png", ass));
- if (PatchPlugin.undeadCatEmission.Value)
+ if (PatchPlugin.configEnforceUndeadCatToHaveARedEmission.Value)
{
CardManager.BaseGameCards.CardByName("CatUndead")
.SetEmissivePortrait(TextureHelper.GetImageAsTexture("CatUndead_emission.png", ass))
diff --git a/InscryptionCommunityPatch/Card/CardCostRender.cs b/InscryptionCommunityPatch/Card/CardCostRender.cs
index 1537c96c..5085de31 100644
--- a/InscryptionCommunityPatch/Card/CardCostRender.cs
+++ b/InscryptionCommunityPatch/Card/CardCostRender.cs
@@ -8,6 +8,9 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Fixes the Rendering related to a Card's Cost.
+///
[HarmonyPatch]
public static class CardCostRender
{
@@ -32,10 +35,15 @@ public static Texture2D GetTextureByName(string key)
AssembledTextures.Add(key, texture);
return texture;
}
-
+
///
/// Creates a sprite that combines all of a card's play costs.
///
+ /// The in which to get the Card's Cost from.
+ /// The in which to get the Card's Cost from.
+ /// The type of Sprite we are trying to combine.
+ /// The amount of spacing to use when combing a Card's Cost in the Vertical.
+ /// A Combined Cost Sprite that is Vertically stacked.
public static Sprite FinalCostSprite(CardInfo cardInfo, PlayableCard playableCard, TextureHelper.SpriteType spriteType, int yStep)
{
Texture2D baseTexture;
@@ -78,16 +86,16 @@ private static void CreateFullCostSprite(CardDisplayer __instance, CardRenderInf
{
__instance.costRenderer.sprite = FinalCostSprite(renderInfo.baseInfo, playableCard, TextureHelper.SpriteType.OversizedCostDecal, 28);
}
- else if (__instance is PixelCardDisplayer pixelDisplay && PatchPlugin.act2CostRender.Value)
+ else if (__instance is PixelCardDisplayer pixelDisplay && PatchPlugin.configUseAPIAct2CostRender.Value)
{
- if (PatchPlugin.act2VanillaStyle.Value)
+ if (PatchPlugin.configDisplayVanillaStyleAct2CostIcons.Value)
{
- __instance.costRenderer.sprite = Part2CardCostRender.FinalVanillaCostSprite(pixelDisplay, renderInfo.baseInfo, playableCard, !PatchPlugin.rightAct2Cost.Value);
+ __instance.costRenderer.sprite = Part2CardCostRender.FinalVanillaCostSprite(pixelDisplay, renderInfo.baseInfo, playableCard, !PatchPlugin.configDisplayAct2CostInTheTopRightCorner.Value);
}
else
{
__instance.costRenderer.sprite = FinalCostSprite(renderInfo.baseInfo, playableCard,
- PatchPlugin.rightAct2Cost.Value ? TextureHelper.SpriteType.Act2CostDecalRight : TextureHelper.SpriteType.Act2CostDecalLeft, 8);
+ PatchPlugin.configDisplayAct2CostInTheTopRightCorner.Value ? TextureHelper.SpriteType.Act2CostDecalRight : TextureHelper.SpriteType.Act2CostDecalLeft, 8);
}
}
}
@@ -100,7 +108,7 @@ private static bool Part1CardCostDisplayerPatch(CardDisplayer __instance, ref Sp
{
return false;
}
- if (__instance is PixelCardDisplayer && PatchPlugin.act2CostRender.Value)
+ if (__instance is PixelCardDisplayer && PatchPlugin.configUseAPIAct2CostRender.Value)
{
return false;
}
diff --git a/InscryptionCommunityPatch/Card/GiantCardEmissionAspectFix.cs b/InscryptionCommunityPatch/Card/GiantCardEmissionAspectFix.cs
index eb41d873..f3f1da7c 100644
--- a/InscryptionCommunityPatch/Card/GiantCardEmissionAspectFix.cs
+++ b/InscryptionCommunityPatch/Card/GiantCardEmissionAspectFix.cs
@@ -9,7 +9,7 @@ namespace InscryptionCommunityPatch.Card;
[HarmonyPatch]
internal class GiantCardEmissionAspectFix {
///
- /// Changes the emissioner render camera's aspect ratio for Giant cards so emission texture don't appear stretched.
+ /// Changes the emission render camera's aspect ratio for Giant cards so emission texture don't appear stretched.
/// Aspect number taken from the base texture renderer's aspect ratio.
///
[HarmonyPostfix, HarmonyPatch(typeof(CardRenderCamera), nameof(CardRenderCamera.TryCreateCameraForLiveRender))]
diff --git a/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs b/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs
index 31e30a69..23a44a2b 100644
--- a/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs
+++ b/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs
@@ -4,6 +4,9 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Makes it so that Merged Sigils are shown on the Bottom of the Card.
+///
[HarmonyPatch]
public class MergedSigilOnBottom
{
@@ -22,7 +25,7 @@ private static bool DontPlaceCardModIcons_IfShowOnBottom(CardAbilityIcons __inst
{
// If we are showing card modifications sigils on the bottom, we don't allow the
// AppyAbilitiesToIcons method to do anything
- if (PatchPlugin.configMergeOnBottom.Value && PatchPlugin.configRemovePatches.Value && iconMat == __instance.emissiveIconMat)
+ if (PatchPlugin.configMergeSigilsOnBottom.Value && PatchPlugin.configRemoveSigilPatchesFromCards.Value && iconMat == __instance.emissiveIconMat)
{
foreach (AbilityIconInteractable icon in icons) {
icon.gameObject.SetActive(false);
@@ -40,9 +43,9 @@ private static void MoveMergeIconsToDefaultGroup_IfShowOnBottom(List de
// This is the first time that the default abilities list is used once it has been built
// What we want to do is take all of the abilities from the merge group and move them to the default group
// if the "show merged icons on bottom" setting is active.
- if (PatchPlugin.configMergeOnBottom.Value) {
+ if (PatchPlugin.configMergeSigilsOnBottom.Value) {
defaultAbilities.AddRange(mergeAbilities);
- if (PatchPlugin.configRemovePatches.Value) {
+ if (PatchPlugin.configRemoveSigilPatchesFromCards.Value) {
mergeAbilities.Clear();
}
}
@@ -53,14 +56,14 @@ private static void MoveMergeIconsToDefaultGroup_IfShowOnBottom(List de
[HarmonyPostfix]
private static void RepositionAndRetextureMergedIcons_IfShowOnBottom(ref CardInfo info, ref AbilityInfo ability, ref AbilityIconInteractable __instance)
{
- if (PatchPlugin.configMergeOnBottom.Value && info != null && info.Mods.Count > 0) {
+ if (PatchPlugin.configMergeSigilsOnBottom.Value && info != null && info.Mods.Count > 0) {
List MergeSigils = info.Mods.FindAll(x => x.fromCardMerge);
if (MergeSigils.Count > 0) {
foreach (CardModificationInfo mod in MergeSigils) {
// if ability whose icon we're loading came from a card merge mod
if (mod.abilities.Contains(ability.ability) && (__instance.name == "AbilityIcon" || __instance.name == "DefaultIcons_1Ability")) {
- if (PatchPlugin.configRemovePatches.Value) {
+ if (PatchPlugin.configRemoveSigilPatchesFromCards.Value) {
__instance.SetMaterial(Singleton.Instance.totemIconMat);
if (__instance.GetComponentInParent() != null)
__instance.GetComponentInParent().enabled = true;
diff --git a/InscryptionCommunityPatch/Card/MissingSquirrelTribeIconFix.cs b/InscryptionCommunityPatch/Card/MissingSquirrelTribeIconFix.cs
index f267a6d6..b8df2eb3 100644
--- a/InscryptionCommunityPatch/Card/MissingSquirrelTribeIconFix.cs
+++ b/InscryptionCommunityPatch/Card/MissingSquirrelTribeIconFix.cs
@@ -7,6 +7,9 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Patches in the Missing Squirrel Tribe Icon.
+///
[HarmonyPatch]
public class MissingSquirrelTribeIconFix
{
@@ -80,7 +83,7 @@ private static bool ShowTribeOnCard(CardInfo info, Tribe tribe)
}
if (tribe == Tribe.Squirrel)
{
- return PatchPlugin.configShowSquirrelTribeOnCards.Value;
+ return PatchPlugin.configCustomSquirrelTribeIconToShowOnCards.Value;
}
return true;
diff --git a/InscryptionCommunityPatch/Card/Part1CostEmissionMaskRender.cs b/InscryptionCommunityPatch/Card/Part1CostEmissionMaskRender.cs
index a1e6d639..a1378ed4 100644
--- a/InscryptionCommunityPatch/Card/Part1CostEmissionMaskRender.cs
+++ b/InscryptionCommunityPatch/Card/Part1CostEmissionMaskRender.cs
@@ -29,7 +29,7 @@ public static SpriteRenderer Verify3DCostEmissionMaskRenderer(CardDisplayer3D ca
}
else {
// disable if config is false ; otherwise toggle based on appearance of emissive portrait
- result.gameObject.SetActive(PatchPlugin.configCostMask.Value && emissionEnabled);
+ result.gameObject.SetActive(PatchPlugin.configDisplayEmissionsUnderCostIcons.Value && emissionEnabled);
}
return result;
diff --git a/InscryptionCommunityPatch/Card/Part2CardCostRender.cs b/InscryptionCommunityPatch/Card/Part2CardCostRender.cs
index 5330d53e..403c2b81 100644
--- a/InscryptionCommunityPatch/Card/Part2CardCostRender.cs
+++ b/InscryptionCommunityPatch/Card/Part2CardCostRender.cs
@@ -27,7 +27,7 @@ public static class Part2CardCostRender
public static event Action> UpdateVanillaPlayableCardCost;
- public static bool RightAct2Cost => PatchPlugin.rightAct2Cost.Value;
+ public static bool RightAct2Cost => PatchPlugin.configDisplayAct2CostInTheTopRightCorner.Value;
public static Sprite FinalVanillaCostSprite(
PixelCardDisplayer display,
diff --git a/InscryptionCommunityPatch/Card/SacrificeTokensFix.cs b/InscryptionCommunityPatch/Card/SacrificeTokensFix.cs
index 409e5396..139dcdc5 100644
--- a/InscryptionCommunityPatch/Card/SacrificeTokensFix.cs
+++ b/InscryptionCommunityPatch/Card/SacrificeTokensFix.cs
@@ -4,9 +4,14 @@
namespace InscryptionCommunityPatch.Card;
-public static class SacrificeTokensFix // Allows blood costs over 4 to work properly
+///
+/// Allows blood costs over 4 to work properly
+///
+public static class SacrificeTokensFix
{
- // modders can access this to change increase/decrease the amount of tokens added
+ ///
+ /// Modders can access this to change increase/decrease the amount of tokens added
+ ///
public static int amountOfNewTokens = 20;
[HarmonyPatch(typeof(BoardManager3D), nameof(BoardManager3D.Start))]
diff --git a/InscryptionCommunityPatch/Card/StackAbilityIcons.cs b/InscryptionCommunityPatch/Card/StackAbilityIcons.cs
index 684847d3..17650cde 100644
--- a/InscryptionCommunityPatch/Card/StackAbilityIcons.cs
+++ b/InscryptionCommunityPatch/Card/StackAbilityIcons.cs
@@ -7,6 +7,9 @@
namespace InscryptionCommunityPatch.Card;
+///
+/// Adds Handling for Stacking Abilities of the same type.
+///
[HarmonyPatch]
public static class StackAbilityIcons
{
@@ -25,6 +28,7 @@ public static class StackAbilityIcons
TextureHelper.GetImageAsTexture("Stack_8.png", typeof(StackAbilityIcons).Assembly),
TextureHelper.GetImageAsTexture("Stack_9.png", typeof(StackAbilityIcons).Assembly)
};
+
private static readonly Texture2D[] MEDIUM_NUMBER_TEXTURES = new Texture2D[]
{
TextureHelper.GetImageAsTexture("Stack_0_med.png", typeof(StackAbilityIcons).Assembly),
@@ -38,6 +42,7 @@ public static class StackAbilityIcons
TextureHelper.GetImageAsTexture("Stack_8_med.png", typeof(StackAbilityIcons).Assembly),
TextureHelper.GetImageAsTexture("Stack_9_med.png", typeof(StackAbilityIcons).Assembly)
};
+
private static readonly Sprite[] GBC_NUMBER_SPRITES = new Sprite[]
{
GetGBCNumberSprite(1),
@@ -54,7 +59,7 @@ public static class StackAbilityIcons
private static Sprite GetGBCNumberSprite(int number)
{
string stackGBC = "stack_gbc.png";
- if (!PatchPlugin.act2StackIconType.Value)
+ if (!PatchPlugin.configAct2StackIconNumberStyle.Value)
stackGBC = "stack_gbc_alt.png";
Texture2D texture = TextureHelper.GetImageAsTexture(stackGBC, typeof(StackAbilityIcons).Assembly);
@@ -297,7 +302,7 @@ private static void ClearStackableIcons(ref List __result, CardInfo inf
{
int preDistinctCount = __result.Count;
__result = __result.Distinct().ToList();
- if (PatchPlugin.doubleStackSplit.Value && __result.Count == 1 && preDistinctCount == 2 && AbilitiesUtil.GetInfo(__result[0]).canStack)
+ if (PatchPlugin.configDisplayStackableSigilsSeparately.Value && __result.Count == 1 && preDistinctCount == 2 && AbilitiesUtil.GetInfo(__result[0]).canStack)
{
__result.Add(__result[0]);
}
@@ -340,7 +345,7 @@ private static void AddIconNumber(Ability ability, CardInfo info, PlayableCard c
if (count > 1) // we have a stack and need to add an override
{
- if (PatchPlugin.doubleStackSplit.Value && count == 2 && count == baseAbilities.Count)
+ if (PatchPlugin.configDisplayStackableSigilsSeparately.Value && count == 2 && count == baseAbilities.Count)
__instance.SetIcon(__instance.LoadIcon(info, ai, card != null && card.OpponentCard));
else
__instance.SetIcon(PatchTexture(ability, (int)count));
@@ -374,7 +379,7 @@ public static bool RenderPixelAbilityStacks(PixelCardAbilityIcons __instance, Li
if (grps.Count > 0 && grps.Count - 1 < abilityIconGroups.Count) // if there are displayable sigils and there are enough icon groups
{
// if there is only 1 ability and there are two stacks of it, render it twice
- if (PatchPlugin.doubleStackSplit.Value && grps.Count == 1 && grps[0].Item2 == 2/* && AbilitiesUtil.GetInfo(grps[0].Item1).canStack*/)
+ if (PatchPlugin.configDisplayStackableSigilsSeparately.Value && grps.Count == 1 && grps[0].Item2 == 2/* && AbilitiesUtil.GetInfo(grps[0].Item1).canStack*/)
{
//PatchPlugin.Logger.LogDebug($"Displaying {grps[0].Item1} twice");
grps[0] = new Tuple(grps[0].Item1, 1);
diff --git a/InscryptionCommunityPatch/Card/TempModDecalsFix.cs b/InscryptionCommunityPatch/Card/TempModDecalsFix.cs
index 8fb0cc47..5f17ae5d 100644
--- a/InscryptionCommunityPatch/Card/TempModDecalsFix.cs
+++ b/InscryptionCommunityPatch/Card/TempModDecalsFix.cs
@@ -7,7 +7,9 @@
namespace InscryptionCommunityPatch.Card;
-// Lets you add and remove decals via temporary mods
+///
+/// Lets you add and remove decals via temporary mods
+///
[HarmonyPatch]
internal class TempModDecalsFix
{
@@ -22,6 +24,7 @@ private static void RemoveTemporaryModsWithDecals(PlayableCard __instance, CardM
if (cardModificationInfo != null)
__instance.Info.Mods.Remove(cardModificationInfo);
}
+
[HarmonyPatch(typeof(PlayableCard), nameof(PlayableCard.AddTemporaryMod))]
[HarmonyTranspiler]
private static IEnumerable AddTemporaryDecalsWithDecals(IEnumerable instructions)
@@ -50,6 +53,7 @@ private static IEnumerable AddTemporaryDecalsWithDecals(IEnumer
return codes;
}
+
private static void AddDecalIdsToMods(PlayableCard card, CardModificationInfo tempMod)
{
// only interested in adding decals, thank you very much
diff --git a/InscryptionCommunityPatch/Card/TempModPixelSigilsFix.cs b/InscryptionCommunityPatch/Card/TempModPixelSigilsFix.cs
index fe23143d..e66f7ea8 100644
--- a/InscryptionCommunityPatch/Card/TempModPixelSigilsFix.cs
+++ b/InscryptionCommunityPatch/Card/TempModPixelSigilsFix.cs
@@ -6,7 +6,9 @@
namespace InscryptionCommunityPatch.Card;
-// Lets you add and remove decals via temporary mods
+///
+/// Lets you add and remove decals via temporary mods
+///
[HarmonyPatch]
public class TempModPixelSigilsFix
{
@@ -30,6 +32,12 @@ private static IEnumerable AddTemporaryMods(IEnumerable
+ /// This is used to Handle the Render of Temporary Sigils to the Card.
+ ///
+ /// The of the Card we are trying to apply the temporary sigils to.
+ /// The in which we want to apply the temporary sigils to.
+ /// A list of Temporary Abilities after handling the rendering of them.
public static List RenderTemporarySigils(CardInfo info, PlayableCard card)
{
if (card == null)
diff --git a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act1LatchAbilityFix.cs b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act1LatchAbilityFix.cs
index 625325b3..bad566ca 100644
--- a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act1LatchAbilityFix.cs
+++ b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act1LatchAbilityFix.cs
@@ -78,7 +78,7 @@ private static IEnumerator Postfix(IEnumerator enumerator, Latch __state, bool w
List validTargets = BoardManager.Instance.AllSlotsCopy;
validTargets.RemoveAll(slot => slot.Card == null || slot.Card.Dead || __state.CardHasLatchMod(slot.Card) || slot.Card == __state.Card);
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
{
PatchPlugin.Logger.LogDebug($"[LatchFix] Started death, latch name: [{__state.name}]");
PatchPlugin.Logger.LogDebug("[LatchFix] Count of Valid Targets : " + validTargets.Count);
@@ -174,7 +174,7 @@ private static IEnumerator Postfix(IEnumerator enumerator, Latch __state, bool w
};
mod.SetExtendedProperty("LatchMod", true);
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"[LatchFix] Selected card name [{selectedSlot.Card.name}]");
selectedSlot.Card.AddTemporaryMod(mod);
diff --git a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act2ShapeshifterPatches.cs b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act2ShapeshifterPatches.cs
index 2d5cf5ab..8b797f7d 100644
--- a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act2ShapeshifterPatches.cs
+++ b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/Act2ShapeshifterPatches.cs
@@ -54,13 +54,13 @@ public static List GetIjiraqDisguises()
{
if (SaveManager.SaveFile.IsPart2)
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"GetIjiraqDisguises: Act2:{SaveData.Data.collection.CardInfos.Count}");
return new(SaveData.Data.collection.CardInfos);
}
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"GetIjiraqDisguises: DeckCount:{RunState.Run.playerDeck.Cards.Count}");
return new(RunState.Run.playerDeck.Cards);
diff --git a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryInteractionFixes.cs b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryInteractionFixes.cs
index 0c47c001..b7e80421 100644
--- a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryInteractionFixes.cs
+++ b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryInteractionFixes.cs
@@ -63,7 +63,7 @@ public static IEnumerator NewFireAtOpposingSlot(Sentry instance, PlayableCard ot
// Check if the animation is paused then unpause it
if (instance.Card.Anim.Anim.speed == 0f)
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"{instance.Card} is frozen, unpausing animation.");
midCombat = true; // indicates that we need to restart the attack animation at the end of the sequence
diff --git a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryPackMuleFixes.cs b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryPackMuleFixes.cs
index ce02a3c3..9658b7ab 100644
--- a/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryPackMuleFixes.cs
+++ b/InscryptionCommunityPatch/Card/Vanilla Ability Patches/SentryPackMuleFixes.cs
@@ -28,7 +28,7 @@ private static IEnumerator FixPackNotExisting(IEnumerator enumerator, PackMule _
{
if (__instance.pack == null)
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"{__instance.PlayableCard.name} died before fully resolving on board, instantiating pack.");
// Instantiates the pack object if it's null
@@ -44,7 +44,7 @@ private static IEnumerator FixPackNotExisting(IEnumerator enumerator, PackMule _
yield return new WaitUntil(() => !Tween.activeTweens.Exists((TweenBase t) => t.targetInstanceID == __instance.PlayableCard.transform.GetInstanceID()));
__instance.pack.SetParent(__instance.PlayableCard.transform);
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"Pack has been instantiated. Reality has been saved.");
}
yield return enumerator;
diff --git a/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj b/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj
index 611bf61a..ba313073 100644
--- a/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj
+++ b/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj
@@ -1,38 +1,55 @@
-
- netframework4.7.2
+ netframework4.7.2
+ win-x64;win-x86;win-arm64;linux-x64;linux-arm;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64
+ InscryptionCommunityPatch
+ The Community Patches For Inscryption which fixes a ton of bugs with the underlying game and adds some new functionality to it.
+ 2.24.2
+ Cyantist, IngoH, WhistleWind, Chaosyr and Contibutors
+ true
+ Latest
+ InscryptionCommunityPatch
+ full
+ $(NoWarn);AD0001;CS0612;CS8604;CS0252;CS0618;Harmony003;Publicizer001
enable
disable
false
- latest
- true
- full
+ true
+ false
+ false
+ true
false
- 2.24.0
+ true
-
- $(NoWarn);AD0001;CS0612;CS8604;CS0252;CS0618;Harmony003;Publicizer001
-
-
-
+
-
+
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/InscryptionCommunityPatch/InscryptionCommunityPatchPlugin.cs b/InscryptionCommunityPatch/InscryptionCommunityPatchPlugin.cs
index 2ddf4520..60c134d0 100644
--- a/InscryptionCommunityPatch/InscryptionCommunityPatchPlugin.cs
+++ b/InscryptionCommunityPatch/InscryptionCommunityPatchPlugin.cs
@@ -14,55 +14,132 @@
namespace InscryptionCommunityPatch;
+///
+/// The Entry Point for the Community Patch.
+///
[BepInPlugin(ModGUID, ModName, ModVer)]
[BepInDependency("cyantist.inscryption.api")]
public class PatchPlugin : BaseUnityPlugin
{
+ ///
+ /// The GUID for the Inscryption Community Patch, if you depend on this set of Patches and their associated code, you'll want to load after it in Awake().
+ ///
public const string ModGUID = "community.inscryption.patch";
+ ///
+ /// This is the Inscryption Community Patch's Internal Name, prefer identifying the Community Patch with the GUID.
+ ///
public const string ModName = "InscryptionCommunityPatch";
- public const string ModVer = "2.24.0";
-
+ ///
+ /// This is the Version of the Inscryption Community Patch you are using.
+ ///
+ public const string ModVer = "2.24.2";
+
+ ///
+ /// This is the Plugin Instance associated with the Inscryption Community Patch.
+ ///
internal static PatchPlugin Instance;
- internal static ConfigEntry configEnergy;
- internal static ConfigEntry configDrone;
- internal static ConfigEntry configMox;
- internal static ConfigEntry configDroneMox;
- internal static ConfigEntry configShowSquirrelTribeOnCards;
+ ///
+ /// Configure whether Energy should refresh or not. Refresh meaning the per-match removal of the Energy you have acquired.
+ ///
+ internal static ConfigEntry configEnergyPerMatchCleanUp;
+ ///
+ /// Configure whether the Energy Drone should be enabled or not.
+ ///
+ internal static ConfigEntry configEnergyDrone;
+ ///
+ /// Configure whether Mox should refresh or not. Refresh meaning the per-match removal of the Mox you have acquired.
+ ///
+ internal static ConfigEntry configMoxPerMatchCleanup;
+ ///
+ /// Configure whether the Mox Drone should be enabled or not.
+ ///
+ internal static ConfigEntry configMoxDrone;
+ ///
+ /// Configure whether the Act 3 Drone or Scale Drone should be used within Act 1.
+ ///
+ internal static ConfigEntry configUtilizeDefaultDrone;
+ ///
+ /// Configure whether the Bones Display is active in Act 3 or not.
+ ///
internal static ConfigEntry configAct3Bones;
-
- internal static ConfigEntry configCostMask;
- internal static ConfigEntry configResetEyes;
- internal static ConfigEntry undeadCatEmission;
-
- internal static ConfigEntry rightAct2Cost;
- internal static ConfigEntry act2CostRender;
- internal static ConfigEntry act2VanillaStyle;
-
- internal static ConfigEntry doubleStackSplit;
-
- internal static ConfigEntry act2StackIconType;
-
- internal static ConfigEntry configMergeOnBottom;
-
- internal static ConfigEntry configRemovePatches;
-
- internal static ConfigEntry configSmallPricetags;
- internal static ConfigEntry configMovePricetags;
-
- internal static ConfigEntry configTestState;
-
- internal static ConfigEntry configFullDebug;
-
- internal static ConfigEntry configDefaultDrone;
-
- internal static ConfigEntry act2TutorCenterRows;
-
-
+ ///
+ /// Configure whether the Custom Squirrel Tribe Icon should be shown on cards.
+ ///
+ internal static ConfigEntry configCustomSquirrelTribeIconToShowOnCards;
+ ///
+ /// Configure whether to use API's custom Act 2 Cost Rendering system or not for Custom and Hybrid Costs.
+ ///
+ internal static ConfigEntry configUseAPIAct2CostRender;
+ ///
+ /// Configure whether the Act 2 Cost should be in the Top Left or Top Right corner of the card.
+ ///
+ internal static ConfigEntry configDisplayAct2CostInTheTopRightCorner;
+ ///
+ /// Configure whether Cost Icons should use the Vanilla Style icons or the Custom Ones.
+ ///
+ internal static ConfigEntry configDisplayVanillaStyleAct2CostIcons;
+ ///
+ /// Configure the rendering of the Act 2 Stack Icon Number Renders, e.g. Black Outline or Cream Outline.
+ ///
+ internal static ConfigEntry configAct2StackIconNumberStyle;
+ ///
+ /// Configure whether sigils should be merged on the bottom of a card or not.
+ ///
+ internal static ConfigEntry configMergeSigilsOnBottom;
+ ///
+ /// Configure whether the actual patch the sigil is fused with is shown or not. If not the sigil icon shows up orange. Requires to be true.
+ ///
+ internal static ConfigEntry configRemoveSigilPatchesFromCards;
+ ///
+ /// Configure whether the Stackable Sigils should be displayed as seperate icons or not.
+ ///
+ internal static ConfigEntry configDisplayStackableSigilsSeparately;
+ ///
+ /// Configure whether the Price Tags should be smaller on the cards.
+ ///
+ internal static ConfigEntry configDisplaySmallerPriceTags;
+ ///
+ /// Configure whether the Price Tags should be displayed on the Right of a card.
+ ///
+ internal static ConfigEntry configDisplayPriceTagsOnTheRight;
+ ///
+ /// Configure whether card selection rows in the Act 2 Tutor Screen should be centered or not.
+ ///
+ internal static ConfigEntry configCenterAct2TutorSelectionRows;
+ ///
+ /// Configure whether Emissions should show over or under Cost Icons.
+ ///
+ internal static ConfigEntry configDisplayEmissionsUnderCostIcons;
+ ///
+ /// Configure whether Leshy's Eye Color should reset after the 8 Bears Fight.
+ ///
+ internal static ConfigEntry configResetEyesToNormalAfter8BearsFights;
+ ///
+ /// Configure whether Undead Cat's Emission should be forced Red or not.
+ ///
+ internal static ConfigEntry configEnforceUndeadCatToHaveARedEmission;
+ ///
+ /// Configure whether the Community Patch should display complete Debug Logs or not.
+ ///
+ internal static ConfigEntry configDisplayCompleteDebugLogsInConsole;
+ ///
+ /// Configure whether the Community Patch should be in Testing Mode or not.
+ ///
+ internal static ConfigEntry configCommunityPatchTestingMode;
+
+ ///
+ /// Our Community Patch's Internal Logger.
+ ///
new internal static ManualLogSource Logger;
-
+ ///
+ /// Our Community Patch's Internal Harmony Instance.
+ ///
private readonly Harmony HarmonyInstance = new(ModGUID);
+ ///
+ /// The following runs when the Community Patch is enabled by Unity.
+ ///
private void OnEnable()
{
Logger = base.Logger;
@@ -70,7 +147,7 @@ private void OnEnable()
HarmonyInstance.PatchAll(typeof(PatchPlugin).Assembly);
SceneManager.sceneLoaded += this.OnSceneLoaded;
- if (configTestState.Value)
+ if (configCommunityPatchTestingMode.Value)
{
ExecuteCommunityPatchTests.PrepareForTests();
TestCost.Init();
@@ -80,39 +157,49 @@ private void OnEnable()
CommunityArtPatches.PatchCommunityArt();
}
+ ///
+ /// The following runs when the Community Patch is diabled by Unity.
+ ///
private void OnDisable()
{
HarmonyInstance.UnpatchSelf();
}
+ ///
+ /// This is our Community Patch's Initializer, we primarily use it to set the internal Instance of the Community Patcher and create the Configurations to the Configuration File.
+ ///
private void Awake()
{
Instance = this;
- configEnergy = Config.Bind("Energy", "Energy Refresh", true, "Max energy increases and energy refreshes at end of turn");
- configDrone = Config.Bind("Energy", "Energy Drone", false, "Drone is visible to display energy (requires Energy Refresh)");
- configDefaultDrone = Config.Bind("Energy", "Default Drone", false, "Drone uses the vanilla model instead of being attached to the scales (requires Energy Drone)");
- configMox = Config.Bind("Mox", "Mox Refresh", true, "Mox refreshes at end of battle");
- configDroneMox = Config.Bind("Mox", "Mox Drone", false, "Drone displays mox (requires Energy Drone and Mox Refresh)");
+ configEnergyPerMatchCleanUp = Config.Bind("Energy", "Energy Refresh", true, "Max energy increases and energy refreshes at end of turn");
+ configEnergyDrone = Config.Bind("Energy", "Energy Drone", false, "Drone is visible to display energy (requires Energy Refresh)");
+ configUtilizeDefaultDrone = Config.Bind("Energy", "Default Drone", false, "Drone uses the vanilla model instead of being attached to the scales (requires Energy Drone)");
+ configMoxPerMatchCleanup = Config.Bind("Mox", "Mox Refresh", true, "Mox refreshes at end of battle");
+ configMoxDrone = Config.Bind("Mox", "Mox Drone", false, "Drone displays mox (requires Energy Drone and Mox Refresh)");
configAct3Bones = Config.Bind("Bones", "Act 3 Bones", false, "Force bones displayer to be active in Act 3");
- configShowSquirrelTribeOnCards = Config.Bind("Tribes", "Show Squirrel Tribe", false, "Shows the Squirrel tribe icon on cards");
- act2CostRender = Config.Bind("Card Costs", "GBC Cost render", true, "GBC Cards are able to display custom costs and hybrid costs through the API.");
- rightAct2Cost = Config.Bind("Card Costs", "GBC Cost On Right", true, "GBC Cards display their costs on the top-right corner. If false, display on the top-left corner");
- act2VanillaStyle = Config.Bind("Card Costs", "GBC Vanilla Render", false, "GBC cards use vanilla sprites when rendering multiple and custom costs.");
- configMergeOnBottom = Config.Bind("Sigil Display", "Merge_On_Botom", false, "Makes it so if enabled, merged sigils will display on the bottom of the card instead of on the artwork. In extreme cases, this can cause some visual bugs.");
- configRemovePatches = Config.Bind("Sigil Display", "Remove_Patches", false, "Makes it so if enabled, merged sigils will not have a patch behind them anymore and will instead be glowing yellow (only works with Merge_On_Bottom).");
- doubleStackSplit = Config.Bind("Sigil Display", "Vanilla Stacking", false, "If enabled, cards with only two visible sigils will display each separately even if they can stack.");
-
- configSmallPricetags = Config.Bind("Act 1", "Smaller Pricetags", false, "If enabled, the price tags placed on cards while buying from the Trapper will be scaled down.");
- configMovePricetags = Config.Bind("Act 1", "Move Pricetags", false, "If enabled, the price tags placed on cards while buying from the Trapper will be moved to the right.");
- act2StackIconType = Config.Bind("Sigil Display", "Act 2 Sigil icon type", true, "If true, stacking icons are a cream outline with a black center. If false, stacking icons are a black outline with a cream center. Act 2");
- act2TutorCenterRows = Config.Bind("Act 2", "Centred Hoarder UI", true, "If true, centres displayed cards in each row during the Hoarder selection sequence.");
- configFullDebug = Config.Bind("General", "Full Debug", true, "If true, displays all debug logs in the console.");
- configTestState = Config.Bind("General", "Test Mode", false, "Puts the game into test mode. This will cause (among potentially other things) a new run to spawn a number of cards into your opening deck that will demonstrate card behaviors.");
- configResetEyes = Config.Bind("Act 1", "Reset Red Eyes", false, "Resets Leshy's eyes to normal if they were turned red due to a boss fight's grizzly bear sequence.");
- configCostMask = Config.Bind("Act 1", "Render Costs Above Emission", true, "Applies a mask to card emissions that prevents them from covering play costs when rendering in-game.");
- undeadCatEmission = Config.Bind("General", "Undead Cat Emission", false, "If true, Undead Cat will have a forced red emission.");
+ configCustomSquirrelTribeIconToShowOnCards = Config.Bind("Tribes", "Show Squirrel Tribe", false, "Shows the Squirrel tribe icon on cards");
+ configUseAPIAct2CostRender = Config.Bind("Card Costs", "GBC Cost render", true, "GBC Cards are able to display custom costs and hybrid costs through the API.");
+ configDisplayAct2CostInTheTopRightCorner = Config.Bind("Card Costs", "GBC Cost On Right", true, "GBC Cards display their costs on the top-right corner. If false, display on the top-left corner");
+ configDisplayVanillaStyleAct2CostIcons = Config.Bind("Card Costs", "GBC Vanilla Render", false, "GBC cards use vanilla sprites when rendering multiple and custom costs.");
+ configAct2StackIconNumberStyle = Config.Bind("Sigil Display", "GBC Stack Icon Number Rendering", true, "If true, stacking icons are a cream outline with a black center. If false, stacking icons are a black outline with a cream center. Act 2");
+ configMergeSigilsOnBottom = Config.Bind("Sigil Display", "Merge_On_Bottom", false, "Makes it so if enabled, merged sigils will display on the bottom of the card instead of on the artwork. In extreme cases, this can cause some visual bugs.");
+ configRemoveSigilPatchesFromCards = Config.Bind("Sigil Display", "Remove_Patches", false, "Makes it so if enabled, merged sigils will not have a patch behind them anymore and will instead be glowing yellow (only works with Merge_On_Bottom).");
+ configDisplayStackableSigilsSeparately = Config.Bind("Sigil Display", "Vanilla Stacking", false, "If enabled, cards with only two visible sigils will display each separately even if they can stack.");
+ configDisplaySmallerPriceTags = Config.Bind("Act 1", "Smaller Pricetags", false, "If enabled, the price tags placed on cards while buying from the Trapper will be scaled down.");
+ configDisplayPriceTagsOnTheRight = Config.Bind("Act 1", "Move Pricetags", false, "If enabled, the price tags placed on cards while buying from the Trapper will be moved to the right.");
+ configCenterAct2TutorSelectionRows = Config.Bind("Act 2", "Centred Hoarder UI", true, "If true, centers displayed cards in each row during the Hoarder selection sequence.");
+ configResetEyesToNormalAfter8BearsFights = Config.Bind("Act 1", "Reset Red Eyes", false, "Resets Leshy's eyes to normal if they were turned red due to a boss fight's grizzly bear sequence.");
+ configDisplayEmissionsUnderCostIcons = Config.Bind("Act 1", "Render Costs Above Emission", true, "Applies a mask to card emissions that prevents them from covering play costs when rendering in-game.");
+ configEnforceUndeadCatToHaveARedEmission = Config.Bind("General", "Undead Cat Emission", false, "If true, Undead Cat will have a forced red emission.");
+ configDisplayCompleteDebugLogsInConsole = Config.Bind("General", "Full Debug", true, "If true, displays all debug logs in the console.");
+ configCommunityPatchTestingMode = Config.Bind("General", "Test Mode", false, "Puts the game into test mode. This will cause (among potentially other things) a new run to spawn a number of cards into your opening deck that will demonstrate card behaviors.");
}
+ ///
+ /// A simple function that runs when a Scene has Loaded in Unity.
+ ///
+ /// The Scene in which we are trying to Load things during.
+ /// The Mode in which to Load the Scene with.
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
EnergyDrone.TryEnableEnergy(scene.name);
diff --git a/InscryptionCommunityPatch/PixelTutor/Act2TutorFix.cs b/InscryptionCommunityPatch/PixelTutor/Act2TutorFix.cs
index e7960847..28e5b4bc 100644
--- a/InscryptionCommunityPatch/PixelTutor/Act2TutorFix.cs
+++ b/InscryptionCommunityPatch/PixelTutor/Act2TutorFix.cs
@@ -7,7 +7,9 @@
namespace InscryptionCommunityPatch.PixelTutor;
-// fixes Tutor to work in Act 2
+///
+/// Patches in our Act 2 related UI, that way it doesn't break when used in Act 2.
+///
[HarmonyPatch]
public static class Act2TutorFix
{
@@ -87,6 +89,12 @@ private static IEnumerator PixelTutorSequence(IEnumerator enumerator, Deck __ins
yield return Singleton.Instance.SpawnCardToHand(selectedCard);
}
+ ///
+ /// An called when selecting a card through the Ability in Act 2.
+ ///
+ /// The current instance of the .
+ /// The call back used when a Card is Selected.
+ /// The callback passed in triggered when a card is selected.
public static IEnumerator ChoosePixelCard(Deck instance, Action cardSelectedCallback)
{
PixelPlayableCard selectedCard = null;
diff --git a/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs b/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs
index 9a3bc244..7441b81a 100644
--- a/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs
+++ b/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs
@@ -9,10 +9,19 @@
namespace InscryptionCommunityPatch.PixelTutor;
+///
+/// Handles the UI related to the Act 2 patched in by .
+///
public class PixelPlayableCardArray : ManagedBehaviour
{
+ ///
+ /// The Selected Card, by default null.
+ ///
public PixelPlayableCard selectedCard = null;
+ ///
+ /// The Cards to Display when is triggered in Act 2, by default an empty list.
+ ///
public readonly List displayedCards = new();
private PixelPlayableCard gameObjectReference = null;
@@ -34,8 +43,14 @@ public class PixelPlayableCardArray : ManagedBehaviour
private GamepadGridControl gamepadGrid;
- public IEnumerator DisplayUntilCancelled(List cards,
- Func cancelCondition, Action cardsPlacedCallback = null)
+ ///
+ /// An used to make the Act 2 display show until it's cancelled, e.g. by a card being selected..
+ ///
+ /// The cards available for selection.
+ /// The condition needed to cancel the screen showing when would be triggered.
+ /// The callback for when the card(s) has/have been placed.
+ /// The Act 2 screen shown in game.
+ public IEnumerator DisplayUntilCancelled(List cards, Func cancelCondition, Action cardsPlacedCallback = null)
{
//Debug.Log($"{cards.Exists(x => x == null)}");
cards.RemoveAll(x => x == null);
@@ -58,9 +73,15 @@ public IEnumerator DisplayUntilCancelled(List cards,
CleanUpButtons();
}
- public IEnumerator SelectPixelCardFrom(
- List cards, Action cardSelectedCallback,
- Func cancelCondition = null, bool forPositiveEffect = true)
+ ///
+ /// An used to determine the selection for when the Act 2 is triggered.
+ ///
+ /// The cards we want to show.
+ /// The call back for when a Card has been selected.
+ /// The condition by which to cancel the Selection screen.
+ /// Whether the special ability should use a Positive Effect when the card is shown in selection.
+ /// A selection screen of cards to be selected from.
+ public IEnumerator SelectPixelCardFrom(List cards, Action cardSelectedCallback, Func cancelCondition = null, bool forPositiveEffect = true)
{
//Debug.Log($"{cards.Exists(x => x == null)}");
cards.RemoveAll(x => x == null);
@@ -122,6 +143,7 @@ public IEnumerator SelectPixelCardFrom(
cardSelectedCallback?.Invoke(selectedCard);
}
}
+
private void InitialiseButtons(List cards, bool deckReview, bool forPositiveEffect)
{
if (forwardButton == null)
@@ -156,6 +178,7 @@ private void InitialiseButtons(List cards, bool deckReview, bool forPo
backButton.gameObject.SetActive(false);
EnableButtons(false);
}
+
private void CleanUpButtons()
{
if (forwardButton.gameObject.activeSelf)
@@ -164,17 +187,20 @@ private void CleanUpButtons()
backButton.gameObject.SetActive(false);
}
}
+
private void EnableButtons(bool enable)
{
forwardButton.SetEnabled(enable);
backButton.SetEnabled(enable);
}
+
private void OnChangePage(bool forwards, List cards, bool deckReview, bool forPositiveEffect)
{
EnableButtons(false);
SetCardsEnabled(enabled: false);
base.StartCoroutine(ChangePage(forwards, cards, deckReview, forPositiveEffect));
}
+
private IEnumerator ChangePage(bool forwards, List cards, bool deckReview, bool forPositiveEffect)
{
yield return CleanUpCards();
@@ -188,6 +214,15 @@ private IEnumerator ChangePage(bool forwards, List cards, bool deckRev
SetCardsEnabled(enabled: true);
EnableButtons(true);
}
+
+ ///
+ /// A function used to get the card's position.
+ ///
+ /// The Index of the card we are after within the row of cards.
+ /// The amount of cards to place in the row of cards.
+ /// The number of rows on the screen.
+ /// The amount of cards placed in the row of cards.
+ ///
protected Vector3 GetCardPosition(int cardIndex, int cardsToPlace, int numRows, int cardsPerRow)
{
int cardRowIndex = Mathf.FloorToInt(cardIndex / cardsPerRow);
@@ -196,6 +231,7 @@ protected Vector3 GetCardPosition(int cardIndex, int cardsToPlace, int numRows,
float zPos = 0f + 0.01f * cardRowIndex;
return new Vector3(xPos, yPos, zPos);
}
+
private float GetXPos(int cardIndex, int cardRowIndex, int cardsToPlace, int cardsPerRow)
{
float cardGap = 0.41f;
@@ -205,7 +241,7 @@ private float GetXPos(int cardIndex, int cardRowIndex, int cardsToPlace, int car
float multiplier = cardIndex - positionInRow;
// when there are <7 cards, we need to centre them
- if (PatchPlugin.act2TutorCenterRows.Value && cardsLeftToPlace > 0 && cardsLeftToPlace < cardsPerRow)
+ if (PatchPlugin.configCenterAct2TutorSelectionRows.Value && cardsLeftToPlace > 0 && cardsLeftToPlace < cardsPerRow)
{
anchor = centreAnchor;
multiplier = cardIndex - positionInRow - (cardsLeftToPlace - 1) / 2f;
@@ -213,6 +249,11 @@ private float GetXPos(int cardIndex, int cardRowIndex, int cardsToPlace, int car
return anchor + cardGap * multiplier;
}
+
+ ///
+ /// An used to Clean Up the card's in the screen.
+ ///
+ /// The cleaned up menu and a switch back to the Board context.
protected IEnumerator CleanUpCards()
{
List list = new(displayedCards);
@@ -231,6 +272,15 @@ protected IEnumerator CleanUpCards()
SetBoardEnabled(true);
}
+ ///
+ /// An related to the spawning and placement of card's to the screen.
+ ///
+ /// The List of to place into the Menu.
+ /// The Number of Rows alloted to the Menu.
+ /// The Index of the current Selection Screen's pages.
+ /// Whether or not after this was triggered we should go to the Deck for review.
+ /// Whether the special ability should use a Positive Effect when the card is shown in selection.
+ /// The readied screen of cards to show in our selection.
protected IEnumerator SpawnAndPlaceCards(List cards, int numRows, int pageIndex, bool isDeckReview = false, bool forPositiveEffect = true)
{
if (numRows < 1) {
@@ -266,6 +316,11 @@ protected IEnumerator SpawnAndPlaceCards(List cards, int numRows, int
}
}
+ ///
+ /// Handles the tweening of a card to the specified position.
+ ///
+ /// The Card Transform we want to tween.
+ /// The Vector3 related to where the Card is located.
protected void TweenInCard(Transform cardTransform, Vector3 cardPos)
{
cardTransform.localPosition = cardPos;
diff --git a/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs b/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs
index 0f7fe52f..1c6a45f3 100644
--- a/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs
+++ b/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs
@@ -8,6 +8,9 @@
namespace InscryptionCommunityPatch.ResourceManagers;
+///
+/// This patch handles information related to the Drone Configuration for Act 1.
+///
[HarmonyPatch]
public static class EnergyDrone
{
@@ -16,11 +19,26 @@ public static class EnergyDrone
///
public class EnergyConfigInfo
{
- public bool ConfigEnergy { get; set; } = PoolHasEnergy || PatchPlugin.configEnergy.Value;
- public bool ConfigShowDrone { get; set; } = PoolHasEnergy || PatchPlugin.configDrone.Value;
- public bool ConfigDroneMox { get; set; } = PoolHasGems || PatchPlugin.configDroneMox.Value;
- public bool ConfigMox { get; set; } = PoolHasGems || PatchPlugin.configMox.Value;
- public bool ConfigDefaultDrone { get; set; } = PatchPlugin.configDefaultDrone.Value;
+ ///
+ /// Whether or not the Energy Drone should be shown.
+ ///
+ public bool ConfigShowDrone { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyDrone.Value;
+ ///
+ /// Whether or not the Energy Drone should be refreshed per match.
+ ///
+ public bool ConfigEnergy { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyPerMatchCleanUp.Value;
+ ///
+ /// Whether or not the Mox Drone should be shown.
+ ///
+ public bool ConfigDroneMox { get; set; } = PoolHasGems || PatchPlugin.configMoxDrone.Value;
+ ///
+ /// Whether or not the Mox Drone should be refreshed per match.
+ ///
+ public bool ConfigMox { get; set; } = PoolHasGems || PatchPlugin.configMoxPerMatchCleanup.Value;
+ ///
+ /// Whether or not the Default Drone should be used.
+ ///
+ public bool ConfigDefaultDrone { get; set; } = PatchPlugin.configUtilizeDefaultDrone.Value;
///
/// Controls whether or not the Drone will appear. By default, will appear if there are obtainable Energy or Mox cards in the card pool (or the corresponding config value has been set).
@@ -38,7 +56,12 @@ public class EnergyConfigInfo
{ CardTemple.Tech, new() },
{ CardTemple.Wizard, new() }
};
-
+
+ ///
+ /// Validator used to ensure a Scene can have the Drone or not.
+ ///
+ /// The scene we are checking.
+ /// True if the scene can have the drone, false otherwise.
public static bool SceneCanHaveEnergyDrone(string sceneName)
{
string activeSceneName = sceneName.ToLowerInvariant();
@@ -48,6 +71,9 @@ public static bool SceneCanHaveEnergyDrone(string sceneName)
return activeSceneName.Contains("magnificus") || activeSceneName.Contains("grimora");
}
+ ///
+ /// Determines whether the current Scene can have the Drone or not. Verified via .
+ ///
public static bool CurrentSceneCanHaveEnergyDrone
{
get
@@ -61,7 +87,7 @@ public static bool CurrentSceneCanHaveEnergyDrone
}
///
- /// Returns the EnergyConfigInfo object corresponding to the current Act.
+ /// Returns the object corresponding to the current Act.
///
public static EnergyConfigInfo GetEnergyConfig()
{
@@ -78,14 +104,26 @@ public static EnergyConfigInfo GetEnergyConfig()
}
///
- /// The EnergyConfigInfo for the current Act.
+ /// The for the current Act.
///
private static EnergyConfigInfo EnergyConfig => GetEnergyConfig();
+ ///
+ /// Used to determine whether the current Card Pool has Energy or not.
+ ///
public static bool PoolHasEnergy { get; private set; }
+ ///
+ /// Used to determine whether the current Card Pool has Mox or not.
+ ///
public static bool PoolHasGems { get; private set; }
- private static bool CardIsVisible(this CardInfo info, CardTemple targetTemple)
+ ///
+ /// Determines whether or not a card is a part of the targeted temple passed in through targetTemple, and if they have the meta categories needed in order for them to show up.
+ ///
+ /// The of the card we are checking.
+ /// The temple in which we are targetting. Options are Nature -> Act 1, Undead -> Grimora, Wizard -> Magnificus.
+ /// True if the Card is part of one of the temples we are after, and if the card has any of the meta categories needed to show up in the given act, otherwise false.
+ public static bool CardIsVisible(this CardInfo info, CardTemple targetTemple)
{
// if the CardInfo can't appear in this part of the game - Act 1 = Nature, Grimora = Undead, Magnificus = Wizard
if (info.temple != targetTemple)
@@ -119,7 +157,7 @@ internal static void TryEnableEnergy(string sceneName)
private static IEnumerator AwakeDrone()
{
// pretty sure the drone can't be null in this method, but we'll check just in case
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug($"Awaking ResourceDrone, instance exists? {ResourceDrone.Instance != null}.");
yield return new WaitForSeconds(1f);
@@ -132,6 +170,7 @@ private static IEnumerator AwakeDrone()
else
AttachDroneToScale();
}
+
private static void AttachDroneToScale()
{
try
@@ -189,6 +228,7 @@ private static bool Act1ResourceDrone_SetOnBoard(ResourceDrone __instance, bool
return false;
}
+
[HarmonyPrefix, HarmonyPatch(typeof(ResourceDrone), nameof(ResourceDrone.UpdateCellAndGemColors))]
private static bool DisableUpdateWhenNull()
{
@@ -196,6 +236,7 @@ private static bool DisableUpdateWhenNull()
return false;
return true;
}
+
[HarmonyPatch(typeof(Part1ResourcesManager), nameof(Part1ResourcesManager.CleanUp))]
[HarmonyPrefix]
private static void Part1ResourcesManager_CleanUp(Part1ResourcesManager __instance)
diff --git a/InscryptionCommunityPatch/ResourceManagers/ActThreeBonesDisplayer.cs b/InscryptionCommunityPatch/ResourceManagers/ActThreeBonesDisplayer.cs
index 0d962fb1..467ece78 100644
--- a/InscryptionCommunityPatch/ResourceManagers/ActThreeBonesDisplayer.cs
+++ b/InscryptionCommunityPatch/ResourceManagers/ActThreeBonesDisplayer.cs
@@ -10,13 +10,33 @@
namespace InscryptionCommunityPatch.ResourceManagers;
+///
+/// This patch handles adding the Bones Displayer to the Drone.
+///
[HarmonyPatch]
public static class Act3BonesDisplayer
{
+ ///
+ /// A bool determining whether the Bones Displayer should be forced to active.
+ ///
public static bool ForceBonesDisplayActive { get; set; } = false;
+ ///
+ /// A bool determining whether the Bones Displayer is active, namely when any one of the following are true;
+ ///
+ /// -
+ ///
+ /// -
+ ///
+ /// -
+ ///
public static bool DisplayAct3Bones => ForceBonesDisplayActive || PoolHasBones || PatchPlugin.configAct3Bones.Value;
+ ///
+ /// Determines whether or not a card is a part of the Tech Temple, and whether it has a Meta Category that can show in Act 3.
+ ///
+ /// The of the card we are checking.
+ /// True if the card is a part of the Technology temple, and if the card has any of the meta categories needed to show up in the given act, otherwise false.
private static bool CardIsVisible(this CardInfo info)
{
if (info.temple != CardTemple.Tech)
@@ -24,12 +44,17 @@ private static bool CardIsVisible(this CardInfo info)
// Now we check metacategories
// If the card's metacategories are set such that it can't actually appear, don't count it
- return info.metaCategories.Exists((CardMetaCategory x) =>
- x == CardMetaCategory.ChoiceNode || x == CardMetaCategory.Part3Random || x == CardMetaCategory.Rare);
+ return info.metaCategories.Exists((CardMetaCategory x) => x == CardMetaCategory.ChoiceNode || x == CardMetaCategory.Part3Random || x == CardMetaCategory.Rare);
}
+ ///
+ /// Determines whether the Card Pool has any cards that cost Bones, verified with .
+ ///
public static bool PoolHasBones => CardManager.AllCardsCopy.Any(ci => ci.BonesCost > 0 && ci.CardIsVisible());
+ ///
+ /// Determines whether the current Scene can have the Bones Displayer or not.
+ ///
public static bool SceneCanHaveBonesDisplayer
{
get
diff --git a/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs b/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs
index b74bab35..aa61fff4 100644
--- a/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs
+++ b/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs
@@ -4,23 +4,26 @@
namespace InscryptionCommunityPatch.Sequencers;
+///
+/// Patches in Smaller Price tags and a moved Price tag when either the and are true respectively.
+///
[HarmonyPatch]
internal class BuyPeltsSmallTags
{
[HarmonyPostfix, HarmonyPatch(typeof(BuyPeltsSequencer), nameof(BuyPeltsSequencer.AddPricetagToCard))]
private static void ReducePricetagSize(SelectableCard card)
{
- if (PatchPlugin.configSmallPricetags.Value || PatchPlugin.configMovePricetags.Value)
+ if (PatchPlugin.configDisplaySmallerPriceTags.Value || PatchPlugin.configDisplayPriceTagsOnTheRight.Value)
{
Transform t = card.transform.Find("pricetag");
if (t == null)
return;
- if (PatchPlugin.configSmallPricetags.Value)
+ if (PatchPlugin.configDisplaySmallerPriceTags.Value)
{
t.localScale = new(0.75f, 1f, 0.75f);
}
- if (PatchPlugin.configMovePricetags.Value)
+ if (PatchPlugin.configDisplayPriceTagsOnTheRight.Value)
{
t.localPosition = new(t.localPosition.x * -1, t.localPosition.y, t.localPosition.z);
}
diff --git a/InscryptionCommunityPatch/Sequencers/CardCostChoiceNodePatch.cs b/InscryptionCommunityPatch/Sequencers/CardCostChoiceNodePatch.cs
index 2451696b..6eb2266e 100644
--- a/InscryptionCommunityPatch/Sequencers/CardCostChoiceNodePatch.cs
+++ b/InscryptionCommunityPatch/Sequencers/CardCostChoiceNodePatch.cs
@@ -5,6 +5,9 @@
namespace InscryptionCommunityPatch.Sequencers;
+///
+/// Patches in Our Cost Card Backs into the function for Energy and Mox costs.
+///
[HarmonyPatch]
internal static class ChoiceNodePatch
{
@@ -21,5 +24,11 @@ private static void CardSingleChoicesSequencer_GetCardbackTexture(ref Texture __
break;
}
}
- public static string MoxTextureName(int index) => "moxCost" + (index switch { 1 => "Green", 2 => "Orange", 3 => "Blue", _ => "" }) + ".png";
+
+ ///
+ /// Handles getting the correct Mox Texture Name for usage in the patch.
+ ///
+ /// 1 -> Green, 2 -> Orange, 3 -> Blue, otherwise -> Empty
+ /// A string texture name in the form of moxCost{Color}.png
+ private static string MoxTextureName(int index) => "moxCost" + (index switch { 1 => "Green", 2 => "Orange", 3 => "Blue", _ => "" }) + ".png";
}
\ No newline at end of file
diff --git a/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs b/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs
index ce4eeae2..701f4736 100644
--- a/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs
+++ b/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs
@@ -7,6 +7,9 @@
namespace InscryptionCommunityPatch.Sequencers;
+///
+/// This patches in a conditional check as to whether or not the card has Boostable Stats or not.
+///
[HarmonyPatch]
internal class CardStatBoostSequencerPatch
{
@@ -127,7 +130,7 @@ private static IEnumerator NewStatBoostSequence(CardStatBoostSequencer instance,
// if there aren't any valid cards, exit the sequence
if (instance.GetValidCards(forAttackMod: attackMod).Count == 0)
{
- if (PatchPlugin.configFullDebug.Value)
+ if (PatchPlugin.configDisplayCompleteDebugLogsInConsole.Value)
PatchPlugin.Logger.LogDebug("Player has no cards that can be boosted at the campfire.");
yield return new WaitForSeconds(0.5f);
yield return Singleton.Instance.ShowUntilInput("You have no creatures to warm.");
diff --git a/InscryptionCommunityPatch/Sequencers/LeshyResetRedEyes.cs b/InscryptionCommunityPatch/Sequencers/LeshyResetRedEyes.cs
index 0e9f940b..14abbca9 100644
--- a/InscryptionCommunityPatch/Sequencers/LeshyResetRedEyes.cs
+++ b/InscryptionCommunityPatch/Sequencers/LeshyResetRedEyes.cs
@@ -4,13 +4,17 @@
namespace InscryptionCommunityPatch.Sequencers;
+///
+/// This patch applies when is set to true.
+/// When set to true after the boss has been beat, it resets their eyes back to normal rather than remaining red.
+///
[HarmonyPatch]
internal class LeshyResetRedEyes
{
[HarmonyPostfix, HarmonyPatch(typeof(TurnManager), nameof(TurnManager.CleanupPhase))]
private static IEnumerator ResetLeshyEyes(IEnumerator enumerator, TurnManager __instance)
{
- if (!PatchPlugin.configResetEyes.Value || !SaveManager.SaveFile.IsPart1 || __instance.opponent == null)
+ if (!PatchPlugin.configResetEyesToNormalAfter8BearsFights.Value || !SaveManager.SaveFile.IsPart1 || __instance.opponent == null)
{
yield return enumerator;
yield break;
diff --git a/InscryptionCommunityPatch/Sequencers/PackRatNodeBackgroundFix.cs b/InscryptionCommunityPatch/Sequencers/PackRatNodeBackgroundFix.cs
index 0cdd0a8f..d68724a8 100644
--- a/InscryptionCommunityPatch/Sequencers/PackRatNodeBackgroundFix.cs
+++ b/InscryptionCommunityPatch/Sequencers/PackRatNodeBackgroundFix.cs
@@ -4,7 +4,9 @@
namespace InscryptionCommunityPatch.Sequencers;
-// 'fixes' the pack rat card not being rare
+///
+/// Corrects the Pack Rat Card to be a Rare Card.
+///
[HarmonyPatch]
internal class PackRatNodeBackgroundFix
{
diff --git a/InscryptionCommunityPatch/Sequencers/TradeableTalkingCardFix.cs b/InscryptionCommunityPatch/Sequencers/TradeableTalkingCardFix.cs
index 9dadc5ff..deaeb1db 100644
--- a/InscryptionCommunityPatch/Sequencers/TradeableTalkingCardFix.cs
+++ b/InscryptionCommunityPatch/Sequencers/TradeableTalkingCardFix.cs
@@ -6,9 +6,19 @@
namespace InscryptionCommunityPatch.Sequencers;
+///
+/// This patch fixes Tradable Talking Card related Issues.
+///
[HarmonyPatch]
public class TradeableTalkingCardFix
{
+ ///
+ /// Patches the to allow for better handling regarding the Trade of Talking Cards.
+ ///
+ /// The Class Instance associated with the function e.g. .
+ /// The slot the card was found in.
+ /// The card being traded for.
+ /// This only returns our patched variant if the card is a talking card, otherwise it uses vanilla handling.
[HarmonyPrefix, HarmonyPatch(typeof(TradeCardsForPelts), nameof(TradeCardsForPelts.OnTradableSelected))]
private static bool OnTalkingCardSelected(TradeCardsForPelts __instance, HighlightedInteractable slot, PlayableCard card)
{
@@ -42,6 +52,11 @@ private static bool OnTalkingCardSelected(TradeCardsForPelts __instance, Highlig
return false;
}
+ ///
+ /// Handles the View associated with a trade specific to Talking Cards.
+ ///
+ /// The card in which is being given to the player.
+ /// The card added to hand, then a switch back to the trading pool.
public static IEnumerator TradeForTalkingCard(PlayableCard card)
{
yield return Singleton.Instance.AddCardToHand(CardSpawner.SpawnPlayableCard(card.Info), new Vector3(0f, 0.5f, -3f), 0f);
diff --git a/InscryptionCommunityPatch/Tests/DebugCards.cs b/InscryptionCommunityPatch/Tests/DebugCards.cs
index fa89916a..1df18b48 100644
--- a/InscryptionCommunityPatch/Tests/DebugCards.cs
+++ b/InscryptionCommunityPatch/Tests/DebugCards.cs
@@ -4,6 +4,9 @@
namespace InscryptionCommunityPatch.Tests;
+///
+/// This class adds some Debug Cards for testing the Steel Trap Death Patch in the Main API's functionality.
+///
public class DebugCards
{
///
diff --git a/InscryptionCommunityPatch/Tests/TestBoons.cs b/InscryptionCommunityPatch/Tests/TestBoons.cs
index 3a41d4fc..55c2f216 100644
--- a/InscryptionCommunityPatch/Tests/TestBoons.cs
+++ b/InscryptionCommunityPatch/Tests/TestBoons.cs
@@ -4,13 +4,26 @@
namespace InscryptionCommunityPatch.Tests;
+///
+/// This is a test related to Boons.
+///
public class SacrificeSquirrels : BoonBehaviour
{
+ ///
+ /// This makes the Boon respond specifically when resolving a card other than itself being a Squirrel.
+ ///
+ /// The being resolved.
+ /// True when the Card Being Resolved other than itself is a Squirrel.
public override bool RespondsToOtherCardResolve(PlayableCard otherCard)
{
return otherCard.Info.name.ToLowerInvariant().Equals("squirrel");
}
+ ///
+ /// This triggers when returns True. When it triggers it gives the cards the Unkillable Sigil after playing the Boon's Animation, then Render's the card.
+ ///
+ /// The being resolved.
+ /// The updated and rerendered with the Unkillable Sigil.
public override IEnumerator OnOtherCardResolve(PlayableCard otherCard)
{
yield return this.PlayBoonAnimation();
diff --git a/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs b/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs
index 4745fadf..3703805d 100644
--- a/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs
+++ b/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs
@@ -6,11 +6,20 @@
namespace InscryptionCommunityPatch.Tests;
+///
+/// The home of the Community Patch's Tests/
+///
[HarmonyPatch]
public static class ExecuteCommunityPatchTests
{
+ ///
+ /// The Boon associated with our Test Boon described in .
+ ///
public static BoonData.Type TestBoon;
+ ///
+ /// This function prepares our Tests.
+ ///
public static void PrepareForTests()
{
AbilityManager.BaseGameAbilities.AbilityByID(Ability.Sharp).Info.canStack = true;
@@ -23,11 +32,15 @@ public static void PrepareForTests()
Resources.Load("art/cards/boons/boonportraits/boon_startinggoat"), false, true, true);
}
+ ///
+ /// This function patches in our Tests at the start of a New Ascension Run.
+ ///
+ ///
[HarmonyPatch(typeof(AscensionSaveData), nameof(AscensionSaveData.NewRun))]
[HarmonyPostfix]
private static void StartRunInTestMode(ref AscensionSaveData __instance)
{
- if (PatchPlugin.configTestState.Value)
+ if (PatchPlugin.configCommunityPatchTestingMode.Value)
{
List testAbilityList = new() { Ability.Sharp, Ability.DebuffEnemy, Ability.CreateDams, Ability.DrawRabbits, Ability.Strafe, Ability.Deathtouch, Ability.DoubleStrike, Ability.Reach, Ability.BeesOnHit };
diff --git a/InscryptionCommunityPatch/Tests/TestCost.cs b/InscryptionCommunityPatch/Tests/TestCost.cs
index c0b2b896..336197a8 100644
--- a/InscryptionCommunityPatch/Tests/TestCost.cs
+++ b/InscryptionCommunityPatch/Tests/TestCost.cs
@@ -8,9 +8,18 @@
namespace InscryptionCommunityPatch.Tests;
+///
+/// This function defines our Testing Cost.
+///
public class TestCost : CustomCardCost
{
+ ///
+ /// The Name of the Custom Cost.
+ ///
public override string CostName => "TestCost";
+ ///
+ /// This function initializes our Test Cost.
+ ///
public static void Init()
{
PatchPlugin.Logger.LogDebug("Adding TestCost");
@@ -21,24 +30,60 @@ public static void Init()
.SetFoundAtChoiceNodes(true, TextureHelper.GetImageAsTexture("testCost.png", typeof(TestCost).Assembly));
}
+ ///
+ /// This defines the Cost Tier associated with the Amount of the Cost.
+ ///
+ /// The amount of the Test Cost.
+ /// A of amount/2.
public static int CostTier(int amount)
{
return Mathf.FloorToInt(amount / 2f);
}
+
+ ///
+ /// A bool determining whether a can be played with the current amount of the cost.
+ ///
+ /// The Amount of a Cost the Player currently has.
+ /// The Card the Player is trying to play.
+ /// The Player's current Hand.
+ /// True if the Amount of the Cost is <= 2.
public static bool CanBePlayed(int amount, CardInfo card, List hand)
{
return amount <= 2;
}
+
+ ///
+ /// A Function used to get the Cost's Texture within 3D Act's.
+ ///
+ /// The Cost Amount of the Card.
+ /// The of the Card.
+ /// The variant of the Card.
+ /// A application of the 3D Act Variant EnergyCost associated with the passed in Cost Amount.
public static Texture2D Texture3D(int cardCost, CardInfo cardInfo, PlayableCard playableCard)
{
Texture2D tex = TextureHelper.GetImageAsTexture($"energy_cost_{Mathf.Min(7, cardCost)}.png", typeof(PatchPlugin).Assembly);
return ReverseColours(tex);
}
+
+ ///
+ /// A Function used to get the Cost's Texture within 2D Act's.
+ ///
+ /// The Cost Amount of the Card.
+ /// The of the Card.
+ /// The variant of the Card.
+ /// A application of the 2D Act Variant EnergyCost associated with the passed in Cost Amount.
+ ///
public static Texture2D TexturePixel(int cardCost, CardInfo info, PlayableCard playableCard)
{
Texture2D tex = Part2CardCostRender.CombineIconAndCount(cardCost, TextureHelper.GetImageAsTexture($"pixel_energy.png", typeof(PatchPlugin).Assembly));
return ReverseColours(tex);
}
+
+ ///
+ /// A function used to Reverse the Colours of a Sprite.
+ ///
+ /// The Texture in which to reverse the Colours of.
+ /// A Colour Reversed version of the Passed Texture.
private static Texture2D ReverseColours(Texture2D texToReverse)
{
for (int x = 0; x < texToReverse.width; x++)
@@ -57,16 +102,34 @@ private static Texture2D ReverseColours(Texture2D texToReverse)
return texToReverse;
}
+ ///
+ /// A Bool determining whether the Card's Cost was satisfied or not.
+ ///
+ /// The Card's Cost.
+ /// The Card in which is attempting to be played.
+ /// True if the Cost was satisified and false otherwise.
public override bool CostSatisfied(int cardCost, PlayableCard card)
{
return cardCost <= (Singleton.Instance.PlayerEnergy - card.EnergyCost);
}
-
+
+ ///
+ /// The Hint said when the Cost was not Satisfied.
+ ///
+ /// The Card's Cost.
+ /// The Card in which is attempting to be played.
+ /// The String of the Hint to be said when the Card's Cost is not Satisfied.
public override string CostUnsatisfiedHint(int cardCost, PlayableCard card)
{
return "Eat your greens aby. " + card.Info.DisplayedNameLocalized;
}
+ ///
+ /// Depletes the Card's Cost from our Custom Cost's Cost Pool.
+ ///
+ /// The Card's Cost
+ /// The Card in which is attempting to be played.
+ /// The Card's Cost depleted from the Custom Cost's pool.
public override IEnumerator OnPlayed(int cardCost, PlayableCard card)
{
if (cardCost > 0)
diff --git a/LICENSE b/LICENSE.md
similarity index 100%
rename from LICENSE
rename to LICENSE.md
diff --git a/README.md b/README.md
index 2acf2604..c2ff42ff 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ To begin, we'll go over how to install BepInEx, the framework all Inscryption mo
**FOR LINUX AND STEAMDECK:** Ensure that the game is set to run using `Proton` in he game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`.
### Installing with a Mod Manager
-1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/).
+1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), [Pulsar](https://pulsarmods.com/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/).
2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page.
3. Run the game via the mod manager.
@@ -268,4 +268,4 @@ Contributors and builders of API 2.0:
- Keks307
- Creator/Chaosyr/SaxbyMod/The Stoat Lord/ThinCreator3483
- stillrinny
-- R3b00t3d-kawaii
\ No newline at end of file
+- R3b00t3d-kawaii
diff --git a/docs/wiki/getting_started.md b/docs/wiki/getting_started.md
index f647ae54..b6a02088 100644
--- a/docs/wiki/getting_started.md
+++ b/docs/wiki/getting_started.md
@@ -5,7 +5,7 @@ To begin, we'll go over how to install BepInEx, the framework all Inscryption mo
**FOR LINUX AND STEAMDECK:** Ensure that the game is set to run using `Proton` in he game settings on steam. Should be a setting like this: `Change launch behaviour` -> `Proton`.
### Installing with a Mod Manager
-1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/).
+1. Download and install [Thunderstore Mod Manager](https://www.overwolf.com/app/Thunderstore-Thunderstore_Mod_Manager), [Gale](https://thunderstore.io/c/inscryption/p/Kesomannen/GaleModManager/), [Pulsar](https://pulsarmods.com/) or [r2modman](https://thunderstore.io/c/inscryption/p/ebkr/r2modman/).
2. Click the **Install with Mod Manager** button on the top of [BepInEx's](https://thunderstore.io/c/inscryption/p/BepInEx/BepInExPack_Inscryption/) page.
3. Run the game via the mod manager.
diff --git a/thunderstore.toml b/thunderstore.toml
index 7daa74f9..186e2477 100644
--- a/thunderstore.toml
+++ b/thunderstore.toml
@@ -4,13 +4,13 @@ schemaVersion = "0.0.1"
[package]
namespace = "API_dev"
name = "API"
-versionNumber = "2.15.2"
+versionNumber = "2.24.2"
description = "The de-facto standard core API for all Inscryption mods. This lets you create new cards, abilities, challenges, map nodes, starter decks, and more."
websiteUrl = "https://github.com/InscryptionModding/InscryptionAPI/"
containsNsfwContent = false
[package.dependencies]
-BepInEx-BepInExPack_Inscryption = "5.4.1902"
+BepInEx-BepInExPack_Inscryption = "5.4.2306"
BepInEx-MonoMod_Loader_Inscryption = "1.0.0"
[build]
@@ -23,13 +23,45 @@ source = "InscryptionAPI/bin/Release/InscryptionAPI.dll"
target = "plugins/InscryptionAPI.dll"
[[build.copy]]
-source = "APIPatcher/bin/Release/Assembly-CSharp.APIPatcher.mm.dll"
+source = "InscryptionAPI/bin/Release/InscryptionAPI.pdb"
+target = "plugins/InscryptionAPI.pdb"
+
+[[build.copy]]
+source = "InscryptionAPI/bin/Release/InscryptionAPI.xml"
+target = "plugins/InscryptionAPI.xml"
+
+[[build.copy]]
+source = "InscryptionAPI/Thunderstore-Package-Elements/monomod/Assembly-CSharp.APIPatcher.mm.dll"
target = "monomod/Assembly-CSharp.APIPatcher.mm.dll"
+[[build.copy]]
+source = "InscryptionAPI/Thunderstore-Package-Elements/monomod/Assembly-CSharp.APIPatcher.mm.pdb"
+target = "monomod/Assembly-CSharp.APIPatcher.mm.pdb"
+
+[[build.copy]]
+source = "InscryptionAPI/Thunderstore-Package-Elements/monomod/Assembly-CSharp.APIPatcher.mm.xml"
+target = "monomod/Assembly-CSharp.APIPatcher.mm.xml"
+
[[build.copy]]
source = "InscryptionCommunityPatch/bin/Release/InscryptionCommunityPatch.dll"
target = "plugins/InscryptionCommunityPatch.dll"
+[[build.copy]]
+source = "InscryptionCommunityPatch/bin/Release/InscryptionCommunityPatch.pdb"
+target = "plugins/InscryptionCommunityPatch.pdb"
+
+[[build.copy]]
+source = "InscryptionCommunityPatch/bin/Release/InscryptionCommunityPatch.xml"
+target = "plugins/InscryptionCommunityPatch.xml"
+
+[[build.copy]]
+source = "CHANGELOG.md"
+target = "CHANGELOG.md"
+
+[[build.copy]]
+source = "LICENSE.md"
+target = "LICENSE.md"
+
[publish]
repository = "https://inscryption.thunderstore.io"
communities = ["inscryption"]