Effect.SetTargetRange
Signature
Effect.SetTargetRange(Effect e, int s_range, int o_range) -> voidDescription
Sets e's target range fields and clears EFFECT_FLAG_ABSOLUTE_TARGET. For most field effects, s_range is the affected locations on the handler's controller's side and o_range is the affected locations on the opponent's side. With EFFECT_FLAG_SPSUM_PARAM, they store Special Summon destination player and position. Use Effect.SetAbsoluteRange when the affected sides must be fixed to a specific player instead of relative to the handler.
How To Use It
Use this for the cards or players affected by a field-like effect, or for special meanings required by certain properties.
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)The local binding writes s_range and o_range and clears EFFECT_FLAG_ABSOLUTE_TARGET. For absolute player-oriented ranges, use Effect.SetAbsoluteRange.
Related Functions
Parameters
eEffect- Effect whose target range fields are being set.s_rangeint- Usually the handler controller's affected locations. With EFFECT_FLAG_SPSUM_PARAM, this is the allowed Special Summon position.o_rangeint- Usually the opponent's affected locations. With EFFECT_FLAG_SPSUM_PARAM, this is the destination player value for the Special Summon.
Source
D:\Programs\GitHub\ygopro-core\libeffect.cpp:615
Guided Examples
Learn how to use this function in context:
- Battle Position Effects
- Common Script Errors And Debugging
- Effects That Apply Continuously
- Continuous Stat Modifiers
- Creation, Building, and Registration of an Effect Object
- EFFECT_TYPE Constants and Templates
More guided lessons (5)
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 3047 indexed script(s).
- Search this function in the Script Explorer with
Effect.SetTargetRange.
Script Examples
Pendulum Evolution (55795155)
Source: Scripts/c55795155.lua
e1:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END)Azure Ocean Dragon Lord - Neo-Daedalus Rage (41570943)
Source: Scripts/c41570943.lua
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
endGoyo Emperor (59255742)
Source: Scripts/c59255742.lua
e1:SetCode(EFFECT_REMOVE_BRAINWASHING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.TargetEqualFunction(Card.GetFlagEffect,1,59255742))
e1:SetLabelObject(tg)