Skip to content

Card.GetDefense ​

Signature ​

lua
Card.GetDefense(Card c) -> int

Description ​

Returns c's current DEF. Unknown or negative DEF values are clamped to 0 by this binding.

Parameters ​

  • c Card

Returns ​

  • int

Source ​

  • D:\Programs\GitHub\ygopro-core\libcard.cpp:3494

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 122 indexed script(s).
  • Search this function in the Script Explorer with Card.GetDefense.
CardIDScriptDetected Calls
Duel Link Dragon, the Duel Dragon60025883Scripts/c60025883.lua1
Amaze Attraction Wonder Wheel93473606Scripts/c93473606.lua1
Nemleria Louve57296396Scripts/c57296396.lua1
Gladiator Beast Gaiodiaz90957527Scripts/c90957527.lua2
Millennium-Eyes Restrict41578483Scripts/c41578483.lua2
Melffy Staring Contest76981308Scripts/c76981308.lua1
Gilti-Gearfried the Magical Steel Knight49161188Scripts/c49161188.lua2
Mythical Beast Medusa54965929Scripts/c54965929.lua1
Floowandereeze & Empen80611581Scripts/c80611581.lua1
Cherubini, Ebon Angel of the Burning Abyss58699500Scripts/c58699500.lua1
Dimension Reflector54297661Scripts/c54297661.lua2
Light and Darkness Dragonlord19652159Scripts/c19652159.lua1
True Draco Apocalypse61529473Scripts/c61529473.lua1
Vanquish Soul Dr. Mad Love29280200Scripts/c29280200.lua2
Victory Viper XX0393130021Scripts/c93130021.lua3
Replicard LAD1665819Scripts/c1665819.lua1
Power Capsule54289683Scripts/c54289683.lua3
Malacoda, Netherlord of the Burning Abyss35330871Scripts/c35330871.lua1
Number C104: Umbral Horror Masquerade Victory42396591Scripts/c42396591.lua1
Galaxy Brave55168550Scripts/c55168550.lua1
Psychic Commander21454943Scripts/c21454943.lua1
Yosenju Oyam69838592Scripts/c69838592.lua1
Superheavy Samurai Helper44891812Scripts/c44891812.lua1
Legendary Secret of the Six Samurai15327215Scripts/c15327215.lua2
...and 98 more

Script Examples ​

Source: Scripts/c60025883.lua

lua
	return c:IsType(TYPE_SYNCHRO) and c:IsAbleToRemoveAsCost()
		and (c:IsSetCard(0xc2) or c:IsRace(RACE_DRAGON) and (c:IsLevel(7) or c:IsLevel(8)))
		and Duel.IsPlayerCanSpecialSummonMonster(tp,60025884,0,TYPES_TOKEN_MONSTER,c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute())
end
function c60025883.spcost(e,tp,eg,ep,ev,re,r,rp,chk)

Amaze Attraction Wonder Wheel (93473606) ​

Source: Scripts/c93473606.lua

lua
	if ec and c:IsRelateToEffect(e) then
		local atk=ec:GetAttack()
		local def=ec:GetDefense()
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)

Nemleria Louve (57296396) ​

Source: Scripts/c57296396.lua

lua
end
function s.atkfilter(c)
	return c:IsFaceup() and (c:GetAttack()>0 or c:GetDefense()>0)
end
function s.stattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)