Skip to content

Group.SelectWithSumEqual ​

Signature ​

lua
Group.SelectWithSumEqual(Group g, int player, function f, int acc, int min, int max, [... any]) -> Group|nil

Description ​

Lets player select cards from g whose f-sum equals acc using between min and max cards. Cards previously set with Duel.SetSelectedCard are forced into the sum, removed from the selectable pool, cleared afterward, and are not included in the returned Group.

Parameters ​

  • g Group
  • player int
  • f function
  • acc int
  • min int
  • max int
  • ... any optional

Returns ​

  • Group|nil - Selected optional cards, or nil for invalid player.

Source ​

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

Used By ​

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

  • Detected in 19 indexed script(s).
  • Search this function in the Script Explorer with Group.SelectWithSumEqual.
CardIDScriptDetected Calls
Prompthorn50548657Scripts/c50548657.lua1
Blackwing - Gofu the Vague Shadow9929398Scripts/c9929398.lua1
Rescue Ferret56343672Scripts/c56343672.lua1
Benghalancer the Resurgent73345237Scripts/c73345237.lua1
Blackwing - Vata the Emblem of Wandering71187462Scripts/c71187462.lua1
Starliege Seyfert15381421Scripts/c15381421.lua1
Variety Comes Out65196094Scripts/c65196094.lua1
Block Dragon94689206Scripts/c94689206.lua1
Gordian Slicer66236707Scripts/c66236707.lua1
Luminous Dragon Ritual34834619Scripts/c34834619.lua1
Spacetime Transcendence39041729Scripts/c39041729.lua1
Crop Circles24082387Scripts/c24082387.lua1
Necroid Synchro26194151Scripts/c26194151.lua1
Ancient Gear Factory30435145Scripts/c30435145.lua1
King's Consonance24590232Scripts/c24590232.lua1
Stardust Shimmer89181369Scripts/c89181369.lua1
Void Feast31548814Scripts/c31548814.lua1
The Puppet Magic of Dark Ruler40703393Scripts/c40703393.lua1
Tokusano Shinkyojin50357013Scripts/c50357013.lua1

Script Examples ​

Prompthorn (50548657) ​

Source: Scripts/c50548657.lua

lua
	if ft<=0 or g:GetCount()==0 then return end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
	local sg=g:SelectWithSumEqual(tp,Card.GetLevel,e:GetLabel(),1,ft)
	if sg:GetCount()>0 then
		local fid=e:GetHandler():GetFieldID()

Blackwing - Gofu the Vague Shadow (9929398) ​

Source: Scripts/c9929398.lua

lua
	local rg=Duel.GetMatchingGroup(c9929398.cfilter,tp,LOCATION_MZONE,0,e:GetHandler())
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
	local g2=rg:SelectWithSumEqual(tp,Card.GetLevel,rlv,ct,63)
	g2:AddCard(e:GetHandler())
	Duel.Remove(g2,POS_FACEUP,REASON_COST)

Rescue Ferret (56343672) ​

Source: Scripts/c56343672.lua

lua
		local fid=c:GetFieldID()
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
		local sg=g:SelectWithSumEqual(tp,Card.GetLevel,6,1,ct)
		local tc=sg:GetFirst()
		while tc do