Skip to content

Duel.IsDamageCalculated ​

Signature ​

lua
Duel.IsDamageCalculated() -> bool

Description ​

Returns whether damage calculation has been performed in the current battle/damage-step state. Use it with Duel.GetCurrentPhase in Damage Step conditions, especially for ATK/DEF-changing effects that stop being legal after damage calculation.

Returns ​

  • bool - true after damage calculation has been performed in the current battle timing.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 42 indexed script(s).
  • Search this function in the Script Explorer with Duel.IsDamageCalculated.
CardIDScriptDetected Calls
Assault Spirits87043568Scripts/c87043568.lua1
Flower Cardian Cherry Blossom with Curtain5489987Scripts/c5489987.lua1
At One With the Sword6112401Scripts/c6112401.lua1
Guilt of the Sinful Spoils88695895Scripts/c88695895.lua1
Psychic Commander21454943Scripts/c21454943.lua1
Ocean Dragon Lord - Kairyu-Shin23931679Scripts/c23931679.lua1
Gouki Iron Claw71555408Scripts/c71555408.lua1
Attack of the Cornered Rat84389640Scripts/c84389640.lua1
Superheavy Samurai Soulbuster Gauntlet35800511Scripts/c35800511.lua1
Bark of Dark Ruler41925941Scripts/c41925941.lua1
Shinobird Crow39817919Scripts/c39817919.lua1
Trickstar Corobane98169343Scripts/c98169343.lua1
Mecha Phantom Beast Tetherwolf67922702Scripts/c67922702.lua1
Yosenju Tsujik25244515Scripts/c25244515.lua1
Dark Honest26914168Scripts/c26914168.lua1
Scrap Shark69155991Scripts/c69155991.lua1
Dragunity Knight - Gae Bulg900787Scripts/c900787.lua1
Indomitable Gladiator Beast55136228Scripts/c55136228.lua1
Bujingi Sinyou56574543Scripts/c56574543.lua1
Reaper on the Nightmare85684223Scripts/c85684223.lua1
There Can Be Only One24207889Scripts/c24207889.lua1
Honest37742478Scripts/c37742478.lua1
Constellar Praesepe2091298Scripts/c2091298.lua1
Spirit Reaper23205979Scripts/c23205979.lua1
...and 18 more

Script Examples ​

Assault Spirits (87043568) ​

Source: Scripts/c87043568.lua

lua
	local ph=Duel.GetCurrentPhase()
	return a==e:GetHandler():GetEquipTarget()
		and ph==PHASE_DAMAGE and not Duel.IsDamageCalculated()
end
function c87043568.cfilter(c)

Flower Cardian Cherry Blossom with Curtain (5489987) ​

Source: Scripts/c5489987.lua

lua
function c5489987.atkcon(e,tp,eg,ep,ev,re,r,rp)
	local phase=Duel.GetCurrentPhase()
	if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
	local tc=Duel.GetAttackTarget()
	if not tc then return false end

At One With the Sword (6112401) ​

Source: Scripts/c6112401.lua

lua
end
function c6112401.condition(e,tp,eg,ep,ev,re,r,rp)
	if Duel.GetCurrentPhase()==PHASE_DAMAGE and Duel.IsDamageCalculated() then return false end
	local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
	local tc=g:GetFirst()