Skip to content

Group.GetClassCount ​

Signature ​

lua
Group.GetClassCount(Group g, function f, ... any) -> int

Description ​

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 ​

  • g Group
  • f function
  • ... any

Returns ​

  • int

Source ​

  • D:\Programs\GitHub\ygopro-core\libgroup.cpp:927

Guided Examples ​

Learn how to use this function in context:

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.
CardIDScriptDetected Calls
Lady's Dragonmaid48658295Scripts/c48658295.lua1
Spellbook of the Grand Circle11911336Scripts/c11911336.lua2
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua2
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Converging Wishes20007374Scripts/c20007374.lua1
Enlightenment Dragon46186135Scripts/c46186135.lua1
Bujinki Ahashima71095768Scripts/c71095768.lua3
Ultimate Crystal Rainbow Dragon Overdrive84544192Scripts/c84544192.lua1
Chimera Fusion63136489Scripts/c63136489.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua2
Prank-Kids Rocket Ride18514525Scripts/c18514525.lua1
Gravity Balance37930737Scripts/c37930737.lua1
Regenesis Birth27781371Scripts/c27781371.lua1
Vernusylph and the Changing Season37313338Scripts/c37313338.lua1
Chaos Magical Hats2372506Scripts/c2372506.lua1
Isolde, Two Tales of the Noble Knights59934749Scripts/c59934749.lua2
Magikey Dragon - Andrabime71159974Scripts/c71159974.lua1
Ojamassimilation2390019Scripts/c2390019.lua1
Cyberse Reminder56337500Scripts/c56337500.lua1
Alba System Dogmatikalamity93053159Scripts/c93053159.lua2
Prank-Kids Bow-Wow-Bark43886072Scripts/c43886072.lua1
Super Quantal Mech Ship Magnacarrier10424147Scripts/c10424147.lua1
Awakening of the Sacred Beasts53701259Scripts/c53701259.lua2
Arktos XII - Chronochasm Vaylantz50687050Scripts/c50687050.lua1
...and 299 more

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)