Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HandleDefrost:
- ldh a, [hSerialConnectionStatus]
- cp USING_EXTERNAL_CLOCK
- jr z, .enemy_first
- call .do_player_turn
- jr .do_enemy_turn
- .enemy_first
- call .do_enemy_turn
- .do_player_turn
- ld a, [wBattleMonStatus]
- bit FRZ, a
- ret z
- ld a, [wPlayerIsSwitching]
- and a
- jr nz, .switch_roll
- ld a, [wPlayerJustGotFrozen]
- and a
- jr z, .defrosting
- call BattleRandom
- cp 21 percent
- jr c, .one_turn
- cp 61 percent
- jr c, .two_turns
- jr .three_turns
- .switch_roll
- call BattleRandom
- cp 51 percent
- jr c, .one_turn
- jr .two_turns
- .one_turn
- ld a, 1
- ld [wPlayerFrozenTurns], a
- ret
- .two_turns
- ld a, 2
- ld [wPlayerFrozenTurns], a
- ret
- .three_turns
- ld a, 3
- ld [wPlayerFrozenTurns], a
- ret
- .defrosting
- ld a, [wPlayerFrozenTurns]
- dec a
- ld [wPlayerFrozenTurns], a
- ret nz
- xor a
- ld [wBattleMonStatus], a
- ld a, [wCurBattleMon]
- ld hl, wPartyMon1Status
- call GetPartyLocation
- ld [hl], 0
- call UpdateBattleHuds
- call SetEnemyTurn
- ld hl, DefrostedOpponentText
- jp StdBattleTextbox
- .do_enemy_turn
- ld a, [wEnemyMonStatus]
- bit FRZ, a
- ret z
- ld a, [wEnemyIsSwitching]
- and a
- jr nz, .switch_roll_e
- ld a, [wEnemyJustGotFrozen]
- and a
- jr z, .defrosting_e
- call BattleRandom
- cp 21 percent
- jr c, .one_turn_e
- cp 61 percent
- jr c, .two_turns_e
- jr .three_turns_e
- .switch_roll_e
- call BattleRandom
- cp 51 percent
- jr c, .one_turn_e
- jr .two_turns_e
- .one_turn_e
- ld a, 1
- ld [wEnemyFrozenTurns], a
- ret
- .two_turns_e
- ld a, 2
- ld [wEnemyFrozenTurns], a
- ret
- .three_turns_e
- ld a, 3
- ld [wEnemyFrozenTurns], a
- ret
- .defrosting_e
- ld a, [wEnemyFrozenTurns]
- dec a
- ld [wEnemyFrozenTurns], a
- ret nz
- xor a
- ld [wEnemyMonStatus], a
- ld a, [wBattleMode]
- dec a
- jr z, .wild
- ld a, [wCurOTMon]
- ld hl, wOTPartyMon1Status
- call GetPartyLocation
- ld [hl], 0
- .wild
- call UpdateBattleHuds
- call SetPlayerTurn
- ld hl, DefrostedOpponentText
- jp StdBattleTextbox
Add Comment
Please, Sign In to add comment