RushDuel.Filter
Alias: RD.Filter. Requires the matching Rush Duel Lua bootstrap.
Signature
lua
RushDuel.Filter(function filter, ... any) -> functionDescription
Returns a one-card predicate that invokes filter(c, ...) with the captured extra arguments.
Parameters
filterfunction: Predicate called with a Card followed by the captured arguments....any: Type and behavior are not yet reviewed; see the source.
Returns
function: Single-card predicate.
Example
lua
local machine = RD.Filter(Card.IsRace, RACE_MACHINE)
local g = Duel.GetMatchingGroup(machine, tp, LOCATION_MZONE, 0, nil)Source
Rush/Utilities/RDFunction.lua:17
lua
function RushDuel.Filter(filter, ...)
local args = {...}
return function(c)
return filter(c, table.unpack(args))
end
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 212 indexed script(s).
- Search this function in the Script Explorer with
RushDuel.Filter.
Script Examples
Instant Gift (120306059)
Source: Rush/Scripts/c120306059.lua
lua
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local code=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local filter=RD.Filter(cm.spfilter,e,tp,code)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(filter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)~=0 then
RD.CanDraw(aux.Stringid(m,1),tp,1,true)Valkyrian Guard (120231066)
Source: Rush/Scripts/c120231066.lua
lua
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP_ATTACK)~=0 then
local filter=RD.Filter(cm.posfilter,e,tp)
RD.CanSelectGroupAndDoAction(aux.Stringid(m,1),HINTMSG_POSCHANGE,filter,cm.poscheck,tp,LOCATION_MZONE,0,1,3,nil,function(g)
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 thenFreshberry Collaboration (120301071)
Source: Rush/Scripts/c120301071.lua
lua
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.ChangePosition(g,e,tp,REASON_EFFECT,POS_FACEUP_DEFENSE)~=0 and e:GetLabel()==1 then