Duel.AddCustomActivityCounter
Signature
lua
Duel.AddCustomActivityCounter(int counter_id, int activity_type, function f) -> voidDescription
Registers a custom activity counter with id counter_id for the selected ACTIVITY_* type. For Summon and attack counters, f is called with a Card and the counter increases when f returns false. For ACTIVITY_CHAIN, f is called with effect, player, chain_id and also counts false results. ACTIVITY_BATTLE_PHASE and unknown activity types do not register a custom counter in this core.
Parameters
counter_idint- Script-chosen identifier used later with Duel.GetCustomActivityCount.activity_typeint- ACTIVITY_* constant selecting which activity map receives the counter.ffunction- Filter callback. Returning false marks that activity as counted for the acting player.
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:5068
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 174 indexed script(s).
- Search this function in the Script Explorer with
Duel.AddCustomActivityCounter.
| Card | ID | Script | Detected Calls |
|---|---|---|---|
| Deftero Enneacraft - "alazoneIA" | 92171126 | Scripts/c92171126.lua | 1 |
| Enneacraft - Asta.PIXEA | 28454232 | Scripts/c28454232.lua | 1 |
| Tohushaddoll Grysta | 95072744 | Scripts/c95072744.lua | 1 |
| Enneacraft - Archa.TAIL | 81237046 | Scripts/c81237046.lua | 1 |
| Enneacraft - Atil.SPIA | 71801447 | Scripts/c71801447.lua | 1 |
| Enneacraft - Aiza.LEON | 82359538 | Scripts/c82359538.lua | 1 |
| Cyberse Reminder | 56337500 | Scripts/c56337500.lua | 1 |
| Enneacraft - Atori.MAR | 54842941 | Scripts/c54842941.lua | 1 |
| Number 99: Utopia Dragonar | 95134948 | Scripts/c95134948.lua | 1 |
| Hi-Speedroid Cork Shooter | 23361526 | Scripts/c23361526.lua | 1 |
| Xtra HERO Cross Crusader | 58004362 | Scripts/c58004362.lua | 1 |
| Dreaming Nemleria | 70155677 | Scripts/c70155677.lua | 1 |
| Thunder Dragonlord | 5206415 | Scripts/c5206415.lua | 1 |
| Megaroid City | 44139064 | Scripts/c44139064.lua | 1 |
| Helping Robo for Underwater Combat | 77856460 | Scripts/c77856460.lua | 1 |
| Chaos Emperor Dragon - Envoy of the End | 82301904 | Scripts/c82301904.lua | 1 |
| Ekto Enneacraft - "tromarIA" | 29570824 | Scripts/c29570824.lua | 1 |
| Enato Enneacraft - "oknirIA" | 55965529 | Scripts/c55965529.lua | 1 |
| Masked HERO Furnace | 58288218 | Scripts/c58288218.lua | 1 |
| Branded Fusion | 44362883 | Scripts/c44362883.lua | 1 |
| Trito Enneacraft - "exapatisIA" | 44716748 | Scripts/c44716748.lua | 1 |
| Proto Enneacraft - "orgIA" | 56187077 | Scripts/c56187077.lua | 1 |
| Dream Tower of Princess Nemleria | 18458255 | Scripts/c18458255.lua | 1 |
| Dawn Angel Kambi | 12500059 | Scripts/c12500059.lua | 1 |
| ...and 150 more |
Script Examples
Deftero Enneacraft - "alazoneIA" (92171126)
Source: Scripts/c92171126.lua
lua
e4:SetOperation(s.rmop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
s.mentioned_counter={Enneacraft - Asta.PIXEA (28454232)
Source: Scripts/c28454232.lua
lua
e5:SetValue(aux.tgoval)
c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
s.mentioned_counter={Tohushaddoll Grysta (95072744)
Source: Scripts/c95072744.lua
lua
e2:SetOperation(s.fspop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
s.shadoll_flip_effect=e1
end