Duel.SendtoGrave
Signature
Duel.SendtoGrave(Card|Group targets, int reason, [int reason_player]) -> intDescription
Sends targets to the GY for reason, optionally treating reason_player as the player that moved them, and returns the number actually moved. This is not destruction by itself. Use Duel.Destroy for destroy effects, or include the correct discard/material/release reason flags when the card text or mechanic requires them.
How To Use It
Use this for sending cards to the Graveyard by effect, cost, discard, or material handling.
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
endThis is not the same as destroying. A card sent to the Graveyard by Duel.SendtoGrave was not destroyed unless the reason and prior action also say it was destroyed.
Related Functions
Parameters
targetsCard|Group- Card or Group to send to the Graveyard.reasonint- REASON_* flags recorded for the move.reason_playerintoptional - Player recorded as the reason player; defaults to the core's current reason player.
Returns
int- Number of cards actually sent to the Graveyard.
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4860
Guided Examples
Learn how to use this function in context:
- Methods for Affecting Cards
- Field Spells
- Fusion Procedure Guide
- Link Procedure Guide
- Functions That Move Cards Across Locations
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 2387 indexed script(s).
- Search this function in the Script Explorer with
Duel.SendtoGrave.
Script Examples
Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
local dg=g:Filter(s.disfilter,nil)
g:Sub(dg)
Duel.SendtoGrave(dg,REASON_SPSUMMON+REASON_DISCARD)
Duel.Release(g,REASON_SPSUMMON)
g:DeleteGroup()Levia-Dragoon - Daedalus (78579058)
Source: Scripts/c78579058.lua
c:SetMaterial(g)
s.LExtraMaterialCount(g,c,tp)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
endAzure Ocean Dragon Lord - Neo-Daedalus Rage (41570943)
Source: Scripts/c41570943.lua
c:SetMaterial(g)
s.LExtraMaterialCount(g,c,tp)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
end