Skip to content

Duel.IsEnvironment ​

Signature ​

lua
Duel.IsEnvironment(int code, [int player], [int loc]) -> bool

Description ​

Checks whether code is currently treated as the environment card or as a matching face-up card in the requested locations. player defaults to PLAYER_ALL and loc defaults to LOCATION_ONFIELD. The core checks Field Zones first; if no face-up Field Zone card exists, it can also match the latest EFFECT_CHANGE_ENVIRONMENT effect.

Parameters ​

  • code int
  • player int optional - default: PLAYER_ALL
  • loc int optional - default: LOCATION_ONFIELD

Returns ​

  • bool

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4898

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 121 indexed script(s).
  • Search this function in the Script Explorer with Duel.IsEnvironment.
CardIDScriptDetected Calls
Hojo the Vaylantz Warrior88919365Scripts/c88919365.lua1
Sea Stealth Attack19089195Scripts/c19089195.lua2
Numeron Calling77402960Scripts/c77402960.lua1
Malefic Paradigm Dragon16958382Scripts/c16958382.lua1
Protector of The Agents - Moon90290572Scripts/c90290572.lua2
Arcana Force EX - The Chaos Ruler12686296Scripts/c12686296.lua1
Mega Fortress Whale96546575Scripts/c96546575.lua1
The Sacred Waters in the Sky26684111Scripts/c26684111.lua1
Celestial Knightlord Parshath48589580Scripts/c48589580.lua2
Dream Mirror of Chaos98570539Scripts/c98570539.lua4
Yorishiro of the Aqua57511992Scripts/c57511992.lua2
The Executor of the Underworld - Pluto37706769Scripts/c37706769.lua1
Light Force30913809Scripts/c30913809.lua1
Atlantis Call65785782Scripts/c65785782.lua1
Coralianektes the Shimmering Shining Dragon82692552Scripts/c82692552.lua1
Vaylantz Mad Marquess87897777Scripts/c87897777.lua1
Necrovalley Temple56773577Scripts/c56773577.lua1
Phantasm Spiral Power61397885Scripts/c61397885.lua1
Advanced Crystal Beast Cobalt Eagle45236142Scripts/c45236142.lua1
Phantasm Spiral Assault97795930Scripts/c97795930.lua1
Ocean Dragon Lord - Kairyu-Shin23931679Scripts/c23931679.lua1
Symphonic Warrior Rockks24070330Scripts/c24070330.lua1
Ojama Emperor34031284Scripts/c34031284.lua1
Prinzessin78527720Scripts/c78527720.lua1
...and 97 more

Script Examples ​

Hojo the Vaylantz Warrior (88919365) ​

Source: Scripts/c88919365.lua

lua
end
function c88919365.spcon(e,tp,eg,ep,ev,re,r,rp)
	return Duel.IsEnvironment(49568943) or Duel.IsExistingMatchingCard(c88919365.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c88919365.sptg(e,tp,eg,ep,ev,re,r,rp,chk)

Sea Stealth Attack (19089195) ​

Source: Scripts/c19089195.lua

lua
end
function c19089195.econ(e,tp,eg,ep,ev,re,r,rp)
	return Duel.IsEnvironment(22702055) and not Duel.IsPlayerAffectedByEffect(tp,19089195)
end
function c19089195.costfilter(c)

Numeron Calling (77402960) ​

Source: Scripts/c77402960.lua

lua
end
function c77402960.condition(e,tp,eg,ep,ev,re,r,rp)
	return Duel.IsEnvironment(41418852,tp,LOCATION_FZONE) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c77402960.spfilter(c,e,tp)