Skip to content

Effect.SetReset ​

Signature ​

lua
Effect.SetReset(Effect e, int reset_flag, [int reset_count]) -> void

Description ​

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:

lua
e1:SetReset(RESET_EVENT+RESETS_STANDARD)

Phase resets take an optional count:

lua
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.

Parameters ​

  • e Effect - Effect whose reset mask is replaced.
  • reset_flag int - RESET_* mask describing the events or phases that can reset e.
  • reset_count int optional - 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:

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.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua4
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Pendulum Evolution55795155Scripts/c55795155.lua3
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua1
Eternal Favorite87532344Scripts/c87532344.lua1
Surprise Fusion35167375Scripts/c35167375.lua3
Spellbook of the Grand Circle11911336Scripts/c11911336.lua1
Ultra Polymerization76647978Scripts/c76647978.lua3
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua2
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua2
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua1
Yomagna the Fire Phantom17350692Scripts/c17350692.lua1
Fiendsmith's Sequence49867899Scripts/c49867899.lua2
El Shaddoll Apkallone50907446Scripts/c50907446.lua3
Favorite HERO Flame Wingman13243124Scripts/c13243124.lua1
Mixousia the Confounder80843006Scripts/c80843006.lua2
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Invoked Sorath43989315Scripts/c43989315.lua2
Performage Cup Tricker6812770Scripts/c6812770.lua1
Spirit Illusion71939275Scripts/c71939275.lua2
Lubellion the Searing Dragon70534340Scripts/c70534340.lua2
Destratification Dino Stratiae3841104Scripts/c3841104.lua2
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
...and 5364 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

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

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)
	end

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
		e1:SetTargetRange(1,0)
		e1:SetValue(aux.TRUE)
		e1:SetReset(RESET_PHASE+PHASE_END)
		Duel.RegisterEffect(e1,tp)
		local eset={e1}