-
Notifications
You must be signed in to change notification settings - Fork 6
Extended card behavior
(mechanic from Cryptlib and Entropy)
Spectrallib extends the compatibility of cards so that regardless of which card area they are in, they retain some functionality. In particular:
- Voucher cards and booster packs can now be redeemed and opened respectively in
G.jokers,G.consumeables, andG.hand. - Deck cards (and Sleeve cards, if CardSleeves is installed) now have well-defined on-use behaviour; see Deck redeeming for more information. They can be used in
G.jokers,G.consumeables,G.hand, andG.pack_cards. - Jokers in
G.handcan be pulled back intoG.jokers. While inG.hand, Jokers are not calculated during scoring.
Much like consumables, by defining the use(self, card, area, copier) method in a Joker's register, a "USE" button is added to the Joker. The method can_use(self, card) can also be defined to conditionally toggle the use button.
Additionally, by defining the method needs_use_button(self, card), the visibility of the use button can also be conditionally toggled; if the method is defined, the use button will only be visible if the method returns a truthy value.
CCD refers to the ability to apply any center to any playing card. When this occurs, the playing card decal (rank and suit) is imposed onto the center's sprite.
In this state, the behaviour of the center that a CCD card has will be present. For example, Joker-CCD playing cards will not be calculated during scoring if in G.hand, but will be calculated during scoring if in G.jokers. As another example, useable-CCD playing cards can be used in G.hand, in which case the card will be removed as usual due to usage.
To apply a center to a playing card, call the method Card:set_ability(center), where center is a key or value in G.P_CENTERS.
"CCD" stands for "consumable card in deck", as this functionality originally only applied to consumables.
By defining cry_multiuse in a consumable's config table (in its register), or defining cry_multiuse in a card's ability table (given that the card has a consumable center), the card can be used multiple times, and will only be removed once cry_multiuse decreases to 0.