Skip to content

aux.ToHandOrElse ​

Source Code | Usage Examples | aux Functions

Makes a player either add cards to the hand or perform an alternative action.

Signature ​

aux.ToHandOrElse(Card|Group cg, int player, CardFilter check, CardFilter oper, int str, [any ...]) → any

lua
aux.ToHandOrElse(cg,player,check,oper,str,...)

Parameters ​

  • Card|Group cg ​

    The cards to be either be added to the hand or perform the alternative action on.

  • int player ​

    The player performing the action.

  • CardFilter check ​

    A filter that the card must fulfill to allow the alternative action.

  • CardFilter oper ​

    An operation to perform on a card, returning true if it succeeds.

  • int str ​

    An integer representing a string to use as prompt option for the alternative action.

  • any ... ​

    Optional.

    Optional arguments to be passed to check and oper.

Returns ​

  • any ​

    Returns true if the action was performed successfully.

Overload ​

aux.ToHandOrElse(Card|Group cg, int player) → nil

lua
aux.ToHandOrElse(cg,player)

Shortcut if the alternative action is sending to the GY.

Parameters ​

  • Card|Group cg ​

    The cards to be either be added to the hand or sent to the GY.

  • int player ​

    The player performing the action.