Skip to content

Duel.GetCustomActivityCount ​

Signature ​

lua
Duel.GetCustomActivityCount(int counter_id, int player, int activity_type) -> int

Description ​

Returns player 0's or player 1's count for the custom counter_id and ACTIVITY_* type. Counts are reset each turn. In this core, most card-based custom counters only record whether that player has performed a counted activity at least once, while Chain counters can increase and decrease with Chain creation and cancellation.

Parameters ​

  • counter_id int - Identifier previously registered with Duel.AddCustomActivityCounter.
  • player int - Player whose count is read; use 0 or 1.
  • activity_type int - ACTIVITY_* constant selecting which custom activity map is read.

Returns ​

  • int - Stored count for that player, counter ID, and activity type, or 0 if no matching custom counter exists.

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:5069

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 173 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetCustomActivityCount.
CardIDScriptDetected Calls
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua1
Enneacraft - Asta.PIXEA28454232Scripts/c28454232.lua1
Tohushaddoll Grysta95072744Scripts/c95072744.lua1
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua1
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua1
Enneacraft - Aiza.LEON82359538Scripts/c82359538.lua1
Cyberse Reminder56337500Scripts/c56337500.lua1
Enneacraft - Atori.MAR54842941Scripts/c54842941.lua1
Number 99: Utopia Dragonar95134948Scripts/c95134948.lua1
Hi-Speedroid Cork Shooter23361526Scripts/c23361526.lua1
Xtra HERO Cross Crusader58004362Scripts/c58004362.lua1
Dreaming Nemleria70155677Scripts/c70155677.lua1
Thunder Dragonlord5206415Scripts/c5206415.lua2
Megaroid City44139064Scripts/c44139064.lua2
Helping Robo for Underwater Combat77856460Scripts/c77856460.lua1
Chaos Emperor Dragon - Envoy of the End82301904Scripts/c82301904.lua1
Ekto Enneacraft - "tromarIA"29570824Scripts/c29570824.lua1
Enato Enneacraft - "oknirIA"55965529Scripts/c55965529.lua1
Masked HERO Furnace58288218Scripts/c58288218.lua1
Branded Fusion44362883Scripts/c44362883.lua1
Trito Enneacraft - "exapatisIA"44716748Scripts/c44716748.lua1
Proto Enneacraft - "orgIA"56187077Scripts/c56187077.lua1
Dream Tower of Princess Nemleria18458255Scripts/c18458255.lua1
Dawn Angel Kambi12500059Scripts/c12500059.lua1
...and 149 more

Script Examples ​

Deftero Enneacraft - "alazoneIA" (92171126) ​

Source: Scripts/c92171126.lua

lua
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return not e:GetHandler():IsPublic()
		and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)

Enneacraft - Asta.PIXEA (28454232) ​

Source: Scripts/c28454232.lua

lua
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return not e:GetHandler():IsPublic()
		and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)

Tohushaddoll Grysta (95072744) ​

Source: Scripts/c95072744.lua

lua
end
function s.fspcost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
	local e1=Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)