Duel.GetBattleMonster
Signature
lua
Duel.GetBattleMonster(int player) -> Card|nil,Card|nilDescription
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
playerint
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.
| Card | ID | Script | Detected Calls |
|---|---|---|---|
| Sea Stealth Attack | 19089195 | Scripts/c19089195.lua | 1 |
| Dual Avatar - Manifested A-Un | 28798938 | Scripts/c28798938.lua | 2 |
| Sangen Furo | 55484152 | Scripts/c55484152.lua | 1 |
| Abyss Shark | 61496006 | Scripts/c61496006.lua | 1 |
| Prohibited Power Patron Portal - Terminus | 25661743 | Scripts/c25661743.lua | 1 |
| Performapal Duelist Extraordinaire | 92644052 | Scripts/c92644052.lua | 2 |
| Number C79: Battlin' Boxer General Kaiser | 10300821 | Scripts/c10300821.lua | 1 |
| War Rock Meteoragon | 10497636 | Scripts/c10497636.lua | 1 |
| Infinite Antlion | 39078434 | Scripts/c39078434.lua | 1 |
| Exosister Carpedivem | 30802207 | Scripts/c30802207.lua | 1 |
| War Rock Skyler | 72554862 | Scripts/c72554862.lua | 1 |
| Pennant of Revolution | 73193552 | Scripts/c73193552.lua | 2 |
| Heroic Champion - Claivesolish | 97453744 | Scripts/c97453744.lua | 1 |
| Ice Barrier | 34293667 | Scripts/c34293667.lua | 2 |
| Heroic Champion - Jarngreipr | 23848752 | Scripts/c23848752.lua | 2 |
| Fighting Flame Sword | 35697544 | Scripts/c35697544.lua | 1 |
| Tilting Entrainment | 77855162 | Scripts/c77855162.lua | 1 |
| Mementotlan Fracture Dance | 43215738 | Scripts/c43215738.lua | 1 |
| Performapal Ladyange | 58938528 | Scripts/c58938528.lua | 2 |
| Sunvine Gardna | 28168762 | Scripts/c28168762.lua | 1 |
| Swordsoul Auspice Chunjun | 29884951 | Scripts/c29884951.lua | 3 |
| Lyrilusc - Phantom Feathers | 8243121 | Scripts/c8243121.lua | 3 |
| Piercing the Darkness | 21862633 | Scripts/c21862633.lua | 2 |
| Lyrilusc - Promenade Thrush | 19369609 | Scripts/c19369609.lua | 2 |
| ...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) thenDual 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)
endSangen 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)