Skip to content

Card.GetBattleTarget ​

Signature ​

lua
Card.GetBattleTarget(Card c) -> Card|nil

Description ​

Returns the monster currently battling c, or nil if c is not the current attacker or attack target.

Parameters ​

  • c Card

Returns ​

  • Card|nil - The monster battling c, or nil.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 356 indexed script(s).
  • Search this function in the Script Explorer with Card.GetBattleTarget.
CardIDScriptDetected Calls
Goyo Emperor59255742Scripts/c59255742.lua3
Favorite HERO Flame Wingman13243124Scripts/c13243124.lua1
Spirit Illusion71939275Scripts/c71939275.lua1
Performapal Odd-Eyes Dissolver46136942Scripts/c46136942.lua1
Galaxy-Eyes Photon Dragon93717133Scripts/c93717133.lua1
All-Eyes Phantom Dragon70335319Scripts/c70335319.lua1
Arcana Force EX - The Light Ruler5861892Scripts/c5861892.lua1
Supreme King Z-ARC - Synchro Universe48654267Scripts/c48654267.lua2
Hecahands Mankibuel18321034Scripts/c18321034.lua1
Mirror Barrier95915457Scripts/c95915457.lua2
Gilti-Gearfried the Magical Steel Knight49161188Scripts/c49161188.lua1
TiSolfachord Beautia54387923Scripts/c54387923.lua3
Supreme King Dragon Odd-Eyes96733134Scripts/c96733134.lua1
Courageous Crimson Chevalier Bradamante91479482Scripts/c91479482.lua1
Blue-Eyes Toon Ultimate Dragon71808988Scripts/c71808988.lua1
Alien Mother24104865Scripts/c24104865.lua1
Predaplant Chimerafflesia25586143Scripts/c25586143.lua1
Magikey Deity - Ashtartu26988374Scripts/c26988374.lua1
Life Extreme36148308Scripts/c36148308.lua2
Myutant Blast79072916Scripts/c79072916.lua3
Infernoid Attondel88301393Scripts/c88301393.lua1
Gussari @Ignister55762976Scripts/c55762976.lua1
Infinitrack Earth Slicer97584719Scripts/c97584719.lua1
Magikey Mechmusket - Batosbuster19489718Scripts/c19489718.lua1
...and 332 more

Script Examples ​

Goyo Emperor (59255742) ​

Source: Scripts/c59255742.lua

lua
function c59255742.spcon(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local bc=c:GetBattleTarget()
	if not c:IsRelateToBattle() or c:IsFacedown() then return false end
	return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)

Favorite HERO Flame Wingman (13243124) ​

Source: Scripts/c13243124.lua

lua
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
	local c=e:GetHandler()
	local bc=c:GetBattleTarget()
	return bc and bc:IsFaceup() and bc:IsAttackAbove(2200)
end

Spirit Illusion (71939275) ​

Source: Scripts/c71939275.lua

lua
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
	local ec=e:GetHandler():GetEquipTarget()
	local tc=ec:GetBattleTarget()
	e:SetLabelObject(tc)
	return not ec:IsAttack(0) and tc and tc:IsFaceup()