Duel.Draw
Signature
lua
Duel.Draw(int player, int count, int reason) -> intDescription
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
playerintcountintreasonint
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.
| Card | ID | Script | Detected Calls |
|---|---|---|---|
| Levia-Dragoon - Daedalus | 78579058 | Scripts/c78579058.lua | 1 |
| Pere-Zenet Em Heru | 46273941 | Scripts/c46273941.lua | 1 |
| Junoldo the Shadespirit Power Patron | 10266279 | Scripts/c10266279.lua | 1 |
| Flower Cardian Peony with Butterfly | 57261568 | Scripts/c57261568.lua | 1 |
| A Bao A Qu, the Lightless Shadow | 4731783 | Scripts/c4731783.lua | 1 |
| Flower Cardian Willow with Calligrapher | 89818984 | Scripts/c89818984.lua | 1 |
| Magikey Dragon - Andrabime | 71159974 | Scripts/c71159974.lua | 1 |
| Ojamassimilation | 2390019 | Scripts/c2390019.lua | 1 |
| Triamid Pulse | 96100333 | Scripts/c96100333.lua | 1 |
| Abyss-steam | 63941169 | Scripts/c63941169.lua | 1 |
| Flower Cardian Moonflowerviewing | 33541430 | Scripts/c33541430.lua | 1 |
| Ojamatch | 38395123 | Scripts/c38395123.lua | 1 |
| Inzektor Picofalena | 97273514 | Scripts/c97273514.lua | 1 |
| Witchcrafter Pittore | 95245544 | Scripts/c95245544.lua | 1 |
| Fallen Paradise of the Sacred Beasts | 65861210 | Scripts/c65861210.lua | 1 |
| Amaze Attraction Wonder Wheel | 93473606 | Scripts/c93473606.lua | 1 |
| Vernusylph of the Thawing Mountains | 9238125 | Scripts/c9238125.lua | 1 |
| Genex Ally Triarm | 17760003 | Scripts/c17760003.lua | 1 |
| Megalith Anastasis | 29876299 | Scripts/c29876299.lua | 1 |
| Radiant Typhoon Mandate | 53813120 | Scripts/c53813120.lua | 1 |
| Fabled Realm's Revival | 57775790 | Scripts/c57775790.lua | 1 |
| Ryu-Ge Rivalry | 81549048 | Scripts/c81549048.lua | 1 |
| Miracle Synchro Fusion | 36484016 | Scripts/c36484016.lua | 1 |
| Neo Super Quantal Mech King Blaster Magna | 95493471 | Scripts/c95493471.lua | 1 |
| ...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
endPere-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)
endJunoldo 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)