Group.GetClassCount
Signature
lua
Group.GetClassCount(Group g, function f, ... any) -> intDescription
Counts distinct classes among cards in g according to f. Cards with the same return value from f count as the same class; extra arguments are passed to f.
Parameters
gGroupffunction...any
Returns
int
Source
D:\Programs\GitHub\ygopro-core\libgroup.cpp:927
Guided Examples
Learn how to use this function in context:
- Filters, Card Objects, and Group Objects
- Link Procedure Guide
- Special Summon-Only Monster Guide
- Xyz Procedure Guide
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 323 indexed script(s).
- Search this function in the Script Explorer with
Group.GetClassCount.
Script Examples
Lady's Dragonmaid (48658295)
Source: Scripts/c48658295.lua
lua
end
function s.fselect(g)
return g:GetClassCount(Card.GetLevel)==2 and aux.SameValueCheck(g,Card.GetFusionAttribute) and g:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD) and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)
end
function s.spcon(e,c)Spellbook of the Grand Circle (11911336)
Source: Scripts/c11911336.lua
lua
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if chk==0 then return g:GetClassCount(Card.GetAttribute)>=4 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,4,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,tp,LOCATION_HAND)Ehther the Heavenly Monarch (96570609)
Source: Scripts/c96570609.lua
lua
if chk==0 then
local g=Duel.GetMatchingGroup(c96570609.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
return g:GetClassCount(Card.GetCode)>1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c96570609.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)