Skip to content

Card.IsDiscardable ​

Signature ​

lua
Card.IsDiscardable(Card c, [int reason]) -> bool

Description ​

Checks whether c can be discarded for reason. This is only a check: sending a card from the hand to the Graveyard with REASON_DISCARD does not by itself make that card unable to be discarded.

Parameters ​

  • c Card
  • reason int optional - default: REASON_COST

Returns ​

  • bool

Source ​

  • D:\Programs\GitHub\ygopro-core\libcard.cpp:3652

Used By ​

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

  • Detected in 674 indexed script(s).
  • Search this function in the Script Explorer with Card.IsDiscardable.
CardIDScriptDetected Calls
Artmage Non-Finito74631897Scripts/c74631897.lua1
Eternal Favorite87532344Scripts/c87532344.lua2
Lubellion the Searing Dragon70534340Scripts/c70534340.lua2
Resurgam Xyz49082032Scripts/c49082032.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua2
Aroma Blend25861589Scripts/c25861589.lua2
D/D Extra Surveyor74387963Scripts/c74387963.lua1
A-to-Z-Dragon Buster Cannon65172015Scripts/c65172015.lua2
XYZ-Hyper Dragon Cannon75748977Scripts/c75748977.lua2
Deep Sea Minstrel71978434Scripts/c71978434.lua2
Super Quantal Mech Ship Magnacarrier10424147Scripts/c10424147.lua2
Lunalight Masquerade2344618Scripts/c2344618.lua1
Erebus the Underworld Monarch23064604Scripts/c23064604.lua1
Nebulus, Dragon Ruler of Mishaps94655777Scripts/c94655777.lua2
Inzektor Picofalena97273514Scripts/c97273514.lua2
Witchcrafter Pittore95245544Scripts/c95245544.lua1
Witchcrafter Genni64756282Scripts/c64756282.lua1
Dual Avatar Invitation87669904Scripts/c87669904.lua2
Darktellarknight Batlamyus64414267Scripts/c64414267.lua2
Darkuriboh1035143Scripts/c1035143.lua1
ABC-Dragon Buster1561110Scripts/c1561110.lua2
Dark World Accession65956182Scripts/c65956182.lua2
...and 650 more

Script Examples ​

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
end
function s.cfilter(c)
	return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDiscardable(REASON_SPSUMMON)
end
function s.spcon(e,c)

Eternal Favorite (87532344) ​

Source: Scripts/c87532344.lua

lua
function s.fucost(e,tp,eg,ep,ev,re,r,rp,chk)
	local c=e:GetHandler()
	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)

Lubellion the Searing Dragon (70534340) ​

Source: Scripts/c70534340.lua

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