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..84e11198 100644
--- a/InscryptionAPI/InscryptionAPI.csproj
+++ b/InscryptionAPI/InscryptionAPI.csproj
@@ -1,25 +1,62 @@
-
- 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -40,4 +77,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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/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..54d0c31b 100644
--- a/InscryptionCommunityPatch/Card/ActivatedAbilityHandler3D.cs
+++ b/InscryptionCommunityPatch/Card/ActivatedAbilityHandler3D.cs
@@ -40,7 +40,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..37e43409 100644
--- a/InscryptionCommunityPatch/Card/ActivatedAbilityIconFix.cs
+++ b/InscryptionCommunityPatch/Card/ActivatedAbilityIconFix.cs
@@ -30,7 +30,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 +38,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..66c3b3a1 100644
--- a/InscryptionCommunityPatch/Card/ActivatedAbilityIconInteractable.cs
+++ b/InscryptionCommunityPatch/Card/ActivatedAbilityIconInteractable.cs
@@ -33,7 +33,7 @@ private void Start()
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;
diff --git a/InscryptionCommunityPatch/Card/ArtPatches.cs b/InscryptionCommunityPatch/Card/ArtPatches.cs
index ec5a0482..0c680a75 100644
--- a/InscryptionCommunityPatch/Card/ArtPatches.cs
+++ b/InscryptionCommunityPatch/Card/ArtPatches.cs
@@ -95,7 +95,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..2573628a 100644
--- a/InscryptionCommunityPatch/Card/CardCostRender.cs
+++ b/InscryptionCommunityPatch/Card/CardCostRender.cs
@@ -78,16 +78,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 +100,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/MergedSigilOnBottom.cs b/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs
index 31e30a69..e7710312 100644
--- a/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs
+++ b/InscryptionCommunityPatch/Card/MergedSigilOnBottom.cs
@@ -22,7 +22,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 +40,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 +53,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..6b18f521 100644
--- a/InscryptionCommunityPatch/Card/MissingSquirrelTribeIconFix.cs
+++ b/InscryptionCommunityPatch/Card/MissingSquirrelTribeIconFix.cs
@@ -80,7 +80,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/StackAbilityIcons.cs b/InscryptionCommunityPatch/Card/StackAbilityIcons.cs
index 684847d3..119c2403 100644
--- a/InscryptionCommunityPatch/Card/StackAbilityIcons.cs
+++ b/InscryptionCommunityPatch/Card/StackAbilityIcons.cs
@@ -54,7 +54,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 +297,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 +340,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 +374,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/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..64344fb5 100644
--- a/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj
+++ b/InscryptionCommunityPatch/InscryptionCommunityPatch.csproj
@@ -1,19 +1,25 @@
-
- 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
-
-
-
- $(NoWarn);AD0001;CS0612;CS8604;CS0252;CS0618;Harmony003;Publicizer001
+ true
@@ -35,4 +41,15 @@
+
+
+
+
+
+
+
+
+
+
+
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/PixelPlayableCardArray.cs b/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs
index 9a3bc244..55b8669b 100644
--- a/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs
+++ b/InscryptionCommunityPatch/PixelTutor/PixelPlayableCardArray.cs
@@ -205,7 +205,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;
diff --git a/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs b/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs
index 0f7fe52f..c5d604b2 100644
--- a/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs
+++ b/InscryptionCommunityPatch/ResourceManagers/ActOneEnergyDrone.cs
@@ -16,11 +16,11 @@ 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;
+ public bool ConfigEnergy { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyPerMatchCleanUp.Value;
+ public bool ConfigShowDrone { get; set; } = PoolHasEnergy || PatchPlugin.configEnergyDrone.Value;
+ public bool ConfigDroneMox { get; set; } = PoolHasGems || PatchPlugin.configMoxDrone.Value;
+ public bool ConfigMox { get; set; } = PoolHasGems || PatchPlugin.configMoxPerMatchCleanup.Value;
+ 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).
@@ -119,7 +119,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);
diff --git a/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs b/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs
index b74bab35..22c9e533 100644
--- a/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs
+++ b/InscryptionCommunityPatch/Sequencers/BuyPeltsSmallTags.cs
@@ -10,17 +10,17 @@ 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/CardStatBoostSequencerPatch.cs b/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs
index ce4eeae2..d12e9021 100644
--- a/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs
+++ b/InscryptionCommunityPatch/Sequencers/CardStatBoostSequencerPatch.cs
@@ -127,7 +127,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..613032c2 100644
--- a/InscryptionCommunityPatch/Sequencers/LeshyResetRedEyes.cs
+++ b/InscryptionCommunityPatch/Sequencers/LeshyResetRedEyes.cs
@@ -10,7 +10,7 @@ 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/Tests/TestCommunityPatches.cs b/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs
index 4745fadf..817bb5c1 100644
--- a/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs
+++ b/InscryptionCommunityPatch/Tests/TestCommunityPatches.cs
@@ -27,7 +27,7 @@ public static void PrepareForTests()
[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/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..d3fa3b21 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.2305"
BepInEx-MonoMod_Loader_Inscryption = "1.0.0"
[build]
@@ -22,14 +22,46 @@ outdir = "./build"
source = "InscryptionAPI/bin/Release/InscryptionAPI.dll"
target = "plugins/InscryptionAPI.dll"
+[[build.copy]]
+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 = "APIPatcher/bin/Release/Assembly-CSharp.APIPatcher.mm.dll"
target = "monomod/Assembly-CSharp.APIPatcher.mm.dll"
+[[build.copy]]
+source = "APIPatcher/bin/Release/Assembly-CSharp.APIPatcher.mm.pdb"
+target = "monomod/Assembly-CSharp.APIPatcher.mm.pdb"
+
+[[build.copy]]
+source = "APIPatcher/bin/Release/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"]