Effect.CheckCountLimit
Signature
lua
Effect.CheckCountLimit(Effect e, int p) -> boolDescription
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)
endOrdinary 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.
Related Functions
Parameters
eEffect- Effect whose remaining count is checked.pint- 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.
| Card | ID | Script | Detected Calls |
|---|---|---|---|
| Xyz Block | 44487250 | Scripts/c44487250.lua | 1 |
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