Skip to content

Suit shades#1403

Open
MetaNite64 wants to merge 2 commits into
Steamodded:mainfrom
MetaNite64:suit-shades
Open

Suit shades#1403
MetaNite64 wants to merge 2 commits into
Steamodded:mainfrom
MetaNite64:suit-shades

Conversation

@MetaNite64
Copy link
Copy Markdown
Contributor

This is a small feature that allows SMODS.Suit objects to be classified into "shades". By default, Diamonds and Hearts count as "light" suits while Clubs and Spades are "dark" suits. This is mainly just a way to centralize and formalize the light and dark suit classifications that many mods use already (e.g. Paperback, Madcap, Bunco, UNIK's mod, even POLTERWORX).

Important additions:
SMODS.Suit definitions may now specify shade = "something", where the shade can be any string at all. "dark" and "light" are used in the vanilla suit definitions. If no shade is provided, it's just left as nil.
card.base.shade is the same string (or nil) as specified in the suit definition.
Card:is_suit_shade(shade, bypass_debuff) is a new function that works very similarly to Card:is_suit. You pass a string for the shade, and the function checks if the relevant card counts as at least one suit that matches that shade.

Food for thought:
It may be interesting to make Smeared Joker make every suit of the same shade count as each other, instead of just explicitly laying out the 4 vanilla suits. However, that would require a description change, and is probably not suited for SMODS itself.
Allowing wild cards (and other stuff that counts as any suit) to count as any shade, even if there are no suits in-game that actually match that shade?
I know y'all want to put new util functions in separate files in the new utils folder, but Card:is_suit_shade was so small I figured it wouldn't be out of place in the main utils.lua file until that gets fully split up. I can certainly move it if desired

Additional Info:

  • I didn't modify api's or I've made a PR to the wiki repo.
  • I didn't modify api's or I've updated lsp definitions.
  • I didn't make new lovely files or all new lovely files have appropriate priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant