Skip to content

Duel.RegisterFlagEffect ​

Signature ​

lua
Duel.RegisterFlagEffect(int player, int code, int reset_flag, int property, int reset_count, [int label]) -> Effect|nil

Description ​

Registers a player/global flag effect on player and returns the created Effect. The flag effect is player-targeted, field-only, 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 player flags for player-wide markers; use Card.RegisterFlagEffect for markers tied to one card.

How To Use It ​

Use this to place a player marker, such as a once-per-turn or action-limit marker that is not attached to a specific card.

lua
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)

The local binding creates a field-only player-target flag effect. Like card flags, count 0 becomes 1 and phase resets without a turn side apply to both players' turns.

Parameters ​

  • player int - Player that receives the marker; invalid players make the core return no values.
  • 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; player-target, field-only, and cannot-disable flags are 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.

Returns ​

  • Effect|nil - The created flag effect, or nil if player is invalid.

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4853

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 354 indexed script(s).
  • Search this function in the Script Explorer with Duel.RegisterFlagEffect.
CardIDScriptDetected Calls
Artmage Non-Finito74631897Scripts/c74631897.lua1
Pendulum Evolution55795155Scripts/c55795155.lua1
Eternal Favorite87532344Scripts/c87532344.lua2
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Mementotlan Fusion66518509Scripts/c66518509.lua2
Favorite HERO Flame Wingman13243124Scripts/c13243124.lua2
Gem-Knight Dispersion24220368Scripts/c24220368.lua3
Ghostrick Renovation61818176Scripts/c61818176.lua1
Magnet Bonding65514302Scripts/c65514302.lua2
Hecahands Tartaros57809669Scripts/c57809669.lua2
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua1
D/D/D/D Dimensional King Arc Crisis71398055Scripts/c71398055.lua1
Ultimate Crystal Rainbow Dragon Overdrive84544192Scripts/c84544192.lua1
Ashened to Endlessness34813443Scripts/c34813443.lua1
Penetration Fusion8778267Scripts/c8778267.lua1
Fiendsmith Kyrie26434972Scripts/c26434972.lua1
Chef de Nouvelles29251488Scripts/c29251488.lua2
Artmage Pact -Awakening-23599634Scripts/c23599634.lua1
Trirealm Rift Judgment65195679Scripts/c65195679.lua1
Hunting Horn55421040Scripts/c55421040.lua1
Echelon of the Fire Kings38798785Scripts/c38798785.lua1
Double Interlock38129297Scripts/c38129297.lua2
Mementotlan Shleepy50042011Scripts/c50042011.lua1
K9-X Forced Release53792930Scripts/c53792930.lua2
...and 330 more

Script Examples ​

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
	Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
function s.spfilter(c,tp,sc)

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
	local tc=g:GetFirst()
	while tc do
		Duel.RegisterFlagEffect(tc:GetSummonPlayer(),55795155,RESET_PHASE+PHASE_END,0,1)
		tc=g:GetNext()
	end

Eternal Favorite (87532344) ​

Source: Scripts/c87532344.lua

lua
		and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
	Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
	Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
	Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end