-
Notifications
You must be signed in to change notification settings - Fork 4
Forcetriggering
(mechanic from Cryptlib)
Forcetriggering a card forces some of its center's effects to occur. For a center to be forcetriggerable, its register must have forcetrigger_compat = true. Centers that define a calculate function must then check for context.forcetrigger, while centers that can be used must define force_use(self, card, area).
To forcetrigger a card card, use Spectrallib.forcetrigger(args) during calculation, where at minimum, args = {card = card, context = context}. For more information on recognized fields, see the function's corresponding section.
All vanilla Jokers have forcetrigger effects defined in Spectrallib.vanilla_forcetrigger_results. It is not recommended to add forcetrigger effects for modded centers in this table; instead define forcetrigger effects in the center's calculate function.
The boolean in the return table is true if card/its center is forcetriggerable.
todo idk how to describe Used in the calculation loop
Forcetriggers a card. args takes the following fields:
-
card- The card being forcetriggered. -
context- Given the object that is performing the forcetriggering, this field is for the context sent to the object. -
message- A string used for the forcetrigger message. Defaults to the localization of "Forcetrigger!". -
message_card- The card to display the message over. -
colour- The background colour of the message. -
silent- If true, hides the forcetrigger message.