summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xengine/battle/end_of_battle.asm14
-rw-r--r--engine/battle/wild_encounters.asm11
-rwxr-xr-xyellow/main.asm13
3 files changed, 21 insertions, 17 deletions
diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm
index 2f84c6fe..5782b274 100755
--- a/engine/battle/end_of_battle.asm
+++ b/engine/battle/end_of_battle.asm
@@ -1,4 +1,4 @@
-EndOfBattle: ; 137aa (4:77aa)
+EndOfBattle: ; 13765 (4:7765)
ld a, [wLinkState]
cp LINK_STATE_BATTLING
jr nz, .notLinkBattle
@@ -10,6 +10,8 @@ EndOfBattle: ; 137aa (4:77aa)
ld a, [wEnemyMonStatus]
ld [hl], a
call ClearScreen
+ ld b, SET_PAL_OVERWORLD
+ call RunPaletteCommand
callab DisplayLinkBattleVersusTextBox
ld a, [wBattleResult]
cp $1
@@ -43,6 +45,8 @@ EndOfBattle: ; 137aa (4:77aa)
xor a
ld [wForceEvolution], a
predef EvolutionAfterBattle
+ ld d, $82
+ callab Func_fce5a
.resetVariables
xor a
ld [wLowHealthAlarm], a ;disable low health alarm
@@ -74,15 +78,15 @@ EndOfBattle: ; 137aa (4:77aa)
ld [wDestinationWarpID], a
ret
-YouWinText: ; 13853 (4:7853)
+YouWinText: ; 1381d (4:781d)
db "YOU WIN@"
-YouLoseText: ; 1385b (4:785b)
+YouLoseText: ; 13825 (4:7825)
db "YOU LOSE@"
-DrawText: ; 13864 (4:7864)
+DrawText: ; 1382e (4:782e)
db " DRAW@"
-PickUpPayDayMoneyText: ; 1386b (4:786b)
+PickUpPayDayMoneyText: ; 13835 (4:7835)
TX_FAR _PickUpPayDayMoneyText
db "@"
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm
index 044f7ea5..f2f2f457 100644
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -1,6 +1,6 @@
; try to initiate a wild pokemon encounter
; returns success in Z
-TryDoWildEncounter: ; 13870 (4:7870)
+TryDoWildEncounter: ; 1383a (4:783a)
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
@@ -24,8 +24,9 @@ TryDoWildEncounter: ; 13870 (4:7870)
ld [wRepelRemainingSteps], a
.next
; determine if wild pokemon can appear in the half-block we're standing in
-; is the bottom right tile (9,9) of the half-block we're standing in a grass/water tile?
- coord hl, 9, 9
+; is the bottom left tile (8,9) of the half-block we're standing in a grass/water tile?
+; note that by using the bottom left tile, this prevents the "left-shore" tiles from generating grass encounters
+ coord hl, 8, 9
ld c, [hl]
ld a, [wGrassTile]
cp c
@@ -68,8 +69,6 @@ TryDoWildEncounter: ; 13870 (4:7870)
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, 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
ld b, 0
add hl, bc
@@ -101,7 +100,7 @@ TryDoWildEncounter: ; 13870 (4:7870)
xor a
ret
-WildMonEncounterSlotChances: ; 13918 (4:7918)
+WildMonEncounterSlotChances: ; 138e2 (4:78e2)
; There are 10 slots for wild pokemon, and this is the table that defines how common each of
; those 10 slots is. A random number is generated and then the first byte of each pair in this
; table is compared against that random number. If the random number is less than or equal
diff --git a/yellow/main.asm b/yellow/main.asm
index c9c64f10..89d54608 100755
--- a/yellow/main.asm
+++ b/yellow/main.asm
@@ -3536,7 +3536,6 @@ ShrinkPic2: INCBIN "pic/trainer/shrink2.pic"
INCLUDE "engine/menu/start_sub_menus.asm"
INCLUDE "engine/items/tms.asm"
-
SECTION "NPC Sprites 1", ROMX, BANK[NPC_SPRITES_1]
OakAideSprite: INCBIN "gfx/sprites/oak_aide.2bpp"
@@ -3568,10 +3567,10 @@ OldAmberSprite: INCBIN "gfx/sprites/old_amber.2bpp"
LyingOldManSprite: INCBIN "gfx/sprites/lying_old_man.2bpp"
QuestionMarkSprite: INCBIN "gfx/sprites/question_mark.2bpp"
-EndOfBattle: ; 13765 (4:7765)
- dr $13765,$1383a
-TryDoWildEncounter: ; 1383a (4:783a)
- dr $1383a,$14000
+INCLUDE "engine/battle/end_of_battle.asm"
+INCLUDE "engine/battle/wild_encounters.asm"
+
+ dr $138f6,$14000
SECTION "NPC Sprites 2", ROMX, BANK[NPC_SPRITES_2]
@@ -4346,7 +4345,9 @@ SECTION "bank39",ROMX,BANK[$39]
SECTION "bank3A",ROMX,BANK[$3A]
MonsterNames: ; e8000 (3a:4000)
- dr $e8000,$e8a5e
+ dr $e8000,$e876c
+IsPlayerJustOutsideMap: ; e876c (3a:476c)
+ dr $e876c,$e8a5e
Func_e8a5e: ; e8a5e (3a:4a5e)
dr $e8a5e,$e8d35
Func_e8d35:: ; e8d35 (3a:4d35)