Card.RegisterFlagEffect
Signature
Card.RegisterFlagEffect(Card c, int code, int reset_flag, int property, int reset_count, [int label], [int desc]) -> EffectDescription
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.
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.
Related Functions
Parameters
cCard- Card that receives the marker.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; EFFECT_FLAG_CANNOT_DISABLE is always added.reset_countint- Reset counter for the created marker; 0 is treated as 1.labelintoptional - Optional integer payload stored on the marker.descintoptional - 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.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.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
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
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)