Skip to content

Duel.SendtoDeck ​

Signature ​

lua
Duel.SendtoDeck(Card|Group targets, [int|nil player], int seq, int reason, [int reason_player], [bool send_activating]) -> int

Description ​

Returns targets to the Deck or Extra Deck for reason and returns the number of cards moved. If player is nil, each card returns to its owner. Use sequence constants such as SEQ_DECKTOP, SEQ_DECKBOTTOM, or SEQ_DECKSHUFFLE to control placement. Check the return value when a later action depends on the cards actually reaching the Deck or Extra Deck.

How To Use It ​

Use this for returning cards to the Main Deck or Extra Deck.

player can be nil for the normal return destination. seq controls placement: SEQ_DECKTOP, SEQ_DECKBOTTOM, or SEQ_DECKSHUFFLE.

lua
if #g>0 then
    Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end

Check the return value when a later part of the effect depends on a card actually reaching the Deck or Extra Deck.

Parameters ​

  • targets Card|Group
  • player int|nil optional
  • seq int
  • reason int
  • reason_player int optional
  • send_activating bool optional

Returns ​

  • int

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 926 indexed script(s).
  • Search this function in the Script Explorer with Duel.SendtoDeck.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua1
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Pendulum Evolution55795155Scripts/c55795155.lua1
Lady's Dragonmaid48658295Scripts/c48658295.lua1
Spellbook of the Grand Circle11911336Scripts/c11911336.lua1
Ashtraja Susanoo17020474Scripts/c17020474.lua1
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua1
Yomagna the Fire Phantom17350692Scripts/c17350692.lua1
Fiendsmith's Sequence49867899Scripts/c49867899.lua1
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
Mementotlan Fusion66518509Scripts/c66518509.lua1
Lubellion the Searing Dragon70534340Scripts/c70534340.lua1
Magnet Bonding65514302Scripts/c65514302.lua1
Odd-Eyes Revolution Dragon16306932Scripts/c16306932.lua1
Resurgam Xyz49082032Scripts/c49082032.lua1
PSY-Framelord Omega74586817Scripts/c74586817.lua1
Artmage Masterwork -Succession-37517035Scripts/c37517035.lua1
Odd-Eyes Arcray Dragon6218704Scripts/c6218704.lua1
Ultimate Crystal Rainbow Dragon Overdrive84544192Scripts/c84544192.lua1
GMX Associate Noma83528184Scripts/c83528184.lua3
Kewl Tune Crackle39576656Scripts/c39576656.lua1
Dracotail Shaulas42125140Scripts/c42125140.lua1
PSY-Framelord Zeta37192109Scripts/c37192109.lua1
The Gaze of Timaeus22283204Scripts/c22283204.lua1
...and 902 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
				Duel.HintSelection(gg)
			end
			Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
			Duel.BreakEffect()
			Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
				Duel.HintSelection(cg)
			end
			Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
			Duel.BreakEffect()
			Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
	e:SetLabel(g:GetFirst():GetCode())
	Duel.ConfirmCards(1-tp,g)
	Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
	Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end