summaryrefslogtreecommitdiff
path: root/battle
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2015-11-07 09:48:32 -0500
committerPikalaxALT <PikalaxALT@gmail.com>2015-11-07 09:48:32 -0500
commit2cbb1acc6e3bc5fe30d1be8f665d2252703518ac (patch)
tree57908e1a0387e0d7a2ef88935aa1be36e3cacf71 /battle
parente0445806694a80a98e4d803478a2675ec8803ba6 (diff)
Pokemon animations
Diffstat (limited to 'battle')
-rw-r--r--battle/ai/scoring.asm6
-rwxr-xr-xbattle/ai/switch.asm10
-rw-r--r--battle/core.asm54
-rw-r--r--battle/effect_commands.asm125
4 files changed, 99 insertions, 96 deletions
diff --git a/battle/ai/scoring.asm b/battle/ai/scoring.asm
index 52c71d624..39d2a8eca 100644
--- a/battle/ai/scoring.asm
+++ b/battle/ai/scoring.asm
@@ -576,7 +576,7 @@ AI_Smart_Explosion: ; 388a6
; Unless this is the enemy's last Pokemon...
push hl
- callba CountEnemyAliveMons
+ callba CheckEnemyHasMonToSwitchTo
pop hl
jr nc, .asm_388b7
@@ -2028,7 +2028,7 @@ endr
jp nz, AIDiscourageMove
push hl
- callba CountEnemyAliveMons
+ callba CheckEnemyHasMonToSwitchTo
pop hl
jr nc, .asm_38eb0
@@ -2160,7 +2160,7 @@ endr
AI_Smart_PerishSong: ; 38f4a
push hl
- callab CountEnemyAliveMons
+ callab CheckEnemyHasMonToSwitchTo
pop hl
jr c, .no
diff --git a/battle/ai/switch.asm b/battle/ai/switch.asm
index 3d65b187a..c7fd696e1 100755
--- a/battle/ai/switch.asm
+++ b/battle/ai/switch.asm
@@ -184,7 +184,7 @@ endr
CheckAbleToSwitch: ; 34941
xor a
ld [wc717], a
- call CountEnemyAliveMons
+ call CheckEnemyHasMonToSwitchTo
ret c
ld a, [EnemySubStatus1]
@@ -197,7 +197,7 @@ CheckAbleToSwitch: ; 34941
; Perish count is 1
- call CountEnemyAliveMons
+ call CheckEnemyHasMonToSwitchTo
call Function34b77
call Function34b20
call Function34a85
@@ -212,7 +212,7 @@ CheckAbleToSwitch: ; 34941
ret
.not_2
- call CountEnemyAliveMons
+ call CheckEnemyHasMonToSwitchTo
sla c
sla c
ld b, $ff
@@ -284,7 +284,7 @@ CheckAbleToSwitch: ; 34941
cp 10
ret nc
- call CountEnemyAliveMons
+ call CheckEnemyHasMonToSwitchTo
call Function34b77
call Function34b20
call Function34a85
@@ -300,7 +300,7 @@ CheckAbleToSwitch: ; 34941
; 349f4
-CountEnemyAliveMons: ; 349f4
+CheckEnemyHasMonToSwitchTo: ; 349f4
ld a, [OTPartyCount]
cp 2
jr c, .only_one
diff --git a/battle/core.asm b/battle/core.asm
index fbfbdc0a6..45c5e8bd0 100644
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -92,7 +92,7 @@ Function3c000: ; 3c000
call SendOutPkmnText
call NewBattleMonStatus
call BreakAttraction
- call Function3db5f
+ call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
call SetPlayerTurn
@@ -2928,7 +2928,7 @@ Function3d227: ; 3d227
call SendOutPkmnText
call NewBattleMonStatus
call BreakAttraction
- call Function3db5f
+ call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
call SetPlayerTurn
@@ -2950,7 +2950,7 @@ Function3d2b3: ; 3d2b3
call SendOutPkmnText
call NewBattleMonStatus
call BreakAttraction
- call Function3db5f
+ call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
call SetPlayerTurn
@@ -3755,31 +3755,31 @@ Function_SetEnemyPkmnAndSendOutAnimation: ; 3d7c7
call Call_PlayBattleAnim
call BattleCheckEnemyShininess
- jr nc, .asm_3d800
+ jr nc, .not_shiny
ld a, 1 ; shiny anim
ld [wKickCounter], a
ld de, ANIM_SEND_OUT_MON
call Call_PlayBattleAnim
-.asm_3d800
+.not_shiny
ld bc, TempMonSpecies
- callba Function4e53f
- jr c, .asm_3d82c
+ callba CheckFaintedFrzSlp
+ jr c, .skip_cry
callba CheckBattleScene
- jr c, .asm_3d821
+ jr c, .cry_no_anim
hlcoord 12, 0
ld d, $0
- ld e, $0
- predef Functiond008e
- jr .asm_3d82c
+ ld e, ANIM_MON_SLOW
+ predef AnimateFrontpic
+ jr .skip_cry
-.asm_3d821
+.cry_no_anim
ld a, $f
ld [CryTracks], a
ld a, [TempEnemyMonSpecies]
call PlayStereoCry
-.asm_3d82c
+.skip_cry
call UpdateEnemyHUD
ld a, $1
ld [hBGMapMode], a
@@ -4207,7 +4207,7 @@ endr
; 3db32
-Function3db32: ; 3db32
+SwitchPlayerMon: ; 3db32
call ClearSprites
ld a, [CurBattleMon]
ld [LastPlayerMon], a
@@ -4218,7 +4218,7 @@ Function3db32: ; 3db32
call ResetPlayerStatLevels
call NewBattleMonStatus
call BreakAttraction
- call Function3db5f
+ call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
ld hl, EnemyMonHP
@@ -4228,7 +4228,7 @@ Function3db32: ; 3db32
; 3db5f
-Function3db5f: ; 3db5f
+SendOutPlayerMon: ; 3db5f
ld hl, BattleMonDVs
predef GetUnownLetter
hlcoord 1, 5
@@ -4259,25 +4259,25 @@ Function3db5f: ; 3db5f
ld de, ANIM_SEND_OUT_MON
call Call_PlayBattleAnim
call BattleCheckPlayerShininess
- jr nc, .asm_3dbbc
+ jr nc, .not_shiny
ld a, $1
ld [wKickCounter], a
ld de, ANIM_SEND_OUT_MON
call Call_PlayBattleAnim
-.asm_3dbbc
+.not_shiny
ld a, MON_SPECIES
call GetPartyParamLocation
ld b, h
ld c, l
- callba Function4e53f
- jr c, .asm_3dbd6
+ callba CheckFaintedFrzSlp
+ jr c, .statused
ld a, $f0
ld [CryTracks], a
ld a, [CurPartySpecies]
call PlayStereoCry
-.asm_3dbd6
+.statused
call UpdatePlayerHUD
ld a, $1
ld [hBGMapMode], a
@@ -5528,7 +5528,7 @@ BattleMonEntrance: ; 3e40b
call SendOutPkmnText
call NewBattleMonStatus
call BreakAttraction
- call Function3db5f
+ call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
call SetPlayerTurn
@@ -5553,7 +5553,7 @@ PassedBattleMonEntrance: ; 3e459
xor a
ld [wd265], a
call ApplyStatLevelMultiplierOnAllStats
- call Function3db5f
+ call SendOutPlayerMon
call EmptyBattleTextBox
call LoadTileMapToTempTileMap
call SetPlayerTurn
@@ -9556,15 +9556,15 @@ BattleStartMessage: ; 3fc8b
jr c, .skip_cry
callba CheckBattleScene
- jr c, .do_cry
+ jr c, .cry_no_anim
hlcoord 12, 0
ld d, $0
- ld e, $1
- predef Functiond008e
+ ld e, ANIM_MON_NORMAL
+ predef AnimateFrontpic
jr .skip_cry
-.do_cry
+.cry_no_anim
ld a, $0f
ld [CryTracks], a
ld a, [TempEnemyMonSpecies]
diff --git a/battle/effect_commands.asm b/battle/effect_commands.asm
index 5f6a22414..c05336bd3 100644
--- a/battle/effect_commands.asm
+++ b/battle/effect_commands.asm
@@ -6555,41 +6555,42 @@ BattleCommand_ForceSwitch: ; 3680f
ld a, [BattleType]
cp BATTLETYPE_SHINY
- jp z, .asm_36969
+ jp z, .fail
cp BATTLETYPE_TRAP
- jp z, .asm_36969
+ jp z, .fail
cp BATTLETYPE_CELEBI
- jp z, .asm_36969
+ jp z, .fail
cp BATTLETYPE_SUICUNE
- jp z, .asm_36969
+ jp z, .fail
ld a, [hBattleTurn]
and a
- jp nz, .asm_368cd
+ jp nz, .force_player_switch
ld a, [AttackMissed]
and a
- jr nz, .asm_36852 ; 36830 $20
+ jr nz, .missed ; 36830 $20
ld a, [wBattleMode]
dec a
- jr nz, .asm_36869 ; 36836 $31
+ jr nz, .trainer ; 36836 $31
ld a, [CurPartyLevel]
ld b, a
ld a, [BattleMonLevel]
cp b
- jr nc, .asm_36855 ; 36840 $13
+ jr nc, .wild_force_flee ; 36840 $13
add b
ld c, a
inc c
-.asm_36845
+.random_loop_wild
call BattleRandom
cp c
- jr nc, .asm_36845 ; 36849 $fa
+ jr nc, .random_loop_wild ; 36849 $fa
srl b
srl b
cp b
- jr nc, .asm_36855 ; 36850 $3
-.asm_36852
- jp .asm_36969
-.asm_36855
+ jr nc, .wild_force_flee ; 36850 $3
+.missed
+ jp .fail
+
+.wild_force_flee
call UpdateBattleMonInParty
xor a
ld [wcfca], a
@@ -6597,13 +6598,14 @@ BattleCommand_ForceSwitch: ; 3680f
ld [wd232], a
call SetBattleDraw
ld a, [wPlayerMoveStruct + MOVE_ANIM]
- jp .asm_36975
-.asm_36869
- call CountEnemyAliveMons
- jr c, .asm_368ca ; 3686c $5c
+ jp .succeed
+
+.trainer
+ call CheckEnemyHasMonToSwitchTo
+ jr c, .switch_fail ; 3686c $5c
ld a, [wc70f]
and a
- jr z, .asm_368ca ; 36872 $56
+ jr z, .switch_fail ; 36872 $56
call UpdateEnemyMonInParty
ld a, $1
ld [wKickCounter], a
@@ -6613,19 +6615,20 @@ BattleCommand_ForceSwitch: ; 3680f
hlcoord 1, 0
lb bc, 4, 10
call ClearBox
- ld c, $14
+ ld c, 20
call DelayFrames
ld a, [OTPartyCount]
ld b, a
ld a, [CurOTMon]
ld c, a
-.asm_3689a
+; select a random enemy mon to switch to
+.random_loop_trainer
call BattleRandom
and $7
cp b
- jr nc, .asm_3689a ; 368a0 $f8
+ jr nc, .random_loop_trainer ; 368a0 $f8
cp c
- jr z, .asm_3689a ; 368a3 $f5
+ jr z, .random_loop_trainer ; 368a3 $f5
push af
push bc
ld hl, OTPartyMon1HP
@@ -6634,7 +6637,7 @@ BattleCommand_ForceSwitch: ; 3680f
or [hl]
pop bc
pop de
- jr z, .asm_3689a ; 368b1 $e7
+ jr z, .random_loop_trainer ; 368b1 $e7
ld a, d
inc a
ld [wc718], a
@@ -6646,41 +6649,41 @@ BattleCommand_ForceSwitch: ; 3680f
ld hl, SpikesDamage
jp CallBattleCore
-.asm_368ca
- jp .asm_36969
+.switch_fail
+ jp .fail
-.asm_368cd
+.force_player_switch
ld a, [AttackMissed]
and a
- jr nz, .asm_368f3
+ jr nz, .player_miss
ld a, [wBattleMode]
dec a
- jr nz, .asm_36908
+ jr nz, .vs_trainer
ld a, [BattleMonLevel]
ld b, a
ld a, [CurPartyLevel]
cp b
- jr nc, .asm_368f5
+ jr nc, .wild_succeed_playeristarget
add b
ld c, a
inc c
-.asm_368e6
+.wild_random_loop_playeristarget
call BattleRandom
cp c
- jr nc, .asm_368e6
+ jr nc, .wild_random_loop_playeristarget
srl b
srl b
cp b
- jr nc, .asm_368f5
+ jr nc, .wild_succeed_playeristarget
-.asm_368f3
- jr .asm_36969
+.player_miss
+ jr .fail
-.asm_368f5
+.wild_succeed_playeristarget
call UpdateBattleMonInParty
xor a
ld [wcfca], a
@@ -6688,39 +6691,39 @@ BattleCommand_ForceSwitch: ; 3680f
ld [wd232], a
call SetBattleDraw
ld a, [wEnemyMoveStruct + MOVE_ANIM]
- jr .asm_36975
+ jr .succeed
-.asm_36908
- call Function36994
- jr c, .asm_36969
+.vs_trainer
+ call CheckPlayerHasMonToSwitchTo
+ jr c, .fail
ld a, [wc70f]
cp $1
- jr z, .asm_368ca
+ jr z, .switch_fail
call UpdateBattleMonInParty
ld a, $1
ld [wKickCounter], a
call AnimateCurrentMove
- ld c, $14
+ ld c, 20
call DelayFrames
hlcoord 9, 7
lb bc, 5, 11
call ClearBox
- ld c, $14
+ ld c, 20
call DelayFrames
ld a, [PartyCount]
ld b, a
ld a, [CurBattleMon]
ld c, a
-.asm_3693a
+.random_loop_trainer_playeristarget
call BattleRandom
and $7
cp b
- jr nc, .asm_3693a
+ jr nc, .random_loop_trainer_playeristarget
cp c
- jr z, .asm_3693a
+ jr z, .random_loop_trainer_playeristarget
push af
push bc
@@ -6730,11 +6733,11 @@ BattleCommand_ForceSwitch: ; 3680f
or [hl]
pop bc
pop de
- jr z, .asm_3693a
+ jr z, .random_loop_trainer_playeristarget
ld a, d
ld [CurPartyMon], a
- ld hl, Function3db32
+ ld hl, SwitchPlayerMon
call CallBattleCore
ld hl, DraggedOutText
@@ -6743,57 +6746,57 @@ BattleCommand_ForceSwitch: ; 3680f
ld hl, SpikesDamage
jp CallBattleCore
-.asm_36969
+.fail
call BattleCommand_LowerSub
call BattleCommand_MoveDelay
call BattleCommand_RaiseSub
jp PrintButItFailed
-.asm_36975
+.succeed
push af
call SetBattleDraw
ld a, $1
ld [wKickCounter], a
call AnimateCurrentMove
- ld c, $14
+ ld c, 20
call DelayFrames
pop af
ld hl, FledInFearText
- cp $2e
- jr z, .asm_36991
+ cp ROAR
+ jr z, .do_text
ld hl, BlownAwayText
-.asm_36991
+.do_text
jp StdBattleTextBox
; 36994
-Function36994: ; 36994
+CheckPlayerHasMonToSwitchTo: ; 36994
ld a, [PartyCount]
ld d, a
ld e, 0
ld bc, PARTYMON_STRUCT_LENGTH
-.asm_3699d
+.loop
ld a, [CurBattleMon]
cp e
- jr z, .asm_369ae
+ jr z, .next
ld a, e
ld hl, PartyMon1HP
call AddNTimes
ld a, [hli]
or [hl]
- jr nz, .asm_369b4
+ jr nz, .not_fainted
-.asm_369ae
+.next
inc e
dec d
- jr nz, .asm_3699d
+ jr nz, .loop
scf
ret
-.asm_369b4
+.not_fainted
and a
ret
; 369b6