Duel.GetMatchingGroupCount
Signature
lua
Duel.GetMatchingGroupCount([function|nil f], int player, int s, int o, [Card|Group|nil ex], ... any) -> intDescription
Counts cards in the specified locations that satisfy filter f and are not excluded by ex. Extra arguments after ex are passed to f after the card argument.
Parameters
ffunction|niloptionalplayerintsintointexCard|Group|niloptional...any
Returns
int
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4970
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 609 indexed script(s).
- Search this function in the Script Explorer with
Duel.GetMatchingGroupCount.
| Card | ID | Script | Detected Calls |
|---|---|---|---|
| Ashtraja Susanoo | 17020474 | Scripts/c17020474.lua | 2 |
| D/D/D Alfred the Divine Sage King | 11852093 | Scripts/c11852093.lua | 1 |
| Shooting Majestic Star Dragon | 40939228 | Scripts/c40939228.lua | 1 |
| Kewl Tune Crackle | 39576656 | Scripts/c39576656.lua | 1 |
| D/D Extra Surveyor | 74387963 | Scripts/c74387963.lua | 2 |
| Trirealm Rift Judgment | 65195679 | Scripts/c65195679.lua | 1 |
| Clock Lizard | 51476410 | Scripts/c51476410.lua | 1 |
| Phantom Knights' Rank-Up-Magic Force | 88504133 | Scripts/c88504133.lua | 2 |
| Endymion, the Mighty Master of Magic | 3611830 | Scripts/c3611830.lua | 1 |
| Ursarctic Quint Charge | 15758127 | Scripts/c15758127.lua | 1 |
| Theia, the Primal Being | 85687952 | Scripts/c85687952.lua | 1 |
| Heroic Champion - Magnum Excalibur | 14301396 | Scripts/c14301396.lua | 1 |
| Nemleria Louve | 57296396 | Scripts/c57296396.lua | 1 |
| Abyss Actor - Mellow Madonna | 78310590 | Scripts/c78310590.lua | 1 |
| Traptrix Atypus | 48183890 | Scripts/c48183890.lua | 1 |
| R.B. Shepherd's Crook | 80071619 | Scripts/c80071619.lua | 1 |
| Dragunity Arma Gram | 53184342 | Scripts/c53184342.lua | 1 |
| Squeeze, the Full Moon of Raise Moon - JACKPOT! | 9484285 | Scripts/c9484285.lua | 1 |
| Worldsea Dragon Zealantis | 45112597 | Scripts/c45112597.lua | 1 |
| Red Hypernova Dragon | 30698243 | Scripts/c30698243.lua | 1 |
| Fairy Tail - Wiccat | 27632520 | Scripts/c27632520.lua | 1 |
| Predaplant Daredevil | 82370493 | Scripts/c82370493.lua | 1 |
| X-Saber Gottoms | 8252010 | Scripts/c8252010.lua | 1 |
| Condemned Darklord | 35306215 | Scripts/c35306215.lua | 2 |
| ...and 585 more |
Script Examples
Ashtraja Susanoo (17020474)
Source: Scripts/c17020474.lua
lua
end
function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)D/D/D Alfred the Divine Sage King (11852093)
Source: Scripts/c11852093.lua
lua
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.tffilter(chkc,tp) end
local count1=Duel.GetTargetCount(s.tffilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,tp)
local count2=Duel.GetMatchingGroupCount(s.mfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and count1>0 and count2>0 end
local ct=math.min((Duel.GetLocationCount(tp,LOCATION_SZONE)),count1,count2)Shooting Majestic Star Dragon (40939228)
Source: Scripts/c40939228.lua
lua
end
function c40939228.atkval(e,c)
return Duel.GetMatchingGroupCount(c40939228.atkfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
end
function c40939228.negcon(e,tp,eg,ep,ev,re,r,rp)