Skip to content

Effect.UseCountLimit ​

Signature ​

lua
Effect.UseCountLimit(Effect e, int p, [int count], [bool oath_only]) -> void

Description ​

Manually consumes count uses of e's count limit for player p. count defaults to 1. If oath_only is true, the count is consumed only when e's count code includes EFFECT_COUNT_CODE_OATH; otherwise the binding decrements the count limit directly.

How To Use It ​

Use this to manually spend an Effect's count limit after a separate Effect.CheckCountLimit test.

lua
if e:CheckCountLimit(tp) then
    e:UseCountLimit(tp,1)
end

The optional count defaults to 1. With oath_only=true, the local binding spends the count only when the effect's count code includes EFFECT_COUNT_CODE_OATH.

Parameters ​

  • e Effect - Effect whose count is manually consumed.
  • p int - Player whose local or shared count is consumed.
  • count int optional - Number of uses to consume; default: 1.
  • oath_only bool optional - If true, consume only when e's count code includes EFFECT_COUNT_CODE_OATH; default: false.

Source ​

  • D:\Programs\GitHub\ygopro-core\libeffect.cpp:661

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 86 indexed script(s).
  • Search this function in the Script Explorer with Effect.UseCountLimit.
CardIDScriptDetected Calls
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua1
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua1
Ghostrick Renovation61818176Scripts/c61818176.lua1
Ursarctic Polari27693363Scripts/c27693363.lua2
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
Ursarctic Polar Star62714453Scripts/c62714453.lua1
Prank-Kids Rocket Ride18514525Scripts/c18514525.lua1
Jupredo the Shademachine Power Patron43871165Scripts/c43871165.lua1
Prank-Kids Bow-Wow-Bark43886072Scripts/c43886072.lua1
Sea Stealth Attack19089195Scripts/c19089195.lua1
Ursarctic Grand Chariot80086070Scripts/c80086070.lua1
Lunalight Masquerade2344618Scripts/c2344618.lua1
Amazoness Secret Arts86758746Scripts/c86758746.lua1
Nervedo the Shadebeast Power Patron17473466Scripts/c17473466.lua1
Witchcrafter Pittore95245544Scripts/c95245544.lua1
Witchcrafter Genni64756282Scripts/c64756282.lua1
Favorite Hero11881272Scripts/c11881272.lua1
Malefic Paradigm Dragon16958382Scripts/c16958382.lua1
Triamid Dancer69529337Scripts/c69529337.lua1
Vernusylph of the Thawing Mountains9238125Scripts/c9238125.lua1
Prank-Kids Dodo-Doodle-Doo17382973Scripts/c17382973.lua1
Vernusylph of the Awakening Forests36745317Scripts/c36745317.lua1
Witchcrafter Madame Verre21522601Scripts/c21522601.lua1
...and 62 more

Script Examples ​

Levia-Dragoon - Daedalus (78579058) ​

Source: Scripts/c78579058.lua

lua
			local related,valid=f(te,lc,sg,tc,tp)
			if related and valid then
				te:UseCountLimit(tp)
			end
		end

Azure Ocean Dragon Lord - Neo-Daedalus Rage (41570943) ​

Source: Scripts/c41570943.lua

lua
			local related,valid=f(te,lc,sg,tc,tp)
			if related and valid then
				te:UseCountLimit(tp)
			end
		end

Ghostrick Renovation (61818176) ​

Source: Scripts/c61818176.lua

lua
			Duel.MoveToField(sc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
			local te=sc:GetActivateEffect()
			te:UseCountLimit(tp,1,true)
			local tep=sc:GetControler()
			local cost=te:GetCost()