Skip to content

Group.GetMinGroup ​

Signature ​

lua
Group.GetMinGroup(Group g, function f, [... any]) -> Group|nil,int|nil

Description ​

Calls f for each card in g, forwards any extra arguments, and returns a Group containing every card tied for the minimum value. The second return is the minimum integer value. If g is empty, this binding returns no Lua values. Keep all ties when the card text affects every lowest-scoring card; call Group.Select when a player must choose one tied card.

How To Use It ​

Use this to find every card tied for the lowest score in an existing Group.

lua
local lowg,atk=g:GetMinGroup(Card.GetAttack)
if #lowg>0 then
    local sg=lowg:Select(tp,1,1,nil)
end

The return values are the tied Group and the minimum score. If the source Group is empty, this binding returns no values.

Parameters ​

  • g Group
  • f function
  • ... any optional

Returns ​

  • Group|nil - Cards tied for the minimum value.
  • int|nil - Minimum value.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 23 indexed script(s).
  • Search this function in the Script Explorer with Group.GetMinGroup.
CardIDScriptDetected Calls
TiSolfachord Beautia54387923Scripts/c54387923.lua1
Vanquish Soul Hollie Sue93156774Scripts/c93156774.lua2
Vanquish Soul Dr. Mad Love29280200Scripts/c29280200.lua2
Uradora of Fate27753563Scripts/c27753563.lua1
Mayakashi Mayhem41867019Scripts/c41867019.lua1
Wrecker Panda28139785Scripts/c28139785.lua1
Chain Summon90812044Scripts/c90812044.lua1
Mad Hacker86993168Scripts/c86993168.lua1
Clashing Souls57496978Scripts/c57496978.lua1
Ninjitsu Art of Super-Transformation90200789Scripts/c90200789.lua2
Unibird21296383Scripts/c21296383.lua1
Card of Sacrifice88513608Scripts/c88513608.lua1
Queen Angel of Roses96470883Scripts/c96470883.lua2
Chthonian Blast18271561Scripts/c18271561.lua2
Unbreakable Spirit88494120Scripts/c88494120.lua2
The Great Noodle Inversion67906797Scripts/c67906797.lua1
Fire Prison269510Scripts/c269510.lua1
Burst Breath80163754Scripts/c80163754.lua2
Super Junior Confrontation29590905Scripts/c29590905.lua2
Zubaba Buster57036718Scripts/c57036718.lua2
Utopia Buster30341772Scripts/c30341772.lua2
Goblin Circus18658572Scripts/c18658572.lua1
Fissure66788016Scripts/c66788016.lua2

Script Examples ​

TiSolfachord Beautia (54387923) ​

Source: Scripts/c54387923.lua

lua
	local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
	if g:GetCount()==0 then return false end
	local _,min=g:GetMinGroup(Card.GetCurrentScale)
	return bc:IsAttackAbove(min*300)
end

Vanquish Soul Hollie Sue (93156774) ​

Source: Scripts/c93156774.lua

lua
		local g=Duel.GetMatchingGroup(s.ctfilter,tp,0,LOCATION_MZONE,nil)
		if #g<=0 then return false end
		local tg=g:GetMinGroup(Card.GetAttack):Filter(Card.IsControlerCanBeChanged,nil)
		return tg:GetCount()>0 and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 and Duel.GetFlagEffect(tp,id)==0
	end

Vanquish Soul Dr. Mad Love (29280200) ​

Source: Scripts/c29280200.lua

lua
function c29280200.rthtg(e,tp,eg,ep,ev,re,r,rp,chk)
	local g=Duel.GetMatchingGroup(c29280200.rthtgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
	local tg=g:GetMinGroup(Card.GetDefense)
	if chk==0 then return tg:IsExists(Card.IsAbleToHand,1,nil)
		and Duel.GetFlagEffect(tp,29280200)==0 end