Skip to content

Card.CheckUniqueOnField ​

Signature ​

lua
Card.CheckUniqueOnField(Card c, int check_player, [int check_location], [Card|nil icard]) -> bool

Description ​

Checks whether c can coexist on check_player's field under the current unique-on-field rules. check_location defaults to LOCATION_ONFIELD and is masked to on-field locations. icard can be supplied as an ignored card when testing a pending move.

Parameters ​

  • c Card - Card being tested against unique-on-field restrictions.
  • check_player int - Player whose field is checked for a uniqueness conflict.
  • check_location int optional - On-field location mask to check; default: LOCATION_ONFIELD. The core masks this value to LOCATION_ONFIELD.
  • icard Card|nil optional - Optional card ignored during the check, useful when testing a pending replacement or move.

Returns ​

  • bool - True if c can coexist under the unique-on-field rules for the requested player and location.

Source ​

  • D:\Programs\GitHub\ygopro-core\libcard.cpp:3713

Used By ​

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

  • Detected in 197 indexed script(s).
  • Search this function in the Script Explorer with Card.CheckUniqueOnField.
CardIDScriptDetected Calls
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Am Duazenet45151304Scripts/c45151304.lua1
Shining Draw35906693Scripts/c35906693.lua1
Plunder Patroll Shipshape Ships Shipping44227727Scripts/c44227727.lua1
Radiant Typhoon Varuroon, the Marine Eidolon39341885Scripts/c39341885.lua3
Camelot, Realm of Noble Knights and Noble Arms15635751Scripts/c15635751.lua1
Yummy★Snatchy30581601Scripts/c30581601.lua1
Red-Eyes Slash Dragon21140872Scripts/c21140872.lua1
Power Tool Braver Dragon63265554Scripts/c63265554.lua1
DoomZ XII Zero - Drastea92472273Scripts/c92472273.lua1
Seven Stars Slash - Army Annihilator Hagun65114115Scripts/c65114115.lua1
Zoroa, the Magistus Verethragna37260677Scripts/c37260677.lua1
Emperor Charles the Great97864322Scripts/c97864322.lua2
Inzektor Picofalena97273514Scripts/c97273514.lua1
Dreaming Nemleria70155677Scripts/c70155677.lua1
Yummy☆Surprise29369059Scripts/c29369059.lua1
Sosei Ryu-Ge Mistva92487128Scripts/c92487128.lua1
Spirit Poacher85150300Scripts/c85150300.lua1
The Continuing Epic of Charles11802691Scripts/c11802691.lua3
Angelechy Problem17782288Scripts/c17782288.lua1
Dragunity Arma Gram53184342Scripts/c53184342.lua1
Chaos Allure Queen29925614Scripts/c29925614.lua1
...and 173 more

Script Examples ​

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
function s.pfilter(c,tp)
	return c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and c:GetLeftScale()==1
		and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk)

D/D/D Alfred the Divine Sage King (11852093) ​

Source: Scripts/c11852093.lua

lua
end
function s.tffilter(c,tp)
	return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xae) and c:IsFaceupEx() and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function s.mfilter(c)

Pere-Zenet Em Heru (46273941) ​

Source: Scripts/c46273941.lua

lua
end
function s.eqfilter(c,tp)
	return c:IsType(TYPE_NORMAL) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)