Skip to content

Duel.IsPlayerCanDiscardDeckAsCost ​

Signature ​

lua
Duel.IsPlayerCanDiscardDeckAsCost(int player, int count) -> bool

Description ​

Checks whether player can send count cards from the top of the Deck to the Graveyard as a cost.

Parameters ​

  • player int
  • count int

Returns ​

  • bool

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:5046

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 26 indexed script(s).
  • Search this function in the Script Explorer with Duel.IsPlayerCanDiscardDeckAsCost.
CardIDScriptDetected Calls
Deep Sea Minstrel71978434Scripts/c71978434.lua1
Naturia Mole Cricket93454062Scripts/c93454062.lua1
Deep Sea Sentry45483489Scripts/c45483489.lua1
Deep Sea Artisan8495780Scripts/c8495780.lua1
Naturia Ladybug19605133Scripts/c19605133.lua1
Dante, Traveler of the Burning Abyss83531441Scripts/c83531441.lua2
Driangle, Dragon of the Dark Deep98248208Scripts/c98248208.lua1
Mythical Bestiary38325384Scripts/c38325384.lua1
Rainbow Neos86346643Scripts/c86346643.lua1
Celestia, Lightsworn Angel94381039Scripts/c94381039.lua1
Naturia Sunflower7478431Scripts/c7478431.lua1
Cupid Volley11851647Scripts/c11851647.lua2
Naturia Vein16940215Scripts/c16940215.lua1
Naturia Horneedle84905691Scripts/c84905691.lua1
Orbital Hydralander44009443Scripts/c44009443.lua1
Card Blocker42256406Scripts/c42256406.lua2
Naturia Exterio99916754Scripts/c99916754.lua1
Card Trooper85087012Scripts/c85087012.lua2
Naturia Beast33198837Scripts/c33198837.lua1
Hidden Armory52105192Scripts/c52105192.lua1
Laval Blaster11834972Scripts/c11834972.lua2
Battlin' Boxing Spirits36916401Scripts/c36916401.lua1
Lightsworn Barrier22201234Scripts/c22201234.lua1
Naturia Rock54161401Scripts/c54161401.lua1
...and 2 more

Script Examples ​

Deep Sea Minstrel (71978434) ​

Source: Scripts/c71978434.lua

lua
end
function c71978434.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,3) end
	Duel.DiscardDeck(tp,3,REASON_COST)
end

Naturia Mole Cricket (93454062) ​

Source: Scripts/c93454062.lua

lua
	local c=e:GetHandler()
	local fe=Duel.IsPlayerAffectedByEffect(tp,29942771)
	local b1=fe and Duel.IsPlayerCanDiscardDeckAsCost(tp,2) and Duel.GetMZoneCount(tp)>0
	local b2=c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0
	if chk==0 then return b1 or b2 end

Deep Sea Sentry (45483489) ​

Source: Scripts/c45483489.lua

lua
end
function c45483489.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,2) end
	Duel.DiscardDeck(tp,2,REASON_COST)
end