Skip to content

Effect.SetType ​

Signature ​

lua
Effect.SetType(Effect e, int type) -> void

Description ​

Sets e's effect type flags. The core normalizes some type combinations: Spell/Trap activation effects become field activation effects, Flip Effects receive EVENT_FLIP handling, and ignition/Quick Effects gain field behavior.

How To Use It ​

Use SetType near the start of an effect definition. It decides whether the effect is activated, continuous, single-card, field-wide, trigger, ignition, or Quick.

A common activated ignition effect skeleton looks like this:

lua
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)

MDPro4 normalizes some type combinations. Spell/Trap activation effects become field activation effects and receive the usual hand/Spell & Trap/Field Zone activation range. Flip Effects are converted to EVENT_FLIP handling. Ignition and Quick effects gain field behavior internally.

Parameters ​

  • e Effect
  • type int

Source ​

  • D:\Programs\GitHub\ygopro-core\libeffect.cpp:619

Guided Examples ​

Learn how to use this function in context:

More guided lessons (9)

Used By ​

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

  • Detected in 13438 indexed script(s).
  • Search this function in the Script Explorer with Effect.SetType.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua7
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua4
Artmage Non-Finito74631897Scripts/c74631897.lua5
Pendulum Evolution55795155Scripts/c55795155.lua8
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua3
Lady's Dragonmaid48658295Scripts/c48658295.lua4
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua4
Eternal Favorite87532344Scripts/c87532344.lua6
Surprise Fusion35167375Scripts/c35167375.lua5
Astrograph Sorcerer76794549Scripts/c76794549.lua5
Spellbook of the Grand Circle11911336Scripts/c11911336.lua5
Ultra Polymerization76647978Scripts/c76647978.lua5
Goyo Emperor59255742Scripts/c59255742.lua7
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua4
Melffy Playtime Surprise58036097Scripts/c58036097.lua3
Ashtraja Susanoo17020474Scripts/c17020474.lua2
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua7
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua5
Yomagna the Fire Phantom17350692Scripts/c17350692.lua4
Fiendsmith's Sequence49867899Scripts/c49867899.lua4
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua2
El Shaddoll Apkallone50907446Scripts/c50907446.lua8
Mementotlan Fusion66518509Scripts/c66518509.lua3
Meteoroa Drytron24166324Scripts/c24166324.lua3
...and 13414 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
	local e1=Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_EQUIP+CATEGORY_POSITION+CATEGORY_MSET)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(TIMING_DAMAGE_STEP)

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
	e1:SetDescription(aux.Stringid(id,0))
	e1:SetCategory(CATEGORY_DESTROY)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_PZONE)
	e1:SetCountLimit(1,id)

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
	--splimit
	local e0=Effect.CreateEffect(c)
	e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
	e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e0:SetCode(EVENT_SPSUMMON_SUCCESS)