Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion InscryptionAPI/Card/CardExtensionsCosts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static int BonesCost(this PlayableCard card)
/// </summary>
public static List<GemType> GemsCost(this PlayableCard card)
{
if (card != null && card.Info != null) {
if (card == null || card.Info == null) {
InscryptionAPIPlugin.Logger.LogWarning("[GemsCost] Couldn't find PlayableCard or CardInfo, returning empty list");
return new();
}
Expand Down
6 changes: 3 additions & 3 deletions docs/wiki/custom_costs.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ This is false by default, meaning negative costs on cards will be read as 0 by t
You can use SetCanBeNegative to change this value, or directly modify the CanBeNegative field.

Cost tier is an integer denoting how expensive a card is, with each cost having its own formula that adds to the tier.
From example, the formula for Bones' tier is (amount / 3), rounded down.
For example, the formula for Bones' tier is (amount / 3), rounded down.

By default, custom costs are not accounted when determining a card's cost tier;
By default, custom costs are not accounted for when determining a card's cost tier;
this can be fixed using SetCostTier to define the function to use.

```c#
Expand All @@ -106,7 +106,7 @@ public static int CostTier(int amount)
A vital part of Inscryption's gameplay is the fair hand mechanic;
when a battle starts, the game will give you at least one card that can be played immediately, as well as a card that can be played by the second turn.

By default, when the game checks if a card with custom costs can be played by turn 2, it will return 2 - even if it can't be.
By default, when the game checks if a card with custom costs can be played by turn 2, it will return true - even if it can't be.

To fix this, you'll need to set your cost's CanBePlayedByTurn2WithHand function (long name, I know):
```c#
Expand Down
Loading