Skip to content

RushDuel.CostSendDeckTopToGrave ​

Alias: RD.CostSendDeckTopToGrave. Requires the matching Rush Duel Lua bootstrap.

Signature ​

lua
RushDuel.CostSendDeckTopToGrave(int count, [function|nil set_label], [function|nil set_object]) -> function

Description ​

Returns a cost callback that checks whether the player can send count cards from the Deck as cost, then calls Duel.DiscardDeck with REASON_COST. Optional callbacks store information from the operated Group on the Effect.

Parameters ​

  • count int: Cards to send from the Deck top.
  • set_label function|nil (optional): Computes a numeric label from the operated Group.
  • set_object function|nil (optional): Computes a label object from the operated Group.

Returns ​

  • function: Cost callback.

Source ​

Rush/Utilities/RDCost.lua:240

lua
function RushDuel.CostSendDeckTopToGrave(count, set_label, set_object)
    return function(e, tp, eg, ep, ev, re, r, rp, chk)
        if chk == 0 then
            return Duel.IsPlayerCanDiscardDeckAsCost(tp, count)
        end
        if Duel.DiscardDeck(tp, count, REASON_COST) ~= 0 and (set_label ~= nil or set_object ~= nil) then
            local og = Duel.GetOperatedGroup()
            RushDuel.SetLabelAndObject(e, og, set_label, set_object)
        end
        return true
    end
end

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Rush/Scripts/ folder and rush_cards.cdb.

  • Detected in 310 indexed script(s).
  • Search this function in the Script Explorer with RushDuel.CostSendDeckTopToGrave.
CardIDScriptDetected Calls
Brassdes of the Wicked Wheels120304033Rush/Scripts/c120304033.lua1
Dark-Guiding Kuriboh120280009Rush/Scripts/c120280009.lua1
Planet Aegis120297006Rush/Scripts/c120297006.lua1
Red-Eyes Mars Dragon120306034Rush/Scripts/c120306034.lua1
Qadi of the Monumenthes120300009Rush/Scripts/c120300009.lua1
Yamiterasu the Divine Ruler120199036Rush/Scripts/c120199036.lua1
Harpie Lady Feather Duster120279002Rush/Scripts/c120279002.lua1
OuTerverSe Direct Driver120109056Rush/Scripts/c120109056.lua1
Despair and Desire120301034Rush/Scripts/c120301034.lua1
Fiarma the Ally Spark120298025Rush/Scripts/c120298025.lua1
Transam Road Linac120235030Rush/Scripts/c120235030.lua1
Sevens Road Charmy Witch120260062Rush/Scripts/c120260062.lua1
Peit the Ally Spark120298024Rush/Scripts/c120298024.lua1
Wooly Wonderland - Graveyard Grudge120208055Rush/Scripts/c120208055.lua1
Super Galaxy King Lord of Galactica [L]120254037Rush/Scripts/c120254037.lua1
Imaginary Leading Actor120271029Rush/Scripts/c120271029.lua1
Royal Rebel's Extreme120306006Rush/Scripts/c120306006.lua1
Battletested Curse of Dragon120249031Rush/Scripts/c120249031.lua1
UMP Sky Forbia120306017Rush/Scripts/c120306017.lua1
Voidalfr Buprestruve120300003Rush/Scripts/c120300003.lua1
Owlchannel120253031Rush/Scripts/c120253031.lua1
Blue-Eyes Vision Dragon120252004Rush/Scripts/c120252004.lua1
Dimension Riletta120309024Rush/Scripts/c120309024.lua1
Battletested Gaia The Fierce Knight120249032Rush/Scripts/c120249032.lua1
...and 286 more

Script Examples ​

Brassdes of the Wicked Wheels (120304033) ​

Source: Rush/Scripts/c120304033.lua

lua
	return RD.IsSpecialSummonMainPhase(e:GetHandler())
end
cm.cost=RD.CostSendDeckTopToGrave(3)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()

Dark-Guiding Kuriboh (120280009) ​

Source: Rush/Scripts/c120280009.lua

lua
		and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEDOWN_DEFENSE)
end
cm.cost=RD.CostSendDeckTopToGrave(2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end

Planet Aegis (120297006) ​

Source: Rush/Scripts/c120297006.lua

lua
	end
end
cm.cost=RD.CostSendDeckTopToGrave(2)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_MZONE,0,1,nil) end