Skip to content

Duel.NegateAttack ​

Signature ​

lua
Duel.NegateAttack() -> bool

Description ​

Attempts to negate the current attack and returns whether the attack was successfully negated. The core fails if there is no valid current attacker, if the attacker moved or changed field ID, if the attacker cannot attack, if the Damage Step state blocks attack negation, or if the attacker is not affected by the resolving effect.

Returns ​

  • bool

Source ​

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

Used By ​

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

  • Detected in 125 indexed script(s).
  • Search this function in the Script Explorer with Duel.NegateAttack.
CardIDScriptDetected Calls
Magnet Warrior Sigma Minus87814728Scripts/c87814728.lua1
Doodlebook - Uh uh uh!94113093Scripts/c94113093.lua1
Smile Action47870325Scripts/c47870325.lua1
Magician of Hope67865534Scripts/c67865534.lua1
Performapal Turn Trooper220414Scripts/c220414.lua1
Don Thousand's Throne93238626Scripts/c93238626.lua1
Shooting Star Dragon T.G. EX63180841Scripts/c63180841.lua1
Parasite Paranoid14457896Scripts/c14457896.lua1
Summon Reactor ・SK89493368Scripts/c89493368.lua1
Performapal Odd-Eyes Butler56677752Scripts/c56677752.lua1
Destined Duel48128081Scripts/c48128081.lua1
Red Nova Dragon/Assault Mode82323997Scripts/c82323997.lua1
Amaze Attraction Viking Vortex97182396Scripts/c97182396.lua1
Beetrooper Light Flapper88962829Scripts/c88962829.lua1
Performapal Duelist Extraordinaire92644052Scripts/c92644052.lua1
Shooting Star Dragon24696097Scripts/c24696097.lua1
Marincess Bubble Ring19712214Scripts/c19712214.lua1
The Door of Destiny27062594Scripts/c27062594.lua1
Legacy of the Duelist88851326Scripts/c88851326.lua1
Artmage Varnish -Alteration-74011784Scripts/c74011784.lua1
Cosmic Blazar Dragon21123811Scripts/c21123811.lua1
Light Law Medium52253888Scripts/c52253888.lua1
Turn Silence5786513Scripts/c5786513.lua1
Raging Storm Dragon - Beaufort IX8836329Scripts/c8836329.lua1
...and 101 more

Script Examples ​

Magnet Warrior Sigma Minus (87814728) ​

Source: Scripts/c87814728.lua

lua
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
	Duel.NegateAttack()
end

Doodlebook - Uh uh uh! (94113093) ​

Source: Scripts/c94113093.lua

lua
end
function c94113093.negop(e,tp,eg,ep,ev,re,r,rp)
	if Duel.NegateAttack() then
		local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c94113093.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
		local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)

Smile Action (47870325) ​

Source: Scripts/c47870325.lua

lua
				if Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)~=0 then
					res=true
					Duel.NegateAttack()
				end
			end