Card.GetFlagEffect
Signature
lua
Card.GetFlagEffect(Card c, int code) -> intDescription
Returns how many flag effects with code are registered on c. The return value is a count, not a boolean; compare it with 0 when testing whether a card marker exists.
How To Use It
Use this to count matching card markers.
lua
if c:GetFlagEffect(id)==0 then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
endThe return value is a count, not a boolean. Compare it with 0 when checking whether a marker exists.
Related Functions
Parameters
cCard- Card whose single-card flag effects are counted.codeint- Flag-effect code; the core masks it with MAX_CARD_ID and adds EFFECT_FLAG_EFFECT.
Returns
int- Number of matching flag effects on c.
Source
D:\Programs\GitHub\ygopro-core\libcard.cpp:3608
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 474 indexed script(s).
- Search this function in the Script Explorer with
Card.GetFlagEffect.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
lua
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(id)~=0 then
return true
elseArtmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
lua
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_FUSION) or c:GetFlagEffect(id)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)Astrograph Sorcerer (76794549)
Source: Scripts/c76794549.lua
lua
end
function c76794549.thfilter1(c,tp,id)
return c:IsType(TYPE_MONSTER) and c:GetFlagEffect(76794549)~=0
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c76794549.thfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())