Skip to content

Duel.GetMatchingGroupCount ​

Signature ​

lua
Duel.GetMatchingGroupCount([function|nil f], int player, int s, int o, [Card|Group|nil ex], ... any) -> int

Description ​

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 ​

  • f function|nil optional
  • player int
  • s int
  • o int
  • ex Card|Group|nil optional
  • ... 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.
CardIDScriptDetected Calls
Ashtraja Susanoo17020474Scripts/c17020474.lua2
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
Shooting Majestic Star Dragon40939228Scripts/c40939228.lua1
Kewl Tune Crackle39576656Scripts/c39576656.lua1
D/D Extra Surveyor74387963Scripts/c74387963.lua2
Trirealm Rift Judgment65195679Scripts/c65195679.lua1
Clock Lizard51476410Scripts/c51476410.lua1
Phantom Knights' Rank-Up-Magic Force88504133Scripts/c88504133.lua2
Endymion, the Mighty Master of Magic3611830Scripts/c3611830.lua1
Ursarctic Quint Charge15758127Scripts/c15758127.lua1
Theia, the Primal Being85687952Scripts/c85687952.lua1
Heroic Champion - Magnum Excalibur14301396Scripts/c14301396.lua1
Nemleria Louve57296396Scripts/c57296396.lua1
Abyss Actor - Mellow Madonna78310590Scripts/c78310590.lua1
Traptrix Atypus48183890Scripts/c48183890.lua1
R.B. Shepherd's Crook80071619Scripts/c80071619.lua1
Dragunity Arma Gram53184342Scripts/c53184342.lua1
Squeeze, the Full Moon of Raise Moon - JACKPOT!9484285Scripts/c9484285.lua1
Worldsea Dragon Zealantis45112597Scripts/c45112597.lua1
Red Hypernova Dragon30698243Scripts/c30698243.lua1
Fairy Tail - Wiccat27632520Scripts/c27632520.lua1
Predaplant Daredevil82370493Scripts/c82370493.lua1
X-Saber Gottoms8252010Scripts/c8252010.lua1
Condemned Darklord35306215Scripts/c35306215.lua2
...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)