Group.CheckWithSumEqual
Signature
lua
Group.CheckWithSumEqual(Group g, function f, int acc, int min, int max, [... any]) -> boolDescription
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
gGroupffunctionaccintminintmaxint...anyoptional
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.
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)