mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
40 lines
666 B
NASM
40 lines
666 B
NASM
BattleCommand52: ; 37536
|
|
; nightmare
|
|
|
|
; Can't hit an absent opponent.
|
|
|
|
call CheckHiddenOpponent
|
|
jr nz, .failed
|
|
|
|
; Can't hit a substitute.
|
|
|
|
call CheckSubstituteOpp
|
|
jr nz, .failed
|
|
|
|
; Only works on a sleeping opponent.
|
|
|
|
ld a, BATTLE_VARS_STATUS_OPP
|
|
call _GetBattleVar
|
|
and SLP
|
|
jr z, .failed
|
|
|
|
; Bail if the opponent is already having a nightmare.
|
|
|
|
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
|
call _GetBattleVar
|
|
bit SUBSTATUS_NIGHTMARE, [hl]
|
|
jr nz, .failed
|
|
|
|
; Otherwise give the opponent a nightmare.
|
|
|
|
set SUBSTATUS_NIGHTMARE, [hl]
|
|
call AnimateCurrentMove
|
|
ld hl, StartedNightmareText
|
|
jp StdBattleTextBox
|
|
|
|
.failed
|
|
call AnimateFailedMove
|
|
jp PrintButItFailed
|
|
; 37563
|
|
|