Skip to content

Duel.GetMZoneCount ​

Signature ​

lua
Duel.GetMZoneCount(int player, [Card|Group|nil targets], [int use_player], [int reason], [int zone]) -> int,int

Description ​

Returns the number of usable Monster Zones for player after targets leave, plus the usable zone mask. use_player, reason, and zone are used by effects that restrict where monsters can be placed.

Parameters ​

  • player int - Player whose Monster Zones are checked.
  • targets Card|Group|nil optional - Card or Group treated as leaving the field before the count is checked.
  • use_player int optional - Player treated as placing the monster. Defaults to the current reason player.
  • reason int optional - Placement reason. Defaults to LOCATION_REASON_TOFIELD.
  • zone int optional - Monster Zone mask to restrict the count. Defaults to 0xff.

Returns ​

  • int - Usable Monster Zone count after targets are ignored.
  • int - Usable Monster Zone mask.

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4936

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 726 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetMZoneCount.
CardIDScriptDetected Calls
Surprise Fusion35167375Scripts/c35167375.lua1
Goyo Emperor59255742Scripts/c59255742.lua1
Meteoroa Drytron24166324Scripts/c24166324.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Am Duazenet45151304Scripts/c45151304.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
Tellusion the Magna Warrior24431911Scripts/c24431911.lua2
Vidolium the Unstable Power Patron of Unity70488851Scripts/c70488851.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua1
Cerynemesia, Mystical Beast of the Forest43632709Scripts/c43632709.lua1
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua1
Cyber Pharos29719112Scripts/c29719112.lua1
Prank-Kids Rocket Ride18514525Scripts/c18514525.lua1
Flowering Etoile the Melodious Magnificat83793721Scripts/c83793721.lua2
Frightfur Meister77522571Scripts/c77522571.lua1
Soul of the Supreme King92428405Scripts/c92428405.lua1
Ojamassimilation2390019Scripts/c2390019.lua1
Ecclesia and the Dark Dragon78397661Scripts/c78397661.lua1
Performapal Celestial Magician58092907Scripts/c58092907.lua1
Plunder Patrollship Jord85969517Scripts/c85969517.lua4
Vanquish Soul Trinity Burst53330789Scripts/c53330789.lua2
Grandpa Demetto44190146Scripts/c44190146.lua2
...and 702 more

Script Examples ​

Surprise Fusion (35167375) ​

Source: Scripts/c35167375.lua

lua
function s.cfilter(c,tp,chk)
	return c:IsType(TYPE_FUSION) and c:IsReleasableByEffect() and (not chk
		or (Duel.GetMZoneCount(tp,c)>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
			and Duel.IsPlayerCanSpecialSummonMonster(tp,id+o,0,TYPES_TOKEN_MONSTER,0,0,c:GetLevel(),RACE_SPELLCASTER,ATTRIBUTE_DARK)))
end

Goyo Emperor (59255742) ​

Source: Scripts/c59255742.lua

lua
end
function c59255742.costfilter(c,tp,g)
	return c59255742.ffilter(c) and Duel.GetMZoneCount(tp,c,tp,LOCATION_REASON_CONTROL)>0 and g:IsExists(aux.TRUE,1,c)
end
function c59255742.cost(e,tp,eg,ep,ev,re,r,rp,chk)

Meteoroa Drytron (24166324) ​

Source: Scripts/c24166324.lua

lua
end
function s.RitualCheck(g,tp,c,atk,greater_or_equal)
	return s["RitualCheck"..greater_or_equal](g,c,atk) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
		and (not aux.RCheckAdditional or aux.RCheckAdditional(tp,g,c))
end