mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
bank 0 battle functions
This commit is contained in:
parent
417a73d61a
commit
0cbea9b553
@ -182,7 +182,7 @@ CheckPlayerTurn:
|
|||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
|
|
||||||
call CantMove
|
call CantMove
|
||||||
call $399c
|
call UpdateBattleMonInParty
|
||||||
ld hl, $5f48
|
ld hl, $5f48
|
||||||
call CallBankF
|
call CallBankF
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@ -442,7 +442,7 @@ CheckEnemyTurn: ; 3421f
|
|||||||
ld hl, WokeUpText
|
ld hl, WokeUpText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
call CantMove
|
call CantMove
|
||||||
call $39b0
|
call UpdateEnemyMonInParty
|
||||||
ld hl, $6036
|
ld hl, $6036
|
||||||
call CallBankF
|
call CallBankF
|
||||||
ld a, $1
|
ld a, $1
|
||||||
@ -3268,7 +3268,7 @@ BattleCommand11: ; 351c0
|
|||||||
ld l, c
|
ld l, c
|
||||||
ld a, $b
|
ld a, $b
|
||||||
call $2d83
|
call $2d83
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
|
|
||||||
call SwitchTurn
|
call SwitchTurn
|
||||||
xor a
|
xor a
|
||||||
@ -5385,7 +5385,7 @@ Function0x35d1c: ; 35d1c
|
|||||||
ld a, $b
|
ld a, $b
|
||||||
call Predef
|
call Predef
|
||||||
.asm_35d7b
|
.asm_35d7b
|
||||||
jp $39c9
|
jp RefreshBattleHuds
|
||||||
; 35d7e
|
; 35d7e
|
||||||
|
|
||||||
|
|
||||||
@ -5443,7 +5443,7 @@ Function0x35d7e: ; 35d7e
|
|||||||
ld a, $b
|
ld a, $b
|
||||||
call Predef
|
call Predef
|
||||||
.asm_35ddd
|
.asm_35ddd
|
||||||
jp $39c9
|
jp RefreshBattleHuds
|
||||||
; 35de0
|
; 35de0
|
||||||
|
|
||||||
|
|
||||||
@ -5503,7 +5503,7 @@ Function0x35de0: ; 35de0
|
|||||||
xor a
|
xor a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
.asm_35e3a
|
.asm_35e3a
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
.asm_35e3d
|
.asm_35e3d
|
||||||
jp ResetDamage
|
jp ResetDamage
|
||||||
; 35e40
|
; 35e40
|
||||||
@ -5581,8 +5581,8 @@ BattleCommand14: ; 35e5c
|
|||||||
jr z, .asm_35ea4
|
jr z, .asm_35ea4
|
||||||
inc a
|
inc a
|
||||||
ld [de], a
|
ld [de], a
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
|
|
||||||
ld hl, FellAsleepText
|
ld hl, FellAsleepText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
@ -5659,7 +5659,7 @@ BattleCommand13: ; 35eee
|
|||||||
call Function0x35ff5
|
call Function0x35ff5
|
||||||
ld de, $0106
|
ld de, $0106
|
||||||
call Function0x37e54
|
call Function0x37e54
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
|
|
||||||
ld hl, WasPoisonedText
|
ld hl, WasPoisonedText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
@ -5756,7 +5756,7 @@ BattleCommand2f: ; 35f2c
|
|||||||
Function0x35fc0: ; 35fc0
|
Function0x35fc0: ; 35fc0
|
||||||
call Function0x37e01
|
call Function0x37e01
|
||||||
call Function0x35ff5
|
call Function0x35ff5
|
||||||
jp $39c9
|
jp RefreshBattleHuds
|
||||||
; 35fc9
|
; 35fc9
|
||||||
|
|
||||||
|
|
||||||
@ -5797,7 +5797,7 @@ Function0x35ff5: ; 35ff5
|
|||||||
ld a, $b
|
ld a, $b
|
||||||
call $39e7
|
call $39e7
|
||||||
set 3, [hl]
|
set 3, [hl]
|
||||||
jp $398e
|
jp UpdateOpponentInParty
|
||||||
; 35fff
|
; 35fff
|
||||||
|
|
||||||
|
|
||||||
@ -5895,8 +5895,8 @@ Function0x36011: ; 36011
|
|||||||
ld [$d10a], a
|
ld [$d10a], a
|
||||||
ld a, $b
|
ld a, $b
|
||||||
call Predef
|
call Predef
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
jp $399c
|
jp UpdateBattleMonInParty
|
||||||
; 3608c
|
; 3608c
|
||||||
|
|
||||||
|
|
||||||
@ -5928,12 +5928,12 @@ BattleCommand17: ; 3608c
|
|||||||
ld a, BATTLE_VARS_STATUS_OPP
|
ld a, BATTLE_VARS_STATUS_OPP
|
||||||
call GetBattleVarPair
|
call GetBattleVarPair
|
||||||
set 4, [hl]
|
set 4, [hl]
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
ld hl, $6c76
|
ld hl, $6c76
|
||||||
call CallBankF
|
call CallBankF
|
||||||
ld de, $0105
|
ld de, $0105
|
||||||
call Function0x37e54
|
call Function0x37e54
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
|
|
||||||
ld hl, WasBurnedText
|
ld hl, WasBurnedText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
@ -5965,7 +5965,7 @@ Defrost: ; 360dd
|
|||||||
call GetPartyLocation
|
call GetPartyLocation
|
||||||
xor a
|
xor a
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
|
|
||||||
ld hl, DefrostedOpponentText
|
ld hl, DefrostedOpponentText
|
||||||
jp FarBattleTextBox
|
jp FarBattleTextBox
|
||||||
@ -6003,10 +6003,10 @@ BattleCommand18: ; 36102
|
|||||||
ld a, BATTLE_VARS_STATUS_OPP
|
ld a, BATTLE_VARS_STATUS_OPP
|
||||||
call GetBattleVarPair
|
call GetBattleVarPair
|
||||||
set 5, [hl]
|
set 5, [hl]
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
ld de, $0108
|
ld de, $0108
|
||||||
call Function0x37e54
|
call Function0x37e54
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
|
|
||||||
ld hl, WasFrozenText
|
ld hl, WasFrozenText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
@ -6054,12 +6054,12 @@ BattleCommand19: ; 36165
|
|||||||
ld a, BATTLE_VARS_STATUS_OPP
|
ld a, BATTLE_VARS_STATUS_OPP
|
||||||
call GetBattleVarPair
|
call GetBattleVarPair
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
ld hl, $6c39
|
ld hl, $6c39
|
||||||
call CallBankF
|
call CallBankF
|
||||||
ld de, $0109
|
ld de, $0109
|
||||||
call Function0x37e54
|
call Function0x37e54
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
call PrintParalyze
|
call PrintParalyze
|
||||||
ld hl, $5de9
|
ld hl, $5de9
|
||||||
jp CallBankF
|
jp CallBankF
|
||||||
@ -7158,7 +7158,7 @@ BattleCommanda0: ; 36778
|
|||||||
cp b
|
cp b
|
||||||
jr nc, .asm_367df ; 367dd $0
|
jr nc, .asm_367df ; 367dd $0
|
||||||
.asm_367df
|
.asm_367df
|
||||||
call $399c
|
call UpdateBattleMonInParty
|
||||||
xor a
|
xor a
|
||||||
ld [$cfca], a
|
ld [$cfca], a
|
||||||
inc a
|
inc a
|
||||||
@ -7225,7 +7225,7 @@ BattleCommand23: ; 3680f
|
|||||||
.asm_36852
|
.asm_36852
|
||||||
jp .asm_36969
|
jp .asm_36969
|
||||||
.asm_36855
|
.asm_36855
|
||||||
call $399c
|
call UpdateBattleMonInParty
|
||||||
xor a
|
xor a
|
||||||
ld [$cfca], a
|
ld [$cfca], a
|
||||||
inc a
|
inc a
|
||||||
@ -7239,7 +7239,7 @@ BattleCommand23: ; 3680f
|
|||||||
ld a, [$c70f]
|
ld a, [$c70f]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_368ca ; 36872 $56
|
jr z, .asm_368ca ; 36872 $56
|
||||||
call $39b0
|
call UpdateEnemyMonInParty
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [$c689], a
|
ld [$c689], a
|
||||||
call Function0x37e01
|
call Function0x37e01
|
||||||
@ -7318,7 +7318,7 @@ BattleCommand23: ; 3680f
|
|||||||
jr .asm_36969
|
jr .asm_36969
|
||||||
|
|
||||||
.asm_368f5
|
.asm_368f5
|
||||||
call $399c
|
call UpdateBattleMonInParty
|
||||||
xor a
|
xor a
|
||||||
ld [$cfca], a
|
ld [$cfca], a
|
||||||
inc a
|
inc a
|
||||||
@ -7335,7 +7335,7 @@ BattleCommand23: ; 3680f
|
|||||||
cp $1
|
cp $1
|
||||||
jr z, .asm_368ca
|
jr z, .asm_368ca
|
||||||
|
|
||||||
call $399c
|
call UpdateBattleMonInParty
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [$c689], a
|
ld [$c689], a
|
||||||
call Function0x37e01
|
call Function0x37e01
|
||||||
@ -8017,7 +8017,7 @@ BattleCommand27: ; 36cb2
|
|||||||
ld [$d10a], a
|
ld [$d10a], a
|
||||||
ld a, $b
|
ld a, $b
|
||||||
call $2d83
|
call $2d83
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
ld hl, RecoilText
|
ld hl, RecoilText
|
||||||
jp FarBattleTextBox
|
jp FarBattleTextBox
|
||||||
; 36d1d
|
; 36d1d
|
||||||
@ -8188,10 +8188,10 @@ BattleCommand30: ; 36dc7
|
|||||||
ld a, BATTLE_VARS_STATUS_OPP
|
ld a, BATTLE_VARS_STATUS_OPP
|
||||||
call GetBattleVarPair
|
call GetBattleVarPair
|
||||||
set 6, [hl]
|
set 6, [hl]
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
ld hl, $6c39
|
ld hl, $6c39
|
||||||
call CallBankF
|
call CallBankF
|
||||||
call $39d4
|
call UpdateBattleHuds
|
||||||
call PrintParalyze
|
call PrintParalyze
|
||||||
ld hl, $5de9
|
ld hl, $5de9
|
||||||
jp CallBankF
|
jp CallBankF
|
||||||
@ -8310,7 +8310,7 @@ BattleCommand31: ; 36e7c
|
|||||||
.asm_36eeb
|
.asm_36eeb
|
||||||
ld hl, MadeSubstituteText
|
ld hl, MadeSubstituteText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
jp $39c9
|
jp RefreshBattleHuds
|
||||||
.asm_36ef4
|
.asm_36ef4
|
||||||
call Function0x34548
|
call Function0x34548
|
||||||
call nz, BattleCommand0c
|
call nz, BattleCommand0c
|
||||||
@ -8784,8 +8784,8 @@ BattleCommand2c: ; 3713e
|
|||||||
ld hl, $4cef
|
ld hl, $4cef
|
||||||
call CallBankF
|
call CallBankF
|
||||||
call SwitchTurn
|
call SwitchTurn
|
||||||
call $3995
|
call UpdateUserInParty
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
ld hl, RegainedHealthText
|
ld hl, RegainedHealthText
|
||||||
jp FarBattleTextBox
|
jp FarBattleTextBox
|
||||||
|
|
||||||
@ -9141,7 +9141,7 @@ BattleCommand1a: ; 37380
|
|||||||
ld hl, $6043
|
ld hl, $6043
|
||||||
rst FarCall
|
rst FarCall
|
||||||
call $31f6
|
call $31f6
|
||||||
jp $39c9
|
jp RefreshBattleHuds
|
||||||
; 373c9
|
; 373c9
|
||||||
|
|
||||||
|
|
||||||
@ -9444,7 +9444,7 @@ BattleCommand53: ; 37563
|
|||||||
call $3945
|
call $3945
|
||||||
res 5, [hl]
|
res 5, [hl]
|
||||||
.asm_3757f
|
.asm_3757f
|
||||||
call $39c9
|
call RefreshBattleHuds
|
||||||
ld hl, WasDefrostedText
|
ld hl, WasDefrostedText
|
||||||
jp FarBattleTextBox
|
jp FarBattleTextBox
|
||||||
; 37588
|
; 37588
|
||||||
@ -9505,7 +9505,7 @@ BattleCommand54: ; 37588
|
|||||||
call CallBankF
|
call CallBankF
|
||||||
ld hl, $4c3f
|
ld hl, $4c3f
|
||||||
call CallBankF
|
call CallBankF
|
||||||
call $3995
|
call UpdateUserInParty
|
||||||
ld hl, PutACurseText
|
ld hl, PutACurseText
|
||||||
jp FarBattleTextBox
|
jp FarBattleTextBox
|
||||||
.asm_37604
|
.asm_37604
|
||||||
@ -10041,7 +10041,7 @@ BattleCommand61: ; 37874
|
|||||||
ld hl, RegainedHealthText
|
ld hl, RegainedHealthText
|
||||||
call FarBattleTextBox
|
call FarBattleTextBox
|
||||||
call SwitchTurn
|
call SwitchTurn
|
||||||
call $398e
|
call UpdateOpponentInParty
|
||||||
jr .asm_37904 ; 378f1 $11
|
jr .asm_37904 ; 378f1 $11
|
||||||
.asm_378f3
|
.asm_378f3
|
||||||
call SwitchTurn
|
call SwitchTurn
|
||||||
@ -10199,7 +10199,7 @@ BattleCommand67: ; 379c9
|
|||||||
call Function0x37ae9
|
call Function0x37ae9
|
||||||
jp z, Function0x37aab
|
jp z, Function0x37aab
|
||||||
|
|
||||||
call $399c
|
call UpdateBattleMonInParty
|
||||||
call Function0x37e01
|
call Function0x37e01
|
||||||
|
|
||||||
ld c, 50
|
ld c, 50
|
||||||
@ -10253,7 +10253,7 @@ BattleCommand67: ; 379c9
|
|||||||
call Function0x37af6
|
call Function0x37af6
|
||||||
jp z, Function0x37aab
|
jp z, Function0x37aab
|
||||||
|
|
||||||
call $39b0
|
call UpdateEnemyMonInParty
|
||||||
call Function0x37e01
|
call Function0x37e01
|
||||||
call Function0x37a82
|
call Function0x37a82
|
||||||
|
|
||||||
@ -10564,7 +10564,7 @@ BattleCommand6a6c: ; 37b7e
|
|||||||
rst FarCall ; callab 3ccef
|
rst FarCall ; callab 3ccef
|
||||||
|
|
||||||
call SwitchTurn
|
call SwitchTurn
|
||||||
call $3995
|
call UpdateUserInParty
|
||||||
|
|
||||||
; 'regained health!'
|
; 'regained health!'
|
||||||
ld hl, RegainedHealthText
|
ld hl, RegainedHealthText
|
||||||
@ -10646,7 +10646,7 @@ BattleCommand95: ; 37c1a
|
|||||||
ld hl, $4c3f
|
ld hl, $4c3f
|
||||||
ld a, $f
|
ld a, $f
|
||||||
rst FarCall
|
rst FarCall
|
||||||
call $3995
|
call UpdateUserInParty
|
||||||
ld a, $5
|
ld a, $5
|
||||||
|
|
||||||
.asm_37c41
|
.asm_37c41
|
||||||
|
67
main.asm
67
main.asm
@ -3867,7 +3867,72 @@ SetEnemyTurn: ; 3989
|
|||||||
ret
|
ret
|
||||||
; 398e
|
; 398e
|
||||||
|
|
||||||
INCBIN "baserom.gbc", $398e, $39e1 - $398e
|
|
||||||
|
UpdateOpponentInParty: ; 398e
|
||||||
|
ld a, [hBattleTurn]
|
||||||
|
and a
|
||||||
|
jr z, UpdateEnemyMonInParty
|
||||||
|
jr UpdateBattleMonInParty
|
||||||
|
; 3995
|
||||||
|
|
||||||
|
UpdateUserInParty: ; 3995
|
||||||
|
ld a, [hBattleTurn]
|
||||||
|
and a
|
||||||
|
jr z, UpdateBattleMonInParty
|
||||||
|
jr UpdateEnemyMonInParty
|
||||||
|
; 399c
|
||||||
|
|
||||||
|
UpdateBattleMonInParty: ; 399c
|
||||||
|
; Update level, status, current HP
|
||||||
|
|
||||||
|
ld a, [CurBattleMon]
|
||||||
|
ld hl, PartyMon1Level
|
||||||
|
call GetPartyLocation
|
||||||
|
|
||||||
|
ld d, h
|
||||||
|
ld e, l
|
||||||
|
ld hl, BattleMonLevel
|
||||||
|
ld bc, BattleMonMaxHP - BattleMonLevel
|
||||||
|
jp CopyBytes
|
||||||
|
; 39b0
|
||||||
|
|
||||||
|
UpdateEnemyMonInParty: ; 39b0
|
||||||
|
; Update level, status, current HP
|
||||||
|
|
||||||
|
; No wildmons.
|
||||||
|
ld a, [IsInBattle]
|
||||||
|
dec a
|
||||||
|
ret z
|
||||||
|
|
||||||
|
ld a, [CurOTMon]
|
||||||
|
ld hl, OTPartyMon1Level
|
||||||
|
call GetPartyLocation
|
||||||
|
|
||||||
|
ld d, h
|
||||||
|
ld e, l
|
||||||
|
ld hl, EnemyMonLevel
|
||||||
|
ld bc, EnemyMonMaxHP - EnemyMonLevel
|
||||||
|
jp CopyBytes
|
||||||
|
; 39c9
|
||||||
|
|
||||||
|
|
||||||
|
RefreshBattleHuds: ; 39c9
|
||||||
|
call UpdateBattleHuds
|
||||||
|
ld c, 3
|
||||||
|
call DelayFrames
|
||||||
|
jp WaitBGMap
|
||||||
|
; 39d4
|
||||||
|
|
||||||
|
UpdateBattleHuds: ; 39d4
|
||||||
|
ld a, $f
|
||||||
|
ld hl, $5f48
|
||||||
|
rst FarCall ; UpdatePlayerHud
|
||||||
|
ld a, $f
|
||||||
|
ld hl, $6036
|
||||||
|
rst FarCall ; UpdateEnemyHud
|
||||||
|
ret
|
||||||
|
; 39e1
|
||||||
|
|
||||||
|
|
||||||
CleanGetBattleVarPair: ; 39e1
|
CleanGetBattleVarPair: ; 39e1
|
||||||
; Preserves hl.
|
; Preserves hl.
|
||||||
|
Loading…
Reference in New Issue
Block a user