diff options
Diffstat (limited to 'engine/battle/experience.asm')
-rw-r--r-- | engine/battle/experience.asm | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 0480bfcb..f43a7354 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -1,4 +1,4 @@ -GainExperience: ; 5524f (15:524f) +GainExperience: ; 5524f (15:525f) ld a, [wLinkState] cp LINK_STATE_BATTLING ret z ; return if link battle @@ -43,17 +43,17 @@ GainExperience: ; 5524f (15:524f) inc de jr .nextBaseStat .maxStatExp ; if the upper byte also overflowed, then we have hit the max stat exp - ld a, $ff + dec a ; a is 0 from previous check ld [de], a inc de ld [de], a .nextBaseStat dec c - jr z, .asm_552a1 + jr z, .statExpDone inc de inc de jr .gainStatExpLoop -.asm_552a1 +.statExpDone xor a ld [H_MULTIPLICAND], a ld [H_MULTIPLICAND + 1], a @@ -233,13 +233,19 @@ GainExperience: ; 5524f (15:524f) .recalcStatChanges xor a ; battle mon ld [wCalculateWhoseStats], a - callab CalculateModifiedStats - callab ApplyBurnAndParalysisPenaltiesToPlayer - callab ApplyBadgeStatBoosts - callab DrawPlayerHUDAndHPBar - callab PrintEmptyString + ld hl, CalculateModifiedStats + call Bankswitch15ToF + ld hl, ApplyBurnAndParalysisPenaltiesToPlayer + call Bankswitch15ToF + ld hl, ApplyBadgeStatBoosts + call Bankswitch15ToF + ld hl, DrawPlayerHUDAndHPBar + call Bankswitch15ToF + ld hl, PrintEmptyString + call Bankswitch15ToF call SaveScreenTilesToBuffer1 .printGrewLevelText + callabd_ModifyPikachuHappiness PIKAHAPPY_LEVELUP ld hl, GrewLevelText call PrintText xor a ; PLAYER_PARTY_DATA @@ -291,7 +297,7 @@ GainExperience: ; 5524f (15:524f) predef_jump FlagActionPredef ; set the fought current enemy flag for the mon that is currently out ; divide enemy base stats, catch rate, and base exp by the number of mons gaining exp -DivideExpDataByNumMonsGainingExp: ; 5546c (15:546c) +DivideExpDataByNumMonsGainingExp: ; 5547b (15:547b) ld a, [wPartyGainExpFlags] ld b, a xor a @@ -325,7 +331,7 @@ DivideExpDataByNumMonsGainingExp: ; 5546c (15:546c) ret ; multiplies exp by 1.5 -BoostExp: ; 5549f (15:549f) +BoostExp: ; 554ae (15:54ae) ld a, [H_QUOTIENT + 2] ld b, a ld a, [H_QUOTIENT + 3] @@ -339,7 +345,11 @@ BoostExp: ; 5549f (15:549f) ld [H_QUOTIENT + 2], a ret -GainedText: ; 554b2 (15:54b2) +Bankswitch15ToF: ; 554c1 (15:54c1) + ld b, BANK(BattleCore) + jp Bankswitch + +GainedText: ; 554c6 (15:54c6) TX_FAR _GainedText TX_ASM ld a, [wBoostExpByExpAll] @@ -353,20 +363,20 @@ GainedText: ; 554b2 (15:54b2) ld hl, BoostedText ret -WithExpAllText: ; 554cb (15:54cb) +WithExpAllText: ; 554df (15:54df) TX_FAR _WithExpAllText TX_ASM ld hl, ExpPointsText ret -BoostedText: ; 554d4 (15:54d4) +BoostedText: ; 554e8 (15:54e8) TX_FAR _BoostedText -ExpPointsText: ; 554d8 (15:54d8) +ExpPointsText: ; 554ec (15:54ec) TX_FAR _ExpPointsText db "@" -GrewLevelText: ; 554dd (15:54dd) +GrewLevelText: ; 554f1 (15:54f1) TX_FAR _GrewLevelText db $0b db "@" |