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
36 changes: 35 additions & 1 deletion API Documentation/Utility.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,45 @@ Checks if the effects of Shortcut are applying (i.e. if Straights can be made wi

Returns `true` if Straights can wrap around.

## Playing card properties

#### `SMODS.has_playing_card_property(card, key) -> boolean`

Checks if an enhancement, edition, seal, sticker, etc. of a playing card has a property matching the specified `key`. The functions that follow in this section are use cases of this function.

#### `SMODS.has_no_suit(card) -> boolean`

Checks if a card has no suit due to an enhancement/edition/seal/sticker/etc. (e.g., Stone Cards).

#### `SMODS.has_any_suit(card) -> boolean`

Checks if a card can be used as any suit due to an enhancement/edition/seal/sticker/etc. (e.g., Wild Cards).
> [!NOTE]
> A card may have effects for counting as both no suit and any suit. In this case, the card will be able to be used as any suit.

#### `SMODS.has_no_rank(card) -> boolean`

Checks if a card has no rank due to an enhancement/edition/seal/sticker/etc. (e.g., Stone Cards).

#### `SMODS.always_scores(card) -> boolean`

Checks if a card always scores due to an enhancement/edition/seal/sticker/etc. (e.g., Stone Cards).

#### `SMODS.never_scores(card) -> boolean`

Checks if a card cannot be scored due to an enhancement/edition/seal/sticker/etc.
> [!NOTE]
> A card may have effects for both always scoring and never scoring. In this case, the card will not score.

#### `SMODS.shatters(card) -> boolean`

Checks if a card should on destruction like a Glass Card.

## Card Methods

#### `Card:should_hide_front() -> boolean`

This function checks whether a card object should display the front sprite or not. Currently only checks for Stone cards and cards with `overrides_base_rank = true` defined on the Center, but can be **hooked** to provide additional functionality as required.
This function checks whether a card object should display the front sprite or not. Currently only checks for Stone cards and other cards with `overrides_base_rank = true` defined on an enhancement, edition, seal or sticker, but can be **hooked** to provide additional functionality as required.

#### `Card:is_rarity(rarity) -> boolean`

Expand Down
5 changes: 5 additions & 0 deletions Game Objects/SMODS.Center/SMODS.Edition.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
- `disable_base_shader = false`: Whether the base shader should be applied (`booster` for Booster packs and Spectral cards, `voucher` for Vouchers and Invisible Joker, `dissolve` otherwise). Enable this if your shader modifies card transparency or shape in any way. Example:<br/>![image](https://github.com/user-attachments/assets/c7b32385-e486-40c2-9a83-c8a09a67185c)
- `always_scores`: If `true`, editioned card always counts in scoring.
- `never_scores`: If `true`, editioned card never counts in scoring (supersedes `always_scores`).
- `replace_base_card`: If `true`, don't draw base card sprite or give base card chips. *(added in (RELEASE))*
- `no_rank`: If `true`, editioned card has no rank. *(added in (RELEASE))*
- `no_suit`: If `true`, editioned card has no suit. *(added in (RELEASE))*
- `any_suit`: If `true`, editioned card counts as any suit. *(added in (RELEASE))*
- `shatters`: If `true`, editioned card breaks on destruction like a Glass Card. *(added in (RELEASE))*

## API methods

Expand Down
9 changes: 2 additions & 7 deletions Game Objects/SMODS.Center/SMODS.Enhancement.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
- `shatters`: If `true`, enhanced card breaks on destruction like a Glass Card.
- `always_scores`: If `true`, enhanced card always counts in scoring.
- `never_scores`: If `true`, enhanced card never counts in scoring (supersedes `always_scores`).
- `weight`: The weighting of the enhancement, follows same rules as other weighted objects *(default weight is 5)*.
- `weight`: The weighting of the enhancement, follows same rules as other weighted objects *(default weight is 5)*.

## API methods

Expand Down Expand Up @@ -104,9 +104,4 @@
- `Card:calculate_joker` is called for each joker with `context = { check_enhancement = true, other_card = card }`, expecting return tables in the same format to add extra enhancements. No other ways to give a card multiple enhancements are currently supported.
- If `extra_only == true`, the card's base enhancement is excluded.
- `SMODS.has_enhancement(card, key)`: Returns `true` if the given card has the specified enhancement, either as its natural enhancement or an extra enhancement from jokers.
- `SMODS.has_no_suit(card)`: Returns true if a card doesn't have any suit due to its enhancements (e.g., Stone Cards).
- `SMODS.has_any_suit(card)`: Returns true if a card can be used as any suit due to its enhancements (e.g., Wild Cards).
- Cards with enhancement effects both for having no suit and for having any suit can be used as any suit.
- `SMODS.has_no_rank(card)`: Returns true if a card doesn't have any rank due to its enhancements (e.g., Stone Cards).
- `SMODS.always_scores(card)`: Returns true if a card always scores due to its enhancements (e.g., Stone Cards).
- `SMODS.never_scores(card)`: Returns true if the card cannot be scored.
- Utility functions for playing card properties [(reference)](https://docs.smods.dev/API%20Documentation/Utility/#playing-card-properties)
5 changes: 5 additions & 0 deletions Game Objects/SMODS.Seal.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
- `vol`: The volume at which the sound should be played.
- `always_scores`: If `true`, cards with this seal always count in scoring.
- `never_scores`: If `true`, cards with this seal never count in scoring (supersedes `always_scores`).
- `replace_base_card`: If `true`, don't draw base card sprite or give base card chips. *(added in (RELEASE))*
- `no_rank`: If `true`, cards with this seal have no rank. *(added in (RELEASE))*
- `no_suit`: If `true`, cards with this seal have no suit. *(added in (RELEASE))*
- `any_suit`: If `true`, cards with this seal count as any suit. *(added in (RELEASE))*
- `shatters`: If `true`, cards with this seal break on destruction like a Glass Card. *(added in (RELEASE))*

## API methods

Expand Down
12 changes: 8 additions & 4 deletions Game Objects/SMODS.Sticker.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
}
```

- `rate = 0.3`: Chance of the sticker applying on an eligible card
- `rate = 0.3`: Chance of the sticker applying on an eligible card
- `needs_enable_flag`: If set to `true`, this sticker requires `G.GAME.modifiers['enable_'..self.key]` to be `true` before it can be applied.
- `always_scores`: If `true`, editioned card always counts in scoring.

- `never_scores`: If `true`, editioned card never counts in scoring (supersedes `always_scores`).
- `always_scores`: If `true`, cards with this sticker always count in scoring.
- `never_scores`: If `true`, cards with this sticker never count in scoring (supersedes `always_scores`).
- `replace_base_card`: If `true`, don't draw base card sprite or give base card chips. *(added in (RELEASE))*
- `no_rank`: If `true`, cards with this sticker have no rank. *(added in (RELEASE))*
- `no_suit`: If `true`, cards with this sticker have no suit. *(added in (RELEASE))*
- `any_suit`: If `true`, cards with this sticker count as any suit. *(added in (RELEASE))*
- `shatters`: If `true`, cards with this sticker break on destruction like a Glass Card. *(added in (RELEASE))*

## API methods

Expand Down
Loading