Duel.GetCurrentChain
Signature
lua
Duel.GetCurrentChain() -> intDescription
Returns the number of Chain Links currently stored in the active Chain. Use Duel.GetChainInfo to inspect a specific Chain Link; this function only returns the current Chain size.
How To Use It
Use this when a condition or operation needs the current Chain length.
lua
if Duel.GetCurrentChain()>0 then
-- a Chain is currently being built or resolved
endFor data about a specific Chain Link, use Duel.GetChainInfo instead of treating the count as the data itself.
Related Functions
Returns
int
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4945
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 170 indexed script(s).
- Search this function in the Script Explorer with
Duel.GetCurrentChain.
Script Examples
Eternal Favorite (87532344)
Source: Scripts/c87532344.lua
lua
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(1)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(aux.FALSE)
elseif Duel.GetCurrentChain()==1 thenSpellbook of the Grand Circle (11911336)
Source: Scripts/c11911336.lua
lua
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(1)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(s.chainlm)
elseif Duel.GetCurrentChain()==1 thenGhostrick Renovation (61818176)
Source: Scripts/c61818176.lua
lua
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(sc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end