Skip to content

Duel.Release ​

Signature ​

lua
Duel.Release(Card|Group targets, int reason, [int reason_player]) -> int

Description ​

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:

lua
local g=Duel.SelectReleaseGroupEx(tp,nil,1,1,REASON_COST,false,nil)
if #g>0 then
    Duel.Release(g,REASON_COST)
end

The return value is the number of cards actually released.

Parameters ​

  • targets Card|Group
  • reason int
  • reason_player int optional

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.
CardIDScriptDetected Calls
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Artmage Non-Finito74631897Scripts/c74631897.lua1
Surprise Fusion35167375Scripts/c35167375.lua1
Goyo Emperor59255742Scripts/c59255742.lua1
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua1
Meteoroa Drytron24166324Scripts/c24166324.lua1
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Odd-Eyes Revolution Dragon16306932Scripts/c16306932.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
Odd-Eyes Arcray Dragon6218704Scripts/c6218704.lua1
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
Ultimate Crystal Rainbow Dragon Overdrive84544192Scripts/c84544192.lua1
Tellusion the Magna Warrior24431911Scripts/c24431911.lua1
Ursarctic Polar Star62714453Scripts/c62714453.lua1
Penetration Fusion8778267Scripts/c8778267.lua1
DoSolfachord Coolia80776622Scripts/c80776622.lua1
Rescue Hamster50485594Scripts/c50485594.lua1
Mitsurugi Magatama76725398Scripts/c76725398.lua1
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua1
Cyber Pharos29719112Scripts/c29719112.lua1
Prank-Kids Rocket Ride18514525Scripts/c18514525.lua1
Vaylantz Genesis Grand Duke76075139Scripts/c76075139.lua1
...and 1051 more

Script Examples ​

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

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

lua
	g:Sub(dg)
	Duel.SendtoGrave(dg,REASON_SPSUMMON+REASON_DISCARD)
	Duel.Release(g,REASON_SPSUMMON)
	g:DeleteGroup()
end

Surprise Fusion (35167375) ​

Source: Scripts/c35167375.lua

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)