shithub: pokered

Download patch

ref: 5facf8377aeda68cb3fca389cb1784cf9c2d406b
parent: 38065a744de1065cc021a4cafe22476f8425448d
author: dannye <corrnondacqb@yahoo.com>
date: Sun Aug 30 18:04:08 EDT 2015

No more wram_constants.asm
unfortunately, this means manually declaring the wEnemyMon1 party struct

--- a/constants.asm
+++ b/constants.asm
@@ -7,8 +7,6 @@
 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"
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -38,6 +38,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
--- a/constants/wram_constants.asm
+++ /dev/null
@@ -1,10 +1,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
-
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -33,7 +33,7 @@
 	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 @@
 	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
--- a/main.asm
+++ b/main.asm
@@ -2967,10 +2967,10 @@
 	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
 
--- a/wram.asm
+++ b/wram.asm
@@ -3062,13 +3062,49 @@
 	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