Duel.RegisterFlagEffect
Signature
Duel.RegisterFlagEffect(int player, int code, int reset_flag, int property, int reset_count, [int label]) -> Effect|nilDescription
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.
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.
Related Functions
Parameters
playerint- Player that receives the marker; invalid players make the core return no values.codeint- Flag-effect code; the core masks it with MAX_CARD_ID and adds EFFECT_FLAG_EFFECT.reset_flagint- RESET_* mask controlling when the marker expires; phase resets without an explicit turn side apply to both players' turns.propertyint- Effect property flags stored on the created marker; player-target, field-only, and cannot-disable flags are always added.reset_countint- Reset counter for the created marker; 0 is treated as 1.labelintoptional - 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.
Script Examples
Artmage Non-Finito (74631897)
Source: Scripts/c74631897.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
local tc=g:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),55795155,RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
endEternal Favorite (87532344)
Source: Scripts/c87532344.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