Skip to content

Duel.Draw ​

Signature ​

lua
Duel.Draw(int player, int count, int reason) -> int

Description ​

Makes player draw up to count cards for reason and returns the number actually drawn. When reason includes REASON_RULE, effects that prevent drawing are ignored.

Parameters ​

  • player int
  • count int
  • reason int

Returns ​

  • int

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 850 indexed script(s).
  • Search this function in the Script Explorer with Duel.Draw.
CardIDScriptDetected Calls
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua1
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua1
Magikey Dragon - Andrabime71159974Scripts/c71159974.lua1
Ojamassimilation2390019Scripts/c2390019.lua1
Triamid Pulse96100333Scripts/c96100333.lua1
Abyss-steam63941169Scripts/c63941169.lua1
Flower Cardian Moonflowerviewing33541430Scripts/c33541430.lua1
Ojamatch38395123Scripts/c38395123.lua1
Inzektor Picofalena97273514Scripts/c97273514.lua1
Witchcrafter Pittore95245544Scripts/c95245544.lua1
Fallen Paradise of the Sacred Beasts65861210Scripts/c65861210.lua1
Amaze Attraction Wonder Wheel93473606Scripts/c93473606.lua1
Vernusylph of the Thawing Mountains9238125Scripts/c9238125.lua1
Genex Ally Triarm17760003Scripts/c17760003.lua1
Megalith Anastasis29876299Scripts/c29876299.lua1
Radiant Typhoon Mandate53813120Scripts/c53813120.lua1
Fabled Realm's Revival57775790Scripts/c57775790.lua1
Ryu-Ge Rivalry81549048Scripts/c81549048.lua1
Miracle Synchro Fusion36484016Scripts/c36484016.lua1
Neo Super Quantal Mech King Blaster Magna95493471Scripts/c95493471.lua1
...and 826 more

Script Examples ​

Levia-Dragoon - Daedalus (78579058) ​

Source: Scripts/c78579058.lua

lua
	if Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)>0 then
		Duel.BreakEffect()
		Duel.Draw(1-tp,h,REASON_EFFECT)
	end
end

Pere-Zenet Em Heru (46273941) ​

Source: Scripts/c46273941.lua

lua
function s.drop(e,tp,eg,ep,ev,re,r,rp)
	local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
	Duel.Draw(p,d,REASON_EFFECT)
end

Junoldo the Shadespirit Power Patron (10266279) ​

Source: Scripts/c10266279.lua

lua
	if not c:IsRelateToChain() or Duel.Destroy(c,REASON_EFFECT)==0 then return end
	local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
	if Duel.Draw(p,2,REASON_EFFECT)==2 then
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
		local dg=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil,REASON_EFFECT)