Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DetermineMoveOrder:
- ld a, [wLinkMode]
- and a
- jr z, .use_move
- ld a, [wBattleAction]
- cp BATTLEACTION_STRUGGLE
- jr z, .use_move
- cp BATTLEACTION_SKIPTURN
- jr z, .use_move
- sub BATTLEACTION_SWITCH1
- jr c, .use_move
- ld a, [wBattlePlayerAction]
- cp BATTLEPLAYERACTION_SWITCH
- jr nz, .switch
- ldh a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr z, .player_2
- call BattleRandom
- cp 50 percent + 1
- jp c, .player_first
- jp .enemy_first
- .player_2
- call BattleRandom
- cp 50 percent + 1
- jp c, .enemy_first
- jp .player_first
- .switch
- callfar AI_Switch
- call SetEnemyTurn
- call SpikesDamage
- jp .enemy_first
- .use_move
- ld a, [wBattlePlayerAction]
- and a ; BATTLEPLAYERACTION_USEMOVE?
- jp nz, .player_first
- call CompareMovePriority
- jr z, .equal_priority
- jr c, .player_first ; player goes first
- jr .enemy_first
- .equal_priority
- call SetPlayerTurn
- callfar GetUserItem
- push bc
- callfar GetOpponentItem
- pop de
- ld a, d
- cp HELD_QUICK_CLAW
- jr nz, .player_no_quick_claw
- ld a, b
- cp HELD_QUICK_CLAW
- jr z, .both_have_quick_claw
- call BattleRandom
- cp e
- jr nc, .speed_check
- jr .player_first
- .player_no_quick_claw
- ld a, b
- cp HELD_QUICK_CLAW
- jr nz, .speed_check
- call BattleRandom
- cp c
- jr nc, .speed_check
- jr .enemy_first
- .both_have_quick_claw
- ldh a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr z, .player_2b
- call BattleRandom
- cp c
- jp c, .enemy_first
- call BattleRandom
- cp e
- jr c, .player_first
- jr .speed_check
- .player_2b
- call BattleRandom
- cp e
- jr c, .player_first
- call BattleRandom
- cp c
- jr c, .enemy_first
- .speed_check
- ld de, wBattleMonSpeed
- ld hl, wEnemyMonSpeed
- ld c, 2
- call CompareBytes
- jr z, .speed_tie
- jr nc, .player_first
- jr .enemy_first
- .speed_tie
- ldh a, [hSerialConnectionStatus]
- cp USING_INTERNAL_CLOCK
- jr z, .player_2c
- call BattleRandom
- cp 50 percent + 1
- jr c, .player_first
- jr .enemy_first
- .player_2c
- call BattleRandom
- cp 50 percent + 1
- jr c, .enemy_first
- .player_first
- scf
- ret
- .enemy_first
- and a
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement