Skip to content

Card.GetFlagEffect ​

Signature ​

lua
Card.GetFlagEffect(Card c, int code) -> int

Description ​

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)
end

The return value is a count, not a boolean. Compare it with 0 when checking whether a marker exists.

Parameters ​

  • c Card - Card whose single-card flag effects are counted.
  • code int - 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.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua1
Artmage Non-Finito74631897Scripts/c74631897.lua2
Astrograph Sorcerer76794549Scripts/c76794549.lua1
Ultra Polymerization76647978Scripts/c76647978.lua1
Goyo Emperor59255742Scripts/c59255742.lua2
Enneacraft - Asta.PIXEA28454232Scripts/c28454232.lua1
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua1
The Gaze of Timaeus22283204Scripts/c22283204.lua1
Flowering Etoile the Melodious Magnificat83793721Scripts/c83793721.lua1
Ostinato9113513Scripts/c9113513.lua1
Soul of the Supreme King92428405Scripts/c92428405.lua1
K9-EW Special Release Experiment26585784Scripts/c26585784.lua1
Black Dragon Ninja56562619Scripts/c56562619.lua3
Fusion Destiny52947044Scripts/c52947044.lua1
Meklord Astro Mekanikle63468625Scripts/c63468625.lua1
Number 99: Utopia Dragonar95134948Scripts/c95134948.lua2
The Weather Painter Moonbow95515518Scripts/c95515518.lua1
Enlilgirsu, the Orcust Mekk-Knight74820316Scripts/c74820316.lua2
Ghoti Fury65898344Scripts/c65898344.lua1
R.B. Lambda Blade17188206Scripts/c17188206.lua1
Galaxy-Eyes Photon Dragon93717133Scripts/c93717133.lua1
All-Eyes Phantom Dragon70335319Scripts/c70335319.lua1
Darkuriboh1035143Scripts/c1035143.lua1
Arcana Force EX - The Light Ruler5861892Scripts/c5861892.lua1
...and 450 more

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
	else

Artmage 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())