mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
32ed487a47
# Conflicts: # audio/engine.asm # constants/gfx_constants.asm # constants/map_data_constants.asm # constants/pokemon_data_constants.asm # constants/sprite_constants.asm # constants/wram_constants.asm # data/maps/data.asm # engine/battle/ai/scoring.asm # engine/battle/core.asm # engine/battle/effect_commands.asm # engine/battle/misc.asm # engine/battle_anims/getpokeballwobble.asm # engine/breeding.asm # engine/buy_sell_toss.asm # engine/decorations.asm # engine/events/battle_tower/battle_tower.asm # engine/events/battle_tower/rules.asm # engine/events/buena.asm # engine/events/bug_contest/contest_2.asm # engine/events/daycare.asm # engine/events/dratini.asm # engine/events/halloffame.asm # engine/events/happiness_egg.asm # engine/events/kurt.asm # engine/events/lucky_number.asm # engine/events/magnet_train.asm # engine/events/overworld.asm # engine/events/pokerus/pokerus.asm # engine/events/print_unown.asm # engine/events/print_unown_2.asm # engine/events/unown_walls.asm # engine/item_effects.asm # engine/link.asm # engine/mon_menu.asm # engine/player_object.asm # engine/routines/playslowcry.asm # engine/scripting.asm # engine/search.asm # engine/search2.asm # engine/specials.asm # engine/start_menu.asm # engine/timeset.asm # home/battle_vars.asm # home/map.asm # maps/GoldenrodUndergroundSwitchRoomEntrances.asm # maps/IlexForest.asm # maps/KrissHouse2F.asm # maps/Route39Barn.asm # mobile/mobile_12_2.asm # mobile/mobile_40.asm # mobile/mobile_5f.asm # wram.asm
123 lines
1.8 KiB
NASM
123 lines
1.8 KiB
NASM
BattleCommand_Encore: ; 35864
|
|
; encore
|
|
|
|
ld hl, wEnemyMonMoves
|
|
ld de, wEnemyEncoreCount
|
|
ld a, [hBattleTurn]
|
|
and a
|
|
jr z, .ok
|
|
ld hl, wBattleMonMoves
|
|
ld de, wPlayerEncoreCount
|
|
.ok
|
|
ld a, BATTLE_VARS_LAST_MOVE_OPP
|
|
call GetBattleVar
|
|
and a
|
|
jp z, .failed
|
|
cp STRUGGLE
|
|
jp z, .failed
|
|
cp ENCORE
|
|
jp z, .failed
|
|
cp MIRROR_MOVE
|
|
jp z, .failed
|
|
ld b, a
|
|
|
|
.got_move
|
|
ld a, [hli]
|
|
cp b
|
|
jr nz, .got_move
|
|
|
|
ld bc, wBattleMonPP - wBattleMonMoves - 1
|
|
add hl, bc
|
|
ld a, [hl]
|
|
and PP_MASK
|
|
jp z, .failed
|
|
ld a, [wAttackMissed]
|
|
and a
|
|
jp nz, .failed
|
|
ld a, BATTLE_VARS_SUBSTATUS5_OPP
|
|
call GetBattleVarAddr
|
|
bit SUBSTATUS_ENCORED, [hl]
|
|
jp nz, .failed
|
|
set SUBSTATUS_ENCORED, [hl]
|
|
call BattleRandom
|
|
and $3
|
|
inc a
|
|
inc a
|
|
inc a
|
|
ld [de], a
|
|
call CheckOpponentWentFirst
|
|
jr nz, .finish_move
|
|
ld a, [hBattleTurn]
|
|
and a
|
|
jr z, .force_last_enemy_move
|
|
|
|
push hl
|
|
ld a, [wLastPlayerMove]
|
|
ld b, a
|
|
ld c, 0
|
|
ld hl, wBattleMonMoves
|
|
.find_player_move
|
|
ld a, [hli]
|
|
cp b
|
|
jr z, .got_player_move
|
|
inc c
|
|
ld a, c
|
|
cp NUM_MOVES
|
|
jr c, .find_player_move
|
|
pop hl
|
|
res SUBSTATUS_ENCORED, [hl]
|
|
xor a
|
|
ld [de], a
|
|
jr .failed
|
|
|
|
.got_player_move
|
|
pop hl
|
|
ld a, c
|
|
ld [wCurMoveNum], a
|
|
ld a, b
|
|
ld [wCurPlayerMove], a
|
|
dec a
|
|
ld de, wPlayerMoveStruct
|
|
call GetMoveData
|
|
jr .finish_move
|
|
|
|
.force_last_enemy_move
|
|
push hl
|
|
ld a, [wLastEnemyMove]
|
|
ld b, a
|
|
ld c, 0
|
|
ld hl, wEnemyMonMoves
|
|
.find_enemy_move
|
|
ld a, [hli]
|
|
cp b
|
|
jr z, .got_enemy_move
|
|
inc c
|
|
ld a, c
|
|
cp NUM_MOVES
|
|
jr c, .find_enemy_move
|
|
pop hl
|
|
res SUBSTATUS_ENCORED, [hl]
|
|
xor a
|
|
ld [de], a
|
|
jr .failed
|
|
|
|
.got_enemy_move
|
|
pop hl
|
|
ld a, c
|
|
ld [wCurEnemyMoveNum], a
|
|
ld a, b
|
|
ld [wCurEnemyMove], a
|
|
dec a
|
|
ld de, wEnemyMoveStruct
|
|
call GetMoveData
|
|
|
|
.finish_move
|
|
call AnimateCurrentMove
|
|
ld hl, GotAnEncoreText
|
|
jp StdBattleTextBox
|
|
|
|
.failed
|
|
jp PrintDidntAffect2
|
|
|
|
; 35926
|