Skip to content

Auxiliary.SelectSameCount ​

Signature ​

lua
Auxiliary.SelectSameCount(int tp, Group g1, Group g2, [int min], [int max], [Card|Group|nil except]) -> Group|nil

Description ​

Lets tp build a selection that contains the same number of cards from g1 and g2. except is removed from both groups before selection. The result can be nil if min is greater than the computed max.

Parameters ​

  • tp int
  • g1 Group
  • g2 Group
  • min int optional - default: 1
  • max int optional - default: min(#g1, #g2, 127)
  • except Card|Group|nil optional

Returns ​

  • Group|nil

Source ​

  • Utilities/utility.lua:1424

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 5 indexed script(s).
  • Search this function in the Script Explorer with Auxiliary.SelectSameCount.
CardIDScriptDetected Calls
Melffys' Joyful Surprise79561872Scripts/c79561872.lua1
Dark Rebellion Xyz Dragon of the Four Heavenly Dragons90091224Scripts/c90091224.lua1
Mementomictlan Tecuhtlica - Creation King14529511Scripts/c14529511.lua1
Sky Striker Special Maneuver - Lemnisgate!34433770Scripts/c34433770.lua1
Fire King Sky Burn91703676Scripts/c91703676.lua1

Script Examples ​

Melffys' Joyful Surprise (79561872) ​

Source: Scripts/c79561872.lua

lua
	if chk==0 then return #g1>0 and #g2>0 end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
	local sg=aux.SelectSameCount(tp,g1,g2)
	Duel.SetTargetCard(sg)
	Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)

Dark Rebellion Xyz Dragon of the Four Heavenly Dragons (90091224) ​

Source: Scripts/c90091224.lua

lua
	local g2=g:Filter(Card.IsControler,nil,1-tp)
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
	local sg=aux.SelectSameCount(tp,g1,g2)
	Duel.SetTargetCard(sg)
	Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)

Mementomictlan Tecuhtlica - Creation King (14529511) ​

Source: Scripts/c14529511.lua

lua
		and #g1>0 and #g2>0 end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
	local sg=aux.SelectSameCount(tp,g1,g2)
	Duel.SetTargetCard(sg)
	Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)