summaryrefslogtreecommitdiff
path: root/battle/core.asm
diff options
context:
space:
mode:
Diffstat (limited to 'battle/core.asm')
-rw-r--r--battle/core.asm191
1 files changed, 53 insertions, 138 deletions
diff --git a/battle/core.asm b/battle/core.asm
index eb73f77a2..dec315ab8 100644
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -7,7 +7,7 @@ DoBattle: ; 3c000
ld [wPlayerAction], a
ld [BattleEnded], a
inc a
- ld [wAISwitch], a
+ ld [wBattleHasJustStarted], a
ld hl, OTPartyMon1HP
ld bc, PARTYMON_STRUCT_LENGTH - 1
ld d, BATTLEACTION_SWITCH1 - 1
@@ -116,8 +116,6 @@ DoBattle: ; 3c000
jp BattleMenu
; 3c0e5
-
-
WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
call Call_LoadTempTileMapToTileMap
ld a, [wBattleResult]
@@ -160,7 +158,6 @@ WildFled_EnemyFled_LinkBattleCanceled: ; 3c0e5
ret
; 3c12f
-
BattleTurn: ; 3c12f
.loop
call MobileFn_3c1bf
@@ -170,7 +167,7 @@ BattleTurn: ; 3c12f
xor a
ld [wPlayerIsSwitching], a
ld [wEnemyIsSwitching], a
- ld [wAISwitch], a
+ ld [wBattleHasJustStarted], a
ld [wPlayerJustGotFrozen], a
ld [wEnemyJustGotFrozen], a
ld [CurDamage], a
@@ -183,7 +180,7 @@ BattleTurn: ; 3c12f
call IsMobileBattle
jr nz, .not_disconnected
callba Function100da5
- callba Function100641
+ callba StartMobileInactivityTimer
callba Function100dd8
jp c, .quit
.not_disconnected
@@ -252,7 +249,6 @@ MobileFn_3c1bf: mobile
ret
; 3c1d6
-
HandleBetweenTurnEffects: ; 3c1d6
ld a, [hLinkPlayerNumber]
cp $1
@@ -769,7 +765,6 @@ HandleEncore: ; 3c4df
jp StdBattleTextBox
; 3c543
-
TryEnemyFlee: ; 3c543
ld a, [wBattleMode]
dec a
@@ -861,7 +856,6 @@ AlwaysFleeMons: ; 3c5b1
db -1
; 3c5b4
-
CompareMovePriority: ; 3c5b4
; Compare the priority of the player and enemy's moves.
; Return carry if the player goes first, or z if they match.
@@ -915,7 +909,6 @@ MoveEffectPriorities: ; 3c5df
db -1
; 3c5ec
-
GetMoveEffect: ; 3c5ec
ld a, b
dec a
@@ -928,7 +921,6 @@ GetMoveEffect: ; 3c5ec
ret
; 3c5fe
-
Battle_EnemyFirst: ; 3c5fe
call LoadTileMapToTempTileMap
call TryEnemyFlee
@@ -1695,7 +1687,6 @@ HandleSafeguard: ; 3cafb
ld hl, BattleText_SafeguardFaded
jp StdBattleTextBox
-
HandleScreens: ; 3cb36
ld a, [hLinkPlayerNumber]
cp 1
@@ -1739,7 +1730,6 @@ HandleScreens: ; 3cb36
db "Enemy@"
; 3cb80
-
.LightScreenTick: ; 3cb80
ld a, [de]
dec a
@@ -1878,7 +1868,6 @@ SubtractHPFromUser: ; 3cc3f
jp UpdateHPBarBattleHuds
; 3cc45
-
SubtractHP: ; 3cc45
ld hl, BattleMonHP
ld a, [hBattleTurn]
@@ -1925,7 +1914,6 @@ GetSixteenthMaxHP: ; 3cc76
ret
; 3cc83
-
GetEighthMaxHP: ; 3cc83
; output: bc
call GetQuarterMaxHP
@@ -1941,7 +1929,6 @@ GetEighthMaxHP: ; 3cc83
ret
; 3cc8e
-
GetQuarterMaxHP: ; 3cc8e
; output: bc
call GetMaxHP
@@ -1962,7 +1949,6 @@ GetQuarterMaxHP: ; 3cc8e
ret
; 3cc9f
-
GetHalfMaxHP: ; 3cc9f
; output: bc
call GetMaxHP
@@ -1980,7 +1966,6 @@ GetHalfMaxHP: ; 3cc9f
ret
; 3ccac
-
GetMaxHP: ; 3ccac
; output: bc, Buffer1-2
@@ -2036,7 +2021,6 @@ CheckUserHasEnoughHP: ; 3ccde
ret
; 3ccef
-
RestoreHP ; 3ccef
ld hl, EnemyMonMaxHP
ld a, [hBattleTurn]
@@ -2349,8 +2333,6 @@ IsAnyMonHoldingExpShare: ; 3ceaa
ret
; 3ceec
-
-
StopDangerSound: ; 3ceec
xor a
ld [Danger], a
@@ -2503,8 +2485,8 @@ WinTrainerBattle: ; 3cfa4
call BattleWinSlideInEnemyTrainerFrontpic
ld c, 40
call DelayFrames
- ld c, $4
- callba Function4ea0a
+ ld c, $4 ; win
+ callba Mobile_PrintOpponentBattleMessage
ret
.battle_tower
@@ -2622,7 +2604,6 @@ WinTrainerBattle: ; 3cfa4
dw SentAllToMomText
; 3d0b1
-
.CheckMaxedOutMomMoney: ; 3d0b1
ld hl, wMomsMoney + 2
ld a, [hld]
@@ -2642,7 +2623,7 @@ AddBattleMoneyToAccount: ; 3d0be
push bc
ld b, h
ld c, l
- callba MobileFn_106008
+ callba TrainerRankings_AddToBattlePayouts
pop bc
pop hl
.loop
@@ -2705,8 +2686,6 @@ PlayVictoryMusic: ; 3d0ea
ret
; 3d123
-
-
; These functions check if the current opponent is a gym leader or one of a
; few other special trainers.
@@ -2760,7 +2739,6 @@ KantoGymLeaders:
db BLUE
db -1
-
HandlePlayerMonFaint: ; 3d14e
call FaintYourPokemon
ld hl, EnemyMonHP
@@ -2961,7 +2939,6 @@ PlayerPartyMonEntrance: ; 3d2b3
jp SpikesDamage
; 3d2e0
-
CheckMobileBattleError: ; 3d2e0
ld a, [wLinkMode]
cp LINK_MOBILE
@@ -3060,7 +3037,6 @@ ForcePickPartyMonInBattle: ; 3d362
jr .pick
; 3d375
-
PickSwitchMonInBattle: ; 3d375
.pick
call PickPartyMonInBattle
@@ -3085,7 +3061,6 @@ ForcePickSwitchMonInBattle: ; 3d380
ret
; 3d38e
-
LostBattle: ; 3d38e
ld a, 1
ld [BattleEnded], a
@@ -3176,13 +3151,12 @@ LostBattle: ; 3d38e
ld c, 40
call DelayFrames
- ld c, $3
- callba Function4ea0a
+ ld c, $3 ; lost
+ callba Mobile_PrintOpponentBattleMessage
scf
ret
; 3d432
-
EnemyMonFaintedAnimation: ; 3d432
hlcoord 12, 5
decoord 12, 6
@@ -3250,7 +3224,6 @@ MonFaintedAnimation: ; 3d444
db " @"
; 3d490
-
SlideBattlePicOut: ; 3d490
ld [hMapObjectIndexBuffer], a
ld c, a
@@ -3297,7 +3270,6 @@ SlideBattlePicOut: ; 3d490
ret
; 3d4c3
-
ForceEnemySwitch: ; 3d4c3
call ResetEnemyBattleVars
ld a, [wEnemySwitchMonIndex]
@@ -3313,7 +3285,6 @@ ForceEnemySwitch: ; 3d4c3
ret
; 3d4e1
-
EnemySwitch: ; 3d4e1
call CheckWhetherToAskSwitch
jr nc, EnemySwitch_SetMode
@@ -3372,14 +3343,14 @@ CheckWhetherSwitchmonIsPredetermined: ; 3d533
.not_linked
ld a, [wEnemySwitchMonIndex]
and a
- jr z, .check_wAISwitch
+ jr z, .check_wBattleHasJustStarted
dec a
ld b, a
jr .return_carry
-.check_wAISwitch
- ld a, [wAISwitch]
+.check_wBattleHasJustStarted
+ ld a, [wBattleHasJustStarted]
and a
ld b, $0
jr nz, .return_carry
@@ -3655,7 +3626,7 @@ LoadEnemyPkmnToSwitchTo: ; 3d6ca
; 3d714
CheckWhetherToAskSwitch: ; 3d714
- ld a, [wAISwitch]
+ ld a, [wBattleHasJustStarted]
dec a
jp z, .return_nc
ld a, [PartyCount]
@@ -3846,7 +3817,6 @@ CheckPlayerPartyForFitPkmn: ; 3d873
ret
; 3d887
-
CheckIfCurPartyMonIsFitToFight: ; 3d887
ld a, [CurPartyMon]
ld hl, PartyMon1HP
@@ -3855,7 +3825,7 @@ CheckIfCurPartyMonIsFitToFight: ; 3d887
or [hl]
ret nz
- ld a, [wAISwitch]
+ ld a, [wBattleHasJustStarted]
and a
jr nz, .finish_fail
ld hl, PartySpecies
@@ -3878,7 +3848,6 @@ CheckIfCurPartyMonIsFitToFight: ; 3d887
ret
; 3d8b3
-
TryToRunAwayFromBattle: ; 3d8b3
; Run away from battle, with or without item
ld a, [BattleType]
@@ -4068,7 +4037,6 @@ TryToRunAwayFromBattle: ; 3d8b3
ret
; 3da0d
-
InitBattleMon: ; 3da0d
ld a, MON_SPECIES
call GetPartyParamLocation
@@ -4080,9 +4048,9 @@ InitBattleMon: ; 3da0d
ld de, BattleMonDVs
ld bc, MON_PKRUS - MON_DVS
call CopyBytes
-rept 3
inc hl
-endr
+ inc hl
+ inc hl
ld de, BattleMonLevel
ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL
call CopyBytes
@@ -4159,7 +4127,6 @@ ResetPlayerStatLevels: ; 3dab1
ret
; 3dabd
-
InitEnemyMon: ; 3dabd
ld a, [CurPartyMon]
ld hl, OTPartyMon1Species
@@ -4172,9 +4139,9 @@ InitEnemyMon: ; 3dabd
ld de, EnemyMonDVs
ld bc, MON_PKRUS - MON_DVS
call CopyBytes
-rept 3
inc hl
-endr
+ inc hl
+ inc hl
ld de, EnemyMonLevel
ld bc, PARTYMON_STRUCT_LENGTH - MON_LEVEL
call CopyBytes
@@ -4213,7 +4180,6 @@ endr
ret
; 3db32
-
SwitchPlayerMon: ; 3db32
call ClearSprites
ld a, [CurBattleMon]
@@ -4234,7 +4200,6 @@ SwitchPlayerMon: ; 3db32
ret
; 3db5f
-
SendOutPlayerMon: ; 3db5f
ld hl, BattleMonDVs
predef GetUnownLetter
@@ -4302,9 +4267,9 @@ rept 4
endr
ld [hl], a
ld hl, PlayerUsedMoves
-rept 3
ld [hli], a
-endr
+ ld [hli], a
+ ld [hli], a
ld [hl], a
ld [PlayerDisableCount], a
ld [PlayerFuryCutterCount], a
@@ -4580,7 +4545,6 @@ UseOpponentItem:
jp StdBattleTextBox
; 3ddc8
-
ItemRecoveryAnim: ; 3ddc8
push hl
push de
@@ -4665,7 +4629,6 @@ UseHeldStatusHealingItem: ; 3dde9
db $ff
; 3de51
-
UseConfusionHealingItem: ; 3de51
ld a, BATTLE_VARS_SUBSTATUS3_OPP
call GetBattleVar
@@ -4713,21 +4676,21 @@ HandleStatBoostingHeldItems: ; 3de97
ld a, [hLinkPlayerNumber]
cp $1
jr z, .player_1
- call .DoEnemy
- jp .DoPlayer
-
-.player_1
call .DoPlayer
jp .DoEnemy
+
+.player_1
+ call .DoEnemy
+ jp .DoPlayer
; 3dea9
-.DoEnemy: ; 3dea9
+.DoPlayer: ; 3dea9
call GetPartymonItem
ld a, $0
jp .HandleItem
; 3deb1
-.DoPlayer: ; 3deb1
+.DoEnemy: ; 3deb1
call GetOTPartymonItem
ld a, $1
.HandleItem: ; 3deb6
@@ -4790,7 +4753,6 @@ HandleStatBoostingHeldItems: ; 3de97
db $ff
; 3df12
-
GetPartymonItem: ; 3df12
ld hl, PartyMon1Item
ld a, [CurBattleMon]
@@ -4824,8 +4786,6 @@ UpdateBattleHUDs: ; 3df2c
ret
; 3df48
-
-
UpdatePlayerHUD:: ; 3df48
push hl
push de
@@ -4939,7 +4899,7 @@ PrintPlayerHUD: ; 3dfbf
pop hl
dec hl
- ld a, BREEDMON
+ ld a, TEMPMON
ld [MonType], a
callab GetGender
ld a, " "
@@ -5017,7 +4977,7 @@ DrawEnemyHUD: ; 3e043
ld a, [hl]
ld [de], a
- ld a, BREEDMON
+ ld a, TEMPMON
ld [MonType], a
callab GetGender
ld a, " "
@@ -5164,7 +5124,6 @@ BattleMenu: ; 3e139
jr z, .skip_dude_pack_select
callba _DudeAutoInput_DownA
.skip_dude_pack_select
-
call LoadBattleMenu2
ret c
@@ -5383,35 +5342,42 @@ BattleMenuPKMN_Loop:
Battle_StatsScreen: ; 3e308
call DisableLCD
+
ld hl, VTiles2 tile $31
ld de, VTiles0
- ld bc, $0110
+ ld bc, $11 tiles
call CopyBytes
+
ld hl, VTiles2
ld de, VTiles0 tile $11
ld bc, $31 tiles
call CopyBytes
+
call EnableLCD
+
call ClearSprites
call LowVolume
xor a ; PARTYMON
ld [MonType], a
callba BattleStatsScreenInit
call MaxVolume
+
call DisableLCD
+
ld hl, VTiles0
ld de, VTiles2 tile $31
ld bc, $11 tiles
call CopyBytes
+
ld hl, VTiles0 tile $11
ld de, VTiles2
ld bc, $31 tiles
call CopyBytes
+
call EnableLCD
ret
; 3e358
-
TryPlayerSwitch: ; 3e358
ld a, [CurBattleMon]
ld d, a
@@ -5566,7 +5532,6 @@ PassedBattleMonEntrance: ; 3e459
jp SpikesDamage
; 3e489
-
BattleMenu_Run: ; 3e489
call Call_LoadTempTileMapToTileMap
ld a, $3
@@ -5583,7 +5548,6 @@ BattleMenu_Run: ; 3e489
jp BattleMenu
; 3e4a8
-
CheckAmuletCoin: ; 3e4a8
ld a, [BattleMonItem]
ld b, a
@@ -5990,7 +5954,6 @@ MoveInfoBox: ; 3e6c8
db "TYPE/@"
; 3e75f
-
.PrintPP: ; 3e75f
hlcoord 5, 11
ld a, [wLinkMode] ; What's the point of this check?
@@ -6048,7 +6011,7 @@ CheckPlayerHasUsableMoves: ; 3e786
jr .loop
.done
- and a
+ and a ; This is probably a bug, and will result in a move with PP Up confusing the game.
ret nz
.force_struggle
@@ -6060,8 +6023,6 @@ CheckPlayerHasUsableMoves: ; 3e786
ret
; 3e7c1
-
-
ParseEnemyAction: ; 3e7c1
ld a, [wEnemyIsSwitching]
and a
@@ -6242,7 +6203,6 @@ LinkBattleSendReceiveAction: ; 3e8e4
ret
; 3e8eb
-
LoadEnemyMon: ; 3e8eb
; Initialize enemy monster parameters
; To do this we pull the species from TempEnemyMonSpecies
@@ -6275,7 +6235,6 @@ LoadEnemyMon: ; 3e8eb
; Grab the BaseData for this species
call GetBaseData
-
; Let's get the item:
; Is the item predetermined?
@@ -6290,7 +6249,6 @@ LoadEnemyMon: ; 3e8eb
ld a, [hl]
jr .UpdateItem
-
.WildItem:
; In a wild battle, we pull from the item slots in BaseData
@@ -6320,11 +6278,9 @@ LoadEnemyMon: ; 3e8eb
jr nc, .UpdateItem
ld a, [BaseItems+1]
-
.UpdateItem:
ld [EnemyMonItem], a
-
; Initialize DVs
; If we're in a trainer battle, DVs are predetermined
@@ -6346,7 +6302,6 @@ LoadEnemyMon: ; 3e8eb
ld [de], a
jp .Happiness
-
.InitDVs:
; Trainer DVs
@@ -6359,7 +6314,6 @@ LoadEnemyMon: ; 3e8eb
dec a
jr nz, .UpdateDVs
-
; Wild DVs
; Here's where the fun starts
@@ -6402,7 +6356,6 @@ LoadEnemyMon: ; 3e8eb
; We're done with DVs
jr .UpdateDVs
-
.NotRoaming:
; Register a contains BattleType
@@ -6429,16 +6382,13 @@ LoadEnemyMon: ; 3e8eb
ld [hli], a
ld [hl], c
-
; We've still got more to do if we're dealing with a wild monster
ld a, [wBattleMode]
dec a
jr nz, .Happiness
-
; Species-specfic:
-
; Unown
ld a, [TempEnemyMonSpecies]
cp a, UNOWN
@@ -6452,7 +6402,6 @@ LoadEnemyMon: ; 3e8eb
call CheckUnownLetter
jr c, .GenerateDVs ; try again
-
.Magikarp:
; Skimming this part recommended
@@ -6513,7 +6462,6 @@ LoadEnemyMon: ; 3e8eb
cp a, 1024 >> 8
jr c, .GenerateDVs ; try again
-
; Finally done with DVs
.Happiness:
@@ -6526,7 +6474,7 @@ LoadEnemyMon: ; 3e8eb
; Fill stats
ld de, EnemyMonMaxHP
ld b, FALSE
- ld hl, LinkBattleRNs + 7 ; ?
+ ld hl, EnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1) ; LinkBattleRNs + 7 ; ?
predef CalcPkmnStats
; If we're in a trainer battle,
@@ -6588,7 +6536,6 @@ LoadEnemyMon: ; 3e8eb
ld [hl], a
jr .Moves
-
.OpponentParty:
; Get HP from the party struct
ld hl, (OTPartyMon1HP + 1)
@@ -6608,7 +6555,6 @@ LoadEnemyMon: ; 3e8eb
ld a, [hl] ; OTPartyMonStatus
ld [EnemyMonStatus], a
-
.Moves:
ld hl, BaseType1
ld de, EnemyMonType1
@@ -6637,9 +6583,9 @@ LoadEnemyMon: ; 3e8eb
xor a
ld h, d
ld l, e
-rept 3
ld [hli], a
-endr
+ ld [hli], a
+ ld [hli], a
ld [hl], a
; Make sure the predef knows this isn't a partymon
ld [MagikarpLength], a
@@ -6718,7 +6664,6 @@ endr
ret
; 3eb38
-
CheckSleepingTreeMon: ; 3eb38
; Return carry if species is in the list
; for the current time of day
@@ -6779,7 +6724,6 @@ CheckSleepingTreeMon: ; 3eb38
db -1 ; end
; 3eb75
-
CheckUnownLetter: ; 3eb75
; Return carry if the Unown letter hasn't been unlocked yet
@@ -6848,7 +6792,6 @@ CheckUnownLetter: ; 3eb75
; 3ebc7
-
SwapBattlerLevels: ; 3ebc7
; unreferenced
push bc
@@ -6924,7 +6867,6 @@ BattleWinSlideInEnemyTrainerFrontpic: ; 3ebd8
ret
; 3ec2c
-
ApplyStatusEffectOnPlayerStats: ; 3ec2c
ld a, 1
jr ApplyStatusEffectOnStats
@@ -7143,7 +7085,6 @@ ApplyStatLevelMultiplier: ; 3ecb7
db 4, 1 ; 400%
; 3ed45
-
BadgeStatBoosts: ; 3ed45
; Raise BattleMon stats depending on which badges have been obtained.
@@ -7202,7 +7143,6 @@ BadgeStatBoosts: ; 3ed45
ret
; 3ed7c
-
BoostStat: ; 3ed7c
; Raise stat at hl by 1/8.
@@ -7235,7 +7175,6 @@ BoostStat: ; 3ed7c
ret
; 3ed9f
-
_LoadBattleFontsHPBar: ; 3ed9f
callab LoadBattleFontsHPBar
ret
@@ -7246,7 +7185,6 @@ _LoadHPBar: ; 3eda6
ret
; 3edad
-
LoadHPExpBarGFX: ; unreferenced
ld de, EnemyHPBarBorderGFX
ld hl, VTiles2 tile $6c
@@ -7262,7 +7200,6 @@ LoadHPExpBarGFX: ; unreferenced
jp Get2bpp
; 3edd1
-
EmptyBattleTextBox: ; 3edd1
ld hl, .empty
jp BattleTextBox
@@ -7270,7 +7207,6 @@ EmptyBattleTextBox: ; 3edd1
db "@"
; 3edd8
-
_BattleRandom:: ; 3edd8
; If the normal RNG is used in a link battle it'll desync.
; To circumvent this a shared PRNG is used instead.
@@ -7340,7 +7276,6 @@ _BattleRandom:: ; 3edd8
ret
; 3ee0f
-
Call_PlayBattleAnim_OnlyIfVisible: ; 3ee0f
ld a, BATTLE_VARS_SUBSTATUS3
call GetBattleVar
@@ -7373,7 +7308,6 @@ FinishBattleAnim: ; 3ee27
ret
; 3ee3b
-
GiveExperiencePoints: ; 3ee3b
; Give experience.
; Don't give experience if linked or in the Battle Tower.
@@ -7832,7 +7766,6 @@ TextJump_StringBuffer2ExpPoints: ; 3f131
db "@"
; 3f136
-
AnimateExpBar: ; 3f136
push bc
@@ -8019,8 +7952,6 @@ AnimateExpBar: ; 3f136
ld [hBGMapMode], a
ret
-
-
SendOutPkmnText: ; 3f26d
ld a, [wLinkMode]
and a
@@ -8028,7 +7959,7 @@ SendOutPkmnText: ; 3f26d
ld hl, JumpText_GoPkmn ; If we're in a LinkBattle print just "Go <PlayerMon>"
- ld a, [wAISwitch] ; unless this (unidentified) variable is set
+ ld a, [wBattleHasJustStarted] ; unless this (unidentified) variable is set
and a
jr nz, .skip_to_textbox
@@ -8083,7 +8014,6 @@ SendOutPkmnText: ; 3f26d
jp BattleTextBox
; 3f2d1
-
JumpText_GoPkmn: ; 3f2d1
text_jump Text_GoPkmn
start_asm
@@ -8197,7 +8127,6 @@ TextJump_ComeBack: ; 3f35b
db "@"
; 3f360
-
HandleSafariAngerEatingStatus: ; unreferenced
ld hl, wSafariMonEating
ld a, [hl]
@@ -8230,7 +8159,6 @@ HandleSafariAngerEatingStatus: ; unreferenced
jp StdBattleTextBox
; 3f390
-
FillInExpBar: ; 3f390
push hl
call CalcExpBar
@@ -8447,7 +8375,6 @@ GetFrontpic_DoAnim: ; 3f4b4
ret
; 3f4c1
-
StartBattle: ; 3f4c1
; This check prevents you from entering a battle without any Pokemon.
; Those using walk-through-walls to bypass getting a Pokemon experience
@@ -8467,16 +8394,14 @@ StartBattle: ; 3f4c1
ret
; 3f4d9
-
_DoBattle: ; 3f4d9
; unreferenced
call DoBattle
ret
; 3f4dd
-
BattleIntro: ; 3f4dd
- callba MobileFn_106050 ; mobile
+ callba TrainerRankings_Battles ; mobile
call LoadTrainerOrWildMonPic
xor a
ld [TempBattleMonSpecies], a
@@ -8561,7 +8486,7 @@ BackUpVBGMap2: ; 3f568
InitEnemyTrainer: ; 3f594
ld [TrainerClass], a
- callba MobileFn_10606a
+ callba TrainerRankings_TrainerBattles
xor a
ld [TempEnemyMonSpecies], a
callab GetTrainerAttributes
@@ -8617,7 +8542,7 @@ InitEnemyTrainer: ; 3f594
InitEnemyWildmon: ; 3f607
ld a, WILD_BATTLE
ld [wBattleMode], a
- callba MobileFn_10605d
+ callba TrainerRankings_WildBattles
call LoadEnemyMon
ld hl, EnemyMonMoves
ld de, wWildMonMoves
@@ -8702,7 +8627,6 @@ Function3f662: ; 3f662
ret
; 3f69e
-
ExitBattle: ; 3f69e
call .HandleEndOfBattle
call CleanUpBattleRAM
@@ -8801,7 +8725,7 @@ CheckPayDay: ; 3f71d
; 3f759
ShowLinkBattleParticipantsAfterEnd: ; 3f759
- callba MobileFn_1060df
+ callba TrainerRankings_LinkBattles
callba BackupMobileEventIndex
ld a, [CurOTMon]
ld hl, OTPartyMon1Status
@@ -8831,17 +8755,17 @@ DetermineMobileBattleResult: ; 3f77c
cp $1
jr c, .victory
jr z, .loss
- callba MobileFn_SaveBattleResult_Draw
+ callba TrainerRankings_ColosseumDraws
ld de, .Draw
jr .store_result
.victory
- callba MobileFn_SaveBattleResult_Win
+ callba TrainerRankings_ColosseumWins
ld de, .Win
jr .store_result
.loss
- callba MobileFn_SaveBattleResult_Lose
+ callba TrainerRankings_ColosseumLosses
ld de, .Lose
jr .store_result
@@ -8881,7 +8805,6 @@ DetermineMobileBattleResult: ; 3f77c
db " DRAW@"
; 3f80f
-
.Mobile_InvalidBattle: ; 3f80f
hlcoord 6, 8
ld de, .Invalid
@@ -8896,14 +8819,12 @@ DetermineMobileBattleResult: ; 3f77c
db "INVALID BATTLE@"
; 3f830
-
IsMobileBattle2: ; 3f830
ld a, [wLinkMode]
cp LINK_MOBILE
ret
; 3f836
-
DisplayLinkRecord: ; 3f836
ld a, BANK(sLinkBattleStats)
call GetSRAMBank
@@ -8916,7 +8837,7 @@ DisplayLinkRecord: ; 3f836
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call WaitBGMap2
- ld b, SCGB_08
+ ld b, SCGB_DIPLOMA
call GetSGBLayout
call SetPalettes
ld c, 8
@@ -8925,7 +8846,6 @@ DisplayLinkRecord: ; 3f836
ret
; 3f85f
-
ReadAndPrintLinkBattleRecord: ; 3f85f
call ClearTileMap
call ClearSprites
@@ -9060,7 +8980,6 @@ ReadAndPrintLinkBattleRecord: ; 3f85f
db "TOTAL WIN LOSE DRAW@"
; 3f998
-
BattleEnd_HandleRoamMons: ; 3f998
ld a, [BattleType]
cp BATTLETYPE_ROAMING
@@ -9168,7 +9087,6 @@ GetRoamMonSpecies: ; 3fa31
ret
; 3fa42
-
AddLastMobileBattleToLinkRecord: ; 3fa42
ld hl, OTPlayerID
ld de, StringBuffer1
@@ -9429,7 +9347,7 @@ InitBattleDisplay: ; 3fb6c
ld [rSVBK], a
ld hl, wDecompressScratch
- ld bc, wBackupAttrMap - wDecompressScratch
+ ld bc, wScratchAttrMap - wDecompressScratch
ld a, " "
call ByteFill
@@ -9449,7 +9367,6 @@ InitBattleDisplay: ; 3fb6c
ret
; 3fbff
-
GetTrainerBackpic: ; 3fbff
; Load the player character's backpic (6x6) into VRAM starting from VTiles2 tile $31.
@@ -9484,7 +9401,6 @@ GetTrainerBackpic: ; 3fbff
ret
; 3fc30
-
CopyBackpic: ; 3fc30
ld a, [rSVBK]
push af
@@ -9543,7 +9459,6 @@ CopyBackpic: ; 3fc30
ret
; 3fc8b
-
BattleStartMessage: ; 3fc8b
ld a, [wBattleMode]
dec a
@@ -9598,7 +9513,7 @@ BattleStartMessage: ; 3fc8b
cp BATTLETYPE_FISH
jr nz, .NotFishing
- callba MobileFn_106086 ; update fishing records?
+ callba TrainerRankings_HookedEncounters
ld hl, HookedPokemonAttackedText
jr .PlaceBattleStartText
@@ -9621,8 +9536,8 @@ BattleStartMessage: ; 3fc8b
call IsMobileBattle2
ret nz
- ld c, $2
- callba Function4ea0a
+ ld c, $2 ; start
+ callba Mobile_PrintOpponentBattleMessage
ret
; 3fd26