No more wram_constants.asm

unfortunately, this means manually declaring the wEnemyMon1 party struct
This commit is contained in:
dannye 2015-08-30 22:04:08 -05:00
parent 38065a744d
commit 5facf8377a
6 changed files with 44 additions and 18 deletions

View File

@ -7,8 +7,6 @@ INCLUDE "constants/hardware_constants.asm"
INCLUDE "constants/oam_constants.asm"
INCLUDE "constants/misc_constants.asm"
INCLUDE "constants/wram_constants.asm"
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/pokedex_constants.asm"
INCLUDE "constants/trainer_constants.asm"

View File

@ -38,6 +38,8 @@ SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * 8
BG_MAP_WIDTH EQU 32
BG_MAP_HEIGHT EQU 32
SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile)
NPC_MOVEMENT_DOWN EQU $00
NPC_MOVEMENT_UP EQU $40
NPC_MOVEMENT_LEFT EQU $80

View File

@ -1,10 +0,0 @@
SPRITEBUFFERSIZE EQU 7*7 * 8 ; 7 * 7 (tiles) * 8 (bytes per tile)
; Overload wGrassMons
wSerialEnemyDataBlock EQU $d893 ; wGrassMons + 11
; Overload enemy party data
W_WATERRATE EQU $d8a4 ; wEnemyMon1Species
W_WATERMONS EQU $d8a5 ; wEnemyMon1Species + 1

View File

@ -33,7 +33,7 @@ TryDoWildEncounter: ; 13870 (4:7870)
jr z, .CanEncounter
ld a, $14 ; in all tilesets with a water tile, this is its id
cp c
ld a, [W_WATERRATE]
ld a, [wWaterRate]
jr z, .CanEncounter
; even if not in grass/water, standing anywhere we can encounter pokemon
; so long as the map is "indoor" and has wild pokemon defined.
@ -67,7 +67,7 @@ TryDoWildEncounter: ; 13870 (4:7870)
aCoord 8, 9
cp $14 ; is the bottom left tile (8,9) of the half-block we're standing in a water tile?
jr nz, .gotWildEncounterType ; else, it's treated as a grass tile by default
ld hl, W_WATERMONS
ld hl, wWaterMons
; since the bottom right tile of a "left shore" half-block is $14 but the bottom left tile is not,
; "left shore" half-blocks (such as the one in the east coast of Cinnabar) load grass encounters.
.gotWildEncounterType

View File

@ -2967,10 +2967,10 @@ LoadWildData: ; ceb8 (3:4eb8)
add hl,bc
.NoGrassData
ld a,[hli]
ld [W_WATERRATE],a
ld [wWaterRate],a
and a
ret z ; if no water data, we're done
ld de,W_WATERMONS ; otherwise, load surfing data
ld de,wWaterMons ; otherwise, load surfing data
ld bc,$0014
jp CopyData

View File

@ -3062,13 +3062,49 @@ wGrassRate:: ; d887
ds 1
wGrassMons:: ; d888
ds 20
;ds 20
ds 11
; Overload wGrassMons
wSerialEnemyDataBlock:: ; d893
ds 9
wEnemyPartyCount:: ds 1 ; d89c
wEnemyPartyMons:: ds PARTY_LENGTH + 1 ; d89d
wEnemyMons:: ; d8a4
wEnemyMon1:: party_struct wEnemyMon1
wEnemyMon1::
wEnemyMon1Species::
; Overload enemy party data
wWaterRate:: db ; d8a4
wWaterMons:: ; d8a5
wEnemyMon1HP:: dw
wEnemyMon1BoxLevel:: db
wEnemyMon1Status:: db
wEnemyMon1Type::
wEnemyMon1Type1:: db
wEnemyMon1Type2:: db
wEnemyMon1CatchRate:: db
wEnemyMon1Moves:: ds NUM_MOVES
wEnemyMon1OTID:: dw
wEnemyMon1Exp:: ds 3
wEnemyMon1HPExp:: dw
wEnemyMon1AttackExp:: dw
wEnemyMon1DefenseExp:: dw
wEnemyMon1SpeedExp:: dw
wEnemyMon1SpecialExp:: dw
wEnemyMon1DVs:: ds 2
wEnemyMon1PP:: ds NUM_MOVES
wEnemyMon1Level:: db
wEnemyMon1Stats::
wEnemyMon1MaxHP:: dw
wEnemyMon1Attack:: dw
wEnemyMon1Defense:: dw
wEnemyMon1Speed:: dw
wEnemyMon1Special:: dw
wEnemyMon2:: party_struct wEnemyMon2
wEnemyMon3:: party_struct wEnemyMon3
wEnemyMon4:: party_struct wEnemyMon4