Skip to content

Duel.GetLocationCountFromEx ​

Signature ​

lua
Duel.GetLocationCountFromEx(int player, [int reason_player], [Group|Card|nil targets], [Card|int|nil sc], [int zone]) -> int,int

Description ​

Returns the usable Monster Zone count for Special Summoning from the Extra Deck, followed by the usable zone mask. reason_player defaults to the current reason player. targets are treated as leaving the field before the count is checked.

Parameters ​

  • player int
  • reason_player int optional
  • targets Group|Card|nil optional
  • sc Card|int|nil optional
  • zone int optional

Returns ​

  • int - Number of usable Monster Zones.
  • int - Usable zone mask.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 459 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetLocationCountFromEx.
CardIDScriptDetected Calls
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Artmage Non-Finito74631897Scripts/c74631897.lua1
Pendulum Evolution55795155Scripts/c55795155.lua2
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua1
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua1
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua1
El Shaddoll Apkallone50907446Scripts/c50907446.lua1
Ghostrick Renovation61818176Scripts/c61818176.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Resurgam Xyz49082032Scripts/c49082032.lua1
Converging Wishes20007374Scripts/c20007374.lua1
Predaplant Bal Teah66787942Scripts/c66787942.lua1
D/D/D/D Dimensional King Arc Crisis71398055Scripts/c71398055.lua3
Shining Draw35906693Scripts/c35906693.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
Odd-Eyes Arcray Dragon6218704Scripts/c6218704.lua2
Enlightenment Dragon46186135Scripts/c46186135.lua1
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
Ursarctic Polar Star62714453Scripts/c62714453.lua2
The Gaze of Timaeus22283204Scripts/c22283204.lua1
Vidolium the Unstable Power Patron of Unity70488851Scripts/c70488851.lua1
Chronograph Sorcerer12289247Scripts/c12289247.lua1
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua1
...and 435 more

Script Examples ​

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
function s.spfilter1(c,e,tp)
	if not c:IsCanBeSpecialSummoned(e,0,tp,false,false) or not c:IsControler(tp) then return false end
	if c:IsLocation(LOCATION_EXTRA) then return c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end
	if c:IsLocation(LOCATION_GRAVE) then return aux.NecroValleyFilter()(c) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
	return false

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
	return c:IsFusionSetCard(0x1cd) and c:IsLevelAbove(7)
		and (c:IsControler(tp) or c:IsFaceup())
		and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
		and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
		local loc=0
		if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
		if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end
		if loc==0 then return false end
		local e1=Effect.CreateEffect(c)