mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
99e66c2557
- Remove "Buffer" suffix from some byte and word quantities - Change "Ptr" to "Pointer" Fixes #789
51 lines
851 B
NASM
51 lines
851 B
NASM
BattleCommand_Mimic:
|
|
; mimic
|
|
|
|
call ClearLastMove
|
|
call BattleCommand_MoveDelay
|
|
ld a, [wAttackMissed]
|
|
and a
|
|
jr nz, .fail
|
|
ld hl, wBattleMonMoves
|
|
ldh a, [hBattleTurn]
|
|
and a
|
|
jr z, .player_turn
|
|
ld hl, wEnemyMonMoves
|
|
.player_turn
|
|
call CheckHiddenOpponent
|
|
jr nz, .fail
|
|
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
|
call GetBattleVar
|
|
and a
|
|
jr z, .fail
|
|
cp STRUGGLE
|
|
jr z, .fail
|
|
ld b, a
|
|
ld c, NUM_MOVES
|
|
.check_already_knows_move
|
|
ld a, [hli]
|
|
cp b
|
|
jr z, .fail
|
|
dec c
|
|
jr nz, .check_already_knows_move
|
|
dec hl
|
|
.find_mimic
|
|
ld a, [hld]
|
|
cp MIMIC
|
|
jr nz, .find_mimic
|
|
inc hl
|
|
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
|
call GetBattleVar
|
|
ld [hl], a
|
|
ld [wNamedObjectIndex], a
|
|
ld bc, wBattleMonPP - wBattleMonMoves
|
|
add hl, bc
|
|
ld [hl], 5
|
|
call GetMoveName
|
|
call AnimateCurrentMove
|
|
ld hl, MimicLearnedMoveText
|
|
jp StdBattleTextbox
|
|
|
|
.fail
|
|
jp FailMimic
|