Skip to content

Duel.GetBattleMonster ​

Signature ​

lua
Duel.GetBattleMonster(int player) -> Card|nil,Card|nil

Description ​

Returns the monster controlled by player that is currently in battle, followed by the monster controlled by the opponent that is currently in battle. Each return can be nil if there is no attacker or attack target for that controller.

Parameters ​

  • player int

Returns ​

  • Card|nil - Monster controlled by player.
  • Card|nil - Monster controlled by the opponent.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 56 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetBattleMonster.
CardIDScriptDetected Calls
Sea Stealth Attack19089195Scripts/c19089195.lua1
Dual Avatar - Manifested A-Un28798938Scripts/c28798938.lua2
Sangen Furo55484152Scripts/c55484152.lua1
Abyss Shark61496006Scripts/c61496006.lua1
Prohibited Power Patron Portal - Terminus25661743Scripts/c25661743.lua1
Performapal Duelist Extraordinaire92644052Scripts/c92644052.lua2
Number C79: Battlin' Boxer General Kaiser10300821Scripts/c10300821.lua1
War Rock Meteoragon10497636Scripts/c10497636.lua1
Infinite Antlion39078434Scripts/c39078434.lua1
Exosister Carpedivem30802207Scripts/c30802207.lua1
War Rock Skyler72554862Scripts/c72554862.lua1
Pennant of Revolution73193552Scripts/c73193552.lua2
Heroic Champion - Claivesolish97453744Scripts/c97453744.lua1
Ice Barrier34293667Scripts/c34293667.lua2
Heroic Champion - Jarngreipr23848752Scripts/c23848752.lua2
Fighting Flame Sword35697544Scripts/c35697544.lua1
Tilting Entrainment77855162Scripts/c77855162.lua1
Mementotlan Fracture Dance43215738Scripts/c43215738.lua1
Performapal Ladyange58938528Scripts/c58938528.lua2
Sunvine Gardna28168762Scripts/c28168762.lua1
Swordsoul Auspice Chunjun29884951Scripts/c29884951.lua3
Lyrilusc - Phantom Feathers8243121Scripts/c8243121.lua3
Piercing the Darkness21862633Scripts/c21862633.lua2
Lyrilusc - Promenade Thrush19369609Scripts/c19369609.lua2
...and 32 more

Script Examples ​

Sea Stealth Attack (19089195) ​

Source: Scripts/c19089195.lua

lua
function c19089195.descon(e,tp,eg,ep,ev,re,r,rp)
	if not Duel.IsEnvironment(22702055) then return false end
	local tc,bc=Duel.GetBattleMonster(tp)
	if not tc or not bc then return false end
	if tc:IsFaceup() and tc:GetOriginalLevel()>=5 and tc:IsAttribute(ATTRIBUTE_WATER) then

Dual Avatar - Manifested A-Un (28798938) ​

Source: Scripts/c28798938.lua

lua
function c28798938.atkcon(e)
	local tp=e:GetHandlerPlayer()
	local a=Duel.GetBattleMonster(tp)
	return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and a and a:IsSetCard(0x14f)
end

Sangen Furo (55484152) ​

Source: Scripts/c55484152.lua

lua
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
	local a=Duel.GetBattleMonster(tp)
	return a and (a:IsLocation(LOCATION_MZONE) and a:IsRace(RACE_DRAGON) and a:IsAttribute(ATTRIBUTE_FIRE)
		or not a:IsLocation(LOCATION_MZONE) and a:IsPreviousControler(tp)