Effect.SetType
Signature
Effect.SetType(Effect e, int type) -> voidDescription
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:
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.
Related Functions
Parameters
eEffecttypeint
Source
D:\Programs\GitHub\ygopro-core\libeffect.cpp:619
Guided Examples
Learn how to use this function in context:
- Activated Effects
- Activation Legality
- Beginner Script Ladder
- Chain Timing And Activation Windows
- Effects That Apply Continuously
- Counter Traps
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.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.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
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
--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)