battle/ai/switch.asm and more battle/effect_commands.asm

This commit is contained in:
PikalaxALT
2015-11-07 08:05:57 -05:00
parent 929d0aa081
commit e044580669
12 changed files with 755 additions and 751 deletions

View File

@@ -44,7 +44,7 @@ DontSwitch: ; 38041
; 38045 ; 38045
SwitchOften: ; 38045 SwitchOften: ; 38045
callab Function34941 callab CheckAbleToSwitch
ld a, [wc717] ld a, [wc717]
and $f0 and $f0
jp z, DontSwitch jp z, DontSwitch
@@ -80,7 +80,7 @@ SwitchOften: ; 38045
; 38083 ; 38083
SwitchRarely: ; 38083 SwitchRarely: ; 38083
callab Function34941 callab CheckAbleToSwitch
ld a, [wc717] ld a, [wc717]
and $f0 and $f0
jp z, DontSwitch jp z, DontSwitch
@@ -115,7 +115,7 @@ SwitchRarely: ; 38083
; 380c1 ; 380c1
SwitchSometimes: ; 380c1 SwitchSometimes: ; 380c1
callab Function34941 callab CheckAbleToSwitch
ld a, [wc717] ld a, [wc717]
and $f0 and $f0
jp z, DontSwitch jp z, DontSwitch
@@ -665,7 +665,7 @@ EnemyPotionFinish: ; 38436
xor a xor a
ld [wd10a], a ld [wd10a], a
call AIUsedItemSound call AIUsedItemSound
predef Functionc6e0 predef AnimateHPBar
jp AIUpdateHUD jp AIUpdateHUD

View File

@@ -981,7 +981,7 @@ AI_Smart_Whirlwind: ; 38a2a
; Consider player's type(s) if its moves are unknown. ; Consider player's type(s) if its moves are unknown.
push hl push hl
callab Function3484e callab CheckPlayerMoveTypeMatchups
ld a, [wc716] ld a, [wc716]
cp 10 ; neutral cp 10 ; neutral
pop hl pop hl
@@ -1908,7 +1908,7 @@ AI_Smart_MeanLook: ; 38dfb
; Otherwise, discourage this move unless the player only has not very effective moves against the enemy. ; Otherwise, discourage this move unless the player only has not very effective moves against the enemy.
push hl push hl
callab Function3484e callab CheckPlayerMoveTypeMatchups
ld a, [wc716] ld a, [wc716]
cp $b ; not very effective cp $b ; not very effective
pop hl pop hl
@@ -2169,7 +2169,7 @@ AI_Smart_PerishSong: ; 38f4a
jr nz, .yes jr nz, .yes
push hl push hl
callab Function3484e callab CheckPlayerMoveTypeMatchups
ld a, [wc716] ld a, [wc716]
cp 10 ; 1.0 cp 10 ; 1.0
pop hl pop hl
@@ -2431,7 +2431,7 @@ AI_Smart_BatonPass: ; 39062
; Consider player's type(s) if its moves are unknown. ; Consider player's type(s) if its moves are unknown.
push hl push hl
callab Function3484e callab CheckPlayerMoveTypeMatchups
ld a, [wc716] ld a, [wc716]
cp 10 ; neutral cp 10 ; neutral
pop hl pop hl

662
battle/ai/switch.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1865,13 +1865,13 @@ endr
SubtractHPFromTarget: ; 3cc39 SubtractHPFromTarget: ; 3cc39
call SubtractHP call SubtractHP
jp Function3cd3c jp UpdateHPBar
; 3cc3f ; 3cc3f
SubtractHPFromUser: ; 3cc3f SubtractHPFromUser: ; 3cc3f
; Subtract HP from Pkmn ; Subtract HP from Pkmn
call SubtractHP call SubtractHP
jp Function3cd36 jp UpdateHPBarBattleHuds
; 3cc45 ; 3cc45
@@ -2040,20 +2040,20 @@ RestoreHP ; 3ccef
ld hl, BattleMonMaxHP ld hl, BattleMonMaxHP
.ok .ok
ld a, [hli] ld a, [hli]
ld [Buffer1 + 1], a ld [Buffer2], a
ld a, [hld] ld a, [hld]
ld [Buffer1 + 0], a ld [Buffer1], a
dec hl dec hl
ld a, [hl] ld a, [hl]
ld [Buffer1 + 2], a ld [Buffer3], a
add c add c
ld [hld], a ld [hld], a
ld [Buffer1 + 4], a ld [Buffer5], a
ld a, [hl] ld a, [hl]
ld [Buffer1 + 3], a ld [Buffer4], a
adc b adc b
ld [hli], a ld [hli], a
ld [Buffer1 + 5], a ld [Buffer6], a
ld a, [Buffer1] ld a, [Buffer1]
ld c, a ld c, a
@@ -2066,23 +2066,23 @@ RestoreHP ; 3ccef
jr c, .asm_3cd2d jr c, .asm_3cd2d
ld a, b ld a, b
ld [hli], a ld [hli], a
ld [Buffer1 + 5], a ld [Buffer6], a
ld a, c ld a, c
ld [hl], a ld [hl], a
ld [Buffer1 + 4], a ld [Buffer5], a
.asm_3cd2d .asm_3cd2d
call SwitchTurnCore call SwitchTurnCore
call Function3cd36 call UpdateHPBarBattleHuds
jp SwitchTurnCore jp SwitchTurnCore
; 3cd36 ; 3cd36
Function3cd36: ; 3cd36 UpdateHPBarBattleHuds: ; 3cd36
call Function3cd3c call UpdateHPBar
jp UpdateBattleHuds jp UpdateBattleHuds
; 3cd3c ; 3cd3c
Function3cd3c: ; 3cd3c UpdateHPBar: ; 3cd3c
hlcoord 10, 9 hlcoord 10, 9
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@@ -2093,7 +2093,7 @@ Function3cd3c: ; 3cd3c
.ok .ok
push bc push bc
ld [wd10a], a ld [wd10a], a
predef Functionc6e0 predef AnimateHPBar
pop bc pop bc
ret ret
; 3cd55 ; 3cd55
@@ -4558,7 +4558,7 @@ Function3dd2f: ; 3dd2f
.asm_3dda4 .asm_3dda4
ld [wd10a], a ld [wd10a], a
predef Functionc6e0 predef AnimateHPBar
UseOpponentItem: UseOpponentItem:
call RefreshBattleHuds call RefreshBattleHuds
callab GetOpponentItem callab GetOpponentItem

View File

@@ -163,7 +163,7 @@ BattleCommandPointers: ; 3fd28
dw BattleCommand_Teleport ; 36778 dw BattleCommand_Teleport ; 36778
dw BattleCommand_BeatUp ; 35461 dw BattleCommand_BeatUp ; 35461
dw BattleCommand_RageDamage ; 3527b dw BattleCommand_RageDamage ; 3527b
dw BattleCommanda3 ; 34833 dw BattleCommand_ResetTypeMatchup ; 34833
dw BattleCommand_AllStatsUp ; 36500 dw BattleCommand_AllStatsUp ; 36500
dw BattleCommanda5 ; 35165 dw BattleCommanda5 ; 35165
dw BattleCommand_RaiseSubNoAnim ; 365af dw BattleCommand_RaiseSubNoAnim ; 365af

File diff suppressed because it is too large Load Diff

View File

@@ -898,7 +898,7 @@ Bide:
doturn doturn
usedmovetext usedmovetext
unleashenergy unleashenergy
effect0xa3 resettypematchup
checkhit checkhit
hittarget hittarget
effect0xa5 effect0xa5
@@ -1398,7 +1398,7 @@ StaticDamage:
doturn doturn
constantdamage constantdamage
checkhit checkhit
effect0xa3 resettypematchup
hittarget hittarget
resulttext resulttext
checkfaint checkfaint

View File

@@ -41,7 +41,7 @@ PredefPointers:: ; 856b
add_predef SentGetPkmnIntoFromBox add_predef SentGetPkmnIntoFromBox
add_predef SentPkmnIntoBox add_predef SentPkmnIntoBox
add_predef GiveEgg add_predef GiveEgg
add_predef Functionc6e0 add_predef AnimateHPBar
add_predef CalcPkmnStats add_predef CalcPkmnStats
add_predef CalcPkmnStatC add_predef CalcPkmnStatC
add_predef CanLearnTMHMMove add_predef CanLearnTMHMMove

View File

@@ -1842,7 +1842,7 @@ Functionf1db: ; f1db (3:71db)
call AddNTimes call AddNTimes
ld a, $2 ld a, $2
ld [wd10a], a ld [wd10a], a
predef_jump Functionc6e0 predef_jump AnimateHPBar
Functionf1f9: ; f1f9 (3:71f9) Functionf1f9: ; f1f9 (3:71f9)
call Functionf20b call Functionf20b

View File

@@ -167,7 +167,7 @@ endm
command teleport command teleport
command beatup command beatup
command ragedamage command ragedamage
command effect0xa3 command resettypematchup
command allstatsup command allstatsup
command effect0xa5 command effect0xa5
command raisesubnoanim command raisesubnoanim

View File

@@ -4525,9 +4525,9 @@ Functionc699: ; c699
ret ret
; c6e0 ; c6e0
Functionc6e0: ; c6e0 AnimateHPBar: ; c6e0
call WaitBGMap call WaitBGMap
call Functiond627 call _AnimateHPBar
call WaitBGMap call WaitBGMap
ret ret
; c6ea ; c6ea
@@ -7495,11 +7495,11 @@ Functiond61d: ; d61d (3:561d)
inc [hl] inc [hl]
ret ret
Functiond627: ; d627 _AnimateHPBar: ; d627
call Functiond65f call Functiond65f
jr c, .asm_d645 jr c, .do_player
call Functiond670 call Functiond670
.asm_d62f .enemy_loop
push bc push bc
push hl push hl
call Functiond6e2 call Functiond6e2
@@ -7513,12 +7513,12 @@ Functiond627: ; d627
pop hl pop hl
pop bc pop bc
pop af pop af
jr nc, .asm_d62f jr nc, .enemy_loop
ret ret
.asm_d645 .do_player
call Functiond670 call Functiond670
.asm_d648 .player_loop
push bc push bc
push hl push hl
call Functiond6f5 call Functiond6f5
@@ -7533,21 +7533,21 @@ Functiond627: ; d627
pop hl pop hl
pop bc pop bc
pop af pop af
jr nc, .asm_d648 jr nc, .player_loop
ret ret
; d65f ; d65f
Functiond65f: ; d65f Functiond65f: ; d65f
ld a, [Buffer2] ld a, [Buffer2]
and a and a
jr nz, .asm_d66e jr nz, .player
ld a, [Buffer1] ld a, [Buffer1]
cp $30 cp $30
jr nc, .asm_d66e jr nc, .player
and a and a
ret ret
.asm_d66e .player
scf scf
ret ret
; d670 ; d670

View File

@@ -1776,6 +1776,7 @@ Buffer4::
wd1ed:: ds 1 wd1ed:: ds 1
Buffer5:: Buffer5::
wd1ee:: ds 1 wd1ee:: ds 1
Buffer6::
wd1ef:: ds 1 wd1ef:: ds 1
wd1f0:: ds 1 wd1f0:: ds 1
wd1f1:: ds 1 wd1f1:: ds 1