Skip to content

Auxiliary.ToHandOrElse

Source Code | Auxiliary Functions

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

Signature

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

lua
Auxiliary.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

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

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

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.