Card.IsDiscardable
Signature
lua
Card.IsDiscardable(Card c, [int reason]) -> boolDescription
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
cCardreasonintoptional - 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.
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