Skip to content

Card.RegisterFlagEffect ​

Signature ​

lua
Card.RegisterFlagEffect(Card c, int code, int reset_flag, int property, int reset_count, [int label], [int desc]) -> Effect

Description ​

Registers a special single-card flag effect on c and returns the created Effect. Flag effects are script markers: their code is kept separate from regular effect codes, they cannot be disabled, and count=0 is treated as 1. When reset_flag contains RESET_PHASE without RESET_SELF_TURN or RESET_OPPO_TURN, the core applies both turn sides. See the Reset Flags And Effect Duration learning guide for full patterns. Use card flags for markers tied to one card's lifecycle; use Duel.RegisterFlagEffect for player markers.

How To Use It ​

Use this to place a marker on one card, usually to remember that the card used an effect or entered a temporary state.

lua
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)

The local binding masks the code as a flag-effect code, adds EFFECT_FLAG_CANNOT_DISABLE, treats count 0 as 1, and adds both turn sides to phase resets when no turn side is specified.

Parameters ​

  • c Card - Card that receives the marker.
  • code int - Flag-effect code; the core masks it with MAX_CARD_ID and adds EFFECT_FLAG_EFFECT.
  • reset_flag int - RESET_* mask controlling when the marker expires; phase resets without an explicit turn side apply to both players' turns.
  • property int - Effect property flags stored on the created marker; EFFECT_FLAG_CANNOT_DISABLE is always added.
  • reset_count int - Reset counter for the created marker; 0 is treated as 1.
  • label int optional - Optional integer payload stored on the marker.
  • desc int optional - Optional client description id for marker hints.

Returns ​

  • Effect - The created flag effect.

Source ​

  • D:\Programs\GitHub\ygopro-core\libcard.cpp:3607

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 877 indexed script(s).
  • Search this function in the Script Explorer with Card.RegisterFlagEffect.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua1
Artmage Non-Finito74631897Scripts/c74631897.lua2
Astrograph Sorcerer76794549Scripts/c76794549.lua2
Ultra Polymerization76647978Scripts/c76647978.lua1
Goyo Emperor59255742Scripts/c59255742.lua1
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua1
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua1
Resurgam Xyz49082032Scripts/c49082032.lua1
Converging Wishes20007374Scripts/c20007374.lua1
PSY-Framelord Omega74586817Scripts/c74586817.lua1
Graydle Split75361204Scripts/c75361204.lua2
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua2
Shining Draw35906693Scripts/c35906693.lua1
Barian's Chaos Draw97769122Scripts/c97769122.lua1
Future Fusion Nova92058902Scripts/c92058902.lua1
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua1
Enneacraft - Aiza.LEON82359538Scripts/c82359538.lua2
D/D/D/D Super-Dimensional Sovereign Emperor Zero Paradox97417863Scripts/c97417863.lua1
Shooting Majestic Star Dragon40939228Scripts/c40939228.lua1
Ursarctic Polar Star62714453Scripts/c62714453.lua1
Kewl Tune Crackle39576656Scripts/c39576656.lua2
Albion the Branded Dragon87746184Scripts/c87746184.lua1
PSY-Framelord Zeta37192109Scripts/c37192109.lua1
The Gaze of Timaeus22283204Scripts/c22283204.lua1
...and 853 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
			fop(ce,e,tp,tc,mat2)
		end
		tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
		tc:CompleteProcedure()
		local e2=Effect.CreateEffect(e:GetHandler())

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
		local tc2=g:SelectUnselect(nil,tp,false,true,1,1)
		if tc2 then
			tc2:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD,0,1)
			local sg=Group.FromCards(tc,tc2)
			sg:KeepAlive()

Astrograph Sorcerer (76794549) ​

Source: Scripts/c76794549.lua

lua
	while tc do
		if tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) then
			tc:RegisterFlagEffect(76794549,RESET_EVENT+0x1f20000+RESET_PHASE+PHASE_END,0,1)
		elseif tc:IsLocation(LOCATION_EXTRA) then
			tc:RegisterFlagEffect(76794549,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)