Effect.UseCountLimit
Signature
lua
Effect.UseCountLimit(Effect e, int p, [int count], [bool oath_only]) -> voidDescription
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)
endThe 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.
Related Functions
Parameters
eEffect- Effect whose count is manually consumed.pint- Player whose local or shared count is consumed.countintoptional - Number of uses to consume; default: 1.oath_onlybooloptional - 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:
- Common Script Errors And Debugging
- Count Limits And Once Per Turn
- Field Spells
- Pendulum Procedure Guide
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.
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
endAzure 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
endGhostrick 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()