summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Martinek <andrewrmartinek@gmail.com>2019-10-08 00:20:52 -0400
committerAndrew Martinek <andrewrmartinek@gmail.com>2019-10-08 00:20:52 -0400
commitcb88ee5a13498f060da1be80eb0cc0fcd1357a05 (patch)
treef299946090b8b7c27f3679eed4604b1fc95c3d14 /src
parenta44f17b9a15cf1a572d5e8056a69c368265729f2 (diff)
Created python script to calculate progress and documented some scripts
Diffstat (limited to 'src')
-rw-r--r--src/data/map_scripts.asm70
-rw-r--r--src/data/npc_map_data.asm66
-rw-r--r--src/data/npcs.asm2
-rw-r--r--src/engine/bank03.asm511
-rw-r--r--src/engine/bank04.asm32
-rw-r--r--src/engine/bank07.asm8
-rw-r--r--src/macros/scripts.asm16
-rw-r--r--src/wram.asm8
8 files changed, 501 insertions, 212 deletions
diff --git a/src/data/map_scripts.asm b/src/data/map_scripts.asm
index e156a1c..bd0229d 100644
--- a/src/data/map_scripts.asm
+++ b/src/data/map_scripts.asm
@@ -23,17 +23,17 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; MASON_LABORATORY
- dw NPCData_772f
+ dw MasonLabNPCS
dw $0000
dw $7b04
dw $5565
dw $5549
- dw $553b
+ dw MasonLaboratoryAfterDuel
dw $0000
dw $555e
; DECK_MACHINE_ROOM
- dw NPCData_775a
+ dw DeckMachineRoomNPCS
dw $0000
dw $7b4d
dw $0000
@@ -43,7 +43,7 @@ MapScripts: ; 1162a (4:562a)
dw $58ad
; ISHIHARAS_HOUSE
- dw NPCData_7773
+ dw IshiharasHouseNPCS
dw $0000
dw $7c02
dw $0000
@@ -53,7 +53,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; FIGHTING_CLUB_ENTRANCE
- dw NPCData_7786
+ dw FightingClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -63,17 +63,17 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; FIGHTING_CLUB_LOBBY
- dw NPCData_779f
+ dw FightingClubLobbyNPCS
dw $0000
dw $7c6f
dw $0000
dw $0000
- dw $5c68
+ dw FightingClubLobbyAfterDuel
dw $0000
dw $0000
; FIGHTING_CLUB
- dw NPCData_77ca
+ dw FightingClubNPCS
dw $0000
dw $0000
dw $0000
@@ -83,7 +83,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; ROCK_CLUB_ENTRANCE
- dw NPCData_77e3
+ dw RockClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -93,7 +93,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; ROCK_CLUB_LOBBY
- dw NPCData_77fc
+ dw RockClubLobbyNPCS
dw $0000
dw $7ca6
dw $0000
@@ -103,7 +103,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; ROCK_CLUB
- dw NPCData_7827
+ dw RockClubNPCS
dw $0000
dw $0000
dw $0000
@@ -113,7 +113,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; WATER_CLUB_ENTRANCE
- dw NPCData_783a
+ dw WaterClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -123,7 +123,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; WATER_CLUB_LOBBY
- dw NPCData_7853
+ dw WaterClubLobbyNPCS
dw $0000
dw $7cdd
dw $0000
@@ -133,7 +133,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; WATER_CLUB
- dw NPCData_787e
+ dw WaterClubNPCS
dw $0000
dw $0000
dw $0000
@@ -143,7 +143,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; LIGHTNING_CLUB_ENTRANCE
- dw NPCData_7897
+ dw LightningClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -153,7 +153,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; LIGHTNING_CLUB_LOBBY
- dw NPCData_78b0
+ dw LightningClubLobbyNPCS
dw $0000
dw $7d14
dw $0000
@@ -163,7 +163,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; LIGHTNING_CLUB
- dw NPCData_78d5
+ dw LightningClubNPCS
dw $0000
dw $0000
dw $0000
@@ -173,7 +173,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; GRASS_CLUB_ENTRANCE
- dw NPCData_78ee
+ dw GrassClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -183,7 +183,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; GRASS_CLUB_LOBBY
- dw NPCData_790d
+ dw GrassClubLobbyNPCS
dw $0000
dw $7d4b
dw $0000
@@ -193,7 +193,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; GRASS_CLUB
- dw NPCData_7932
+ dw GrassClubNPCS
dw $0000
dw $0000
dw $0000
@@ -203,7 +203,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; PSYCHIC_CLUB_ENTRANCE
- dw NPCData_7945
+ dw PsychicClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -213,7 +213,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; PSYCHIC_CLUB_LOBBY
- dw NPCData_7964
+ dw PsychicClubLobbyNPCS
dw $0000
dw $7d82
dw $0000
@@ -223,7 +223,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; PSYCHIC_CLUB
- dw NPCData_798f
+ dw PsychicClubNPCS
dw $0000
dw $0000
dw $0000
@@ -233,7 +233,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; SCIENCE_CLUB_ENTRANCE
- dw NPCData_79a8
+ dw ScienceClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -243,7 +243,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; SCIENCE_CLUB_LOBBY
- dw NPCData_79c1
+ dw ScienceClubLobbyNPCS
dw $0000
dw $7db9
dw $0000
@@ -253,7 +253,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; SCIENCE_CLUB
- dw NPCData_79ec
+ dw ScienceClubNPCS
dw $0000
dw $0000
dw $0000
@@ -263,7 +263,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; FIRE_CLUB_ENTRANCE
- dw NPCData_7a05
+ dw FireClubEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -273,7 +273,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; FIRE_CLUB_LOBBY
- dw NPCData_7a1e
+ dw FireClubLobbyNPCS
dw $0000
dw $7df0
dw $6d57
@@ -283,7 +283,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; FIRE_CLUB
- dw NPCData_7a43
+ dw FireClubNPCS
dw $0000
dw $0000
dw $0000
@@ -293,7 +293,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; CHALLENGE_HALL_ENTRANCE
- dw NPCData_7a5c
+ dw ChallengeHallEntranceNPCS
dw $0000
dw $0000
dw $0000
@@ -303,7 +303,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; CHALLENGE_HALL_LOBBY
- dw NPCData_7a63
+ dw ChallengeHallLobbyNPCS
dw $0000
dw $7e27
dw $0000
@@ -313,7 +313,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; CHALLENGE_HALL
- dw NPCData_7a9a
+ dw ChallengeHallNPCS
dw $0000
dw $0000
dw $0000
@@ -323,7 +323,7 @@ MapScripts: ; 1162a (4:562a)
dw $0000
; POKEMON_DOME_ENTRANCE
- dw NPCData_7ab9
+ dw PokemonDomeEntranceNPCS
dw $0000
dw $7e5e
dw $0000
@@ -333,7 +333,7 @@ MapScripts: ; 1162a (4:562a)
dw $762a
; POKEMON_DOME
- dw NPCData_7ac0
+ dw PokemonDomeNPCS
dw $0000
dw $0000
dw $0000
@@ -343,7 +343,7 @@ MapScripts: ; 1162a (4:562a)
dw $7718
; HALL_OF_HONOR
- dw NPCData_7adf
+ dw HallOfHonorNPCS
dw $0000
dw $7ec2
dw $0000
diff --git a/src/data/npc_map_data.asm b/src/data/npc_map_data.asm
index 7bc69cb..bae46d1 100644
--- a/src/data/npc_map_data.asm
+++ b/src/data/npc_map_data.asm
@@ -1,7 +1,7 @@
; NPC Map data. Format:
; NPC, X position, Y Position, Direction,
; pre-load function. (Resets c flag if NPC should not be loaded)
-NPCData_772f: ; 772f (4:1372f)
+MasonLabNPCS: ; 772f (4:1372f)
db DRMASON, $0e, $06, SOUTH
dw $5710
db SAM, $04, $0e, EAST
@@ -18,7 +18,7 @@ NPCData_772f: ; 772f (4:1372f)
dw $55eb
db $00
-NPCData_775a: ; 775a (4:1375a)
+DeckMachineRoomNPCS: ; 775a (4:1375a)
db TECH6, $06, $08, SOUTH
dw $0000
db TECH7, $06, $16, WEST
@@ -29,7 +29,7 @@ NPCData_775a: ; 775a (4:1375a)
dw $0000
db $00
-NPCData_7773: ; 7773 (4:13773)
+IshiharasHouseNPCS: ; 7773 (4:13773)
db NIKKI, $04, $04, NORTH
dw $5add
db ISHIHARA, $08, $08, SOUTH
@@ -38,7 +38,7 @@ NPCData_7773: ; 7773 (4:13773)
dw $5c43
db $00
-NPCData_7786: ; 7786 (4:13786)
+FightingClubEntranceNPCS: ; 7786 (4:13786)
db CLERK1, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -49,7 +49,7 @@ NPCData_7786: ; 7786 (4:13786)
dw $6915
db $00
-NPCData_779f: ; 779f (4:1379f)
+FightingClubLobbyNPCS: ; 779f (4:1379f)
db MAN1, $0c, $0e, WEST
dw $0000
db IMAKUNI, $12, $02, NORTH
@@ -66,7 +66,7 @@ NPCData_779f: ; 779f (4:1379f)
dw $7c6c
db $00
-NPCData_77ca: ; 77ca (4:137ca)
+FightingClubNPCS: ; 77ca (4:137ca)
db CHRIS, $04, $08, SOUTH
dw $5e43
db MICHAEL, $0e, $0a, SOUTH
@@ -77,7 +77,7 @@ NPCData_77ca: ; 77ca (4:137ca)
dw $0000
db $00
-NPCData_77e3: ; 77e3 (4:137e3)
+RockClubEntranceNPCS: ; 77e3 (4:137e3)
db CLERK2, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -88,7 +88,7 @@ NPCData_77e3: ; 77e3 (4:137e3)
dw $6915
db $00
-NPCData_77fc: ; 77fc (4:137fc)
+RockClubLobbyNPCS: ; 77fc (4:137fc)
db CHRIS, $12, $08, WEST
dw $5ee9
db MATTHEW, $06, $0e, EAST
@@ -105,7 +105,7 @@ NPCData_77fc: ; 77fc (4:137fc)
dw $7c6c
db $00
-NPCData_7827: ; 7827 (4:13827)
+RockClubNPCS: ; 7827 (4:13827)
db RYAN, $14, $0e, EAST
dw $0000
db ANDREW, $06, $14, NORTH
@@ -114,7 +114,7 @@ NPCData_7827: ; 7827 (4:13827)
dw $0000
db $00
-NPCData_783a: ; 783a (4:1383a)
+WaterClubEntranceNPCS: ; 783a (4:1383a)
db CLERK3, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -125,7 +125,7 @@ NPCData_783a: ; 783a (4:1383a)
dw $6915
db $00
-NPCData_7853: ; 7853 (4:13853)
+WaterClubLobbyNPCS: ; 7853 (4:13853)
db GAL1, $06, $0e, SOUTH
dw $0000
db LASS1, $10, $0a, SOUTH
@@ -142,7 +142,7 @@ NPCData_7853: ; 7853 (4:13853)
dw $7c6c
db $00
-NPCData_787e: ; 787e (4:1387e)
+WaterClubNPCS: ; 787e (4:1387e)
db SARA, $06, $12, EAST
dw $0000
db AMANDA, $16, $14, WEST
@@ -153,7 +153,7 @@ NPCData_787e: ; 787e (4:1387e)
dw $62ad
db $00
-NPCData_7897: ; 7897 (4:13897)
+LightningClubEntranceNPCS: ; 7897 (4:13897)
db CLERK4, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -164,7 +164,7 @@ NPCData_7897: ; 7897 (4:13897)
dw $6915
db $00
-NPCData_78b0: ; 78b0 (4:138b0)
+LightningClubLobbyNPCS: ; 78b0 (4:138b0)
db CHAP2, $12, $10, WEST
dw $0000
db IMAKUNI, $12, $02, NORTH
@@ -179,7 +179,7 @@ NPCData_78b0: ; 78b0 (4:138b0)
dw $7c6c
db $00
-NPCData_78d5: ; 78d5 (4:138d5)
+LightningClubNPCS: ; 78d5 (4:138d5)
db JENNIFER, $0e, $12, SOUTH
dw $0000
db NICHOLAS, $06, $0a, SOUTH
@@ -190,7 +190,7 @@ NPCData_78d5: ; 78d5 (4:138d5)
dw $6494
db $00
-NPCData_78ee: ; 78ee (4:138ee)
+GrassClubEntranceNPCS: ; 78ee (4:138ee)
db CLERK5, $06, $02, SOUTH
dw $0000
db MICHAEL, $0e, $08, SOUTH
@@ -203,7 +203,7 @@ NPCData_78ee: ; 78ee (4:138ee)
dw $6915
db $00
-NPCData_790d: ; 790d (4:1390d)
+GrassClubLobbyNPCS: ; 790d (4:1390d)
db BRITTANY, $0c, $0e, WEST
dw $0000
db LASS2, $12, $08, SOUTH
@@ -218,7 +218,7 @@ NPCData_790d: ; 790d (4:1390d)
dw $7c6c
db $00
-NPCData_7932: ; 7932 (4:13932)
+GrassClubNPCS: ; 7932 (4:13932)
db KRISTIN, $04, $0a, EAST
dw $0000
db HEATHER, $0e, $10, SOUTH
@@ -227,7 +227,7 @@ NPCData_7932: ; 7932 (4:13932)
dw $6796
db $00
-NPCData_7945: ; 7945 (4:13945)
+PsychicClubEntranceNPCS: ; 7945 (4:13945)
db CLERK6, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -240,7 +240,7 @@ NPCData_7945: ; 7945 (4:13945)
dw $0000
db $00
-NPCData_7964: ; 7964 (4:13964)
+PsychicClubLobbyNPCS: ; 7964 (4:13964)
db ROBERT, $14, $08, NORTH
dw $0000
db PAPPY1, $04, $10, EAST
@@ -257,7 +257,7 @@ NPCData_7964: ; 7964 (4:13964)
dw $7c6c
db $00
-NPCData_798f: ; 798f (4:1398f)
+PsychicClubNPCS: ; 798f (4:1398f)
db DANIEL, $08, $08, NORTH
dw $0000
db STEPHANIE, $16, $0c, EAST
@@ -268,7 +268,7 @@ NPCData_798f: ; 798f (4:1398f)
dw $6ada
db $00
-NPCData_79a8: ; 79a8 (4:139a8)
+ScienceClubEntranceNPCS: ; 79a8 (4:139a8)
db CLERK7, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -279,7 +279,7 @@ NPCData_79a8: ; 79a8 (4:139a8)
dw $6915
db $00
-NPCData_79c1: ; 79c1 (4:139c1)
+ScienceClubLobbyNPCS: ; 79c1 (4:139c1)
db LAD1, $12, $12, NORTH
dw $0000
db IMAKUNI, $12, $02, NORTH
@@ -296,7 +296,7 @@ NPCData_79c1: ; 79c1 (4:139c1)
dw $7c6c
db $00
-NPCData_79ec: ; 79ec (4:139ec)
+ScienceClubNPCS: ; 79ec (4:139ec)
db JOSEPH, $08, $0a, SOUTH
dw $6cc4
db DAVID, $14, $04, NORTH
@@ -307,7 +307,7 @@ NPCData_79ec: ; 79ec (4:139ec)
dw $0000
db $00
-NPCData_7a05: ; 7a05 (4:13a05)
+FireClubEntranceNPCS: ; 7a05 (4:13a05)
db CLERK8, $06, $02, SOUTH
dw $0000
db RONALD1, $08, $fe, SOUTH
@@ -318,7 +318,7 @@ NPCData_7a05: ; 7a05 (4:13a05)
dw $6915
db $00
-NPCData_7a1e: ; 7a1e (4:13a1e)
+FireClubLobbyNPCS: ; 7a1e (4:13a1e)
db JESSICA, $0c, $0e, WEST
dw $6d8d
db LAD2, $12, $06, EAST
@@ -333,7 +333,7 @@ NPCData_7a1e: ; 7a1e (4:13a1e)
dw $7c6c
db $00
-NPCData_7a43: ; 7a43 (4:13a43)
+FireClubNPCS: ; 7a43 (4:13a43)
db JOHN, $0c, $12, SOUTH
dw $0000
db ADAM, $08, $0e, SOUTH
@@ -344,12 +344,12 @@ NPCData_7a43: ; 7a43 (4:13a43)
dw $0000
db $00
-NPCData_7a5c: ; 7a5c (4:13a5c)
+ChallengeHallEntranceNPCS: ; 7a5c (4:13a5c)
db CLERK9, $06, $02, SOUTH
dw $6f96
db $00
-NPCData_7a63: ; 7a63 (4:13a63)
+ChallengeHallLobbyNPCS: ; 7a63 (4:13a63)
db PAPPY3, $06, $0e, EAST
dw $707a
db CHAMP, $10, $12, WEST
@@ -370,7 +370,7 @@ NPCData_7a63: ; 7a63 (4:13a63)
dw $7c6c
db $00
-NPCData_7a9a: ; 7a9a (4:13a9a)
+ChallengeHallNPCS: ; 7a9a (4:13a9a)
db CLERK12, $0a, $12, SOUTH
dw $707a
db CLERK13, $14, $12, SOUTH
@@ -383,12 +383,12 @@ NPCData_7a9a: ; 7a9a (4:13a9a)
dw $7559
db $00
-NPCData_7ab9: ; 7ab9 (4:13ab9)
+PokemonDomeEntranceNPCS: ; 7ab9 (4:13ab9)
db RONALD1, $0e, $12, SOUTH
dw $0000
db $00
-NPCData_7ac0: ; 7ac0 (4:13ac0)
+PokemonDomeNPCS: ; 7ac0 (4:13ac0)
db COURTNEY, $12, $02, SOUTH
dw $774b
db STEVE, $16, $02, SOUTH
@@ -401,7 +401,7 @@ NPCData_7ac0: ; 7ac0 (4:13ac0)
dw $77d6
db $00
-NPCData_7adf: ; 7adf (4:13adf)
+HallOfHonorNPCS: ; 7adf (4:13adf)
db _11F1F, $0a, $08, SOUTH
dw $0000
db _11F26, $0c, $08, SOUTH
diff --git a/src/data/npcs.asm b/src/data/npcs.asm
index bda574f..4ff42c8 100644
--- a/src/data/npcs.asm
+++ b/src/data/npcs.asm
@@ -183,7 +183,7 @@ ImakuniData:
db $00
db $0e
db $00
- dw $5d0d ; Pointer to OWScript
+ dw OWSequence_Imakuni ; Pointer to OWScript
tx Text03af
db IMAKUNI_PIC
db $34
diff --git a/src/engine/bank03.asm b/src/engine/bank03.asm
index c75c009..02ddc67 100644
--- a/src/engine/bank03.asm
+++ b/src/engine/bank03.asm
@@ -29,11 +29,11 @@ LoadMap: ; c000 (3:4000)
ld a, PLAYER_TURN
ldh [hWhoseTurn], a
farcall Func_1c440
- ld a, [wd0bb]
+ ld a, [wTempMap]
ld [wCurMap], a
- ld a, [wd0bc]
+ ld a, [wTempPlayerXCoord]
ld [wPlayerXCoord], a
- ld a, [wd0bd]
+ ld a, [wTempPlayerYCoord]
ld [wPlayerYCoord], a
call Func_c36a
call Func_c184
@@ -231,13 +231,13 @@ Func_c1b1: ; c1b1 (3:41b1)
ld a, $c
ld [wd32e], a
ld a, $0
- ld [wd0bb], a
+ ld [wTempMap], a
ld a, $c
- ld [wd0bc], a
+ ld [wTempPlayerXCoord], a
ld a, $c
- ld [wd0bd], a
+ ld [wTempPlayerYCoord], a
ld a, $2
- ld [wd0be], a
+ ld [wTempPlayerDirection], a
call Func_c9cb
call Func_c9dd
farcall Func_80b7a
@@ -278,13 +278,13 @@ Func_c1f8: ; c1f8 (3:41f8)
Func_c228: ; c228 (3:4228)
ld a, [wCurMap]
- ld [wd0bb], a
+ ld [wTempMap], a
ld a, [wPlayerXCoord]
- ld [wd0bc], a
+ ld [wTempPlayerXCoord], a
ld a, [wPlayerYCoord]
- ld [wd0bd], a
+ ld [wTempPlayerYCoord], a
ld a, [wPlayerDirection]
- ld [wd0be], a
+ ld [wTempPlayerDirection], a
ret
Func_c241: ; c241 (3:4241)
@@ -587,7 +587,7 @@ Func_c4b9: ; c4b9 (3:44b9)
ld a, [wCurMap]
cp OVERWORLD_MAP
jr z, .asm_c4ee
- ld a, [wd0be]
+ ld a, [wTempPlayerDirection]
ld b, a
.asm_c4ee
ld a, b
@@ -930,7 +930,7 @@ Func_c6f7: ; c6f7 (3:46f7)
Func_c70d: ; c70d (3:470d)
push hl
- ld hl, wd0bb
+ ld hl, wTempMap
ld a, [wCurMap]
cp [hl]
jr z, .asm_c71c
@@ -1288,15 +1288,15 @@ Func_c998: ; c998 (3:4998)
ret
Func_c9b8: ; c9b8 (3:49b8)
- ld l, $8
+ ld l, MAP_SCRIPT_LOAD_MAP
jr CallMapScriptPointerIfExists
Func_c9bc: ; c9bc (3:49bc)
- ld l, $a
+ ld l, MAP_SCRIPT_AFTER_DUEL
jr CallMapScriptPointerIfExists
Func_c9c0: ; c9c0 (3:49c0)
- ld l, $c
+ ld l, MAP_SCRIPT_MOVED_PLAYER
CallMapScriptPointerIfExists: ; c9c2 (3:49c2)
call GetMapScriptPointer
@@ -1304,7 +1304,7 @@ CallMapScriptPointerIfExists: ; c9c2 (3:49c2)
jp hl
Func_c9c7: ; c9c7 (3:49c7)
- ld l, $e
+ ld l, MAP_SCRIPT_CLOSE_TEXTBOX
jr CallMapScriptPointerIfExists
Func_c9cb: ; c9cb (3:49cb)
@@ -1342,7 +1342,7 @@ Func_c9e8: ; c9e8 (3:49e8)
ld b, $0
ld hl, Unknown_ca0a
add hl, bc
- ld a, [wd0bb]
+ ld a, [wTempMap]
cp [hl]
jr z, .asm_c9f2
.asm_ca04
@@ -1719,11 +1719,11 @@ RST20: ; cc42 (3:4c42)
ld [wOWScriptPointer+1], a
xor a
ld [wBreakOWScriptLoop], a
-.asm_cc4f
+.continueScriptLoop
call RunOverworldScript
ld a, [wBreakOWScriptLoop] ; if you break out, it jumps
or a
- jr z, .asm_cc4f
+ jr z, .continueScriptLoop
ld hl, wOWScriptPointer
ld a, [hli]
ld c, a
@@ -1808,6 +1808,7 @@ SetScriptControlByteFail: ; ccb9 (3:4cb9)
ld [wScriptControlByte], a
ret
+; Exits Script mode and runs the next instruction like normal
OWScript_EndScriptLoop1: ; ccbe (3:4cbe)
OWScript_EndScriptLoop2: ; ccbe (3:4cbe)
OWScript_EndScriptLoop3: ; ccbe (3:4cbe)
@@ -1826,7 +1827,7 @@ OWScript_CloseAdvancedTextBox: ; ccc6 (3:4cc6)
call CloseAdvancedDialogueBox
jp IncreaseOWScriptPointerBy1
-OWScript_EndScriptCloseText: ; cccc (3:4ccc)
+OWScript_QuitScriptFully: ; cccc (3:4ccc)
call OWScript_CloseAdvancedTextBox
call OWScript_EndScriptLoop1
pop hl
@@ -1845,7 +1846,7 @@ Func_ccdc: ; ccdc (3:4cdc)
call Func_c891
jp IncreaseOWScriptPointerBy3
-Func_cce4: ; cce4 (3:4ce4)
+OWScript_AskQuestionJumpDefaultYes: ; cce4 (3:4ce4)
ld a, $1
ld [wDefaultYesOrNo], a
; fallthrough
@@ -2099,42 +2100,48 @@ OWScript_GiveBoosterPacks: ; ce8a (3:4e8a)
ld [wd117], a
pop bc
ld a, b
- cp $ff
+ cp NO_BOOSTER
jr z, .asm_ceb4
farcall BoosterPack_1031b
call GetOWSArgs3AfterPointer
ld a, c
- cp $ff
+ cp NO_BOOSTER
jr z, .asm_ceb4
farcall BoosterPack_1031b
.asm_ceb4
call Func_c2d4
jp IncreaseOWScriptPointerBy4
-Func_ceba: ; ceba (3:4eba)
+OWScript_GiveOneOfEachTrainerBooster: ; ceba (3:4eba)
xor a
ld [wd117], a
call Func_c2a3
- ld hl, $4edd
-.asm_cec4
+ ld hl, .booster_type_table
+.giveBoosterLoop
ld a, [hl]
- cp $ff
- jr z, .asm_ced7
+ cp NO_BOOSTER
+ jr z, .done
push hl
farcall BoosterPack_1031b
ld a, $1
ld [wd117], a
pop hl
inc hl
- jr .asm_cec4
-.asm_ced7
+ jr .giveBoosterLoop
+.done
call Func_c2d4
jp IncreaseOWScriptPointerBy1
-; 0xcedd
- INCROM $cedd, $cee2
+.booster_type_table
+ db BOOSTER_COLOSSEUM_TRAINER
+ db BOOSTER_EVOLUTION_TRAINER
+ db BOOSTER_MYSTERY_TRAINER_COLORLESS
+ db BOOSTER_LABORATORY_TRAINER
+ db NO_BOOSTER ; $ff
-Func_cee2: ; cee2 (3:4ee2)
+; Shows the card received screen for a given promotional card
+; arg can either be the card, $00 for a wram card, or $ff for the 4 legends
+OWScript_ShowCardReceivedScreen: ; cee2 (3:4ee2)
call Func_c2a3
ld a, c
cp $ff
@@ -2381,7 +2388,7 @@ Func_d04f: ; d04f (3:504f)
call Func_cad8
jp IncreaseOWScriptPointerBy1
-Func_d055: ; d055 (3:5055)
+OWScript_SetPlayerDirection: ; d055 (3:5055)
ld a, c
call Func_c5ce
jp IncreaseOWScriptPointerBy2
@@ -2410,9 +2417,7 @@ OWScript_SetDialogName: ; d080 (3:5080)
farcall SetNPCDialogName
jp IncreaseOWScriptPointerBy2
-; Calls another OWSequence with a specified NPC
-; Not confident enough to give it a name yet
-Func_d088: ; d088 (3:5088)
+OWScript_SetNextNPCandOWSequence: ; d088 (3:5088)
ld a, c
ld [wTempNPC], a
call GetOWSArgs2AfterPointer
@@ -2474,7 +2479,7 @@ Func_d0d9: ; d0d9 (3:50d9)
jp nz, ScriptEventFailedNoJump
jp ScriptEventPassedTryJump
-Func_d0f2: ; d0f2 (3:50f2)
+OWScript_JumpIfPlayerCoordMatches: ; d0f2 (3:50f2)
ld a, [wPlayerXCoord]
cp c
jp nz, ScriptEventFailedNoJump
@@ -2792,7 +2797,8 @@ OWScript_OpenDeckMachine: ; d336 (3:5336)
call Func_c2d4
jp IncreaseOWScriptPointerBy2
-Func_d36d: ; d36d (3:536d)
+; args: unused, room, new player x, new player y, new player direction
+OWScript_EnterMap: ; d36d (3:536d)
ld a, [wOWScriptPointer]
ld l, a
ld a, [wOWScriptPointer+1]
@@ -2800,13 +2806,13 @@ Func_d36d: ; d36d (3:536d)
inc hl
ld a, [hli]
ld a, [hli]
- ld [wd0bb], a
+ ld [wTempMap], a
ld a, [hli]
- ld [wd0bc], a
+ ld [wTempPlayerXCoord], a
ld a, [hli]
- ld [wd0bd], a
+ ld [wTempPlayerYCoord], a
ld a, [hli]
- ld [wd0be], a
+ ld [wTempPlayerDirection], a
ld hl, wd0b4
set 4, [hl]
jp IncreaseOWScriptPointerBy6
@@ -3050,7 +3056,7 @@ LoadOverworld: ; d4ec (3:54ec)
get_flag_value EVENT_FLAG_3E
or a
ret nz
- ld bc, OWSequence_d52e
+ ld bc, OWSequence_BeginGame
jp SetNextOWSequence
Func_d4fb: ; d4fb (3:54fb)
@@ -3077,23 +3083,34 @@ Func_d4fb: ; d4fb (3:54fb)
set_flag_value EVENT_FLAG_3F
ret
-OWSequence_d52e: ; d52e (3:552e)
+OWSequence_BeginGame: ; d52e (3:552e)
start_script
run_script OWScript_DoFrames
db $3c
run_script Func_d3e0
run_script OWScript_DoFrames
db $78
- run_script Func_d36d
+ run_script OWScript_EnterMap
db $02
- db $01
- db $0e
- db $1a
+ db MASON_LABORATORY
+ db 14
+ db 26
+ db NORTH
+ run_script OWScript_QuitScriptFully
+
+MasonLaboratoryAfterDuel: ; d53b (3:553b)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+
+.after_duel_table
+ db SAM
+ db SAM
+ dw $568a
+ dw $569f
db $00
- run_script OWScript_EndScriptCloseText
-; 0xd53b
- INCROM $d53b, $d753
+ INCROM $d549, $d753
OWSequence_d753: ; d753 (3:5753)
start_script
@@ -3127,7 +3144,7 @@ OWSequence_d753: ; d753 (3:5753)
run_script OWScript_PrintTextString
tx Text05e3
run_script OWScript_CloseAdvancedTextBox
- run_script Func_d088
+ run_script OWScript_SetNextNPCandOWSequence
db SAM
dw OWSequence_d779
run_script OWScript_EndScriptLoop1
@@ -3150,15 +3167,286 @@ OWSequence_d779: ; d779 (03:5779)
db $58
run_script Func_cfc6
db $01
- run_script Func_d055
+ run_script OWScript_SetPlayerDirection
db $03
run_script OWScript_CloseAdvancedTextBox
- run_script Func_d088
+ run_script OWScript_SetNextNPCandOWSequence
+ db DRMASON
+ dw OWSequence_d794
+ run_script OWScript_EndScriptLoop1
+ ret
+
+OWSequence_d794: ; d794 (3:5794)
+ start_script
+ run_script Func_ce4a
+ db $8b
+ db $58
+ run_script OWScript_DoFrames
+ db $28
+ run_script OWScript_PrintTextString
+ tx Text05e6
+ run_script OWScript_CloseTextBox
+ run_script OWScript_MovePlayer
+ db WEST
+ db $01
+ run_script OWScript_MovePlayer
+ db WEST
+ db $01
+ run_script OWScript_SetPlayerDirection
+ db SOUTH
+ run_script OWScript_MovePlayer
+ db SOUTH
+ db $01
+ run_script OWScript_MovePlayer
+ db SOUTH
+ db $01
+ run_script OWScript_MovePlayer
+ db SOUTH
+ db $01
+ run_script OWScript_SetPlayerDirection
+ db WEST
+ run_script Func_ce4a
+ db $94
+ db $58
+ run_script OWScript_PrintTextString
+ tx Text05e7
+ run_script OWScript_SetDialogName
+ db $07
+ run_script OWScript_PrintTextString
+ tx Text05e8
+
+.ows_d7bc
+ run_script OWScript_CloseTextBox
+ run_script Func_d317
+ run_script OWScript_CloseTextBox
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $07
+ dw .ows_d80c
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $01
+ dw .ows_d7e8
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $02
+ dw .ows_d7ee
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $03
+ dw .ows_d7f4
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $04
+ dw .ows_d7fa
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $05
+ dw .ows_d800
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_75
+ db $06
+ dw .ows_d806
+ run_script OWScript_PrintTextString
+ tx Text05d6
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d7e8
+ run_script OWScript_PrintTextString
+ tx Text05d7
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d7ee
+ run_script OWScript_PrintTextString
+ tx Text05d8
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d7f4
+ run_script OWScript_PrintTextString
+ tx Text05d9
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d7fa
+ run_script OWScript_PrintTextString
+ tx Text05da
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d800
+ run_script OWScript_PrintTextString
+ tx Text05db
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d806
+ run_script OWScript_PrintTextString
+ tx Text05dc
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d80c
+ run_script OWScript_PrintTextString
+ tx Text05e9
+ run_script OWScript_AskQuestionJumpDefaultYes
+ dw 0000
+ dw .ows_d817
+ run_script OWScript_Jump
+ dw .ows_d7bc
+
+.ows_d817
+ run_script OWScript_SetDialogName
+ db $01
+ run_script OWScript_PrintTextString
+ tx Text05ea
+ run_script OWScript_nop
+ run_script OWScript_SetFlagValue
+ db EVENT_FLAG_3E
db $01
- dw $5794
+ run_script OWScript_CloseAdvancedTextBox
+ run_script OWScript_SetNextNPCandOWSequence
+ db SAM
+ dw OWSequence_d827
run_script OWScript_EndScriptLoop1
+ ret
+
+OWSequence_d827: ; d827 (3:5827)
+ start_script
+ run_script OWScript_StartBattle
+ db PRIZES_2
+ db SAMS_PRACTICE_DECK_ID
+ db MUSIC_DUEL_THEME_1
+ run_script OWScript_QuitScriptFully
+; 0xd82d
+
+ INCROM $d82d, $dc68
+
+FightingClubLobbyAfterDuel: ; dc68 (3:5c68)
+ ld hl, .after_duel_table
+ call FindEndOfBattleScript
+ ret
+.after_duel_table
+ db IMAKUNI
+ db IMAKUNI
+ dw OWSequence_BeatImakuni
+ dw OWSequence_LostToImakuni
+ db $00
+
+ INCROM $dc76, $dd0d
+
+OWSequence_Imakuni: ; dd0d (3:5d0d)
+ start_script
+ run_script OWScript_SetFlagValue
+ db EVENT_FLAG_13
+ db $02
+ run_script OWScript_JumpIfFlagZero2
+ db EVENT_FLAG_02
+ dw NO_JUMP
+ run_script OWScript_PrintVariableText
+ tx Text0467
+ tx Text0468
+ run_script OWScript_MaxOutFlagValue
+ db EVENT_FLAG_02
+ run_script OWScript_AskQuestionJump
+ tx Text0469
+ dw .declineDuel
+ run_script OWScript_PrintTextString
+ tx Text046a
+ run_script OWScript_QuitScriptFully
+
+.declineDuel
+ run_script OWScript_PrintTextString
+ tx Text046b
+ run_script OWScript_StartBattle
+ db PRIZES_6
+ db IMAKUNI_DECK_ID
+ db MUSIC_IMAKUNI
+ run_script OWScript_QuitScriptFully
+; 0xdd2d
+
+OWSequence_BeatImakuni: ; dd2d (3:5d2d)
+ start_script
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_36
+ db $07
+ dw .ows_dd3f
+ run_script OWScript_IncrementFlagValue
+ db EVENT_FLAG_36
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_36
+ db $03
+ dw .ows_dd46
+ run_script OWScript_JumpIfFlagEqual
+ db EVENT_FLAG_36
+ db $06
+ dw .ows_dd4c
+.ows_dd3f
+ run_script OWScript_PrintTextString
+ tx Text046c
+ run_script OWScript_GiveOneOfEachTrainerBooster
+ run_script OWScript_Jump
+ dw .ows_dd56
+
+.ows_dd46
+ run_script OWScript_PrintTextString
+ tx Text046d
+ run_script OWScript_Jump
+ dw .ows_dd4f
+
+.ows_dd4c
+ run_script OWScript_PrintTextString
+ tx Text046e
+.ows_dd4f
+ run_script OWScript_PrintTextString
+ tx Text046f
+ run_script OWScript_GiveCard
+ db IMAKUNI_CARD
+ run_script OWScript_ShowCardReceivedScreen
+ db IMAKUNI_CARD
+.ows_dd56
+ run_script OWScript_PrintTextString
+ tx Text0470
+ run_script OWScript_Jump
+ dw OWJump_ImakuniCommon
- INCROM $d793, $e13f
+OWSequence_LostToImakuni: ; dd5c (3:5d5c)
+ start_script
+ run_script OWScript_PrintTextString
+ tx Text0471
+
+OWJump_ImakuniCommon: ; dd60 (3:5d60)
+ run_script OWScript_CloseTextBox
+ run_script OWScript_JumpIfPlayerCoordMatches
+ db 18
+ db 4
+ dw .ows_dd69
+ run_script OWScript_Jump
+ dw .ows_dd6e
+
+.ows_dd69
+ run_script OWScript_SetPlayerDirection
+ db EAST
+ run_script OWScript_MovePlayer
+ db WEST
+ db $01
+
+.ows_dd6e
+ run_script Func_ce4a
+ db $78
+ db $5d
+ run_script Func_cdcb
+ run_script OWScript_MaxOutFlagValue
+ db EVENT_FLAG_03
+ run_script Func_d408
+ db $09
+ run_script Func_d41d
+ run_script OWScript_QuitScriptFully
+; 0xdd78
+
+ INCROM $dd78, $e13f
WaterClubMovePlayer: ; e13f (3:613f)
ld a, [wPlayerYCoord]
@@ -3167,7 +3455,7 @@ WaterClubMovePlayer: ; e13f (3:613f)
get_flag_value EVENT_JOSHUA_STATE
cp $2
ret nc
- ld a, $21
+ ld a, JOSHUA
ld [wTempNPC], a
ld bc, OWSequence_NotReadyToSeeAmy
jp SetNextNPCAndOWSequence
@@ -3208,7 +3496,7 @@ OWSequence_Sara: ; e177 (3:6177)
dw .yes_duel
run_script OWScript_PrintTextString
tx Text042e
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.yes_duel
run_script OWScript_PrintTextString
tx Text042f
@@ -3216,7 +3504,7 @@ OWSequence_Sara: ; e177 (3:6177)
db PRIZES_2
db WATERFRONT_POKEMON_DECK_ID ; 6189
db MUSIC_DUEL_THEME_1
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatSara: ; e18c (3:618c)
start_script
@@ -3230,7 +3518,7 @@ OWSequence_BeatSara: ; e18c (3:618c)
db NO_BOOSTER
run_script OWScript_PrintTextString
tx Text0431
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_LostToSara: ; e19a (03:619a)
start_script
@@ -3246,7 +3534,7 @@ OWSequence_Amanda: ; e19e (03:619e)
dw .yes_duel
run_script OWScript_PrintTextString
tx Text0435
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.yes_duel
run_script OWScript_PrintTextString
tx Text0436
@@ -3254,7 +3542,7 @@ OWSequence_Amanda: ; e19e (03:619e)
db PRIZES_3
db LONELY_FRIENDS_DECK_ID
db MUSIC_DUEL_THEME_1
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatAmanda: ; e1b3 (03:61b3)
start_script
@@ -3268,24 +3556,24 @@ OWSequence_BeatAmanda: ; e1b3 (03:61b3)
db NO_BOOSTER
run_script OWScript_PrintTextString
tx Text0438
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_LostToAmanda: ; e1c1 (03:61c1)
start_script
run_script OWScript_PrintTextCloseBox
tx Text0439
-OWSequence_NotReadyToSeeAmy:
+OWSequence_NotReadyToSeeAmy: ; e15c (03:6153)
start_script
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $12
db $08
dw $61ec
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $14
db $08
dw $61f2
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $18
db $08
dw $61f8
@@ -3297,18 +3585,18 @@ OWSequence_NotReadyToSeeAmy:
db $62
run_script OWScript_PrintTextString
tx Text043a
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $12
db $0a
dw $61fe
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $14
db $0a
dw $6202
run_script Func_ce4a
db $15
db $62
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.ows_e1ec
run_script Func_ce4a
@@ -3329,7 +3617,7 @@ OWSequence_NotReadyToSeeAmy:
run_script Func_ce4a
db $18
db $62
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
; 0xe202
INCROM $e202, $e21c
@@ -3350,7 +3638,7 @@ OWSequence_Joshua:
db JOSHUA_TALKED
run_script OWScript_PrintTextString
tx Text043b
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.beat_sara_and_amanda
run_script OWScript_JumpIfFlagNonzero1
@@ -3381,7 +3669,7 @@ OWSequence_Joshua:
run_script OWScript_PrintVariableText
tx Text0440
tx Text0441
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.startDuel:
run_script OWScript_PrintTextString
@@ -3392,7 +3680,7 @@ OWSequence_Joshua:
db PRIZES_4
db SOUND_OF_THE_WAVES_DECK_ID
db MUSIC_DUEL_THEME_1
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_LostToJoshua: ; e260 (3:6260)
start_script
@@ -3403,7 +3691,7 @@ OWSequence_LostToJoshua: ; e260 (3:6260)
run_script OWScript_PrintVariableText
tx Text0443
tx Text0444
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatJoshua: ; e26c (3:626c)
start_script
@@ -3429,7 +3717,7 @@ OWSequence_BeatJoshua: ; e26c (3:626c)
db EVENT_JOSHUA_STATE
db JOSHUA_BEATEN
dw .firstJoshuaWin
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.firstJoshuaWin:
run_script OWScript_SetFlagValue
@@ -3445,13 +3733,13 @@ OWSequence_BeatJoshua: ; e26c (3:626c)
run_script Func_cfc6
db $00
run_script OWScript_CloseAdvancedTextBox
- run_script Func_d088
+ run_script OWScript_SetNextNPCandOWSequence
db AMY
dw OWSequence_MeetAmy
run_script OWScript_EndScriptLoop1
-; 0xe2a0
+ ret
- INCROM $e2a0, $e2d1
+ INCROM $e2a1, $e2d1
OWSequence_MeetAmy: ; e2d1 (3:62d1)
start_script
@@ -3479,12 +3767,12 @@ OWSequence_MeetAmy: ; e2d1 (3:62d1)
run_script Func_d0be
db $14
db $04
- run_script Func_d055
+ run_script OWScript_SetPlayerDirection
db $03
run_script OWScript_MovePlayer
db WEST
db $01
- run_script Func_d055
+ run_script OWScript_SetPlayerDirection
db $00
run_script OWScript_MovePlayer
db NORTH
@@ -3520,7 +3808,7 @@ OWSequence_Amy: ; e304 (3:6304)
db $14
db $04
dw OWSequence_LostToAmy.ows_e34e
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.startDuel
run_script OWScript_PrintTextString
@@ -3529,7 +3817,7 @@ OWSequence_Amy: ; e304 (3:6304)
db PRIZES_6
db GO_GO_RAIN_DANCE_DECK_ID
db MUSIC_DUEL_THEME_2
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatAmy: ; e322 (3:6322)
start_script
@@ -3560,7 +3848,7 @@ OWSequence_BeatAmy: ; e322 (3:6322)
db $14
db $04
dw OWSequence_LostToAmy.ows_e34e
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_LostToAmy: ; e344 (3:6344)
start_script
@@ -3570,7 +3858,7 @@ OWSequence_LostToAmy: ; e344 (3:6344)
db $14
db $04
dw .ows_e34e
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.ows_e34e
run_script Func_d095
@@ -3580,7 +3868,7 @@ OWSequence_LostToAmy: ; e344 (3:6344)
run_script Func_d0be
db $16
db $04
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWJump_TalkToAmyAgain: ; e356 (3:6356)
run_script OWScript_PrintTextString
@@ -3598,7 +3886,7 @@ OWJump_TalkToAmyAgain: ; e356 (3:6356)
db PRIZES_6
db GO_GO_RAIN_DANCE_DECK_ID
db MUSIC_DUEL_THEME_2
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
; 0xe369
INCROM $e369, $e525
@@ -3684,7 +3972,7 @@ OWSequence_Brittany: ; e5d2 (3:65d2)
dw .wantToDuel
run_script OWScript_PrintTextString
tx Text06e3
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
.wantToDuel
run_script OWScript_PrintTextString
@@ -3693,7 +3981,7 @@ OWSequence_Brittany: ; e5d2 (3:65d2)
db PRIZES_4
db ETCETERA_DECK_ID
db MUSIC_DUEL_THEME_1
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatBrittany: ; e5ee (3:65ee)
start_script
@@ -3730,7 +4018,7 @@ OWSequence_BeatBrittany: ; e5ee (3:65ee)
run_script OWScript_PrintTextString
tx Text06e8
.finishSequence
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_LostToBrittany: ; e618 (3:6618)
start_script
@@ -3817,7 +4105,7 @@ OWSequence_FirstRonaldEncounter: ; e862 (3:6862)
db $01
run_script OWScript_PrintTextString
tx Text0646
- run_script Func_cce4
+ run_script OWScript_AskQuestionJumpDefaultYes
dw 0000
dw .ows_e882
run_script OWScript_PrintTextString
@@ -3832,7 +4120,7 @@ OWSequence_FirstRonaldEncounter: ; e862 (3:6862)
run_script OWScript_PrintTextString
tx Text0649
run_script OWScript_CloseTextBox
- run_script Func_d055
+ run_script OWScript_SetPlayerDirection
db $03
run_script OWScript_MovePlayer
db EAST
@@ -3842,7 +4130,7 @@ OWSequence_FirstRonaldEncounter: ; e862 (3:6862)
db $68
run_script Func_cdcb
run_script Func_d41d
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
; 0xe894
INCROM $e894, $e8c0
@@ -3859,16 +4147,16 @@ OWSequence_FirstRonaldFight: ; e8c0 (3:68c0)
db $69
run_script OWScript_PrintTextString
tx Text064a
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $08
db $02
dw $68d6
- run_script Func_d055
+ run_script OWScript_SetPlayerDirection
db $03
run_script OWScript_MovePlayer
db WEST
db $01
- run_script Func_d055
+ run_script OWScript_SetPlayerDirection
db $02
run_script OWScript_MovePlayer
db SOUTH
@@ -3885,7 +4173,7 @@ OWSequence_FirstRonaldFight: ; e8c0 (3:68c0)
db PRIZES_6
db IM_RONALD_DECK_ID
db MUSIC_RONALD
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatFirstRonaldFight: ; e8e9 (3:68e9)
start_script
@@ -3893,7 +4181,7 @@ OWSequence_BeatFirstRonaldFight: ; e8e9 (3:68e9)
tx Text064c
run_script OWScript_GiveCard
db JIGGLYPUFF1
- run_script Func_cee2
+ run_script OWScript_ShowCardReceivedScreen
db JIGGLYPUFF1
run_script OWScript_PrintTextString
tx Text064d
@@ -3915,7 +4203,7 @@ OWJump_FinishedFirstRonaldFight
db $69
run_script Func_cdcb
run_script Func_d41d
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
; 0xe905
INCROM $e905, $e91e
@@ -3926,22 +4214,23 @@ OWSequenceSecondRonaldFight: ; e91e (3:691e)
db $05
db $69
run_script OWScript_DoFrames
- db $3c
+ db 60
run_script Func_ce4a
db $0d
db $69
run_script OWScript_PrintTextString
tx Text064f
- run_script Func_d0f2
+ run_script OWScript_JumpIfPlayerCoordMatches
db $08
db $02
- dw $6934
- run_script Func_d055
+ dw .ows_6934
+ run_script OWScript_SetPlayerDirection
db $03
run_script OWScript_MovePlayer
db WEST
db $01
- run_script Func_d055
+.ows_6934
+ run_script OWScript_SetPlayerDirection
db $02
run_script OWScript_MovePlayer
db SOUTH
@@ -3952,13 +4241,13 @@ OWSequenceSecondRonaldFight: ; e91e (3:691e)
run_script OWScript_PrintTextString
tx Text0650
run_script OWScript_SetFlagValue
- db $4d
+ db EVENT_FLAG_4D
db $01
run_script OWScript_StartBattle
db PRIZES_6
db POWERFUL_RONALD_DECK_ID
db MUSIC_RONALD
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
OWSequence_BeatSecondRonaldFight: ; e947 (3:6947)
start_script
@@ -3966,7 +4255,7 @@ OWSequence_BeatSecondRonaldFight: ; e947 (3:6947)
tx Text0651
run_script OWScript_GiveCard
db SUPER_ENERGY_RETRIEVAL
- run_script Func_cee2
+ run_script OWScript_ShowCardReceivedScreen
db SUPER_ENERGY_RETRIEVAL
run_script OWScript_PrintTextString
tx Text0652
@@ -3980,7 +4269,7 @@ OWSequence_LostToSecondRonaldFight: ; e955 (3:6955)
OWJump_FinishedSecondRonaldFight ; e959 (3:6959)
run_script OWScript_SetFlagValue
- db $4d
+ db EVENT_FLAG_4D
db $02
run_script OWScript_CloseTextBox
run_script Func_ce4a
@@ -3988,7 +4277,7 @@ OWJump_FinishedSecondRonaldFight ; e959 (3:6959)
db $69
run_script Func_cdcb
run_script Func_d41d
- run_script OWScript_EndScriptCloseText
+ run_script OWScript_QuitScriptFully
; 0xe963
INCROM $e963, $f580
diff --git a/src/engine/bank04.asm b/src/engine/bank04.asm
index c81db5c..1613204 100644
--- a/src/engine/bank04.asm
+++ b/src/engine/bank04.asm
@@ -478,13 +478,13 @@ LoadOverworldMapSelection: ; 10f61 (4:4f61)
ld hl, OverworldMapIndexes
add hl, bc
ld a, [hli]
- ld [wd0bb], a
+ ld [wTempMap], a
ld a, [hli]
- ld [wd0bc], a
+ ld [wTempPlayerXCoord], a
ld a, [hli]
- ld [wd0bd], a
+ ld [wTempPlayerYCoord], a
ld a, $0
- ld [wd0be], a
+ ld [wTempPlayerDirection], a
ld hl, wd0b4
set 4, [hl]
pop bc
@@ -819,13 +819,13 @@ Func_1157c: ; 1157c (4:557c)
.asm_11586
ld a, $2
- ld [wd0bc], a
+ ld [wTempPlayerXCoord], a
ld a, $4
- ld [wd0bd], a
+ ld [wTempPlayerYCoord], a
ld a, $2
- ld [wd0be], a
+ ld [wTempPlayerDirection], a
ld a, $1
- ld [wd0bb], a
+ ld [wTempMap], a
ld a, $1
ld [wd32e], a
@@ -998,18 +998,18 @@ OverworldScriptTable: ; 1217b (4:617b)
dw Func_d03f
dw OWScript_Jump
dw Func_d04f
- dw Func_d055
+ dw OWScript_SetPlayerDirection
dw OWScript_MovePlayer
- dw Func_cee2
+ dw OWScript_ShowCardReceivedScreen
dw OWScript_SetDialogName
- dw Func_d088
+ dw OWScript_SetNextNPCandOWSequence
dw Func_d095
dw Func_d0be
dw OWScript_DoFrames
dw Func_d0d9
- dw Func_d0f2
+ dw OWScript_JumpIfPlayerCoordMatches
dw Func_ce4a
- dw Func_ceba
+ dw OWScript_GiveOneOfEachTrainerBooster
dw Func_d103
dw Func_d125
dw Func_d135
@@ -1022,12 +1022,12 @@ OverworldScriptTable: ; 1217b (4:617b)
dw Func_d195
dw Func_d1ad
dw Func_d1b3
- dw OWScript_EndScriptCloseText
+ dw OWScript_QuitScriptFully
dw Func_d244
dw Func_d24c
dw OWScript_OpenDeckMachine
dw Func_d271
- dw Func_d36d
+ dw OWScript_EnterMap
dw Func_ce6f
dw Func_d209
dw Func_d38f
@@ -1048,7 +1048,7 @@ OverworldScriptTable: ; 1217b (4:617b)
dw Func_d41d
dw Func_d42f
dw Func_d435
- dw Func_cce4
+ dw OWScript_AskQuestionJumpDefaultYes
dw Func_d2f6
dw Func_d317
dw Func_d43d
diff --git a/src/engine/bank07.asm b/src/engine/bank07.asm
index 4455d3f..b5b9504 100644
--- a/src/engine/bank07.asm
+++ b/src/engine/bank07.asm
@@ -35,13 +35,13 @@ Func_1c056: ; 1c056 (7:4056)
inc hl
inc hl
ld a, [hli]
- ld [wd0bb], a
+ ld [wTempMap], a
ld a, [hli]
- ld [wd0bc], a
+ ld [wTempPlayerXCoord], a
ld a, [hli]
- ld [wd0bd], a
+ ld [wTempPlayerYCoord], a
ld a, [wPlayerDirection]
- ld [wd0be], a
+ ld [wTempPlayerDirection], a
.asm_1c095
pop de
pop bc
diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm
index 7f2bbb5..942fb82 100644
--- a/src/macros/scripts.asm
+++ b/src/macros/scripts.asm
@@ -43,18 +43,18 @@ ENDM
const Func_d03f_index ; $1a
const OWScript_Jump_index ; $1b
const Func_d04f_index ; $1c
- const Func_d055_index ; $1d
+ const OWScript_SetPlayerDirection_index ; $1d
const OWScript_MovePlayer_index ; $1e
- const Func_cee2_index ; $1f
+ const OWScript_ShowCardReceivedScreen_index ; $1f
const OWScript_SetDialogName_index ; $20
- const Func_d088_index ; $21
+ const OWScript_SetNextNPCandOWSequence_index ; $21
const Func_d095_index ; $22
const Func_d0be_index ; $23
const OWScript_DoFrames_index ; $24
const Func_d0d9_index ; $25
- const Func_d0f2_index ; $26
+ const OWScript_JumpIfPlayerCoordMatches_index ; $26
const Func_ce4a_index ; $27
- const Func_ceba_index ; $28
+ const OWScript_GiveOneOfEachTrainerBooster_index ; $28
const Func_d103_index ; $29
const Func_d125_index ; $2a
const Func_d135_index ; $2b
@@ -67,12 +67,12 @@ ENDM
const Func_d195_index ; $32
const Func_d1ad_index ; $33
const Func_d1b3_index ; $34
- const OWScript_EndScriptCloseText_index ; $35
+ const OWScript_QuitScriptFully_index ; $35
const Func_d244_index ; $36
const Func_d24c_index ; $37
const OWScript_OpenDeckMachine_index ; $38
const Func_d271_index ; $39
- const Func_d36d_index ; $3a
+ const OWScript_EnterMap_index ; $3a
const Func_ce6f_index ; $3b
const Func_d209_index ; $3c
const Func_d38f_index ; $3d
@@ -93,7 +93,7 @@ ENDM
const Func_d41d_index ; $4c
const Func_d42f_index ; $4d
const Func_d435_index ; $4e
- const Func_cce4_index ; $4f
+ const OWScript_AskQuestionJumpDefaultYes_index ; $4f
const Func_d2f6_index ; $50
const Func_d317_index ; $51
const Func_d43d_index ; $52
diff --git a/src/wram.asm b/src/wram.asm
index fd24dbd..c3fb738 100644
--- a/src/wram.asm
+++ b/src/wram.asm
@@ -1784,16 +1784,16 @@ wd0b9:: ; d0b9
wd0ba:: ; d0ba
ds $1
-wd0bb:: ; d0bb
+wTempMap:: ; d0bb
ds $1
-wd0bc:: ; d0bc
+wTempPlayerXCoord:: ; d0bc
ds $1
-wd0bd:: ; d0bd
+wTempPlayerYCoord:: ; d0bd
ds $1
-wd0be:: ; d0be
+wTempPlayerDirection:: ; d0be
ds $1
wd0bf:: ; d0bf