Skip to content

Duel.DiscardHand ​

Signature ​

lua
Duel.DiscardHand(int player, [function|nil f], int min, int max, int reason, [Card|Group|nil ex], ... any) -> int

Description ​

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 ​

  • player int
  • f function|nil optional
  • min int
  • max int
  • reason int
  • ex Card|Group|nil optional
  • ... 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.
CardIDScriptDetected Calls
Eternal Favorite87532344Scripts/c87532344.lua1
El Shaddoll Apkallone50907446Scripts/c50907446.lua1
Lubellion the Searing Dragon70534340Scripts/c70534340.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua1
Aroma Blend25861589Scripts/c25861589.lua1
A-to-Z-Dragon Buster Cannon65172015Scripts/c65172015.lua1
XYZ-Hyper Dragon Cannon75748977Scripts/c75748977.lua1
Super Quantal Mech Ship Magnacarrier10424147Scripts/c10424147.lua1
Erebus the Underworld Monarch23064604Scripts/c23064604.lua1
Inzektor Picofalena97273514Scripts/c97273514.lua1
Dual Avatar Invitation87669904Scripts/c87669904.lua1
Darktellarknight Batlamyus64414267Scripts/c64414267.lua1
Ojama Pajama75884822Scripts/c75884822.lua1
ABC-Dragon Buster1561110Scripts/c1561110.lua1
Dark World Accession65956182Scripts/c65956182.lua1
Genex Ally Triarm17760003Scripts/c17760003.lua1
Angello Vaalmonica3048768Scripts/c3048768.lua1
Shimmering Shatterer of the Sacred Beasts3441553Scripts/c3441553.lua1
Megalith Anastasis29876299Scripts/c29876299.lua1
Crealtar, the Impcantation Originator96915510Scripts/c96915510.lua1
Angelechy Problem17782288Scripts/c17782288.lua1
Fabled Realm's Revival57775790Scripts/c57775790.lua1
Dimonno Vaalmonica30432463Scripts/c30432463.lua1
...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)
end

El 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
	end

Lubellion 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)