RushDuel.SendToHandAndExists
Alias: RD.SendToHandAndExists. Requires the matching Rush Duel Lua bootstrap.
Signature
RushDuel.SendToHandAndExists(Card|Group|Effect target, Effect effect, int player, int reason, [function|nil filter], [int count], [Card|Group|nil expect]) -> boolDescription
Moves the supplied Card/Group/Effect handler toward its owner hand after applying the Rush EFFECT_CANNOT_TO_HAND_EFFECT protection filter and expanding Maximum components. After movement, confirms relevant cards from Deck/GY/banishment to the opponent. The reason argument is forwarded to the Rush protection checks, but this pinned implementation calls Duel.SendtoHand with REASON_EFFECT unconditionally. It is not a generic cost-payment helper. player controls protection/confirmation context, not a forced hand destination: the native destination argument is nil. Returns false if the eligible Group is empty or the core movement count is zero. Otherwise returns true when filter is nil, or checks at least count matching cards in Duel.GetOperatedGroup while excluding expect. This is a boolean, not a count, and the default does not prove every selected card reached the hand.
Parameters
targetCard|Group|Effect: Cards to move; Effect input means its handler.effectEffect: Source effect used by Rush protection checks; required.playerint: Player used for protection and confirmation context.reasonint: Reason passed to protection checks; actual movement is always REASON_EFFECT in this snapshot.filterfunction|nil(optional): Optional predicate checked against the operated Group.countint(optional): Required match count when filter is supplied.expectCard|Group|nil(optional): Exclusion for the operated-Group check.
Returns
bool: Whether movement was nonzero and the optional operated-Group check passed.
Source
Rush/Utilities/RDAction.lua:277
function RushDuel.SendToHandAndExists(target, effect, player, reason, filter, count, expect)
local hints = Group.CreateGroup()
local group = RushDuel.ToGroup(target):Filter(RushDuel.FilterToHandTarget, nil, effect, player, reason, hints)
local g = RushDuel.ToMaximunGroup(group)
local tc = hints:GetFirst()
if tc then
Duel.Hint(HINT_CARD, 0, tc:GetOriginalCode())
end
if #g == 0 then
return false
end
if Duel.SendtoHand(g, nil, REASON_EFFECT) == 0 then
return false
end
local cg = g:Filter(RushDuel.FilterToHandConfirm, nil, player)
if #cg > 0 then
Duel.ConfirmCards(1 - player, cg)
end
return RushDuel.IsOperatedGroupExists(filter, count, expect)
endGuided Examples
Learn how to use this function in context:
Used By
Generated from the local Rush/Scripts/ folder and rush_cards.cdb.
- Detected in 496 indexed script(s).
- Search this function in the Script Explorer with
RushDuel.SendToHandAndExists.
Script Examples
Lufer the Symbol of the Devils (120309059)
Source: Rush/Scripts/c120309059.lua
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_GRAVE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,5),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.SendToHandAndExists(sg,e,tp,REASON_EFFECT)
end)
endSkysavior Watch (120235053)
Source: Rush/Scripts/c120235053.lua
Duel.DisableShuffleCheck()
if tc:IsAbleToHand() then
RD.SendToHandAndExists(sg,e,p,REASON_EFFECT)
Duel.ShuffleHand(p)
elseVoidalfr Star Mayfly (120300034)
Source: Rush/Scripts/c120300034.lua
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_RTOHAND,cm.filter,tp,0,LOCATION_MZONE,1,3,nil,function(g)
RD.SendToHandAndExists(g,e,tp,REASON_EFFECT)
end)
if Duel.GetFlagEffect(tp,m)~=0 then return end