Duel.GetFlagEffect
Signature
lua
Duel.GetFlagEffect(int player, int code) -> int|nilDescription
Returns how many player flag effects with code are registered on player. The return value is a count, not a boolean; compare it with 0 when testing whether a player marker exists.
How To Use It
Use this to count matching player markers.
lua
if Duel.GetFlagEffect(tp,id)==0 then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
endThe return value is a count. Use Duel.GetFlagEffectLabel when the marker's label value matters.
Related Functions
Parameters
playerint- Player whose flag effects are counted.codeint- Flag-effect code; the core masks it with MAX_CARD_ID and adds EFFECT_FLAG_EFFECT.
Returns
int|nil- Number of matching player flag effects, or nil if player is invalid.
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:4854
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 349 indexed script(s).
- Search this function in the Script Explorer with
Duel.GetFlagEffect.
Script Examples
Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
lua
end
function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and Duel.GetFlagEffect(sp,id)==0
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)Pendulum Evolution (55795155)
Source: Scripts/c55795155.lua
lua
end
function c55795155.pcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,55795155)>0
end
function c55795155.ptg(e,tp,eg,ep,ev,re,r,rp,chk)Eternal Favorite (87532344)
Source: Scripts/c87532344.lua
lua
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())