Duel.Release
Signature
Duel.Release(Card|Group targets, int reason, [int reason_player]) -> intDescription
Tributes/Releases targets for reason and returns the number of cards actually released. Use REASON_COST when paying a cost and REASON_EFFECT or REASON_SPSUMMON when the release is part of an effect or Summon procedure. Match the reason to the filter that selected the cards, such as cost-specific releasable checks for costs.
How To Use It
Use this to Tribute/Release cards as a cost, effect, or Summon procedure.
When selecting a release cost, select cards that are legal to release, then release them with the same reason used for the cost:
local g=Duel.SelectReleaseGroupEx(tp,nil,1,1,REASON_COST,false,nil)
if #g>0 then
Duel.Release(g,REASON_COST)
endThe return value is the number of cards actually released.
Related Functions
Parameters
targetsCard|Groupreasonintreason_playerintoptional
Returns
int
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4881
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 1075 indexed script(s).
- Search this function in the Script Explorer with
Duel.Release.
Script Examples
Astrograph Sorcerer, the Starfrost Magician (48171151)
Source: Scripts/c48171151.lua
local c=e:GetHandler()
if not c:IsRelateToChain() or not c:IsReleasable(REASON_EFFECT) then return end
Duel.Release(c,REASON_EFFECT)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter0,nil,e)Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
g:Sub(dg)
Duel.SendtoGrave(dg,REASON_SPSUMMON+REASON_DISCARD)
Duel.Release(g,REASON_SPSUMMON)
g:DeleteGroup()
endSurprise Fusion (35167375)
Source: Scripts/c35167375.lua
local rc=srg:GetFirst()
local level=rc:GetLevel()
if Duel.Release(rc,REASON_EFFECT)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133)