Skip to content

Effect.SetTargetRange ​

Signature ​

lua
Effect.SetTargetRange(Effect e, int s_range, int o_range) -> void

Description ​

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.

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

Parameters ​

  • e Effect - Effect whose target range fields are being set.
  • s_range int - Usually the handler controller's affected locations. With EFFECT_FLAG_SPSUM_PARAM, this is the allowed Special Summon position.
  • o_range int - 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:

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.
CardIDScriptDetected Calls
Pendulum Evolution55795155Scripts/c55795155.lua2
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua1
Goyo Emperor59255742Scripts/c59255742.lua1
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua1
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Lubellion the Searing Dragon70534340Scripts/c70534340.lua1
Destratification Dino Stratiae3841104Scripts/c3841104.lua1
Hecahands Tartaros57809669Scripts/c57809669.lua2
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Enneacraft - Asta.PIXEA28454232Scripts/c28454232.lua2
Odd-Eyes Revolution Dragon16306932Scripts/c16306932.lua1
Resurgam Xyz49082032Scripts/c49082032.lua1
Tohushaddoll Grysta95072744Scripts/c95072744.lua1
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua2
Dark End Evaporation Dragon62002838Scripts/c62002838.lua1
Future Fusion Nova92058902Scripts/c92058902.lua2
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua1
Enneacraft - Aiza.LEON82359538Scripts/c82359538.lua1
Ursarctic Polar Star62714453Scripts/c62714453.lua1
Vidolium the Unstable Power Patron of Unity70488851Scripts/c70488851.lua1
Starving Venemy Dragon93729065Scripts/c93729065.lua1
W:P Fancy Ball4993187Scripts/c4993187.lua2
Cerynemesia, Mystical Beast of the Forest43632709Scripts/c43632709.lua1
...and 3023 more

Script Examples ​

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

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

lua
	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e1:SetReset(RESET_PHASE+PHASE_END)
	e1:SetTargetRange(1,0)
	Duel.RegisterEffect(e1,tp)
end

Goyo Emperor (59255742) ​

Source: Scripts/c59255742.lua

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)