Skip to content

Duel.GetSZoneCount ​

Signature ​

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

Description ​

Returns the number of available Spell & Trap Zones for player after targets leave, optionally restricted by zone. The Field Zone is not included. The additional use_player and reason parameters are used by effects that restrict zones, such as Kaiser Colosseum.

Parameters ​

  • player int - Player whose Spell & Trap 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 card. Defaults to the current reason player.
  • reason int optional - Placement reason. Defaults to LOCATION_REASON_TOFIELD.
  • zone int optional - Spell & Trap Zone mask to restrict the count. Defaults to 0xff.

Returns ​

  • int - Usable Spell & Trap Zone count after targets are ignored.
  • int - Usable Spell & Trap Zone mask.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 18 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetSZoneCount.
CardIDScriptDetected Calls
Hrimnir the Divine Follower49904658Scripts/c49904658.lua1
Paleozoic Cambroraster36346532Scripts/c36346532.lua1
Parametalfoes Melcaster10024317Scripts/c10024317.lua1
Zenetmes Nekhbet10884847Scripts/c10884847.lua1
Amazement Precious Park33773528Scripts/c33773528.lua1
The Weather Painter Sun54895237Scripts/c54895237.lua1
Sunvine Shrine27946124Scripts/c27946124.lua1
That's 10!97223101Scripts/c97223101.lua1
Raremetalfoes Bismugear18716735Scripts/c18716735.lua1
The Weather Painter Thunder91299846Scripts/c91299846.lua1
Crystal Tree47408488Scripts/c47408488.lua1
Artifact Ignition29223325Scripts/c29223325.lua1
Trap Holic22377092Scripts/c22377092.lua1
Metalfoes Silverd7868571Scripts/c7868571.lua1
Metalfoes Volflame69351984Scripts/c69351984.lua1
Metalfoes Steelen60473572Scripts/c60473572.lua1
Metalfoes Goldriver33256280Scripts/c33256280.lua1
Terrors of the Overroot63086455Scripts/c63086455.lua1

Script Examples ​

Hrimnir the Divine Follower (49904658) ​

Source: Scripts/c49904658.lua

lua
end
function s.rcheck(g,tp)
	return Duel.GetSZoneCount(tp,g)>0 and Duel.CheckReleaseGroupEx(tp,Auxiliary.IsInGroup,#g,REASON_COST,true,nil,g)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)

Paleozoic Cambroraster (36346532) ​

Source: Scripts/c36346532.lua

lua
end
function c36346532.cfilter(c,tp)
	return c:GetSequence()<5 and c:IsFacedown() and c:IsAbleToGrave() and Duel.GetSZoneCount(tp,c)>0
		and Duel.IsExistingMatchingCard(c36346532.setfilter,tp,LOCATION_DECK,0,1,nil,c,tp)
end

Parametalfoes Melcaster (10024317) ​

Source: Scripts/c10024317.lua

lua
function c10024317.desfilter(c,tp)
	if c:IsFacedown() then return false end
	return Duel.GetSZoneCount(tp,c)>0 and Duel.IsExistingMatchingCard(c10024317.filter,tp,LOCATION_DECK,0,1,nil,true)
end
function c10024317.filter(c,ignore)