Effect.SetReset
Signature
Effect.SetReset(Effect e, int reset_flag, [int reset_count]) -> voidDescription
Sets when e resets and how many reset checks it can survive. If reset_count is 0 or omitted, the core stores 1. When a phase reset is used without an explicit turn side, the core applies both RESET_SELF_TURN and RESET_OPPO_TURN. For card-bound temporary effects, combine the card-identity reset, such as RESET_EVENT+RESETS_STANDARD, with the phase or lifetime reset from the card text. See the Reset Flags And Effect Duration learning guide for full patterns. RegisterFlagEffect uses the same phase-turn default behavior for card and player markers.
How To Use It
SetReset controls when a temporary effect disappears.
Card-bound effects usually reset when the card leaves normal field relation:
e1:SetReset(RESET_EVENT+RESETS_STANDARD)Phase resets take an optional count:
e1:SetReset(RESET_PHASE+PHASE_END,2)If the count is omitted or 0, MDPro4 stores 1. If a phase reset does not specify RESET_SELF_TURN or RESET_OPPO_TURN, the core adds both turn flags.
Related Functions
Parameters
eEffect- Effect whose reset mask is replaced.reset_flagint- RESET_* mask describing the events or phases that can reset e.reset_countintoptional - Number of matching reset checks before e resets; omitted or 0 is treated as 1.
Source
D:\Programs\GitHub\ygopro-core\libeffect.cpp:618
Guided Examples
Learn how to use this function in context:
- Common Script Errors And Debugging
- Effects That Apply Continuously
- Normal And Continuous Traps
- Reset Flags And Effect Duration
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 5388 indexed script(s).
- Search this function in the Script Explorer with
Effect.SetReset.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)Astrograph Sorcerer, the Starfrost Magician (48171151)
Source: Scripts/c48171151.lua
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
endPendulum Evolution (55795155)
Source: Scripts/c55795155.lua
e1:SetTargetRange(1,0)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local eset={e1}