Duel.GetMZoneCount
Signature
lua
Duel.GetMZoneCount(int player, [Card|Group|nil targets], [int use_player], [int reason], [int zone]) -> int,intDescription
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
playerint- Player whose Monster Zones are checked.targetsCard|Group|niloptional - Card or Group treated as leaving the field before the count is checked.use_playerintoptional - Player treated as placing the monster. Defaults to the current reason player.reasonintoptional - Placement reason. Defaults to LOCATION_REASON_TOFIELD.zoneintoptional - 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:
- Activation Legality
- Common Script Errors And Debugging
- Control Change
- Field Zones And Sequences
- Special Summon-Only Monster Guide
- Tribute Summon Materials
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.
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)))
endGoyo 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