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

View File

@@ -981,7 +981,7 @@ AI_Smart_Whirlwind: ; 38a2a
; Consider player's type(s) if its moves are unknown.
push hl
callab Function3484e
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
cp 10 ; neutral
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.
push hl
callab Function3484e
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
cp $b ; not very effective
pop hl
@@ -2169,7 +2169,7 @@ AI_Smart_PerishSong: ; 38f4a
jr nz, .yes
push hl
callab Function3484e
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
cp 10 ; 1.0
pop hl
@@ -2431,7 +2431,7 @@ AI_Smart_BatonPass: ; 39062
; Consider player's type(s) if its moves are unknown.
push hl
callab Function3484e
callab CheckPlayerMoveTypeMatchups
ld a, [wc716]
cp 10 ; neutral
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
call SubtractHP
jp Function3cd3c
jp UpdateHPBar
; 3cc3f
SubtractHPFromUser: ; 3cc3f
; Subtract HP from Pkmn
call SubtractHP
jp Function3cd36
jp UpdateHPBarBattleHuds
; 3cc45
@@ -2040,20 +2040,20 @@ RestoreHP ; 3ccef
ld hl, BattleMonMaxHP
.ok
ld a, [hli]
ld [Buffer1 + 1], a
ld [Buffer2], a
ld a, [hld]
ld [Buffer1 + 0], a
ld [Buffer1], a
dec hl
ld a, [hl]
ld [Buffer1 + 2], a
ld [Buffer3], a
add c
ld [hld], a
ld [Buffer1 + 4], a
ld [Buffer5], a
ld a, [hl]
ld [Buffer1 + 3], a
ld [Buffer4], a
adc b
ld [hli], a
ld [Buffer1 + 5], a
ld [Buffer6], a
ld a, [Buffer1]
ld c, a
@@ -2066,23 +2066,23 @@ RestoreHP ; 3ccef
jr c, .asm_3cd2d
ld a, b
ld [hli], a
ld [Buffer1 + 5], a
ld [Buffer6], a
ld a, c
ld [hl], a
ld [Buffer1 + 4], a
ld [Buffer5], a
.asm_3cd2d
call SwitchTurnCore
call Function3cd36
call UpdateHPBarBattleHuds
jp SwitchTurnCore
; 3cd36
Function3cd36: ; 3cd36
call Function3cd3c
UpdateHPBarBattleHuds: ; 3cd36
call UpdateHPBar
jp UpdateBattleHuds
; 3cd3c
Function3cd3c: ; 3cd3c
UpdateHPBar: ; 3cd3c
hlcoord 10, 9
ld a, [hBattleTurn]
and a
@@ -2093,7 +2093,7 @@ Function3cd3c: ; 3cd3c
.ok
push bc
ld [wd10a], a
predef Functionc6e0
predef AnimateHPBar
pop bc
ret
; 3cd55
@@ -4558,7 +4558,7 @@ Function3dd2f: ; 3dd2f
.asm_3dda4
ld [wd10a], a
predef Functionc6e0
predef AnimateHPBar
UseOpponentItem:
call RefreshBattleHuds
callab GetOpponentItem

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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