Skip to content

Duel.IsChainNegatable ​

Signature ​

lua
Duel.IsChainNegatable(int chainc) -> bool

Description ​

Compatibility check for whether chainc's activation can be negated. In this MDPro4 core binding, the function currently returns true for any chain count. Local scripts still call it in negation conditions so the script expresses the intended activation-legality check. Use it with Duel.NegateActivation, not as a substitute for effect-negation checks such as Duel.IsChainDisablable.

How To Use It ​

Use this in activation-negation conditions to express that the responding effect only works on a Chain Link whose activation can be negated.

lua
return Duel.IsChainNegatable(ev)

In the current MDPro4 core binding this function returns true for any chain count, but local scripts still use it as the activation-negation legality marker. Use Duel.IsChainDisablable when the operation is effect negation rather than activation negation.

Parameters ​

  • chainc int - Chain Link number to test, commonly the ev argument in an EVENT_CHAINING condition.

Returns ​

  • bool - true when this binding considers that Chain Link's activation negatable.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 385 indexed script(s).
  • Search this function in the Script Explorer with Duel.IsChainNegatable.
CardIDScriptDetected Calls
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua1
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua2
Shooting Majestic Star Dragon40939228Scripts/c40939228.lua1
Red-Eyes Slash Dragon21140872Scripts/c21140872.lua1
A-to-Z-Dragon Buster Cannon65172015Scripts/c65172015.lua1
Frightfur March74416026Scripts/c74416026.lua1
Dragon Master Magia12381100Scripts/c12381100.lua1
Ursarctic Grand Chariot80086070Scripts/c80086070.lua1
Endymion, the Mighty Master of Magic3611830Scripts/c3611830.lua1
Arms of Genex Return Zero61775475Scripts/c61775475.lua1
Emperor Charles the Great97864322Scripts/c97864322.lua1
Toadally Awesome90809975Scripts/c90809975.lua1
All-Eyes Phantom Dragon70335319Scripts/c70335319.lua1
Drytron Meteonis DA Draconids56863746Scripts/c56863746.lua1
Machina Ruinforce46033517Scripts/c46033517.lua1
Loki, Lord of the Aesir67098114Scripts/c67098114.lua1
Fire King Avatar Arvata18621798Scripts/c18621798.lua1
Immortal Phoenix Gearfried22091647Scripts/c22091647.lua1
PSY-Framegear Gamma38814750Scripts/c38814750.lua1
PSY-Framegear Delta74203495Scripts/c74203495.lua1
PSY-Framegear Epsilon1697104Scripts/c1697104.lua1
Red-Eyes Dark Dragoon37818794Scripts/c37818794.lua1
Whisker Blitzclique85523502Scripts/c85523502.lua1
Eclipse, Dragon Ruler of Catastrophes30350202Scripts/c30350202.lua1
...and 361 more

Script Examples ​

Enneacraft - Archa.TAIL (81237046) ​

Source: Scripts/c81237046.lua

lua
end
function s.indcon(e,tp,eg,ep,ev,re,r,rp)
	if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
	if re:IsHasCategory(CATEGORY_NEGATE)
		and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end

Enneacraft - Atil.SPIA (71801447) ​

Source: Scripts/c71801447.lua

lua
	for i=1,ev do
		local tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_PLAYER)
		if tgp~=tp and Duel.IsChainNegatable(i) then
			return Duel.GetCurrentChain()>2
		end

Shooting Majestic Star Dragon (40939228) ​

Source: Scripts/c40939228.lua

lua
end
function c40939228.negcon(e,tp,eg,ep,ev,re,r,rp)
	return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function c40939228.negtg(e,tp,eg,ep,ev,re,r,rp,chk)