diff options
| author | dannye <33dannye@gmail.com> | 2026-01-17 22:38:33 -0600 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2026-01-17 22:38:33 -0600 |
| commit | bc2354dd6626ce28bb9561547ed2107cfa56c18e (patch) | |
| tree | 5902d4c3389253c76b7c3351e0d7dfecb551c28d /engine/battle/experience.asm | |
| parent | Identify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff) | |
| parent | Use macros for `WildMonEncounterSlotChances` (#562) (diff) | |
| download | pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/battle/experience.asm')
| -rw-r--r-- | engine/battle/experience.asm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm index 32afc017..55d8d782 100644 --- a/engine/battle/experience.asm +++ b/engine/battle/experience.asm @@ -21,7 +21,7 @@ GainExperience: and a ; is mon's gain exp flag set? pop hl jp z, .nextMon ; if mon's gain exp flag not set, go to next mon - ld de, (wPartyMon1HPExp + 1) - (wPartyMon1HP + 1) + ld de, (MON_HP_EXP + 1) - (MON_HP + 1) add hl, de ld d, h ld e, l @@ -66,9 +66,9 @@ GainExperience: ldh [hDivisor], a ld b, 4 call Divide - ld hl, wPartyMon1OTID - (wPartyMon1DVs - 1) + ld hl, MON_OTID - (MON_DVS - 1) add hl, de - ld b, [hl] ; party mon OTID + ld b, [hl] ; wPartyMon*OTID inc hl ld a, [wPlayerID] cp b @@ -152,7 +152,7 @@ GainExperience: ld [wMonDataLocation], a call LoadMonData pop hl - ld bc, wPartyMon1Level - wPartyMon1Exp + ld bc, MON_LEVEL - MON_EXP add hl, bc push hl farcall CalcLevelFromExperience @@ -166,13 +166,13 @@ GainExperience: ld a, d ld [wCurEnemyLevel], a ld [hl], a - ld bc, wPartyMon1Species - wPartyMon1Level + ld bc, MON_SPECIES - MON_LEVEL add hl, bc ld a, [hl] ld [wCurSpecies], a ld [wPokedexNum], a call GetMonHeader - ld bc, (wPartyMon1MaxHP + 1) - wPartyMon1Species + ld bc, (MON_MAXHP + 1) - MON_SPECIES add hl, bc push hl ld a, [hld] @@ -181,7 +181,7 @@ GainExperience: push bc ; push max HP (from before levelling up) ld d, h ld e, l - ld bc, (wPartyMon1HPExp - 1) - wPartyMon1MaxHP + ld bc, (MON_HP_EXP - 1) - MON_MAXHP add hl, bc ld b, $1 ; consider stat exp when calculating stats call CalcStats @@ -193,15 +193,15 @@ GainExperience: ld a, [hl] sbc b ld b, a ; bc = difference between old max HP and new max HP after levelling - ld de, (wPartyMon1HP + 1) - wPartyMon1MaxHP + ld de, (MON_HP + 1) - MON_MAXHP add hl, de ; add to the current HP the amount of max HP gained when levelling - ld a, [hl] ; wPartyMon1HP + 1 + ld a, [hl] ; wPartyMon*HP + 1 add c ld [hld], a - ld a, [hl] ; wPartyMon1HP + 1 + ld a, [hl] ; wPartyMon*HP + 1 adc b - ld [hl], a ; wPartyMon1HP + ld [hl], a ; wPartyMon*HP ld a, [wPlayerMonNumber] ld b, a ld a, [wWhichPokemon] @@ -216,7 +216,7 @@ GainExperience: ld a, [hl] ld [de], a ; copy other stats from party mon to battle mon - ld bc, wPartyMon1Level - (wPartyMon1HP + 1) + ld bc, MON_LEVEL - (MON_HP + 1) add hl, bc push hl ld de, wBattleMonLevel @@ -251,7 +251,7 @@ GainExperience: xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a call LoadMonData - ld d, $1 + ld d, LEVEL_UP_STATS_BOX callfar PrintStatsBox call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 @@ -277,7 +277,7 @@ GainExperience: cp b jr z, .done ld [wWhichPokemon], a - ld bc, wPartyMon2 - wPartyMon1 + ld bc, PARTYMON_STRUCT_LENGTH ld hl, wPartyMon1 call AddNTimes jp .partyMonLoop |
