Custom actions give your game a lot more power and flexibility. Once set up, a custom action can let you do many things with just a one line effect.
What are actions
Actions are on the second column of the effect builder.
If you think of an effect as a sentence, actions are the verb of the sentence.
Custom Action Settings
There are a handful of possible custom action settings you may put into the Custom Card Properties field.
displayName
Instead of showing the title of the card in the effect builder, set a displayName instead.
reqType
Prevent the custom action from showing up in any types other than the type requested.
excludeType
Prevent the custom action from showing up in the type requested.
hiddenFields
Enter a comma separated list of target fields to hide from the designer when they're using this action. These fields would be fields that generally do not work with that action. Hiding them here can make the UI more intuitive.
Working with custom actions
Letting the card designer control the action
While many custom actions are pretty simple, letting card designers to just select it and go, some will want the designer to select options.
The targeting column selections the card designer makes when using the custom action is known by the custom action. You can access the selections with variables.
$_targetCards
References the selected cards if applicable.
$_target
References the overall target. This can be a player such as "player1" or "player2". This can be "game". This can be selected cards, same as _targetCards.
$_targetCount
References the number of cards field.
$_targetProperty
References any property selected, works with cardProperty
, playerProperty
, or gameProperty
.
$_targetValue
References the value selected.
$_targetInstructions
References instructions given to players when selecting cards.
To give card designers the ability to make choices in the action column use the action parameters under rule card triggers to let card designers have the same access to option fields in your custom action as you would have in base actions.
These custom actions can be later referenced by the field name. Examples: $_magnitude
, $_player
, $_location
.
Setting defaults
Defaults can be set in the custom card properties. When a card uses a custom action, it will overwrite the default if there is an argument passed on a card. If there is not, then the default will be used.
In this example, which is the "add card to hand" custom action Rule card from Animal Kingdom, the number of cards is set by the variable $_targetCount.
_targetCount is set as 1 on the card itself.
This makes 1 the default for this action instead of undefined, allowing the card designer to not put anything in this field if they wish.
Custom Parameters
Custom parameters can be defined on the custom card properties section of the card editor. They require these settings:
param_id param_[paramID]_label
param_[paramID]_tooltip
If no options are set, then this will produce a regular text field. You can access the param with $[_paramId]
param_[paramID]_radio
Radio property makes it so that only 1 option may be selected at a time. Don't set this property to allow unlimited selections.
You may also choose to to show some options:
param_[paramID]_option_id
param_[paramID]_option_[optionId]_label
param_[paramID]_option_[optionId]_tooltip