Duel.DiscardHand
Signature
lua
Duel.DiscardHand(int player, [function|nil f], int min, int max, int reason, [Card|Group|nil ex], ... any) -> intDescription
Lets player choose and discard min to max matching cards from their hand for reason, then returns the number discarded. Cards in ex are excluded. Extra arguments after ex are passed to filter f.
Parameters
playerintffunction|niloptionalminintmaxintreasonintexCard|Group|niloptional...any
Returns
int
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4911
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 630 indexed script(s).
- Search this function in the Script Explorer with
Duel.DiscardHand.
| Card | ID | Script | Detected Calls |
|---|---|---|---|
| Eternal Favorite | 87532344 | Scripts/c87532344.lua | 1 |
| El Shaddoll Apkallone | 50907446 | Scripts/c50907446.lua | 1 |
| Lubellion the Searing Dragon | 70534340 | Scripts/c70534340.lua | 1 |
| D/D Count Surveyor | 5997110 | Scripts/c5997110.lua | 1 |
| A Bao A Qu, the Lightless Shadow | 4731783 | Scripts/c4731783.lua | 1 |
| Aroma Blend | 25861589 | Scripts/c25861589.lua | 1 |
| A-to-Z-Dragon Buster Cannon | 65172015 | Scripts/c65172015.lua | 1 |
| XYZ-Hyper Dragon Cannon | 75748977 | Scripts/c75748977.lua | 1 |
| Super Quantal Mech Ship Magnacarrier | 10424147 | Scripts/c10424147.lua | 1 |
| Erebus the Underworld Monarch | 23064604 | Scripts/c23064604.lua | 1 |
| Inzektor Picofalena | 97273514 | Scripts/c97273514.lua | 1 |
| Dual Avatar Invitation | 87669904 | Scripts/c87669904.lua | 1 |
| Darktellarknight Batlamyus | 64414267 | Scripts/c64414267.lua | 1 |
| Ojama Pajama | 75884822 | Scripts/c75884822.lua | 1 |
| ABC-Dragon Buster | 1561110 | Scripts/c1561110.lua | 1 |
| Dark World Accession | 65956182 | Scripts/c65956182.lua | 1 |
| Genex Ally Triarm | 17760003 | Scripts/c17760003.lua | 1 |
| Angello Vaalmonica | 3048768 | Scripts/c3048768.lua | 1 |
| Shimmering Shatterer of the Sacred Beasts | 3441553 | Scripts/c3441553.lua | 1 |
| Megalith Anastasis | 29876299 | Scripts/c29876299.lua | 1 |
| Crealtar, the Impcantation Originator | 96915510 | Scripts/c96915510.lua | 1 |
| Angelechy Problem | 17782288 | Scripts/c17782288.lua | 1 |
| Fabled Realm's Revival | 57775790 | Scripts/c57775790.lua | 1 |
| Dimonno Vaalmonica | 30432463 | Scripts/c30432463.lua | 1 |
| ...and 606 more |
Script Examples
Eternal Favorite (87532344)
Source: Scripts/c87532344.lua
lua
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler())
and c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
Duel.SendtoGrave(c,REASON_COST)
endEl Shaddoll Apkallone (50907446)
Source: Scripts/c50907446.lua
lua
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD,nil)
end
endLubellion the Searing Dragon (70534340)
Source: Scripts/c70534340.lua
lua
function c70534340.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c70534340.filter0(c)