Effect.SetRange
Signature
lua
Effect.SetRange(Effect e, int range) -> voidDescription
Sets the location range where e applies or can be activated. This is the handler's active location, not the affected-card range. Continuous field effects usually pair it with Effect.SetTargetRange.
How To Use It
Use this to say where the effect itself is active or can be activated from.
lua
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)SetRange is the handler's location. SetTargetRange is the affected side or destination range. Continuous effects commonly need both.
Related Functions
Parameters
eEffectrangeint
Source
D:\Programs\GitHub\ygopro-core\libeffect.cpp:614
Guided Examples
Learn how to use this function in context:
- Chain Timing And Activation Windows
- Common Script Errors And Debugging
- Effects That Apply Continuously
- Counters
- Creation, Building, and Registration of an Effect Object
- EFFECT_TYPE Constants and Templates
More guided lessons (3)
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 9177 indexed script(s).
- Search this function in the Script Explorer with
Effect.SetRange.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
lua
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,id)Astrograph Sorcerer, the Starfrost Magician (48171151)
Source: Scripts/c48171151.lua
lua
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.ptg)Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
lua
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_EXTRA)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)