Skip to content

Group.CheckWithSumEqual ​

Signature ​

lua
Group.CheckWithSumEqual(Group g, function f, int acc, int min, int max, [... any]) -> bool

Description ​

Checks whether a subset of g, including any must-select cards, can make the f-sum exactly acc using between min and max cards.

Parameters ​

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

Returns ​

  • bool

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 37 indexed script(s).
  • Search this function in the Script Explorer with Group.CheckWithSumEqual.
CardIDScriptDetected Calls
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua2
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua2
Meteoroa Drytron24166324Scripts/c24166324.lua1
Nekroz Kaleidoscope51124303Scripts/c51124303.lua2
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua2
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua2
Meteonis Drytron22398665Scripts/c22398665.lua1
Horn of Olifant55749927Scripts/c55749927.lua2
Flower Cardian Moonflowerviewing33541430Scripts/c33541430.lua2
Cupid Pitch21915012Scripts/c21915012.lua2
R-Genex Turing61052897Scripts/c61052897.lua2
Prompthorn50548657Scripts/c50548657.lua1
Blackwing - Gofu the Vague Shadow9929398Scripts/c9929398.lua1
Rampaging Smashtank Rhynosaber82197831Scripts/c82197831.lua1
Rescue Ferret56343672Scripts/c56343672.lua2
Benghalancer the Resurgent73345237Scripts/c73345237.lua1
T.G. Cyber Magician64910482Scripts/c64910482.lua1
Blackwing - Vata the Emblem of Wandering71187462Scripts/c71187462.lua1
Starliege Seyfert15381421Scripts/c15381421.lua1
Variety Comes Out65196094Scripts/c65196094.lua1
Vendread Reunion2266498Scripts/c2266498.lua1
Block Dragon94689206Scripts/c94689206.lua1
Tatsunoko55863245Scripts/c55863245.lua1
Tatsunecro3096468Scripts/c3096468.lua1
...and 13 more

Script Examples ​

Levia-Dragoon - Daedalus (78579058) ​

Source: Scripts/c78579058.lua

lua
function s.LCheckGoal(sg,tp,lc,gf,lmat)
	return (Duel.IsPlayerAffectedByEffect(tp,38391684)
		and sg:CheckWithSumEqual(s.GetLinkCount,2,#sg,#sg)
		or sg:CheckWithSumEqual(s.GetLinkCount,lc:GetLink(),#sg,#sg))
		and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg,lc,tp))

Azure Ocean Dragon Lord - Neo-Daedalus Rage (41570943) ​

Source: Scripts/c41570943.lua

lua
function s.LCheckGoal(sg,tp,lc,gf,lmat)
	return (Duel.IsPlayerAffectedByEffect(tp,38391684)
		and sg:CheckWithSumEqual(s.GetLinkCount,3,#sg,#sg)
		or sg:CheckWithSumEqual(s.GetLinkCount,lc:GetLink(),#sg,#sg))
		and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg,lc,tp))

Meteoroa Drytron (24166324) ​

Source: Scripts/c24166324.lua

lua
function s.RitualCheckEqual(g,c,atk)
	if atk==0 then return false end
	return g:CheckWithSumEqual(aux.GetCappedAttack,atk,#g,#g)
end
function s.RitualCheck(g,tp,c,atk,greater_or_equal)