Skip to content

Card.IsCode ​

Signature ​

lua
Card.IsCode(Card c, int code1, [int code2], [... int]) -> bool

Description ​

Checks whether c's current card code, or alternate code if it has one, matches any supplied code.

How To Use It ​

Use this in filters when a card must specifically be one or more card IDs.

lua
function s.matfilter(c)
    return c:IsCode(89631139,23995346)
end

This checks the card's current code and alternate code, so copied or changed-code effects can matter.

Parameters ​

  • c Card
  • code1 int
  • code2 int optional
  • ... int optional

Returns ​

  • bool

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 3019 indexed script(s).
  • Search this function in the Script Explorer with Card.IsCode.
CardIDScriptDetected Calls
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Pendulum Evolution55795155Scripts/c55795155.lua3
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua1
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua2
Eternal Favorite87532344Scripts/c87532344.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua3
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua1
Meteoroa Drytron24166324Scripts/c24166324.lua1
Gem-Knight Dispersion24220368Scripts/c24220368.lua2
Lubellion the Searing Dragon70534340Scripts/c70534340.lua1
Ghostrick Renovation61818176Scripts/c61818176.lua1
Magnet Bonding65514302Scripts/c65514302.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Converging Wishes20007374Scripts/c20007374.lua1
Tohushaddoll Grysta95072744Scripts/c95072744.lua1
Predaplant Bal Teah66787942Scripts/c66787942.lua1
Graydle Split75361204Scripts/c75361204.lua1
Shining Draw35906693Scripts/c35906693.lua1
Plunder Patroll Shipshape Ships Shipping44227727Scripts/c44227727.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua2
Odd-Eyes Arcray Dragon6218704Scripts/c6218704.lua1
Enlightenment Dragon46186135Scripts/c46186135.lua3
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
Chimera Fusion63136489Scripts/c63136489.lua2
...and 2995 more

Script Examples ​

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

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

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
end
function c55795155.thfilter(c,code)
	return c:IsType(TYPE_PENDULUM) and c:IsAttack(2500) and not c:IsCode(code) and c:IsAbleToHand()
end
function c55795155.thtg(e,tp,eg,ep,ev,re,r,rp,chk)

Levia-Dragoon - Daedalus (78579058) ​

Source: Scripts/c78579058.lua

lua
end
function s.costfilter(c)
	return c:IsFaceup() and c:IsCode(22702055) and c:IsAbleToGraveAsCost()
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)