Skip to content

Effect.CheckCountLimit ​

Signature ​

lua
Effect.CheckCountLimit(Effect e, int p) -> bool

Description ​

Checks whether e's count limit is still available for player p. Normal activation checks already use the core count-limit check; this helper is mainly for scripts that manually inspect another Effect object. If a custom helper spends the count manually, pair this with Effect.UseCountLimit.

How To Use It ​

Use this when a script helper needs to test whether an Effect still has count available for a player before manually spending it.

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

Ordinary activated effects usually let the engine manage the count limit. Reach for this only when the script manually controls a custom branch or helper procedure.

Parameters ​

  • e Effect - Effect whose remaining count is checked.
  • p int - Player whose local or shared count map is checked.

Returns ​

  • bool - True if e has no exhausted count limit for p; false when the count is already spent.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 1 indexed script(s).
  • Search this function in the Script Explorer with Effect.CheckCountLimit.
CardIDScriptDetected Calls
Xyz Block44487250Scripts/c44487250.lua1

Script Examples ​

Xyz Block (44487250) ​

Source: Scripts/c44487250.lua

lua
			for _,te in ipairs(fromhand_effects) do
				local cost=te:GetCost()
				if te:CheckCountLimit(tp) and (not cost or cost(te,tp,eg,ep,ev,re,r,rp,0,e)) then
					table.insert(available_fromhand_effects,te)
				end