mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
Use more wram labels and other constants
This commit is contained in:
parent
c34156c5fb
commit
bbb86671ea
10 changed files with 65 additions and 59 deletions
|
|
@ -1696,19 +1696,19 @@ GotAwayText: ; 3cba1 (f:4ba1)
|
|||
; copies from party data to battle mon data when sending out a new player mon
|
||||
LoadBattleMonFromParty: ; 3cba6 (f:4ba6)
|
||||
ld a, [wWhichPokemon]
|
||||
ld bc, $2c
|
||||
ld bc, wPartyMon2 - wPartyMon1
|
||||
ld hl, wPartyMon1Species
|
||||
call AddNTimes
|
||||
ld de, wBattleMonSpecies
|
||||
ld bc, $c
|
||||
ld bc, wBattleMonDVs - wBattleMonSpecies
|
||||
call CopyData
|
||||
ld bc, $f
|
||||
ld bc, wPartyMon1DVs - wPartyMon1OTID
|
||||
add hl, bc
|
||||
ld de, wBattleMonDVs
|
||||
ld bc, $2
|
||||
ld bc, NUM_DVS
|
||||
call CopyData
|
||||
ld de, wBattleMonPP
|
||||
ld bc, $4
|
||||
ld bc, NUM_MOVES
|
||||
call CopyData
|
||||
ld de, wBattleMonLevel
|
||||
ld bc, $b
|
||||
|
|
@ -1724,12 +1724,12 @@ LoadBattleMonFromParty: ; 3cba6 (f:4ba6)
|
|||
call CopyData
|
||||
ld hl, wBattleMonLevel
|
||||
ld de, wPlayerMonUnmodifiedLevel ; block of memory used for unmodified stats
|
||||
ld bc, $b
|
||||
ld bc, 1 + NUM_STATS * 2
|
||||
call CopyData
|
||||
call ApplyBurnAndParalysisPenaltiesToPlayer
|
||||
call ApplyBadgeStatBoosts
|
||||
ld a, $7 ; default stat modifier
|
||||
ld b, $8
|
||||
ld b, NUM_STAT_MODS
|
||||
ld hl, wPlayerMonAttackMod
|
||||
.statModLoop
|
||||
ld [hli], a
|
||||
|
|
@ -1740,19 +1740,19 @@ LoadBattleMonFromParty: ; 3cba6 (f:4ba6)
|
|||
; copies from enemy party data to current enemy mon data when sending out a new enemy mon
|
||||
LoadEnemyMonFromParty: ; 3cc13 (f:4c13)
|
||||
ld a, [wWhichPokemon]
|
||||
ld bc, $2c
|
||||
ld bc, wEnemyMon2 - wEnemyMon1
|
||||
ld hl, wEnemyMons
|
||||
call AddNTimes
|
||||
ld de, wEnemyMonSpecies
|
||||
ld bc, $c
|
||||
ld bc, wEnemyMonDVs - wEnemyMonSpecies
|
||||
call CopyData
|
||||
ld bc, $f
|
||||
ld bc, wEnemyMon1DVs - wEnemyMon1OTID
|
||||
add hl, bc
|
||||
ld de, wEnemyMonDVs
|
||||
ld bc, $2
|
||||
ld bc, NUM_DVS
|
||||
call CopyData
|
||||
ld de, wEnemyMonPP
|
||||
ld bc, $4
|
||||
ld bc, NUM_MOVES
|
||||
call CopyData
|
||||
ld de, wEnemyMonLevel
|
||||
ld bc, $b
|
||||
|
|
@ -1768,12 +1768,12 @@ LoadEnemyMonFromParty: ; 3cc13 (f:4c13)
|
|||
call CopyData
|
||||
ld hl, wEnemyMonLevel
|
||||
ld de, wEnemyMonUnmodifiedLevel ; block of memory used for unmodified stats
|
||||
ld bc, $b
|
||||
ld bc, 1 + NUM_STATS * 2
|
||||
call CopyData
|
||||
call ApplyBurnAndParalysisPenaltiesToEnemy
|
||||
ld hl, W_MONHBASESTATS
|
||||
ld de, wEnemyMonBaseStats
|
||||
ld b, $5
|
||||
ld b, NUM_STATS
|
||||
.copyBaseStatsLoop
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
|
|
@ -1781,7 +1781,7 @@ LoadEnemyMonFromParty: ; 3cc13 (f:4c13)
|
|||
dec b
|
||||
jr nz, .copyBaseStatsLoop
|
||||
ld a, $7 ; default stat modifier
|
||||
ld b, $8
|
||||
ld b, NUM_STAT_MODS
|
||||
ld hl, wEnemyMonStatMods
|
||||
.statModLoop
|
||||
ld [hli], a
|
||||
|
|
@ -6300,7 +6300,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
|
|||
predef LoadMovePPs
|
||||
ld hl, W_MONHBASESTATS
|
||||
ld de, wEnemyMonBaseStats
|
||||
ld b, $5
|
||||
ld b, NUM_STATS
|
||||
.copyBaseStatsLoop
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
|
|
@ -6331,10 +6331,10 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
|
|||
predef FlagActionPredef ; mark this mon as seen in the pokedex
|
||||
ld hl, wEnemyMonLevel
|
||||
ld de, wEnemyMonUnmodifiedLevel
|
||||
ld bc, $b
|
||||
ld bc, 1 + NUM_STATS * 2
|
||||
call CopyData
|
||||
ld a, $7 ; default stat mod
|
||||
ld b, $8 ; number of stat mods
|
||||
ld b, NUM_STAT_MODS ; number of stat mods
|
||||
ld hl, wEnemyMonStatMods
|
||||
.statModLoop
|
||||
ld [hli], a
|
||||
|
|
@ -6561,7 +6561,7 @@ CalculateModifiedStats: ; 3ed99 (f:6d99)
|
|||
call CalculateModifiedStat
|
||||
inc c
|
||||
ld a, c
|
||||
cp 4
|
||||
cp NUM_STATS - 1
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ PickPokeball: ; 3a8c2 (e:68c2)
|
|||
.done
|
||||
ld a, b
|
||||
ld [de], a
|
||||
ld bc, $0028 ; rest of mon struct
|
||||
ld bc, wPartyMon2 - wPartyMon1 - 4 ; rest of mon struct
|
||||
add hl, bc
|
||||
ret
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ GainExperience: ; 5524f (15:524f)
|
|||
ld d, h
|
||||
ld e, l
|
||||
ld hl, wEnemyMonBaseStats
|
||||
ld c, $5
|
||||
ld c, NUM_STATS
|
||||
.gainStatExpLoop
|
||||
ld a, [hli]
|
||||
ld b, a ; enemy mon base stat
|
||||
|
|
@ -66,7 +66,7 @@ GainExperience: ; 5524f (15:524f)
|
|||
ld [H_DIVISOR], a
|
||||
ld b, 4
|
||||
call Divide
|
||||
ld hl, -((wPartyMon1HPExp + 1) - wPartyMon1OTID + 4 * 2)
|
||||
ld hl, wPartyMon1OTID - (wPartyMon1DVs - 1)
|
||||
add hl, de
|
||||
ld b, [hl] ; party mon OTID
|
||||
inc hl
|
||||
|
|
@ -220,7 +220,7 @@ GainExperience: ; 5524f (15:524f)
|
|||
add hl, bc
|
||||
push hl
|
||||
ld de, wBattleMonLevel
|
||||
ld bc, $b ; size of stats
|
||||
ld bc, 1 + NUM_STATS * 2 ; size of stats
|
||||
call CopyData
|
||||
pop hl
|
||||
ld a, [W_PLAYERBATTSTATUS3]
|
||||
|
|
@ -228,7 +228,7 @@ GainExperience: ; 5524f (15:524f)
|
|||
jr nz, .recalcStatChanges
|
||||
; the mon is not transformed, so update the unmodified stats
|
||||
ld de, wPlayerMonUnmodifiedLevel
|
||||
ld bc, $b
|
||||
ld bc, 1 + NUM_STATS * 2
|
||||
call CopyData
|
||||
.recalcStatChanges
|
||||
xor a
|
||||
|
|
@ -308,7 +308,7 @@ DivideExpDataByNumMonsGainingExp: ; 5546c (15:546c)
|
|||
ret c ; return if only one mon is gaining exp
|
||||
ld [wd11e], a ; store number of mons gaining exp
|
||||
ld hl, wEnemyMonBaseStats
|
||||
ld c, $7
|
||||
ld c, wEnemyMonBaseExp + 1 - wEnemyMonBaseStats
|
||||
.divideLoop
|
||||
xor a
|
||||
ld [H_DIVIDEND], a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue