Skip to content

Card.IsCanAddCounter ​

Signature ​

lua
Card.IsCanAddCounter(Card c, int countertype, int count, [bool singly], [int loc]) -> bool

Description ​

Checks whether the current reason player can place count counters of countertype on c. When loc is 0, c must currently be face-up on the field. When loc is nonzero, the counter permit range is checked against loc instead. If singly is true, counter limits are tested as current count + 1 rather than current count + count.

Parameters ​

  • c Card
  • countertype int
  • count int
  • singly bool optional - default: false
  • loc int optional - default: 0

Returns ​

  • bool

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 82 indexed script(s).
  • Search this function in the Script Explorer with Card.IsCanAddCounter.
CardIDScriptDetected Calls
Limit Code86607583Scripts/c86607583.lua1
Servant of Endymion92559258Scripts/c92559258.lua4
Mythical Beast Medusa54965929Scripts/c54965929.lua1
Combat Wheel12501230Scripts/c12501230.lua2
Mythical Beast Jackal91182675Scripts/c91182675.lua1
Zushin the Sleeping Giant67547370Scripts/c67547370.lua1
Alien Shocktrooper M-Frame74974229Scripts/c74974229.lua2
Chaos Core54040484Scripts/c54040484.lua2
Cubic Wave35058588Scripts/c35058588.lua2
Predaplant Longinephila44994712Scripts/c44994712.lua3
Signal Warrior9634146Scripts/c9634146.lua1
Super B.E.S. Metal Slave41516133Scripts/c41516133.lua1
B.E.S. Derringer Core5121528Scripts/c5121528.lua1
Cosmic Fortress Gol'gar68319538Scripts/c68319538.lua2
Aiza the Dragoness of Deranged Devotion63378869Scripts/c63378869.lua3
Beat Cop from the Underworld99011763Scripts/c99011763.lua3
Starving Venemy Lethal Dose Dragon22070401Scripts/c22070401.lua1
Predaplanning44536921Scripts/c44536921.lua2
Summer97254001Scripts/c97254001.lua1
Ninjitsu Art of Mosquito Marching68441986Scripts/c68441986.lua1
Borreload Savage Dragon27548199Scripts/c27548199.lua1
Cosmic Horror Gangi'el51192573Scripts/c51192573.lua3
Ice Master32750510Scripts/c32750510.lua4
Blackwing - Auster the South Wind17465972Scripts/c17465972.lua2
...and 58 more

Script Examples ​

Limit Code (86607583) ​

Source: Scripts/c86607583.lua

lua
	local c=e:GetHandler()
	local ct=Duel.GetMatchingGroupCount(c86607583.cfilter,tp,LOCATION_GRAVE,0,nil)
	if c:IsRelateToEffect(e) and ct>0 and c:IsCanAddCounter(0x47,ct) then
		c:AddCounter(0x47,ct)
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)

Servant of Endymion (92559258) ​

Source: Scripts/c92559258.lua

lua
function c92559258.countertg2(e,tp,eg,ep,ev,re,r,rp,chk)
	local c=e:GetHandler()
	if chk==0 then return c:IsCanAddCounter(0x1,1) end
	local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,c,0x1,1)
	g:AddCard(c)

Mythical Beast Medusa (54965929) ​

Source: Scripts/c54965929.lua

lua
		local tc=Duel.GetFirstTarget()
		if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0
			and tc:IsCanAddCounter(0x1,1) then
			tc:AddCounter(0x1,1)
		end